diff --git a/css/index.css b/css/index.css index b1990967..62092109 100644 --- a/css/index.css +++ b/css/index.css @@ -347,7 +347,7 @@ button:hover { #addressDiv1 { color: white; - width: 3000px; + width: 20000px; height: 2px; position: absolute; padding: 0px; @@ -360,7 +360,7 @@ button:hover { #addressDiv2 { color: white; - width: 3000px; + width: 20000px; height: 2px; position: absolute; padding: 0px; diff --git a/dist/assets/index-ChZp0Joh.js b/dist/assets/index-BKlYAz7v.js similarity index 99% rename from dist/assets/index-ChZp0Joh.js rename to dist/assets/index-BKlYAz7v.js index 7135fd65..0d081dcd 100644 --- a/dist/assets/index-ChZp0Joh.js +++ b/dist/assets/index-BKlYAz7v.js @@ -3586,7 +3586,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function xv(n,e,t){let i=new Lc;const r=new je,s=new je,a=new at,o=new gv({depthPacking:mp}),c=new _v,l={},u=t.maxTextureSize,d={[oi]:Bt,[Bt]:oi,[Fn]:Fn},p=new Di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new je},radius:{value:4}},vertexShader:vv,fragmentShader:yv}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const _=new Fi;_.setAttribute("position",new Sn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Hn(_,p),h=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ud;let f=this.type;this.render=function(R,L,C){if(h.enabled===!1||h.autoUpdate===!1&&h.needsUpdate===!1||R.length===0)return;const P=n.getRenderTarget(),S=n.getActiveCubeFace(),E=n.getActiveMipmapLevel(),O=n.state;O.setBlending(ri),O.buffers.color.setClear(1,1,1,1),O.buffers.depth.setTest(!0),O.setScissorTest(!1);const k=f!==On&&this.type===On,Z=f===On&&this.type!==On;for(let I=0,y=R.length;Iu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/q.x),r.x=s.x*q.x,D.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/q.y),r.y=s.y*q.y,D.mapSize.y=s.y)),D.map===null||k===!0||Z===!0){const H=this.type!==On?{minFilter:It,magFilter:It}:{};D.map!==null&&D.map.dispose(),D.map=new Ii(r.x,r.y,H),D.map.texture.name=w.name+".shadowMap",D.camera.updateProjectionMatrix()}n.setRenderTarget(D.map),n.clear();const V=D.getViewportCount();for(let H=0;H0||L.map&&L.alphaTest>0){const O=S.uuid,k=L.uuid;let Z=l[O];Z===void 0&&(Z={},l[O]=Z);let I=Z[k];I===void 0&&(I=S.clone(),Z[k]=I),S=I}if(S.visible=L.visible,S.wireframe=L.wireframe,P===On?S.side=L.shadowSide!==null?L.shadowSide:L.side:S.side=L.shadowSide!==null?L.shadowSide:d[L.side],S.alphaMap=L.alphaMap,S.alphaTest=L.alphaTest,S.map=L.map,S.clipShadows=L.clipShadows,S.clippingPlanes=L.clippingPlanes,S.clipIntersection=L.clipIntersection,S.displacementMap=L.displacementMap,S.displacementScale=L.displacementScale,S.displacementBias=L.displacementBias,S.wireframeLinewidth=L.wireframeLinewidth,S.linewidth=L.linewidth,C.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const O=n.properties.get(S);O.light=C}return S}function M(R,L,C,P,S){if(R.visible===!1)return;if(R.layers.test(L.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&S===On)&&(!R.frustumCulled||i.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,R.matrixWorld);const k=e.update(R),Z=R.material;if(Array.isArray(Z)){const I=k.groups;for(let y=0,w=I.length;y=1):H.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),q=V>=2);let N=null,G={};const ee=n.getParameter(n.SCISSOR_BOX),ae=n.getParameter(n.VIEWPORT),fe=new at().fromArray(ee),xe=new at().fromArray(ae);function De(U,ue,re,Y){const se=new Uint8Array(4),Me=n.createTexture();n.bindTexture(U,Me),n.texParameteri(U,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(U,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Je=0;Je"u"?!1:/OculusBrowser/g.test(navigator.userAgent),_=new WeakMap;let m;const h=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(A,x){return f?new OffscreenCanvas(A,x):ua("canvas")}function v(A,x,W,ne){let Q=1;if((A.width>ne||A.height>ne)&&(Q=ne/Math.max(A.width,A.height)),Q<1||x===!0)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap){const ie=x?Ko:Math.floor,ve=ie(Q*A.width),oe=ie(Q*A.height);m===void 0&&(m=b(ve,oe));const he=W?b(ve,oe):m;return he.width=ve,he.height=oe,he.getContext("2d").drawImage(A,0,0,ve,oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+A.width+"x"+A.height+") to ("+ve+"x"+oe+")."),he}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+A.width+"x"+A.height+")."),A;return A}function M(A){return Vl(A.width)&&Vl(A.height)}function R(A){return o?!1:A.wrapS!==dn||A.wrapT!==dn||A.minFilter!==It&&A.minFilter!==Jt}function L(A,x){return A.generateMipmaps&&x&&A.minFilter!==It&&A.minFilter!==Jt}function C(A){n.generateMipmap(A)}function P(A,x,W,ne,Q=!1){if(o===!1)return x;if(A!==null){if(n[A]!==void 0)return n[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let ie=x;if(x===n.RED&&(W===n.FLOAT&&(ie=n.R32F),W===n.HALF_FLOAT&&(ie=n.R16F),W===n.UNSIGNED_BYTE&&(ie=n.R8)),x===n.RED_INTEGER&&(W===n.UNSIGNED_BYTE&&(ie=n.R8UI),W===n.UNSIGNED_SHORT&&(ie=n.R16UI),W===n.UNSIGNED_INT&&(ie=n.R32UI),W===n.BYTE&&(ie=n.R8I),W===n.SHORT&&(ie=n.R16I),W===n.INT&&(ie=n.R32I)),x===n.RG&&(W===n.FLOAT&&(ie=n.RG32F),W===n.HALF_FLOAT&&(ie=n.RG16F),W===n.UNSIGNED_BYTE&&(ie=n.RG8)),x===n.RGBA){const ve=Q?aa:tt.getTransfer(ne);W===n.FLOAT&&(ie=n.RGBA32F),W===n.HALF_FLOAT&&(ie=n.RGBA16F),W===n.UNSIGNED_BYTE&&(ie=ve===st?n.SRGB8_ALPHA8:n.RGBA8),W===n.UNSIGNED_SHORT_4_4_4_4&&(ie=n.RGBA4),W===n.UNSIGNED_SHORT_5_5_5_1&&(ie=n.RGB5_A1)}return(ie===n.R16F||ie===n.R32F||ie===n.RG16F||ie===n.RG32F||ie===n.RGBA16F||ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function S(A,x,W){return L(A,W)===!0||A.isFramebufferTexture&&A.minFilter!==It&&A.minFilter!==Jt?Math.log2(Math.max(x.width,x.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?x.mipmaps.length:1}function E(A){return A===It||A===hl||A===Za?n.NEAREST:n.LINEAR}function O(A){const x=A.target;x.removeEventListener("dispose",O),Z(x),x.isVideoTexture&&_.delete(x)}function k(A){const x=A.target;x.removeEventListener("dispose",k),y(x)}function Z(A){const x=i.get(A);if(x.__webglInit===void 0)return;const W=A.source,ne=h.get(W);if(ne){const Q=ne[x.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&I(A),Object.keys(ne).length===0&&h.delete(W)}i.remove(A)}function I(A){const x=i.get(A);n.deleteTexture(x.__webglTexture);const W=A.source,ne=h.get(W);delete ne[x.__cacheKey],a.memory.textures--}function y(A){const x=A.texture,W=i.get(A),ne=i.get(x);if(ne.__webglTexture!==void 0&&(n.deleteTexture(ne.__webglTexture),a.memory.textures--),A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++){if(Array.isArray(W.__webglFramebuffer[Q]))for(let ie=0;ie=c&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+c),w+=1,A}function V(A){const x=[];return x.push(A.wrapS),x.push(A.wrapT),x.push(A.wrapR||0),x.push(A.magFilter),x.push(A.minFilter),x.push(A.anisotropy),x.push(A.internalFormat),x.push(A.format),x.push(A.type),x.push(A.generateMipmaps),x.push(A.premultiplyAlpha),x.push(A.flipY),x.push(A.unpackAlignment),x.push(A.colorSpace),x.join()}function H(A,x){const W=i.get(A);if(A.isVideoTexture&&yt(A),A.isRenderTargetTexture===!1&&A.version>0&&W.__version!==A.version){const ne=A.image;if(ne===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ne.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{be(W,A,x);return}}t.bindTexture(n.TEXTURE_2D,W.__webglTexture,n.TEXTURE0+x)}function N(A,x){const W=i.get(A);if(A.version>0&&W.__version!==A.version){be(W,A,x);return}t.bindTexture(n.TEXTURE_2D_ARRAY,W.__webglTexture,n.TEXTURE0+x)}function G(A,x){const W=i.get(A);if(A.version>0&&W.__version!==A.version){be(W,A,x);return}t.bindTexture(n.TEXTURE_3D,W.__webglTexture,n.TEXTURE0+x)}function ee(A,x){const W=i.get(A);if(A.version>0&&W.__version!==A.version){Qe(W,A,x);return}t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+x)}const ae={[jo]:n.REPEAT,[dn]:n.CLAMP_TO_EDGE,[$o]:n.MIRRORED_REPEAT},fe={[It]:n.NEAREST,[hl]:n.NEAREST_MIPMAP_NEAREST,[Za]:n.NEAREST_MIPMAP_LINEAR,[Jt]:n.LINEAR,[rp]:n.LINEAR_MIPMAP_NEAREST,[Xr]:n.LINEAR_MIPMAP_LINEAR},xe={[_p]:n.NEVER,[Mp]:n.ALWAYS,[vp]:n.LESS,[xp]:n.LEQUAL,[yp]:n.EQUAL,[bp]:n.GEQUAL,[Sp]:n.GREATER,[Ep]:n.NOTEQUAL};function De(A,x,W){if(W?(n.texParameteri(A,n.TEXTURE_WRAP_S,ae[x.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,ae[x.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,ae[x.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,fe[x.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,fe[x.minFilter])):(n.texParameteri(A,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(A,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(x.wrapS!==dn||x.wrapT!==dn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(A,n.TEXTURE_MAG_FILTER,E(x.magFilter)),n.texParameteri(A,n.TEXTURE_MIN_FILTER,E(x.minFilter)),x.minFilter!==It&&x.minFilter!==Jt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),x.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,xe[x.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ne=e.get("EXT_texture_filter_anisotropic");if(x.magFilter===It||x.minFilter!==Za&&x.minFilter!==Xr||x.type===ii&&e.has("OES_texture_float_linear")===!1||o===!1&&x.type===qr&&e.has("OES_texture_half_float_linear")===!1)return;(x.anisotropy>1||i.get(x).__currentAnisotropy)&&(n.texParameterf(A,ne.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,r.getMaxAnisotropy())),i.get(x).__currentAnisotropy=x.anisotropy)}}function Ae(A,x){let W=!1;A.__webglInit===void 0&&(A.__webglInit=!0,x.addEventListener("dispose",O));const ne=x.source;let Q=h.get(ne);Q===void 0&&(Q={},h.set(ne,Q));const ie=V(x);if(ie!==A.__cacheKey){Q[ie]===void 0&&(Q[ie]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,W=!0),Q[ie].usedTimes++;const ve=Q[A.__cacheKey];ve!==void 0&&(Q[A.__cacheKey].usedTimes--,ve.usedTimes===0&&I(x)),A.__cacheKey=ie,A.__webglTexture=Q[ie].texture}return W}function be(A,x,W){let ne=n.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(ne=n.TEXTURE_2D_ARRAY),x.isData3DTexture&&(ne=n.TEXTURE_3D);const Q=Ae(A,x),ie=x.source;t.bindTexture(ne,A.__webglTexture,n.TEXTURE0+W);const ve=i.get(ie);if(ie.version!==ve.__version||Q===!0){t.activeTexture(n.TEXTURE0+W);const oe=tt.getPrimaries(tt.workingColorSpace),he=x.colorSpace===Qt?null:tt.getPrimaries(x.colorSpace),Le=x.colorSpace===Qt||oe===he?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,x.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,x.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Le);const Ke=R(x)&&M(x.image)===!1;let te=v(x.image,Ke,!1,u);te=Tt(x,te);const et=M(te)||o,Ne=s.convert(x.format,x.colorSpace);let Pe=s.convert(x.type),Se=P(x.internalFormat,Ne,Pe,x.colorSpace,x.isVideoTexture);De(ne,x,et);let me;const $e=x.mipmaps,U=o&&x.isVideoTexture!==!0,ue=ve.__version===void 0||Q===!0,re=S(x,te,et);if(x.isDepthTexture)Se=n.DEPTH_COMPONENT,o?x.type===ii?Se=n.DEPTH_COMPONENT32F:x.type===ni?Se=n.DEPTH_COMPONENT24:x.type===Ti?Se=n.DEPTH24_STENCIL8:Se=n.DEPTH_COMPONENT16:x.type===ii&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),x.format===wi&&Se===n.DEPTH_COMPONENT&&x.type!==wc&&x.type!==ni&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),x.type=ni,Pe=s.convert(x.type)),x.format===hr&&Se===n.DEPTH_COMPONENT&&(Se=n.DEPTH_STENCIL,x.type!==Ti&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),x.type=Ti,Pe=s.convert(x.type))),ue&&(U?t.texStorage2D(n.TEXTURE_2D,1,Se,te.width,te.height):t.texImage2D(n.TEXTURE_2D,0,Se,te.width,te.height,0,Ne,Pe,null));else if(x.isDataTexture)if($e.length>0&&et){U&&ue&&t.texStorage2D(n.TEXTURE_2D,re,Se,$e[0].width,$e[0].height);for(let Y=0,se=$e.length;Y>=1,se>>=1}}else if($e.length>0&&et){U&&ue&&t.texStorage2D(n.TEXTURE_2D,re,Se,$e[0].width,$e[0].height);for(let Y=0,se=$e.length;Y0&&ue++,t.texStorage2D(n.TEXTURE_CUBE_MAP,ue,me,te[0].width,te[0].height));for(let Y=0;Y<6;Y++)if(Ke){$e?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Y,0,0,0,te[Y].width,te[Y].height,Pe,Se,te[Y].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Y,0,me,te[Y].width,te[Y].height,0,Pe,Se,te[Y].data);for(let se=0;se>ie),te=Math.max(1,x.height>>ie);Q===n.TEXTURE_3D||Q===n.TEXTURE_2D_ARRAY?t.texImage3D(Q,ie,he,Ke,te,x.depth,0,ve,oe,null):t.texImage2D(Q,ie,he,Ke,te,0,ve,oe,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),nt(x)?p.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ne,Q,i.get(W).__webglTexture,0,We(x)):(Q===n.TEXTURE_2D||Q>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ne,Q,i.get(W).__webglTexture,ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function z(A,x,W){if(n.bindRenderbuffer(n.RENDERBUFFER,A),x.depthBuffer&&!x.stencilBuffer){let ne=o===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(W||nt(x)){const Q=x.depthTexture;Q&&Q.isDepthTexture&&(Q.type===ii?ne=n.DEPTH_COMPONENT32F:Q.type===ni&&(ne=n.DEPTH_COMPONENT24));const ie=We(x);nt(x)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ie,ne,x.width,x.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ie,ne,x.width,x.height)}else n.renderbufferStorage(n.RENDERBUFFER,ne,x.width,x.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,A)}else if(x.depthBuffer&&x.stencilBuffer){const ne=We(x);W&&nt(x)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ne,n.DEPTH24_STENCIL8,x.width,x.height):nt(x)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ne,n.DEPTH24_STENCIL8,x.width,x.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,x.width,x.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,A)}else{const ne=x.isWebGLMultipleRenderTargets===!0?x.texture:[x.texture];for(let Q=0;Q0){W.__webglFramebuffer[oe]=[];for(let he=0;he0){W.__webglFramebuffer=[];for(let oe=0;oe0&&nt(A)===!1){const oe=ie?x:[x];W.__webglMultisampledFramebuffer=n.createFramebuffer(),W.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let he=0;he0)for(let he=0;he0)for(let he=0;he0&&nt(A)===!1){const x=A.isWebGLMultipleRenderTargets?A.texture:[A.texture],W=A.width,ne=A.height;let Q=n.COLOR_BUFFER_BIT;const ie=[],ve=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,oe=i.get(A),he=A.isWebGLMultipleRenderTargets===!0;if(he)for(let Le=0;Le0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function yt(A){const x=a.render.frame;_.get(A)!==x&&(_.set(A,x),A.update())}function Tt(A,x){const W=A.colorSpace,ne=A.format,Q=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||A.format===Zo||W!==Gn&&W!==Qt&&(tt.getTransfer(W)===st?o===!1?e.has("EXT_sRGB")===!0&&ne===fn?(A.format=Zo,A.minFilter=Jt,A.generateMipmaps=!1):x=Xd.sRGBToLinear(x):(ne!==fn||Q!==ai)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),x}this.allocateTextureUnit=q,this.resetTextureUnits=D,this.setTexture2D=H,this.setTexture2DArray=N,this.setTexture3D=G,this.setTextureCube=ee,this.rebindTextures=Ce,this.setupRenderTarget=Re,this.updateRenderTargetMipmap=ct,this.updateMultisampleRenderTarget=Ge,this.setupDepthRenderbuffer=ge,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=nt}function bv(n,e,t){const i=t.isWebGL2;function r(s,a=Qt){let o;const c=tt.getTransfer(a);if(s===ai)return n.UNSIGNED_BYTE;if(s===Bd)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Fd)return n.UNSIGNED_SHORT_5_5_5_1;if(s===sp)return n.BYTE;if(s===ap)return n.SHORT;if(s===wc)return n.UNSIGNED_SHORT;if(s===Od)return n.INT;if(s===ni)return n.UNSIGNED_INT;if(s===ii)return n.FLOAT;if(s===qr)return i?n.HALF_FLOAT:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===op)return n.ALPHA;if(s===fn)return n.RGBA;if(s===cp)return n.LUMINANCE;if(s===lp)return n.LUMINANCE_ALPHA;if(s===wi)return n.DEPTH_COMPONENT;if(s===hr)return n.DEPTH_STENCIL;if(s===Zo)return o=e.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(s===up)return n.RED;if(s===kd)return n.RED_INTEGER;if(s===dp)return n.RG;if(s===zd)return n.RG_INTEGER;if(s===Hd)return n.RGBA_INTEGER;if(s===Ya||s===Ka||s===Ja||s===Qa)if(c===st)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(s===Ya)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Ka)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Ja)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Qa)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===Ya)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Ka)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Ja)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Qa)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===pl||s===ml||s===gl||s===_l)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===pl)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===ml)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===gl)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===_l)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===fp)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===vl||s===yl)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(s===vl)return c===st?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(s===yl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===xl||s===Sl||s===El||s===bl||s===Ml||s===Tl||s===wl||s===Al||s===Rl||s===Cl||s===Ll||s===Pl||s===Il||s===Dl)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(s===xl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Sl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===El)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===bl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ml)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Tl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===wl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Al)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Rl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Cl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Ll)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Pl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Il)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Dl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===eo||s===Ul||s===Nl)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(s===eo)return c===st?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Ul)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Nl)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===hp||s===Ol||s===Bl||s===Fl)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(s===eo)return o.COMPRESSED_RED_RGTC1_EXT;if(s===Ol)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===Bl)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Fl)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Ti?i?n.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class Mv extends Wt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Br extends Ft{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Tv={type:"move"};class wo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Br,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Br,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Br,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,a=null;const o=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){a=!0;for(const m of e.hand.values()){const h=t.getJointPose(m,i),f=this._getHandJoint(l,m);h!==null&&(f.matrix.fromArray(h.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=h.radius),f.visible=h!==null}const u=l.joints["index-finger-tip"],d=l.joints["thumb-tip"],p=u.position.distanceTo(d.position),g=.02,_=.005;l.inputState.pinching&&p>g+_?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&p<=g-_&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Tv)))}return o!==null&&(o.visible=r!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Br;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class wv extends Xt{constructor(e,t,i,r,s,a,o,c,l,u){if(u=u!==void 0?u:wi,u!==wi&&u!==hr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===wi&&(i=ni),i===void 0&&u===hr&&(i=Ti),super(null,r,s,a,o,c,u,i,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:It,this.minFilter=c!==void 0?c:It,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Av extends br{constructor(e,t){super();const i=this;let r=null,s=1,a=null,o="local-floor",c=1,l=null,u=null,d=null,p=null,g=null,_=null;const m=t.getContextAttributes();let h=null,f=null;const b=[],v=[],M=new Wt;M.layers.enable(1),M.viewport=new at;const R=new Wt;R.layers.enable(2),R.viewport=new at;const L=[M,R],C=new Mv;C.layers.enable(1),C.layers.enable(2);let P=null,S=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let G=b[N];return G===void 0&&(G=new wo,b[N]=G),G.getTargetRaySpace()},this.getControllerGrip=function(N){let G=b[N];return G===void 0&&(G=new wo,b[N]=G),G.getGripSpace()},this.getHand=function(N){let G=b[N];return G===void 0&&(G=new wo,b[N]=G),G.getHandSpace()};function E(N){const G=v.indexOf(N.inputSource);if(G===-1)return;const ee=b[G];ee!==void 0&&(ee.update(N.inputSource,N.frame,l||a),ee.dispatchEvent({type:N.type,data:N.inputSource}))}function O(){r.removeEventListener("select",E),r.removeEventListener("selectstart",E),r.removeEventListener("selectend",E),r.removeEventListener("squeeze",E),r.removeEventListener("squeezestart",E),r.removeEventListener("squeezeend",E),r.removeEventListener("end",O),r.removeEventListener("inputsourceschange",k);for(let N=0;N=0&&(v[ae]=null,b[ae].disconnect(ee))}for(let G=0;G=v.length){v.push(ee),ae=xe;break}else if(v[xe]===null){v[xe]=ee,ae=xe;break}if(ae===-1)break}const fe=b[ae];fe&&fe.connect(ee)}}const Z=new F,I=new F;function y(N,G,ee){Z.setFromMatrixPosition(G.matrixWorld),I.setFromMatrixPosition(ee.matrixWorld);const ae=Z.distanceTo(I),fe=G.projectionMatrix.elements,xe=ee.projectionMatrix.elements,De=fe[14]/(fe[10]-1),Ae=fe[14]/(fe[10]+1),be=(fe[9]+1)/fe[5],Qe=(fe[9]-1)/fe[5],Fe=(fe[8]-1)/fe[0],z=(xe[8]+1)/xe[0],rt=De*Fe,ge=De*z,Ce=ae/(-Fe+z),Re=Ce*-Fe;G.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(Re),N.translateZ(Ce),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const ct=De+Ce,Ge=Ae+Ce,We=rt-Re,nt=ge+(ae-Re),yt=be*Ae/Ge*ct,Tt=Qe*Ae/Ge*ct;N.projectionMatrix.makePerspective(We,nt,yt,Tt,ct,Ge),N.projectionMatrixInverse.copy(N.projectionMatrix).invert()}function w(N,G){G===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(G.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(r===null)return;C.near=R.near=M.near=N.near,C.far=R.far=M.far=N.far,(P!==C.near||S!==C.far)&&(r.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,S=C.far);const G=N.parent,ee=C.cameras;w(C,G);for(let ae=0;ae0&&(h.alphaTest.value=f.alphaTest);const b=e.get(f).envMap;if(b&&(h.envMap.value=b,h.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,h.reflectivity.value=f.reflectivity,h.ior.value=f.ior,h.refractionRatio.value=f.refractionRatio),f.lightMap){h.lightMap.value=f.lightMap;const v=n._useLegacyLights===!0?Math.PI:1;h.lightMapIntensity.value=f.lightMapIntensity*v,t(f.lightMap,h.lightMapTransform)}f.aoMap&&(h.aoMap.value=f.aoMap,h.aoMapIntensity.value=f.aoMapIntensity,t(f.aoMap,h.aoMapTransform))}function a(h,f){h.diffuse.value.copy(f.color),h.opacity.value=f.opacity,f.map&&(h.map.value=f.map,t(f.map,h.mapTransform))}function o(h,f){h.dashSize.value=f.dashSize,h.totalSize.value=f.dashSize+f.gapSize,h.scale.value=f.scale}function c(h,f,b,v){h.diffuse.value.copy(f.color),h.opacity.value=f.opacity,h.size.value=f.size*b,h.scale.value=v*.5,f.map&&(h.map.value=f.map,t(f.map,h.uvTransform)),f.alphaMap&&(h.alphaMap.value=f.alphaMap,t(f.alphaMap,h.alphaMapTransform)),f.alphaTest>0&&(h.alphaTest.value=f.alphaTest)}function l(h,f){h.diffuse.value.copy(f.color),h.opacity.value=f.opacity,h.rotation.value=f.rotation,f.map&&(h.map.value=f.map,t(f.map,h.mapTransform)),f.alphaMap&&(h.alphaMap.value=f.alphaMap,t(f.alphaMap,h.alphaMapTransform)),f.alphaTest>0&&(h.alphaTest.value=f.alphaTest)}function u(h,f){h.specular.value.copy(f.specular),h.shininess.value=Math.max(f.shininess,1e-4)}function d(h,f){f.gradientMap&&(h.gradientMap.value=f.gradientMap)}function p(h,f){h.metalness.value=f.metalness,f.metalnessMap&&(h.metalnessMap.value=f.metalnessMap,t(f.metalnessMap,h.metalnessMapTransform)),h.roughness.value=f.roughness,f.roughnessMap&&(h.roughnessMap.value=f.roughnessMap,t(f.roughnessMap,h.roughnessMapTransform)),e.get(f).envMap&&(h.envMapIntensity.value=f.envMapIntensity)}function g(h,f,b){h.ior.value=f.ior,f.sheen>0&&(h.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),h.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(h.sheenColorMap.value=f.sheenColorMap,t(f.sheenColorMap,h.sheenColorMapTransform)),f.sheenRoughnessMap&&(h.sheenRoughnessMap.value=f.sheenRoughnessMap,t(f.sheenRoughnessMap,h.sheenRoughnessMapTransform))),f.clearcoat>0&&(h.clearcoat.value=f.clearcoat,h.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(h.clearcoatMap.value=f.clearcoatMap,t(f.clearcoatMap,h.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(h.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,t(f.clearcoatRoughnessMap,h.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(h.clearcoatNormalMap.value=f.clearcoatNormalMap,t(f.clearcoatNormalMap,h.clearcoatNormalMapTransform),h.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===Bt&&h.clearcoatNormalScale.value.negate())),f.iridescence>0&&(h.iridescence.value=f.iridescence,h.iridescenceIOR.value=f.iridescenceIOR,h.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],h.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(h.iridescenceMap.value=f.iridescenceMap,t(f.iridescenceMap,h.iridescenceMapTransform)),f.iridescenceThicknessMap&&(h.iridescenceThicknessMap.value=f.iridescenceThicknessMap,t(f.iridescenceThicknessMap,h.iridescenceThicknessMapTransform))),f.transmission>0&&(h.transmission.value=f.transmission,h.transmissionSamplerMap.value=b.texture,h.transmissionSamplerSize.value.set(b.width,b.height),f.transmissionMap&&(h.transmissionMap.value=f.transmissionMap,t(f.transmissionMap,h.transmissionMapTransform)),h.thickness.value=f.thickness,f.thicknessMap&&(h.thicknessMap.value=f.thicknessMap,t(f.thicknessMap,h.thicknessMapTransform)),h.attenuationDistance.value=f.attenuationDistance,h.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(h.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(h.anisotropyMap.value=f.anisotropyMap,t(f.anisotropyMap,h.anisotropyMapTransform))),h.specularIntensity.value=f.specularIntensity,h.specularColor.value.copy(f.specularColor),f.specularColorMap&&(h.specularColorMap.value=f.specularColorMap,t(f.specularColorMap,h.specularColorMapTransform)),f.specularIntensityMap&&(h.specularIntensityMap.value=f.specularIntensityMap,t(f.specularIntensityMap,h.specularIntensityMapTransform))}function _(h,f){f.matcap&&(h.matcap.value=f.matcap)}function m(h,f){const b=e.get(f).light;h.referencePosition.value.setFromMatrixPosition(b.matrixWorld),h.nearDistance.value=b.shadow.camera.near,h.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function Cv(n,e,t,i){let r={},s={},a=[];const o=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(b,v){const M=v.program;i.uniformBlockBinding(b,M)}function l(b,v){let M=r[b.id];M===void 0&&(_(b),M=u(b),r[b.id]=M,b.addEventListener("dispose",h));const R=v.program;i.updateUBOMapping(b,R);const L=e.render.frame;s[b.id]!==L&&(p(b),s[b.id]=L)}function u(b){const v=d();b.__bindingPointIndex=v;const M=n.createBuffer(),R=b.__size,L=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,R,L),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,M),M}function d(){for(let b=0;b0){L=M%R;const k=R-L;L!==0&&k-E.boundary<0&&(M+=R-L,S.__offset=M)}M+=E.storage}return L=M%R,L>0&&(M+=R-L),b.__size=M,b.__cache={},this}function m(b){const v={boundary:0,storage:0};return typeof b=="number"?(v.boundary=4,v.storage=4):b.isVector2?(v.boundary=8,v.storage=8):b.isVector3||b.isColor?(v.boundary=16,v.storage=12):b.isVector4?(v.boundary=16,v.storage=16):b.isMatrix3?(v.boundary=48,v.storage=48):b.isMatrix4?(v.boundary=64,v.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),v}function h(b){const v=b.target;v.removeEventListener("dispose",h);const M=a.indexOf(v.__bindingPointIndex);a.splice(M,1),n.deleteBuffer(r[v.id]),delete r[v.id],delete s[v.id]}function f(){for(const b in r)n.deleteBuffer(r[b]);a=[],r={},s={}}return{bind:c,update:l,dispose:f}}class cf{constructor(e={}){const{canvas:t=wp(),context:i=null,depth:r=!0,stencil:s=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=a;const g=new Uint32Array(4),_=new Int32Array(4);let m=null,h=null;const f=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Mt,this._useLegacyLights=!1,this.toneMapping=si,this.toneMappingExposure=1;const v=this;let M=!1,R=0,L=0,C=null,P=-1,S=null;const E=new at,O=new at;let k=null;const Z=new Ue(0);let I=0,y=t.width,w=t.height,D=1,q=null,V=null;const H=new at(0,0,y,w),N=new at(0,0,y,w);let G=!1;const ee=new Lc;let ae=!1,fe=!1,xe=null;const De=new mt,Ae=new je,be=new F,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Fe(){return C===null?D:1}let z=i;function rt(T,B){for(let X=0;X{function pe(){if(j.forEach(function(ye){Ge.get(ye).currentProgram.isReady()&&j.delete(ye)}),j.size===0){$(T);return}setTimeout(pe,10)}ge.get("KHR_parallel_shader_compile")!==null?pe():setTimeout(pe,10)})};let Je=null;function ft(T){Je&&Je(T)}function jt(){Ct.stop()}function it(){Ct.start()}const Ct=new nf;Ct.setAnimationLoop(ft),typeof self<"u"&&Ct.setContext(self),this.setAnimationLoop=function(T){Je=T,me.setAnimationLoop(T),T===null?Ct.stop():Ct.start()},me.addEventListener("sessionstart",jt),me.addEventListener("sessionend",it),this.render=function(T,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(B),B=me.getCamera()),T.isScene===!0&&T.onBeforeRender(v,T,B,C),h=ie.get(T,b.length),h.init(),b.push(h),De.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),ee.setFromProjectionMatrix(De),fe=this.localClippingEnabled,ae=ve.init(this.clippingPlanes,fe),m=Q.get(T,f.length),m.init(),f.push(m),gn(T,B,0,v.sortObjects),m.finish(),v.sortObjects===!0&&m.sort(q,V),this.info.render.frame++,ae===!0&&ve.beginShadows();const X=h.state.shadowsArray;if(oe.render(X,T,B),ae===!0&&ve.endShadows(),this.info.autoReset===!0&&this.info.reset(),he.render(m,T),h.setupLights(v._useLegacyLights),B.isArrayCamera){const j=B.cameras;for(let $=0,pe=j.length;$0?h=b[b.length-1]:h=null,f.pop(),f.length>0?m=f[f.length-1]:m=null};function gn(T,B,X,j){if(T.visible===!1)return;if(T.layers.test(B.layers)){if(T.isGroup)X=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(B);else if(T.isLight)h.pushLight(T),T.castShadow&&h.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||ee.intersectsSprite(T)){j&&be.setFromMatrixPosition(T.matrixWorld).applyMatrix4(De);const ye=x.update(T),Te=T.material;Te.visible&&m.push(T,ye,Te,X,be.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||ee.intersectsObject(T))){const ye=x.update(T),Te=T.material;if(j&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),be.copy(T.boundingSphere.center)):(ye.boundingSphere===null&&ye.computeBoundingSphere(),be.copy(ye.boundingSphere.center)),be.applyMatrix4(T.matrixWorld).applyMatrix4(De)),Array.isArray(Te)){const Ie=ye.groups;for(let Ve=0,Oe=Ie.length;Ve0&&yh($,pe,B,X),j&&Re.viewport(E.copy(j)),$.length>0&&Ms($,B,X),pe.length>0&&Ms(pe,B,X),ye.length>0&&Ms(ye,B,X),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function yh(T,B,X,j){if((X.isScene===!0?X.overrideMaterial:null)!==null)return;const pe=Ce.isWebGL2;xe===null&&(xe=new Ii(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?qr:ai,minFilter:Xr,samples:pe?4:0})),v.getDrawingBufferSize(Ae),pe?xe.setSize(Ae.x,Ae.y):xe.setSize(Ko(Ae.x),Ko(Ae.y));const ye=v.getRenderTarget();v.setRenderTarget(xe),v.getClearColor(Z),I=v.getClearAlpha(),I<1&&v.setClearColor(16777215,.5),v.clear();const Te=v.toneMapping;v.toneMapping=si,Ms(T,X,j),We.updateMultisampleRenderTarget(xe),We.updateRenderTargetMipmap(xe);let Ie=!1;for(let Ve=0,Oe=B.length;Ve0),ke=!!X.morphAttributes.position,ut=!!X.morphAttributes.normal,zt=!!X.morphAttributes.color;let xt=si;j.toneMapped&&(C===null||C.isXRRenderTarget===!0)&&(xt=v.toneMapping);const An=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,lt=An!==void 0?An.length:0,qe=Ge.get(j),Xa=h.state.lights;if(ae===!0&&(fe===!0||T!==S)){const Ht=T===S&&j.id===P;ve.setState(j,T,Ht)}let ht=!1;j.version===qe.__version?(qe.needsLights&&qe.lightsStateVersion!==Xa.state.version||qe.outputColorSpace!==Te||$.isInstancedMesh&&qe.instancing===!1||!$.isInstancedMesh&&qe.instancing===!0||$.isSkinnedMesh&&qe.skinning===!1||!$.isSkinnedMesh&&qe.skinning===!0||$.isInstancedMesh&&qe.instancingColor===!0&&$.instanceColor===null||$.isInstancedMesh&&qe.instancingColor===!1&&$.instanceColor!==null||qe.envMap!==Ie||j.fog===!0&&qe.fog!==pe||qe.numClippingPlanes!==void 0&&(qe.numClippingPlanes!==ve.numPlanes||qe.numIntersection!==ve.numIntersection)||qe.vertexAlphas!==Ve||qe.vertexTangents!==Oe||qe.morphTargets!==ke||qe.morphNormals!==ut||qe.morphColors!==zt||qe.toneMapping!==xt||Ce.isWebGL2===!0&&qe.morphTargetsCount!==lt)&&(ht=!0):(ht=!0,qe.__version=j.version);let fi=qe.currentProgram;ht===!0&&(fi=Ts(j,B,$));let sl=!1,Ar=!1,qa=!1;const Lt=fi.getUniforms(),hi=qe.uniforms;if(Re.useProgram(fi.program)&&(sl=!0,Ar=!0,qa=!0),j.id!==P&&(P=j.id,Ar=!0),sl||S!==T){Lt.setValue(z,"projectionMatrix",T.projectionMatrix),Lt.setValue(z,"viewMatrix",T.matrixWorldInverse);const Ht=Lt.map.cameraPosition;Ht!==void 0&&Ht.setValue(z,be.setFromMatrixPosition(T.matrixWorld)),Ce.logarithmicDepthBuffer&&Lt.setValue(z,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&Lt.setValue(z,"isOrthographic",T.isOrthographicCamera===!0),S!==T&&(S=T,Ar=!0,qa=!0)}if($.isSkinnedMesh){Lt.setOptional(z,$,"bindMatrix"),Lt.setOptional(z,$,"bindMatrixInverse");const Ht=$.skeleton;Ht&&(Ce.floatVertexTextures?(Ht.boneTexture===null&&Ht.computeBoneTexture(),Lt.setValue(z,"boneTexture",Ht.boneTexture,We),Lt.setValue(z,"boneTextureSize",Ht.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const ja=X.morphAttributes;if((ja.position!==void 0||ja.normal!==void 0||ja.color!==void 0&&Ce.isWebGL2===!0)&&Le.update($,X,fi),(Ar||qe.receiveShadow!==$.receiveShadow)&&(qe.receiveShadow=$.receiveShadow,Lt.setValue(z,"receiveShadow",$.receiveShadow)),j.isMeshGouraudMaterial&&j.envMap!==null&&(hi.envMap.value=Ie,hi.flipEnvMap.value=Ie.isCubeTexture&&Ie.isRenderTargetTexture===!1?-1:1),Ar&&(Lt.setValue(z,"toneMappingExposure",v.toneMappingExposure),qe.needsLights&&Sh(hi,qa),pe&&j.fog===!0&&ne.refreshFogUniforms(hi,pe),ne.refreshMaterialUniforms(hi,j,D,w,xe),na.upload(z,il(qe),hi,We)),j.isShaderMaterial&&j.uniformsNeedUpdate===!0&&(na.upload(z,il(qe),hi,We),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&Lt.setValue(z,"center",$.center),Lt.setValue(z,"modelViewMatrix",$.modelViewMatrix),Lt.setValue(z,"normalMatrix",$.normalMatrix),Lt.setValue(z,"modelMatrix",$.matrixWorld),j.isShaderMaterial||j.isRawShaderMaterial){const Ht=j.uniformsGroups;for(let $a=0,bh=Ht.length;$a0&&We.useMultisampledRTT(T)===!1?$=Ge.get(T).__webglMultisampledFramebuffer:Array.isArray(Oe)?$=Oe[X]:$=Oe,E.copy(T.viewport),O.copy(T.scissor),k=T.scissorTest}else E.copy(H).multiplyScalar(D).floor(),O.copy(N).multiplyScalar(D).floor(),k=G;if(Re.bindFramebuffer(z.FRAMEBUFFER,$)&&Ce.drawBuffers&&j&&Re.drawBuffers(T,$),Re.viewport(E),Re.scissor(O),Re.setScissorTest(k),pe){const Ie=Ge.get(T.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+B,Ie.__webglTexture,X)}else if(ye){const Ie=Ge.get(T.texture),Ve=B||0;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ie.__webglTexture,X||0,Ve)}P=-1},this.readRenderTargetPixels=function(T,B,X,j,$,pe,ye){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Te=Ge.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&ye!==void 0&&(Te=Te[ye]),Te){Re.bindFramebuffer(z.FRAMEBUFFER,Te);try{const Ie=T.texture,Ve=Ie.format,Oe=Ie.type;if(Ve!==fn&&et.convert(Ve)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ke=Oe===qr&&(ge.has("EXT_color_buffer_half_float")||Ce.isWebGL2&&ge.has("EXT_color_buffer_float"));if(Oe!==ai&&et.convert(Oe)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Oe===ii&&(Ce.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=T.width-j&&X>=0&&X<=T.height-$&&z.readPixels(B,X,j,$,et.convert(Ve),et.convert(Oe),pe)}finally{const Ie=C!==null?Ge.get(C).__webglFramebuffer:null;Re.bindFramebuffer(z.FRAMEBUFFER,Ie)}}},this.copyFramebufferToTexture=function(T,B,X=0){const j=Math.pow(2,-X),$=Math.floor(B.image.width*j),pe=Math.floor(B.image.height*j);We.setTexture2D(B,0),z.copyTexSubImage2D(z.TEXTURE_2D,X,0,0,T.x,T.y,$,pe),Re.unbindTexture()},this.copyTextureToTexture=function(T,B,X,j=0){const $=B.image.width,pe=B.image.height,ye=et.convert(X.format),Te=et.convert(X.type);We.setTexture2D(X,0),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,X.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,X.unpackAlignment),B.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,j,T.x,T.y,$,pe,ye,Te,B.image.data):B.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,j,T.x,T.y,B.mipmaps[0].width,B.mipmaps[0].height,ye,B.mipmaps[0].data):z.texSubImage2D(z.TEXTURE_2D,j,T.x,T.y,ye,Te,B.image),j===0&&X.generateMipmaps&&z.generateMipmap(z.TEXTURE_2D),Re.unbindTexture()},this.copyTextureToTexture3D=function(T,B,X,j,$=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const pe=T.max.x-T.min.x+1,ye=T.max.y-T.min.y+1,Te=T.max.z-T.min.z+1,Ie=et.convert(j.format),Ve=et.convert(j.type);let Oe;if(j.isData3DTexture)We.setTexture3D(j,0),Oe=z.TEXTURE_3D;else if(j.isDataArrayTexture)We.setTexture2DArray(j,0),Oe=z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,j.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,j.unpackAlignment);const ke=z.getParameter(z.UNPACK_ROW_LENGTH),ut=z.getParameter(z.UNPACK_IMAGE_HEIGHT),zt=z.getParameter(z.UNPACK_SKIP_PIXELS),xt=z.getParameter(z.UNPACK_SKIP_ROWS),An=z.getParameter(z.UNPACK_SKIP_IMAGES),lt=X.isCompressedTexture?X.mipmaps[0]:X.image;z.pixelStorei(z.UNPACK_ROW_LENGTH,lt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,lt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,T.min.x),z.pixelStorei(z.UNPACK_SKIP_ROWS,T.min.y),z.pixelStorei(z.UNPACK_SKIP_IMAGES,T.min.z),X.isDataTexture||X.isData3DTexture?z.texSubImage3D(Oe,$,B.x,B.y,B.z,pe,ye,Te,Ie,Ve,lt.data):X.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),z.compressedTexSubImage3D(Oe,$,B.x,B.y,B.z,pe,ye,Te,Ie,lt.data)):z.texSubImage3D(Oe,$,B.x,B.y,B.z,pe,ye,Te,Ie,Ve,lt),z.pixelStorei(z.UNPACK_ROW_LENGTH,ke),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,ut),z.pixelStorei(z.UNPACK_SKIP_PIXELS,zt),z.pixelStorei(z.UNPACK_SKIP_ROWS,xt),z.pixelStorei(z.UNPACK_SKIP_IMAGES,An),$===0&&j.generateMipmaps&&z.generateMipmap(Oe),Re.unbindTexture()},this.initTexture=function(T){T.isCubeTexture?We.setTextureCube(T,0):T.isData3DTexture?We.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?We.setTexture2DArray(T,0):We.setTexture2D(T,0),Re.unbindTexture()},this.resetState=function(){R=0,L=0,C=null,Re.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return zn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Ac?"display-p3":"srgb",t.unpackColorSpace=tt.workingColorSpace===Ua?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Mt?Ai:Vd}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ai?Mt:Gn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class Lv extends cf{}Lv.prototype.isWebGL1Renderer=!0;class Pv extends Ft{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class Iv extends _s{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ue(16777215),this.specular=new Ue(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Gd,this.normalScale=new je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Tc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class lf extends Ft{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ue(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const Ao=new mt,Au=new F,Ru=new F;class Dv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new je(512,512),this.map=null,this.mapPass=null,this.matrix=new mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Lc,this._frameExtents=new je(1,1),this._viewportCount=1,this._viewports=[new at(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Au.setFromMatrixPosition(e.matrixWorld),t.position.copy(Au),Ru.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ru),t.updateMatrixWorld(),Ao.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ao),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Ao)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const Cu=new mt,Dr=new F,Ro=new F;class Uv extends Dv{constructor(){super(new Wt(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new je(4,2),this._viewportCount=6,this._viewports=[new at(2,1,1,1),new at(0,1,1,1),new at(3,1,1,1),new at(1,1,1,1),new at(3,0,1,1),new at(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Dr.setFromMatrixPosition(e.matrixWorld),i.position.copy(Dr),Ro.copy(i.position),Ro.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Ro),i.updateMatrixWorld(),r.makeTranslation(-Dr.x,-Dr.y,-Dr.z),Cu.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cu)}}class da extends lf{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Uv}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Nv extends lf{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Ov{constructor(e,t,i=0,r=1/0){this.ray=new $d(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Cc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return Qo(e,this,i,t),i.sort(Lu),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r{t.setSize(window.innerWidth,window.innerHeight),e.aspect=window.innerWidth/window.innerHeight,e.updateProjectionMatrix()}),{scene:n,camera:e,renderer:t,lights:i}}const Du=[new Ue(0,.7,.6),new Ue(1,1,1)],zv=[new Ue(.3,.3,.3),new Ue(.5,.5,0),new Ue(1,0,0)],Hv=new Ue(.8,.2,.8),Uu=new Ue(.2,1,.5),Qn=1,tr=.3,ei=.2,Vv=2,Gv=.1,Wv=.04;class Xv{constructor(e,t){this.nodes=new Map,this.transactions=new Map,this.addressCount=0,this.loadedBlocks=new Map,this.loadingBlocks=new Map,this.loadedBars=new Map,this.blocksToClear=[],this.scene=e,this.blocks=[],this.canDrag=!0,this.canHover=!0,this.displayFrom,this.displayTo,this.displayAmount,this.maxRange=0,this.nodeArray,this.toggleSort=0,this.toggleScale=0,this.isLoaded=!1,this.dataToLoad,this.tempBlocks=[],this.viewTransitioning=!1,this.camera=t,this.allTimeMax=.01,this.allTimeMaxNumTrans=1,this.allTimeMaxBar=.01,this.allTimeMaxNumTransBar=1,this.symmetrical=!1,this.dataType=0}addNode(e){this.nodes.set(e,new qv(e))}addTransaction(e,t,i,r){let s=this.nodes.get(e),a=this.nodes.get(t);s.addTransactionIn(a,i,r),a.addTransactionOut(s,i,r);let o=[t,e].toString();if(this.transactions.get(o)||this.transactions.set(o,[]),this.transactions.get(o).push({amount:i,time:r}),this.symmetrical){a.addTransactionIn(s,i,r),s.addTransactionOut(a,i,r);let u=[e,t].toString();this.transactions.get(u)||this.transactions.set(u,[]),this.transactions.get(u).push({amount:i,time:r})}let c=0,l=0;this.transactions.get(o).forEach(u=>{c+=u.amount,l+=1}),c>this.allTimeMax&&(this.allTimeMax=c),l>this.allTimeMaxNumTrans&&(this.allTimeMaxNumTrans=l),s.totalTransactionsValueOut>this.allTimeMaxBar&&(this.allTimeMaxBar=s.totalTransactionsValueOut),a.totalTransactionsValueOut>this.allTimeMaxBar&&(this.allTimeMaxBar=a.totalTransactionsValueOut),s.numTransactionsOut>this.allTimeMaxNumTransBar&&(this.allTimeMaxNumTransBar=s.numTransactionsOut),a.numTransactionsOut>this.allTimeMaxNumTransBar&&(this.allTimeMaxNumTransBar=a.numTransactionsOut)}getTransactions(e,t){let i=this.transactions.get([e,t].toString());return i||[]}getTransactionsValue(e,t){let i=this.transactions.get([e,t].toString());if(i){let r=0;return i.forEach(s=>r+=s.amount),r}else return 0}getTotalNumTransactions(e,t){let i=this.transactions.get([e,t].toString());return i?i.length:0}compareNodeNumTransactions(e,t){return t.node.numTransactionsOut-e.node.numTransactionsOut}compareNodeTotals(e,t){return t.node.totalTransactionsValueOut-e.node.totalTransactionsValueOut}compareLargestTransaction(e,t){return Math.max(t.node.largestTransactionOut,t.node.largestTransactionIn)-Math.max(e.node.largestTransactionOut,e.node.largestTransactionIn)}loadData(e,t=-1,i=-1){this.dataToLoad=e,this.isLoaded=!1}loadDataHelper(e,t=-1,i=-1){this.allTimeMax=.01,this.allTimeMaxNumTrans=1,this.allTimeMaxBar=.01,this.allTimeMaxNumTransBar=1;let r=e.transactions;e.nodes.forEach(s=>this.addNode(s)),r.forEach(s=>{this.nodes.get(s.from)&&this.nodes.get(s.to)?this.addTransaction(s.from,s.to,Number(s.amount),s.timestamp):console.log("failed to add transaction")}),this.nodeArray=Array.from(this.nodes,([s,a])=>({id:s,node:a})),this.toggleSort==0?this.nodeArray.sort(this.compareNodeTotals):this.toggleSort==1?this.nodeArray.sort(this.compareNodeNumTransactions):this.toggleSort==2?this.nodeArray.sort(this.compareLargestTransaction):console.log("Sorting method unrecognized:",this.toggleSort),this.isLoaded=!0}loadBlocks(e,t,i,r=!1){if(!this.isLoaded)return;let s=e+i=this.allTimeMax,this.scene.add(_.getCube()),this.loadedBlocks.set([o,c].toString(),_),this.loadingBlocks.set([o,c].toString(),_),this.blocks.push(_)}}createTempBlocks(){}clearTempBlocks(){}unloadBlocks(e,t,i){if(!this.isLoaded)return;let r=e+i({key:p,value:g})).forEach(p=>{p.value.forEach(g=>{s+=g.amount,a+=1,o.push({to:p.key,amount:g.amount,time:g.time})})});let l=this.toggleSort==1?a:s,u=this.toggleSort==1?this.allTimeMaxNumTransBar:this.allTimeMaxBar,d=new Nu(this.nodeArray[r].id,null,o,l,u);d.setPosition(r*(Qn+tr),0*(Qn+tr)),d.pos=[r,0],this.scene.add(d.getCube()),this.loadedBlocks.set([r,0].toString(),d),this.loadingBlocks.set([r,0].toString(),d),this.blocks.push(d)}}getBlocks(){return this.blocks}clearBlocks(){for(let e=0;e0){this.blocksToClear.forEach(e=>{this.scene.remove(e.getCube())});for(let e=0;e0&&(t.getCube().material.opacity-=.01)}}else this.clearing=!1,this.blocks=[],this.loadedBlocks=new Map}clearData(){for(let e=0;e({key:t,val:i})).forEach(t=>{let i=t.val,r=i.pos[1];i.getCube().material.opacity=3-.2*r})}update(){if(this.isLoaded){let e=Array.from(this.loadingBlocks,([t,i])=>({key:t,val:i}));e.length>0,e.forEach(t=>{let i=t.val,r=i.yScale+(i.finalScale-i.yScale)*.1;i.getCube().material.opacity<=1&&(i.getCube().material.opacity+=.05),i.yScale=1&&(i.getCube().material.opacity=1,this.loadingBlocks.delete(t.key.toString()))}),e.length==0&&this.clearTempBlocks()}else{let e=Array.from(this.loadedBlocks,([t,i])=>({key:t,val:i}));e.forEach(t=>{let i=t.val,r=ei+(i.yScale-ei)*.9;i.getCube().material.opacity>0&&(i.getCube().material.opacity-=Wv),i.yScale>ei&&(i.getCube().geometry.scale(1,1/i.yScale,1),r-.1{r+=s.amount}),r>this.largestTransactionOut&&(this.largestTransactionOut=r)}addTransactionIn(e,t,i=0){this.transactionsIn.get(e.id)||this.transactionsIn.set(e.id,[]),this.transactionsIn.get(e.id).push({amount:t,time:i}),this.numTransactionsIn+=1,this.totalTransactionsValueIn+=t;let r=0;this.transactionsIn.get(e.id).forEach(s=>{r+=s.amount}),r>this.largestTransactionIn&&(this.largestTransactionIn=r)}}class uf{constructor(e,t){this.name=e,this.domParent=t,this.div=document.createElement("div"),this.div.id=e.replaceAll(" ","-")+"-div",this.div.classList.add("elementDiv"),this.id=e.replaceAll(" ","-"),t=="body"?this.domElement=document.body:this.domParent=document.getElementById(t),this.elements=[],this.endBreak=document.createElement("BR"),this.domParent.appendChild(this.div),this.labelBreak=document.createElement("BR"),this.label=document.createElement("label"),this.label.id=e.replaceAll(" ","-"),this.label.innerHTML=e,this.tooltip=""}createLineBreak(){return document.createElement("BR")}addElements(){this.elements.forEach(e=>{this.div.appendChild(e)})}removeDiv(){this.div.remove()}addDiv(){this.domParent.appendChild(this.div)}hideLabel(){this.label.remove(),this.labelBreak.remove()}showLabel(){this.div.prepend(this.labelBreak),this.div.prepend(this.label)}removeElement(e){this.elements[e].remove(),this.elements.splice(e,1)}addElement(e){this.elements.push(e),this.domParent.appendChild(e)}addClass(e){this.div.classList.add(e)}setToolTip(e,t){this.div.classList.contains("tooltip")||this.div.classList.add("tooltip");let i=document.createElement("span");i.classList.add("tooltiptext"),i.classList.add(t),i.innerHTML=e,this.tooltip=e,this.elements.push(i),this.div.appendChild(i)}}class Gr{constructor(e,t,i=!1){this.div=document.createElement("div"),this.div.id=e,i?this.div.classList.add("verticalContainer"):this.div.classList.add("horizontalContainer"),t=="body"?this.domElement=document.body:this.domParent=document.getElementById(t),this.domParent.appendChild(this.div)}addBlock(){let e=Array.prototype.slice.call(arguments);for(let t=0;t{this.showing?(this.hideOptions(),this.showing=!1):(this.showOptions(),this.showing=!0)}),this.button.button.innerHTML=i+": "+r[0][0],this.buttons=[],this.selected=this.options[0],this.text=i,this.name=e,this.container.addBlock(this.button)}showOptions(){this.button.div.remove();for(let e=0;e{this.selected!=this.options[e]&&(this.selected=this.options[e],this.options[e][1](),this.button.button.innerHTML=this.text+": "+this.options[e][0]),this.showing=!1,this.hideOptions()});t.div.classList.add("option"),this.options[e].length>=3&&(t.setToolTip(this.button.tooltip,"topTooltip"),t.setToolTip(this.options[e][2],"bottomTooltip")),this.buttons.push(t),this.container.addBlock(t)}this.container.addBlock(this.button),this.container.div.style.marginTop="-"+Number(this.button.div.offsetHeight*this.options.length*2)+"px"}hideOptions(){this.buttons.forEach(e=>{e.div.remove()}),this.container.div.style.marginTop="0px"}}const Ou=15,Bu=.99,jv=40,$v=5,Dn=10,Ks=5,Fu=10,ku=1,zu=.3,Po=1e4,Hu=0,Js=["yellow",2,10,1],Qs=["purple",80,20,2],Vu=1;function nr(n,e,t){return n+(e-n)*t}class Zv{constructor(e,t,i){this.scene=e,this.camera=t,this.transactionsGrid=i,this.mouse=new je,this.lastMouse=new je,this.raycaster=new Ov,this.isMouseHold=!1,this.cameraAccel=new je,this.highlightedBlock=null,this.clickedBlock=null,this.selectedBlock=null,this.selectedDiv,this.hlLight,this.hoverLight,this.hoverLightExists=!1,this.canScroll=!0,this.loadedChunks=new Map,this.isDataLoaded=!1,this.cameraMode=0,this.transitioning=!1,this.resettingCamera=!1,this.sideBarTransactionsToLoad=[],this.transitionSpeed=.008,this.cameraGridView={position:new F(0,10,0),lookAtDelta:new F(0,-1,0)},this.cameraBarView={position:new F(0,2,8),lookAtDelta:new F(0,-1,-3)},this.storedCamera,this.cameraTVal=0,this.addressDiv1=document.createElement("div"),this.addressDiv1.id="addressDiv1",document.body.appendChild(this.addressDiv1),this.addressDiv2=document.createElement("div"),this.addressDiv2.id="addressDiv2",document.body.appendChild(this.addressDiv2),this.selects=[]}mouseUpdate(){(this.lastMouse.x!=this.mouse.x||this.lastMouseY!=this.mouse.y)&&this.updateHighlight(),this.lastMouse.x=this.mouse.x,this.lastMouse.y=this.mouse.y,this.mouse.x=event.clientX/window.innerWidth*2-1,this.mouse.y=-(event.clientY/window.innerHeight)*2+1}updateHighlight(){let e=this.transactionsGrid.getBlocks(),t=e.flat().map(r=>r.getCube());this.raycaster.setFromCamera(this.mouse,this.camera);let i=this.raycaster.intersectObjects(t,!1);if(i.length>0&&this.transactionsGrid.canHover){let r=i[0].object;e.flat().forEach(s=>{r==s.getCube()?(s.toggleHighlight(!0),this.highlightedBlock=s):s.toggleHighlight(!1)})}else this.highlightedBlock&&this.highlightedBlock.toggleHighlight(!1),this.highlightedBlock=null;if(this.highlightedBlock&&this.transactionsGrid.displayFrom){this.transactionsGrid.displayFrom.label.innerHTML="From: "+this.highlightedBlock.node1,this.transactionsGrid.displayTo.label.innerHTML="To: "+this.highlightedBlock.node2,this.transactionsGrid.toggleSort==1?this.transactionsGrid.displayAmount.label.innerHTML="Number of Transactions: "+this.highlightedBlock.getTransactionsValue():this.transactionsGrid.displayAmount.label.innerHTML="Transactions Sum: "+this.highlightedBlock.getTransactionsValue();let r=this.highlightedBlock.getCube().position.clone();r.y+=this.highlightedBlock.yScale/2,r.project(this.transactionsGrid.camera);let s=(r.x+1)*window.innerWidth/2,a=(1-r.y)*window.innerHeight/2;if(this.addressDiv1.style.left=s-Po-Hu+"px",this.addressDiv1.style.top=a+"px",this.addressDiv2.style.left=s-Po/2+"px",this.addressDiv2.style.top=a-Po/2-Hu+"px",!this.hoverLightExists){let o=this.cameraMode==1?Vu:0;this.hoverLight=new da(Js[0],Js[1],Js[2],Js[3]),this.hoverLight.position.x=this.highlightedBlock.getCube().position.x,this.hoverLight.position.y=this.highlightedBlock.getCube().position.y+this.highlightedBlock.yScale/2+1,this.hoverLight.position.z=this.highlightedBlock.getCube().position.z+o,this.scene.add(this.hoverLight),this.hoverLightExists=!0}}else this.addressDiv1.style.left="-100000px",this.addressDiv1.style.top="-100000px",this.addressDiv2.style.left="-100000px",this.addressDiv2.style.top="-10000px",this.hoverLightExists&&(this.scene.remove(this.hoverLight),this.hoverLightExists=!1)}onMouseMove(e){if(this.mouseUpdate(),this.isMouseHold&&this.transactionsGrid.canDrag){let t=this.mouse.x-this.lastMouse.x,i=this.mouse.y-this.lastMouse.y;this.camera.position.x+=-t*Ou,this.camera.position.z+=i*Ou*(window.innerHeight/window.innerWidth),this.cameraAccel.x=t,this.cameraAccel.y=i,this.bindCamera()}}onMouseDown(e){this.mouseUpdate(),this.isMouseHold=!0}onMouseClick(e){this.mouseUpdate()}onMouseDblClick(e){if(this.mouseUpdate(),this.isMouseHold=!1,this.transactionsGrid.canDrag=!0,this.clickedBlock&&this.transactionsGrid.canHover&&this.highlightedBlock){this.selectedBlock&&this.selectedBlock.toggleSelect(!1),this.selectedBlock=this.clickedBlock;let t=document.getElementById("sideDiv");t.style.width="300px",t.style.padding="10px";let i=this.cameraMode==1?Vu:0;this.hlLight=new da(Qs[0],Qs[1],Qs[2],Qs[3]),this.hlLight.position.x=this.selectedBlock.getCube().position.x,this.hlLight.position.y=this.selectedBlock.getCube().position.y+this.selectedBlock.yScale/2+1,this.hlLight.position.z=this.selectedBlock.getCube().position.z+i,this.scene.add(this.hlLight),this.selectedDiv&&this.selectedDiv.removeDiv(),this.selectedDiv=new Gr("transaction select","sideDiv",!0);let r=new Kt("transaction from","sideDiv","From: "+String(this.clickedBlock.node1).substring(0,20)+"...");if(this.clickedBlock.node2){let s=new Kt("transaction to","sideDiv","To: "+String(this.clickedBlock.node2).substring(0,20)+"...");this.selectedDiv.addBlock(r,s)}else this.selectedDiv.addBlock(r);if(this.clickedBlock.transactions.sort(function(s,a){return new Date(a.time)-new Date(s.time)}),this.clickedBlock.transactions.forEach(s=>{this.sideBarTransactionsToLoad.push(s)}),this.sideBarTransactionsToLoad.length==0){let s=new Gr("tCont","sideDiv",!0),a=new Kt("transaction","sideDiv","Amount: NA");s.addBlock(a),this.selectedDiv.addBlock(s)}this.selectedBlock.toggleSelect(!0)}}addTransactionsToSideBar(e){if(e.amount>0){let t=new Gr("tCont","sideDiv",!0),i;e.to&&(i=new Kt("transaction to inner","sideDiv","To: "+String(e.to)));let r=new Kt("transaction amount","sideDiv","Amount: "+String(e.amount)),s;if(this.transactionsGrid.dataType==0){let a=new Date(e.time),o=String(a.getHours());o.length==1&&(o="0"+o);let c=String(a.getMinutes());c.length==1&&(c="0"+c);let l=String(a.getSeconds());l.length==1&&(l="0"+l);let u=String(a.getFullYear())+"-"+String(a.getMonth())+"-"+String(a.getDay())+" "+o+":"+c+":"+l;u=="NaN-NaN-NaN NaN:NaN:NaN"&&(u="N/A"),s=new Kt("transaction time","sideDiv","Time: "+u)}else{let a=e.time;s=new Kt("transaction time","sideDiv","Time: "+a)}i?t.addBlock(i,r,s):t.addBlock(r,s),this.selectedDiv.addBlock(t)}}onWheelEvent(e){if(!this.canScroll)return;e.deltaX;let t=e.deltaY;t>0&&this.camera.position.y$v&&this.cameraMode==0&&(this.camera.position.y-=.2,this.updateHighlight())}unselectBlock(){if(this.clickedBlock){this.clickedBlock.toggleSelect(!1);let e=document.getElementById("sideDiv");e.style.width="0px",e.style.padding="10px 0px 10px 0px",this.scene.remove(this.hlLight)}this.sideBarTransactionsToLoad=[]}onMouseUp(e){this.isMouseHold=!1,this.transactionsGrid.canDrag=!0,this.lastMouse.x==this.mouse.x&&this.lastMouse.y==this.mouse.y&&(this.unselectBlock(),this.clickedBlock=this.highlightedBlock)}update(){if(this.sideBarTransactionsToLoad.length>0){let e=this.sideBarTransactionsToLoad.shift();this.addTransactionsToSideBar(e)}if(this.transitioning){this.cameraTVal+=this.transitionSpeed,this.cameraTVal>=1&&(this.transitioning=!1,this.resettingCamera=!1,this.cameraTVal=1);let e;this.cameraMode==0?e=this.cameraGridView:e=this.cameraBarView;let t=nr(this.storedCamera.position.x,e.position.x,this.cameraTVal),i=nr(this.storedCamera.position.y,e.position.y,this.cameraTVal),r=nr(this.storedCamera.position.z,e.position.z,this.cameraTVal),s=nr(this.storedCamera.lookAtDelta.x,e.lookAtDelta.x,this.cameraTVal),a=nr(this.storedCamera.lookAtDelta.y,e.lookAtDelta.y,this.cameraTVal),o=nr(this.storedCamera.lookAtDelta.z,e.lookAtDelta.z,this.cameraTVal);this.resettingCamera?this.camera.position.set(t,i,r):this.camera.position.set(this.camera.position.x,i,r),this.camera.lookAt(this.camera.position.x+s,this.camera.position.y+a,this.camera.position.z+o),this.cameraTVal>=1&&(this.cameraTVal=0)}else this.isMouseHold||(this.cameraAccel.x*=Bu,this.cameraAccel.y*=Bu,Math.abs(this.cameraAccel.x)<.005&&(this.cameraAccel.x=0),Math.abs(this.cameraAccel.y)<.005&&(this.cameraAccel.y=0),this.camera.position.x+=-this.cameraAccel.x,this.camera.position.z+=this.cameraAccel.y,this.bindCamera()),this.cameraMode==1&&(this.camera.position.z=this.cameraBarView.position.z);if(this.isDataLoaded&&this.transactionsGrid.isLoaded){let e=(ku+zu)*Dn;for(let s=-Ks;s<=Ks;s++)for(let a=-Ks;a<=Ks;a++){let o=Math.floor(this.camera.position.x/e)+s,c=Math.floor(this.camera.position.z/e)+a;o>=0&&c>=0&&(this.loadedChunks.get([o,c].toString())||(this.loadedChunks.set([o,c].toString(),!0),this.cameraMode==0?this.transactionsGrid.loadBlocks(o*Dn,c*Dn,Dn,!1):this.transactionsGrid.loadBars(o*Dn,Dn)))}let t=Math.floor(this.camera.position.x/e),i=Math.floor(this.camera.position.z/e);Array.from(this.loadedChunks).forEach(s=>{let a=s[0].split(",").map(o=>Number(o));this.loadedChunks.get([a[0],a[1]].toString())&&(Math.abs(a[0]-t)>Fu||Math.abs(a[1]-i)>Fu)&&(this.loadedChunks.set([a[0],a[1]].toString(),!1),this.transactionsGrid.unloadBlocks(a[0]*Dn,a[1]*Dn,Dn))})}this.bindCamera()}clearChunks(){this.loadedChunks=new Map}setCamera(e){this.unselectBlock(),this.transitionSpeed=.008,this.transitioning=!0,e==0?(this.storedCamera={position:this.camera.position.clone(),lookAtDelta:this.cameraBarView.lookAtDelta},this.addressDiv1.style.height="2px",this.addressDiv2.style.height="2px"):e==1&&(this.storedCamera={position:this.camera.position.clone(),lookAtDelta:this.cameraGridView.lookAtDelta},this.addressDiv1.style.height="0px",this.addressDiv2.style.height="0px"),this.cameraMode=e}resetCamera(){this.transitioning=!0,this.resettingCamera=!0,this.transitionSpeed=.05,this.storedCamera={position:this.camera.position.clone(),lookAtDelta:this.cameraGridView.lookAtDelta},this.cameraAccel=new je}bindCamera(){if(this.isDataLoaded){if(!this.transactionsGrid.nodeArray)return;let e=(ku+zu)*this.transactionsGrid.nodeArray.length;this.camera.position.x>e&&(this.camera.position.x=e),this.camera.position.x<0&&(this.camera.position.x=0),this.camera.position.z>e&&(this.camera.position.z=e),this.camera.position.z<0&&(this.camera.position.z=0)}}}function df(n,e){return function(){return n.apply(e,arguments)}}const{toString:Yv}=Object.prototype,{getPrototypeOf:Dc}=Object,Ba=(n=>e=>{const t=Yv.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),wn=n=>(n=n.toLowerCase(),e=>Ba(e)===n),Fa=n=>e=>typeof e===n,{isArray:wr}=Array,jr=Fa("undefined");function Kv(n){return n!==null&&!jr(n)&&n.constructor!==null&&!jr(n.constructor)&&en(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const ff=wn("ArrayBuffer");function Jv(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&ff(n.buffer),e}const Qv=Fa("string"),en=Fa("function"),hf=Fa("number"),ka=n=>n!==null&&typeof n=="object",ey=n=>n===!0||n===!1,ia=n=>{if(Ba(n)!=="object")return!1;const e=Dc(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ty=wn("Date"),ny=wn("File"),iy=wn("Blob"),ry=wn("FileList"),sy=n=>ka(n)&&en(n.pipe),ay=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||en(n.append)&&((e=Ba(n))==="formdata"||e==="object"&&en(n.toString)&&n.toString()==="[object FormData]"))},oy=wn("URLSearchParams"),cy=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vs(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),wr(n))for(i=0,r=n.length;i0;)if(r=t[i],e===r.toLowerCase())return r;return null}const mf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gf=n=>!jr(n)&&n!==mf;function tc(){const{caseless:n}=gf(this)&&this||{},e={},t=(i,r)=>{const s=n&&pf(e,r)||r;ia(e[s])&&ia(i)?e[s]=tc(e[s],i):ia(i)?e[s]=tc({},i):wr(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i(vs(e,(r,s)=>{t&&en(r)?n[s]=df(r,t):n[s]=r},{allOwnKeys:i}),n),uy=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),dy=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},fy=(n,e,t,i)=>{let r,s,a;const o={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)a=r[s],(!i||i(a,n,e))&&!o[a]&&(e[a]=n[a],o[a]=!0);n=t!==!1&&Dc(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},hy=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},py=n=>{if(!n)return null;if(wr(n))return n;let e=n.length;if(!hf(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},my=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Dc(Uint8Array)),gy=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(n,s[0],s[1])}},_y=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},vy=wn("HTMLFormElement"),yy=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),Gu=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),xy=wn("RegExp"),_f=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};vs(t,(r,s)=>{let a;(a=e(r,s,n))!==!1&&(i[s]=a||r)}),Object.defineProperties(n,i)},Sy=n=>{_f(n,(e,t)=>{if(en(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(en(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Ey=(n,e)=>{const t={},i=r=>{r.forEach(s=>{t[s]=!0})};return wr(n)?i(n):i(String(n).split(e)),t},by=()=>{},My=(n,e)=>(n=+n,Number.isFinite(n)?n:e),Io="abcdefghijklmnopqrstuvwxyz",Wu="0123456789",vf={DIGIT:Wu,ALPHA:Io,ALPHA_DIGIT:Io+Io.toUpperCase()+Wu},Ty=(n=16,e=vf.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function wy(n){return!!(n&&en(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Ay=n=>{const e=new Array(10),t=(i,r)=>{if(ka(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=wr(i)?[]:{};return vs(i,(a,o)=>{const c=t(a,r+1);!jr(c)&&(s[o]=c)}),e[r]=void 0,s}}return i};return t(n,0)},Ry=wn("AsyncFunction"),Cy=n=>n&&(ka(n)||en(n))&&en(n.then)&&en(n.catch),K={isArray:wr,isArrayBuffer:ff,isBuffer:Kv,isFormData:ay,isArrayBufferView:Jv,isString:Qv,isNumber:hf,isBoolean:ey,isObject:ka,isPlainObject:ia,isUndefined:jr,isDate:ty,isFile:ny,isBlob:iy,isRegExp:xy,isFunction:en,isStream:sy,isURLSearchParams:oy,isTypedArray:my,isFileList:ry,forEach:vs,merge:tc,extend:ly,trim:cy,stripBOM:uy,inherits:dy,toFlatObject:fy,kindOf:Ba,kindOfTest:wn,endsWith:hy,toArray:py,forEachEntry:gy,matchAll:_y,isHTMLForm:vy,hasOwnProperty:Gu,hasOwnProp:Gu,reduceDescriptors:_f,freezeMethods:Sy,toObjectSet:Ey,toCamelCase:yy,noop:by,toFiniteNumber:My,findKey:pf,global:mf,isContextDefined:gf,ALPHABET:vf,generateString:Ty,isSpecCompliantForm:wy,toJSONObject:Ay,isAsyncFn:Ry,isThenable:Cy};function Ze(n,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r)}K.inherits(Ze,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const yf=Ze.prototype,xf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{xf[n]={value:n}});Object.defineProperties(Ze,xf);Object.defineProperty(yf,"isAxiosError",{value:!0});Ze.from=(n,e,t,i,r,s)=>{const a=Object.create(yf);return K.toFlatObject(n,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),Ze.call(a,n.message,e,t,i,r),a.cause=n,a.name=n.name,s&&Object.assign(a,s),a};const Ly=null;function nc(n){return K.isPlainObject(n)||K.isArray(n)}function Sf(n){return K.endsWith(n,"[]")?n.slice(0,-2):n}function Xu(n,e,t){return n?n.concat(e).map(function(r,s){return r=Sf(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function Py(n){return K.isArray(n)&&!n.some(nc)}const Iy=K.toFlatObject(K,{},null,function(e){return/^is[A-Z]/.test(e)});function za(n,e,t){if(!K.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=K.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!K.isUndefined(h[m])});const i=t.metaTokens,r=t.visitor||u,s=t.dots,a=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(e);if(!K.isFunction(r))throw new TypeError("visitor must be a function");function l(_){if(_===null)return"";if(K.isDate(_))return _.toISOString();if(!c&&K.isBlob(_))throw new Ze("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(_)||K.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function u(_,m,h){let f=_;if(_&&!h&&typeof _=="object"){if(K.endsWith(m,"{}"))m=i?m:m.slice(0,-2),_=JSON.stringify(_);else if(K.isArray(_)&&Py(_)||(K.isFileList(_)||K.endsWith(m,"[]"))&&(f=K.toArray(_)))return m=Sf(m),f.forEach(function(v,M){!(K.isUndefined(v)||v===null)&&e.append(a===!0?Xu([m],M,s):a===null?m:m+"[]",l(v))}),!1}return nc(_)?!0:(e.append(Xu(h,m,s),l(_)),!1)}const d=[],p=Object.assign(Iy,{defaultVisitor:u,convertValue:l,isVisitable:nc});function g(_,m){if(!K.isUndefined(_)){if(d.indexOf(_)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(_),K.forEach(_,function(f,b){(!(K.isUndefined(f)||f===null)&&r.call(e,f,K.isString(b)?b.trim():b,m,p))===!0&&g(f,m?m.concat(b):[b])}),d.pop()}}if(!K.isObject(n))throw new TypeError("data must be an object");return g(n),e}function qu(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Uc(n,e){this._pairs=[],n&&za(n,this,e)}const Ef=Uc.prototype;Ef.append=function(e,t){this._pairs.push([e,t])};Ef.toString=function(e){const t=e?function(i){return e.call(this,i,qu)}:qu;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function Dy(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bf(n,e,t){if(!e)return n;const i=t&&t.encode||Dy,r=t&&t.serialize;let s;if(r?s=r(e,t):s=K.isURLSearchParams(e)?e.toString():new Uc(e,t).toString(i),s){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}class ju{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,function(i){i!==null&&e(i)})}}const Mf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uy=typeof URLSearchParams<"u"?URLSearchParams:Uc,Ny=typeof FormData<"u"?FormData:null,Oy=typeof Blob<"u"?Blob:null,By={isBrowser:!0,classes:{URLSearchParams:Uy,FormData:Ny,Blob:Oy},protocols:["http","https","file","blob","url","data"]},Tf=typeof window<"u"&&typeof document<"u",Fy=(n=>Tf&&["ReactNative","NativeScript","NS"].indexOf(n)<0)(typeof navigator<"u"&&navigator.product),ky=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Tf,hasStandardBrowserEnv:Fy,hasStandardBrowserWebWorkerEnv:ky},Symbol.toStringTag,{value:"Module"})),xn={...zy,...By};function Hy(n,e){return za(n,new xn.classes.URLSearchParams,Object.assign({visitor:function(t,i,r,s){return xn.isNode&&K.isBuffer(t)?(this.append(i,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Vy(n){return K.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gy(n){const e={},t=Object.keys(n);let i;const r=t.length;let s;for(i=0;i=t.length;return a=!a&&K.isArray(r)?r.length:a,c?(K.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i,!o):((!r[a]||!K.isObject(r[a]))&&(r[a]=[]),e(t,i,r[a],s)&&K.isArray(r[a])&&(r[a]=Gy(r[a])),!o)}if(K.isFormData(n)&&K.isFunction(n.entries)){const t={};return K.forEachEntry(n,(i,r)=>{e(Vy(i),r,t,0)}),t}return null}function Wy(n,e,t){if(K.isString(n))try{return(e||JSON.parse)(n),K.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}const ys={transitional:Mf,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,s=K.isObject(e);if(s&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return r?JSON.stringify(wf(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Hy(e,this.formSerializer).toString();if((o=K.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return za(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),Wy(e)):e}],transformResponse:[function(e){const t=this.transitional||ys.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(e&&K.isString(e)&&(i&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?Ze.from(o,Ze.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xn.classes.FormData,Blob:xn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],n=>{ys.headers[n]={}});const Xy=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qy=n=>{const e={};let t,i,r;return n&&n.split(` +}`;function xv(n,e,t){let i=new Lc;const r=new je,s=new je,a=new at,o=new gv({depthPacking:mp}),c=new _v,l={},u=t.maxTextureSize,d={[oi]:Bt,[Bt]:oi,[Fn]:Fn},p=new Di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new je},radius:{value:4}},vertexShader:vv,fragmentShader:yv}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const _=new Fi;_.setAttribute("position",new Sn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Hn(_,p),h=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ud;let f=this.type;this.render=function(R,L,C){if(h.enabled===!1||h.autoUpdate===!1&&h.needsUpdate===!1||R.length===0)return;const P=n.getRenderTarget(),S=n.getActiveCubeFace(),E=n.getActiveMipmapLevel(),O=n.state;O.setBlending(ri),O.buffers.color.setClear(1,1,1,1),O.buffers.depth.setTest(!0),O.setScissorTest(!1);const k=f!==On&&this.type===On,Z=f===On&&this.type!==On;for(let I=0,y=R.length;Iu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/q.x),r.x=s.x*q.x,D.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/q.y),r.y=s.y*q.y,D.mapSize.y=s.y)),D.map===null||k===!0||Z===!0){const H=this.type!==On?{minFilter:It,magFilter:It}:{};D.map!==null&&D.map.dispose(),D.map=new Ii(r.x,r.y,H),D.map.texture.name=w.name+".shadowMap",D.camera.updateProjectionMatrix()}n.setRenderTarget(D.map),n.clear();const V=D.getViewportCount();for(let H=0;H0||L.map&&L.alphaTest>0){const O=S.uuid,k=L.uuid;let Z=l[O];Z===void 0&&(Z={},l[O]=Z);let I=Z[k];I===void 0&&(I=S.clone(),Z[k]=I),S=I}if(S.visible=L.visible,S.wireframe=L.wireframe,P===On?S.side=L.shadowSide!==null?L.shadowSide:L.side:S.side=L.shadowSide!==null?L.shadowSide:d[L.side],S.alphaMap=L.alphaMap,S.alphaTest=L.alphaTest,S.map=L.map,S.clipShadows=L.clipShadows,S.clippingPlanes=L.clippingPlanes,S.clipIntersection=L.clipIntersection,S.displacementMap=L.displacementMap,S.displacementScale=L.displacementScale,S.displacementBias=L.displacementBias,S.wireframeLinewidth=L.wireframeLinewidth,S.linewidth=L.linewidth,C.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const O=n.properties.get(S);O.light=C}return S}function M(R,L,C,P,S){if(R.visible===!1)return;if(R.layers.test(L.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&S===On)&&(!R.frustumCulled||i.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,R.matrixWorld);const k=e.update(R),Z=R.material;if(Array.isArray(Z)){const I=k.groups;for(let y=0,w=I.length;y=1):H.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),q=V>=2);let N=null,G={};const ee=n.getParameter(n.SCISSOR_BOX),ae=n.getParameter(n.VIEWPORT),fe=new at().fromArray(ee),xe=new at().fromArray(ae);function De(U,ue,re,Y){const se=new Uint8Array(4),Me=n.createTexture();n.bindTexture(U,Me),n.texParameteri(U,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(U,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Je=0;Je"u"?!1:/OculusBrowser/g.test(navigator.userAgent),_=new WeakMap;let m;const h=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(A,x){return f?new OffscreenCanvas(A,x):ua("canvas")}function v(A,x,W,ne){let Q=1;if((A.width>ne||A.height>ne)&&(Q=ne/Math.max(A.width,A.height)),Q<1||x===!0)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap){const ie=x?Ko:Math.floor,ve=ie(Q*A.width),oe=ie(Q*A.height);m===void 0&&(m=b(ve,oe));const he=W?b(ve,oe):m;return he.width=ve,he.height=oe,he.getContext("2d").drawImage(A,0,0,ve,oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+A.width+"x"+A.height+") to ("+ve+"x"+oe+")."),he}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+A.width+"x"+A.height+")."),A;return A}function M(A){return Vl(A.width)&&Vl(A.height)}function R(A){return o?!1:A.wrapS!==dn||A.wrapT!==dn||A.minFilter!==It&&A.minFilter!==Jt}function L(A,x){return A.generateMipmaps&&x&&A.minFilter!==It&&A.minFilter!==Jt}function C(A){n.generateMipmap(A)}function P(A,x,W,ne,Q=!1){if(o===!1)return x;if(A!==null){if(n[A]!==void 0)return n[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let ie=x;if(x===n.RED&&(W===n.FLOAT&&(ie=n.R32F),W===n.HALF_FLOAT&&(ie=n.R16F),W===n.UNSIGNED_BYTE&&(ie=n.R8)),x===n.RED_INTEGER&&(W===n.UNSIGNED_BYTE&&(ie=n.R8UI),W===n.UNSIGNED_SHORT&&(ie=n.R16UI),W===n.UNSIGNED_INT&&(ie=n.R32UI),W===n.BYTE&&(ie=n.R8I),W===n.SHORT&&(ie=n.R16I),W===n.INT&&(ie=n.R32I)),x===n.RG&&(W===n.FLOAT&&(ie=n.RG32F),W===n.HALF_FLOAT&&(ie=n.RG16F),W===n.UNSIGNED_BYTE&&(ie=n.RG8)),x===n.RGBA){const ve=Q?aa:tt.getTransfer(ne);W===n.FLOAT&&(ie=n.RGBA32F),W===n.HALF_FLOAT&&(ie=n.RGBA16F),W===n.UNSIGNED_BYTE&&(ie=ve===st?n.SRGB8_ALPHA8:n.RGBA8),W===n.UNSIGNED_SHORT_4_4_4_4&&(ie=n.RGBA4),W===n.UNSIGNED_SHORT_5_5_5_1&&(ie=n.RGB5_A1)}return(ie===n.R16F||ie===n.R32F||ie===n.RG16F||ie===n.RG32F||ie===n.RGBA16F||ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function S(A,x,W){return L(A,W)===!0||A.isFramebufferTexture&&A.minFilter!==It&&A.minFilter!==Jt?Math.log2(Math.max(x.width,x.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?x.mipmaps.length:1}function E(A){return A===It||A===hl||A===Za?n.NEAREST:n.LINEAR}function O(A){const x=A.target;x.removeEventListener("dispose",O),Z(x),x.isVideoTexture&&_.delete(x)}function k(A){const x=A.target;x.removeEventListener("dispose",k),y(x)}function Z(A){const x=i.get(A);if(x.__webglInit===void 0)return;const W=A.source,ne=h.get(W);if(ne){const Q=ne[x.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&I(A),Object.keys(ne).length===0&&h.delete(W)}i.remove(A)}function I(A){const x=i.get(A);n.deleteTexture(x.__webglTexture);const W=A.source,ne=h.get(W);delete ne[x.__cacheKey],a.memory.textures--}function y(A){const x=A.texture,W=i.get(A),ne=i.get(x);if(ne.__webglTexture!==void 0&&(n.deleteTexture(ne.__webglTexture),a.memory.textures--),A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++){if(Array.isArray(W.__webglFramebuffer[Q]))for(let ie=0;ie=c&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+c),w+=1,A}function V(A){const x=[];return x.push(A.wrapS),x.push(A.wrapT),x.push(A.wrapR||0),x.push(A.magFilter),x.push(A.minFilter),x.push(A.anisotropy),x.push(A.internalFormat),x.push(A.format),x.push(A.type),x.push(A.generateMipmaps),x.push(A.premultiplyAlpha),x.push(A.flipY),x.push(A.unpackAlignment),x.push(A.colorSpace),x.join()}function H(A,x){const W=i.get(A);if(A.isVideoTexture&&yt(A),A.isRenderTargetTexture===!1&&A.version>0&&W.__version!==A.version){const ne=A.image;if(ne===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ne.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{be(W,A,x);return}}t.bindTexture(n.TEXTURE_2D,W.__webglTexture,n.TEXTURE0+x)}function N(A,x){const W=i.get(A);if(A.version>0&&W.__version!==A.version){be(W,A,x);return}t.bindTexture(n.TEXTURE_2D_ARRAY,W.__webglTexture,n.TEXTURE0+x)}function G(A,x){const W=i.get(A);if(A.version>0&&W.__version!==A.version){be(W,A,x);return}t.bindTexture(n.TEXTURE_3D,W.__webglTexture,n.TEXTURE0+x)}function ee(A,x){const W=i.get(A);if(A.version>0&&W.__version!==A.version){Qe(W,A,x);return}t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+x)}const ae={[jo]:n.REPEAT,[dn]:n.CLAMP_TO_EDGE,[$o]:n.MIRRORED_REPEAT},fe={[It]:n.NEAREST,[hl]:n.NEAREST_MIPMAP_NEAREST,[Za]:n.NEAREST_MIPMAP_LINEAR,[Jt]:n.LINEAR,[rp]:n.LINEAR_MIPMAP_NEAREST,[Xr]:n.LINEAR_MIPMAP_LINEAR},xe={[_p]:n.NEVER,[Mp]:n.ALWAYS,[vp]:n.LESS,[xp]:n.LEQUAL,[yp]:n.EQUAL,[bp]:n.GEQUAL,[Sp]:n.GREATER,[Ep]:n.NOTEQUAL};function De(A,x,W){if(W?(n.texParameteri(A,n.TEXTURE_WRAP_S,ae[x.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,ae[x.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,ae[x.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,fe[x.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,fe[x.minFilter])):(n.texParameteri(A,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(A,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(x.wrapS!==dn||x.wrapT!==dn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(A,n.TEXTURE_MAG_FILTER,E(x.magFilter)),n.texParameteri(A,n.TEXTURE_MIN_FILTER,E(x.minFilter)),x.minFilter!==It&&x.minFilter!==Jt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),x.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,xe[x.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ne=e.get("EXT_texture_filter_anisotropic");if(x.magFilter===It||x.minFilter!==Za&&x.minFilter!==Xr||x.type===ii&&e.has("OES_texture_float_linear")===!1||o===!1&&x.type===qr&&e.has("OES_texture_half_float_linear")===!1)return;(x.anisotropy>1||i.get(x).__currentAnisotropy)&&(n.texParameterf(A,ne.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,r.getMaxAnisotropy())),i.get(x).__currentAnisotropy=x.anisotropy)}}function Ae(A,x){let W=!1;A.__webglInit===void 0&&(A.__webglInit=!0,x.addEventListener("dispose",O));const ne=x.source;let Q=h.get(ne);Q===void 0&&(Q={},h.set(ne,Q));const ie=V(x);if(ie!==A.__cacheKey){Q[ie]===void 0&&(Q[ie]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,W=!0),Q[ie].usedTimes++;const ve=Q[A.__cacheKey];ve!==void 0&&(Q[A.__cacheKey].usedTimes--,ve.usedTimes===0&&I(x)),A.__cacheKey=ie,A.__webglTexture=Q[ie].texture}return W}function be(A,x,W){let ne=n.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(ne=n.TEXTURE_2D_ARRAY),x.isData3DTexture&&(ne=n.TEXTURE_3D);const Q=Ae(A,x),ie=x.source;t.bindTexture(ne,A.__webglTexture,n.TEXTURE0+W);const ve=i.get(ie);if(ie.version!==ve.__version||Q===!0){t.activeTexture(n.TEXTURE0+W);const oe=tt.getPrimaries(tt.workingColorSpace),he=x.colorSpace===Qt?null:tt.getPrimaries(x.colorSpace),Le=x.colorSpace===Qt||oe===he?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,x.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,x.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Le);const Ke=R(x)&&M(x.image)===!1;let te=v(x.image,Ke,!1,u);te=Tt(x,te);const et=M(te)||o,Ne=s.convert(x.format,x.colorSpace);let Pe=s.convert(x.type),Se=P(x.internalFormat,Ne,Pe,x.colorSpace,x.isVideoTexture);De(ne,x,et);let me;const $e=x.mipmaps,U=o&&x.isVideoTexture!==!0,ue=ve.__version===void 0||Q===!0,re=S(x,te,et);if(x.isDepthTexture)Se=n.DEPTH_COMPONENT,o?x.type===ii?Se=n.DEPTH_COMPONENT32F:x.type===ni?Se=n.DEPTH_COMPONENT24:x.type===Ti?Se=n.DEPTH24_STENCIL8:Se=n.DEPTH_COMPONENT16:x.type===ii&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),x.format===wi&&Se===n.DEPTH_COMPONENT&&x.type!==wc&&x.type!==ni&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),x.type=ni,Pe=s.convert(x.type)),x.format===hr&&Se===n.DEPTH_COMPONENT&&(Se=n.DEPTH_STENCIL,x.type!==Ti&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),x.type=Ti,Pe=s.convert(x.type))),ue&&(U?t.texStorage2D(n.TEXTURE_2D,1,Se,te.width,te.height):t.texImage2D(n.TEXTURE_2D,0,Se,te.width,te.height,0,Ne,Pe,null));else if(x.isDataTexture)if($e.length>0&&et){U&&ue&&t.texStorage2D(n.TEXTURE_2D,re,Se,$e[0].width,$e[0].height);for(let Y=0,se=$e.length;Y>=1,se>>=1}}else if($e.length>0&&et){U&&ue&&t.texStorage2D(n.TEXTURE_2D,re,Se,$e[0].width,$e[0].height);for(let Y=0,se=$e.length;Y0&&ue++,t.texStorage2D(n.TEXTURE_CUBE_MAP,ue,me,te[0].width,te[0].height));for(let Y=0;Y<6;Y++)if(Ke){$e?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Y,0,0,0,te[Y].width,te[Y].height,Pe,Se,te[Y].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Y,0,me,te[Y].width,te[Y].height,0,Pe,Se,te[Y].data);for(let se=0;se>ie),te=Math.max(1,x.height>>ie);Q===n.TEXTURE_3D||Q===n.TEXTURE_2D_ARRAY?t.texImage3D(Q,ie,he,Ke,te,x.depth,0,ve,oe,null):t.texImage2D(Q,ie,he,Ke,te,0,ve,oe,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),nt(x)?p.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ne,Q,i.get(W).__webglTexture,0,We(x)):(Q===n.TEXTURE_2D||Q>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ne,Q,i.get(W).__webglTexture,ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function z(A,x,W){if(n.bindRenderbuffer(n.RENDERBUFFER,A),x.depthBuffer&&!x.stencilBuffer){let ne=o===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(W||nt(x)){const Q=x.depthTexture;Q&&Q.isDepthTexture&&(Q.type===ii?ne=n.DEPTH_COMPONENT32F:Q.type===ni&&(ne=n.DEPTH_COMPONENT24));const ie=We(x);nt(x)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ie,ne,x.width,x.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ie,ne,x.width,x.height)}else n.renderbufferStorage(n.RENDERBUFFER,ne,x.width,x.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,A)}else if(x.depthBuffer&&x.stencilBuffer){const ne=We(x);W&&nt(x)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ne,n.DEPTH24_STENCIL8,x.width,x.height):nt(x)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ne,n.DEPTH24_STENCIL8,x.width,x.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,x.width,x.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,A)}else{const ne=x.isWebGLMultipleRenderTargets===!0?x.texture:[x.texture];for(let Q=0;Q0){W.__webglFramebuffer[oe]=[];for(let he=0;he0){W.__webglFramebuffer=[];for(let oe=0;oe0&&nt(A)===!1){const oe=ie?x:[x];W.__webglMultisampledFramebuffer=n.createFramebuffer(),W.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let he=0;he0)for(let he=0;he0)for(let he=0;he0&&nt(A)===!1){const x=A.isWebGLMultipleRenderTargets?A.texture:[A.texture],W=A.width,ne=A.height;let Q=n.COLOR_BUFFER_BIT;const ie=[],ve=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,oe=i.get(A),he=A.isWebGLMultipleRenderTargets===!0;if(he)for(let Le=0;Le0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function yt(A){const x=a.render.frame;_.get(A)!==x&&(_.set(A,x),A.update())}function Tt(A,x){const W=A.colorSpace,ne=A.format,Q=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||A.format===Zo||W!==Gn&&W!==Qt&&(tt.getTransfer(W)===st?o===!1?e.has("EXT_sRGB")===!0&&ne===fn?(A.format=Zo,A.minFilter=Jt,A.generateMipmaps=!1):x=Xd.sRGBToLinear(x):(ne!==fn||Q!==ai)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),x}this.allocateTextureUnit=q,this.resetTextureUnits=D,this.setTexture2D=H,this.setTexture2DArray=N,this.setTexture3D=G,this.setTextureCube=ee,this.rebindTextures=Ce,this.setupRenderTarget=Re,this.updateRenderTargetMipmap=ct,this.updateMultisampleRenderTarget=Ge,this.setupDepthRenderbuffer=ge,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=nt}function bv(n,e,t){const i=t.isWebGL2;function r(s,a=Qt){let o;const c=tt.getTransfer(a);if(s===ai)return n.UNSIGNED_BYTE;if(s===Bd)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Fd)return n.UNSIGNED_SHORT_5_5_5_1;if(s===sp)return n.BYTE;if(s===ap)return n.SHORT;if(s===wc)return n.UNSIGNED_SHORT;if(s===Od)return n.INT;if(s===ni)return n.UNSIGNED_INT;if(s===ii)return n.FLOAT;if(s===qr)return i?n.HALF_FLOAT:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===op)return n.ALPHA;if(s===fn)return n.RGBA;if(s===cp)return n.LUMINANCE;if(s===lp)return n.LUMINANCE_ALPHA;if(s===wi)return n.DEPTH_COMPONENT;if(s===hr)return n.DEPTH_STENCIL;if(s===Zo)return o=e.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(s===up)return n.RED;if(s===kd)return n.RED_INTEGER;if(s===dp)return n.RG;if(s===zd)return n.RG_INTEGER;if(s===Hd)return n.RGBA_INTEGER;if(s===Ya||s===Ka||s===Ja||s===Qa)if(c===st)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(s===Ya)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Ka)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Ja)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Qa)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===Ya)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Ka)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Ja)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Qa)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===pl||s===ml||s===gl||s===_l)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===pl)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===ml)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===gl)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===_l)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===fp)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===vl||s===yl)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(s===vl)return c===st?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(s===yl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===xl||s===Sl||s===El||s===bl||s===Ml||s===Tl||s===wl||s===Al||s===Rl||s===Cl||s===Ll||s===Pl||s===Il||s===Dl)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(s===xl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Sl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===El)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===bl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ml)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Tl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===wl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Al)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Rl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Cl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Ll)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Pl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Il)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Dl)return c===st?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===eo||s===Ul||s===Nl)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(s===eo)return c===st?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Ul)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Nl)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===hp||s===Ol||s===Bl||s===Fl)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(s===eo)return o.COMPRESSED_RED_RGTC1_EXT;if(s===Ol)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===Bl)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Fl)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Ti?i?n.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class Mv extends Wt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Br extends Ft{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Tv={type:"move"};class wo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Br,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Br,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Br,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,a=null;const o=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){a=!0;for(const m of e.hand.values()){const h=t.getJointPose(m,i),f=this._getHandJoint(l,m);h!==null&&(f.matrix.fromArray(h.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=h.radius),f.visible=h!==null}const u=l.joints["index-finger-tip"],d=l.joints["thumb-tip"],p=u.position.distanceTo(d.position),g=.02,_=.005;l.inputState.pinching&&p>g+_?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&p<=g-_&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Tv)))}return o!==null&&(o.visible=r!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Br;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class wv extends Xt{constructor(e,t,i,r,s,a,o,c,l,u){if(u=u!==void 0?u:wi,u!==wi&&u!==hr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===wi&&(i=ni),i===void 0&&u===hr&&(i=Ti),super(null,r,s,a,o,c,u,i,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:It,this.minFilter=c!==void 0?c:It,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Av extends br{constructor(e,t){super();const i=this;let r=null,s=1,a=null,o="local-floor",c=1,l=null,u=null,d=null,p=null,g=null,_=null;const m=t.getContextAttributes();let h=null,f=null;const b=[],v=[],M=new Wt;M.layers.enable(1),M.viewport=new at;const R=new Wt;R.layers.enable(2),R.viewport=new at;const L=[M,R],C=new Mv;C.layers.enable(1),C.layers.enable(2);let P=null,S=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let G=b[N];return G===void 0&&(G=new wo,b[N]=G),G.getTargetRaySpace()},this.getControllerGrip=function(N){let G=b[N];return G===void 0&&(G=new wo,b[N]=G),G.getGripSpace()},this.getHand=function(N){let G=b[N];return G===void 0&&(G=new wo,b[N]=G),G.getHandSpace()};function E(N){const G=v.indexOf(N.inputSource);if(G===-1)return;const ee=b[G];ee!==void 0&&(ee.update(N.inputSource,N.frame,l||a),ee.dispatchEvent({type:N.type,data:N.inputSource}))}function O(){r.removeEventListener("select",E),r.removeEventListener("selectstart",E),r.removeEventListener("selectend",E),r.removeEventListener("squeeze",E),r.removeEventListener("squeezestart",E),r.removeEventListener("squeezeend",E),r.removeEventListener("end",O),r.removeEventListener("inputsourceschange",k);for(let N=0;N=0&&(v[ae]=null,b[ae].disconnect(ee))}for(let G=0;G=v.length){v.push(ee),ae=xe;break}else if(v[xe]===null){v[xe]=ee,ae=xe;break}if(ae===-1)break}const fe=b[ae];fe&&fe.connect(ee)}}const Z=new F,I=new F;function y(N,G,ee){Z.setFromMatrixPosition(G.matrixWorld),I.setFromMatrixPosition(ee.matrixWorld);const ae=Z.distanceTo(I),fe=G.projectionMatrix.elements,xe=ee.projectionMatrix.elements,De=fe[14]/(fe[10]-1),Ae=fe[14]/(fe[10]+1),be=(fe[9]+1)/fe[5],Qe=(fe[9]-1)/fe[5],Fe=(fe[8]-1)/fe[0],z=(xe[8]+1)/xe[0],rt=De*Fe,ge=De*z,Ce=ae/(-Fe+z),Re=Ce*-Fe;G.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(Re),N.translateZ(Ce),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();const ct=De+Ce,Ge=Ae+Ce,We=rt-Re,nt=ge+(ae-Re),yt=be*Ae/Ge*ct,Tt=Qe*Ae/Ge*ct;N.projectionMatrix.makePerspective(We,nt,yt,Tt,ct,Ge),N.projectionMatrixInverse.copy(N.projectionMatrix).invert()}function w(N,G){G===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(G.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(r===null)return;C.near=R.near=M.near=N.near,C.far=R.far=M.far=N.far,(P!==C.near||S!==C.far)&&(r.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,S=C.far);const G=N.parent,ee=C.cameras;w(C,G);for(let ae=0;ae0&&(h.alphaTest.value=f.alphaTest);const b=e.get(f).envMap;if(b&&(h.envMap.value=b,h.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,h.reflectivity.value=f.reflectivity,h.ior.value=f.ior,h.refractionRatio.value=f.refractionRatio),f.lightMap){h.lightMap.value=f.lightMap;const v=n._useLegacyLights===!0?Math.PI:1;h.lightMapIntensity.value=f.lightMapIntensity*v,t(f.lightMap,h.lightMapTransform)}f.aoMap&&(h.aoMap.value=f.aoMap,h.aoMapIntensity.value=f.aoMapIntensity,t(f.aoMap,h.aoMapTransform))}function a(h,f){h.diffuse.value.copy(f.color),h.opacity.value=f.opacity,f.map&&(h.map.value=f.map,t(f.map,h.mapTransform))}function o(h,f){h.dashSize.value=f.dashSize,h.totalSize.value=f.dashSize+f.gapSize,h.scale.value=f.scale}function c(h,f,b,v){h.diffuse.value.copy(f.color),h.opacity.value=f.opacity,h.size.value=f.size*b,h.scale.value=v*.5,f.map&&(h.map.value=f.map,t(f.map,h.uvTransform)),f.alphaMap&&(h.alphaMap.value=f.alphaMap,t(f.alphaMap,h.alphaMapTransform)),f.alphaTest>0&&(h.alphaTest.value=f.alphaTest)}function l(h,f){h.diffuse.value.copy(f.color),h.opacity.value=f.opacity,h.rotation.value=f.rotation,f.map&&(h.map.value=f.map,t(f.map,h.mapTransform)),f.alphaMap&&(h.alphaMap.value=f.alphaMap,t(f.alphaMap,h.alphaMapTransform)),f.alphaTest>0&&(h.alphaTest.value=f.alphaTest)}function u(h,f){h.specular.value.copy(f.specular),h.shininess.value=Math.max(f.shininess,1e-4)}function d(h,f){f.gradientMap&&(h.gradientMap.value=f.gradientMap)}function p(h,f){h.metalness.value=f.metalness,f.metalnessMap&&(h.metalnessMap.value=f.metalnessMap,t(f.metalnessMap,h.metalnessMapTransform)),h.roughness.value=f.roughness,f.roughnessMap&&(h.roughnessMap.value=f.roughnessMap,t(f.roughnessMap,h.roughnessMapTransform)),e.get(f).envMap&&(h.envMapIntensity.value=f.envMapIntensity)}function g(h,f,b){h.ior.value=f.ior,f.sheen>0&&(h.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),h.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(h.sheenColorMap.value=f.sheenColorMap,t(f.sheenColorMap,h.sheenColorMapTransform)),f.sheenRoughnessMap&&(h.sheenRoughnessMap.value=f.sheenRoughnessMap,t(f.sheenRoughnessMap,h.sheenRoughnessMapTransform))),f.clearcoat>0&&(h.clearcoat.value=f.clearcoat,h.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(h.clearcoatMap.value=f.clearcoatMap,t(f.clearcoatMap,h.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(h.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,t(f.clearcoatRoughnessMap,h.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(h.clearcoatNormalMap.value=f.clearcoatNormalMap,t(f.clearcoatNormalMap,h.clearcoatNormalMapTransform),h.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===Bt&&h.clearcoatNormalScale.value.negate())),f.iridescence>0&&(h.iridescence.value=f.iridescence,h.iridescenceIOR.value=f.iridescenceIOR,h.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],h.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(h.iridescenceMap.value=f.iridescenceMap,t(f.iridescenceMap,h.iridescenceMapTransform)),f.iridescenceThicknessMap&&(h.iridescenceThicknessMap.value=f.iridescenceThicknessMap,t(f.iridescenceThicknessMap,h.iridescenceThicknessMapTransform))),f.transmission>0&&(h.transmission.value=f.transmission,h.transmissionSamplerMap.value=b.texture,h.transmissionSamplerSize.value.set(b.width,b.height),f.transmissionMap&&(h.transmissionMap.value=f.transmissionMap,t(f.transmissionMap,h.transmissionMapTransform)),h.thickness.value=f.thickness,f.thicknessMap&&(h.thicknessMap.value=f.thicknessMap,t(f.thicknessMap,h.thicknessMapTransform)),h.attenuationDistance.value=f.attenuationDistance,h.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(h.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(h.anisotropyMap.value=f.anisotropyMap,t(f.anisotropyMap,h.anisotropyMapTransform))),h.specularIntensity.value=f.specularIntensity,h.specularColor.value.copy(f.specularColor),f.specularColorMap&&(h.specularColorMap.value=f.specularColorMap,t(f.specularColorMap,h.specularColorMapTransform)),f.specularIntensityMap&&(h.specularIntensityMap.value=f.specularIntensityMap,t(f.specularIntensityMap,h.specularIntensityMapTransform))}function _(h,f){f.matcap&&(h.matcap.value=f.matcap)}function m(h,f){const b=e.get(f).light;h.referencePosition.value.setFromMatrixPosition(b.matrixWorld),h.nearDistance.value=b.shadow.camera.near,h.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function Cv(n,e,t,i){let r={},s={},a=[];const o=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(b,v){const M=v.program;i.uniformBlockBinding(b,M)}function l(b,v){let M=r[b.id];M===void 0&&(_(b),M=u(b),r[b.id]=M,b.addEventListener("dispose",h));const R=v.program;i.updateUBOMapping(b,R);const L=e.render.frame;s[b.id]!==L&&(p(b),s[b.id]=L)}function u(b){const v=d();b.__bindingPointIndex=v;const M=n.createBuffer(),R=b.__size,L=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,R,L),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,M),M}function d(){for(let b=0;b0){L=M%R;const k=R-L;L!==0&&k-E.boundary<0&&(M+=R-L,S.__offset=M)}M+=E.storage}return L=M%R,L>0&&(M+=R-L),b.__size=M,b.__cache={},this}function m(b){const v={boundary:0,storage:0};return typeof b=="number"?(v.boundary=4,v.storage=4):b.isVector2?(v.boundary=8,v.storage=8):b.isVector3||b.isColor?(v.boundary=16,v.storage=12):b.isVector4?(v.boundary=16,v.storage=16):b.isMatrix3?(v.boundary=48,v.storage=48):b.isMatrix4?(v.boundary=64,v.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),v}function h(b){const v=b.target;v.removeEventListener("dispose",h);const M=a.indexOf(v.__bindingPointIndex);a.splice(M,1),n.deleteBuffer(r[v.id]),delete r[v.id],delete s[v.id]}function f(){for(const b in r)n.deleteBuffer(r[b]);a=[],r={},s={}}return{bind:c,update:l,dispose:f}}class cf{constructor(e={}){const{canvas:t=wp(),context:i=null,depth:r=!0,stencil:s=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=a;const g=new Uint32Array(4),_=new Int32Array(4);let m=null,h=null;const f=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Mt,this._useLegacyLights=!1,this.toneMapping=si,this.toneMappingExposure=1;const v=this;let M=!1,R=0,L=0,C=null,P=-1,S=null;const E=new at,O=new at;let k=null;const Z=new Ue(0);let I=0,y=t.width,w=t.height,D=1,q=null,V=null;const H=new at(0,0,y,w),N=new at(0,0,y,w);let G=!1;const ee=new Lc;let ae=!1,fe=!1,xe=null;const De=new mt,Ae=new je,be=new F,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Fe(){return C===null?D:1}let z=i;function rt(T,B){for(let X=0;X{function pe(){if(j.forEach(function(ye){Ge.get(ye).currentProgram.isReady()&&j.delete(ye)}),j.size===0){$(T);return}setTimeout(pe,10)}ge.get("KHR_parallel_shader_compile")!==null?pe():setTimeout(pe,10)})};let Je=null;function ft(T){Je&&Je(T)}function jt(){Ct.stop()}function it(){Ct.start()}const Ct=new nf;Ct.setAnimationLoop(ft),typeof self<"u"&&Ct.setContext(self),this.setAnimationLoop=function(T){Je=T,me.setAnimationLoop(T),T===null?Ct.stop():Ct.start()},me.addEventListener("sessionstart",jt),me.addEventListener("sessionend",it),this.render=function(T,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(B),B=me.getCamera()),T.isScene===!0&&T.onBeforeRender(v,T,B,C),h=ie.get(T,b.length),h.init(),b.push(h),De.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),ee.setFromProjectionMatrix(De),fe=this.localClippingEnabled,ae=ve.init(this.clippingPlanes,fe),m=Q.get(T,f.length),m.init(),f.push(m),gn(T,B,0,v.sortObjects),m.finish(),v.sortObjects===!0&&m.sort(q,V),this.info.render.frame++,ae===!0&&ve.beginShadows();const X=h.state.shadowsArray;if(oe.render(X,T,B),ae===!0&&ve.endShadows(),this.info.autoReset===!0&&this.info.reset(),he.render(m,T),h.setupLights(v._useLegacyLights),B.isArrayCamera){const j=B.cameras;for(let $=0,pe=j.length;$0?h=b[b.length-1]:h=null,f.pop(),f.length>0?m=f[f.length-1]:m=null};function gn(T,B,X,j){if(T.visible===!1)return;if(T.layers.test(B.layers)){if(T.isGroup)X=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(B);else if(T.isLight)h.pushLight(T),T.castShadow&&h.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||ee.intersectsSprite(T)){j&&be.setFromMatrixPosition(T.matrixWorld).applyMatrix4(De);const ye=x.update(T),Te=T.material;Te.visible&&m.push(T,ye,Te,X,be.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||ee.intersectsObject(T))){const ye=x.update(T),Te=T.material;if(j&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),be.copy(T.boundingSphere.center)):(ye.boundingSphere===null&&ye.computeBoundingSphere(),be.copy(ye.boundingSphere.center)),be.applyMatrix4(T.matrixWorld).applyMatrix4(De)),Array.isArray(Te)){const Ie=ye.groups;for(let Ve=0,Oe=Ie.length;Ve0&&yh($,pe,B,X),j&&Re.viewport(E.copy(j)),$.length>0&&Ms($,B,X),pe.length>0&&Ms(pe,B,X),ye.length>0&&Ms(ye,B,X),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function yh(T,B,X,j){if((X.isScene===!0?X.overrideMaterial:null)!==null)return;const pe=Ce.isWebGL2;xe===null&&(xe=new Ii(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?qr:ai,minFilter:Xr,samples:pe?4:0})),v.getDrawingBufferSize(Ae),pe?xe.setSize(Ae.x,Ae.y):xe.setSize(Ko(Ae.x),Ko(Ae.y));const ye=v.getRenderTarget();v.setRenderTarget(xe),v.getClearColor(Z),I=v.getClearAlpha(),I<1&&v.setClearColor(16777215,.5),v.clear();const Te=v.toneMapping;v.toneMapping=si,Ms(T,X,j),We.updateMultisampleRenderTarget(xe),We.updateRenderTargetMipmap(xe);let Ie=!1;for(let Ve=0,Oe=B.length;Ve0),ke=!!X.morphAttributes.position,ut=!!X.morphAttributes.normal,zt=!!X.morphAttributes.color;let xt=si;j.toneMapped&&(C===null||C.isXRRenderTarget===!0)&&(xt=v.toneMapping);const An=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,lt=An!==void 0?An.length:0,qe=Ge.get(j),Xa=h.state.lights;if(ae===!0&&(fe===!0||T!==S)){const Ht=T===S&&j.id===P;ve.setState(j,T,Ht)}let ht=!1;j.version===qe.__version?(qe.needsLights&&qe.lightsStateVersion!==Xa.state.version||qe.outputColorSpace!==Te||$.isInstancedMesh&&qe.instancing===!1||!$.isInstancedMesh&&qe.instancing===!0||$.isSkinnedMesh&&qe.skinning===!1||!$.isSkinnedMesh&&qe.skinning===!0||$.isInstancedMesh&&qe.instancingColor===!0&&$.instanceColor===null||$.isInstancedMesh&&qe.instancingColor===!1&&$.instanceColor!==null||qe.envMap!==Ie||j.fog===!0&&qe.fog!==pe||qe.numClippingPlanes!==void 0&&(qe.numClippingPlanes!==ve.numPlanes||qe.numIntersection!==ve.numIntersection)||qe.vertexAlphas!==Ve||qe.vertexTangents!==Oe||qe.morphTargets!==ke||qe.morphNormals!==ut||qe.morphColors!==zt||qe.toneMapping!==xt||Ce.isWebGL2===!0&&qe.morphTargetsCount!==lt)&&(ht=!0):(ht=!0,qe.__version=j.version);let fi=qe.currentProgram;ht===!0&&(fi=Ts(j,B,$));let sl=!1,Ar=!1,qa=!1;const Lt=fi.getUniforms(),hi=qe.uniforms;if(Re.useProgram(fi.program)&&(sl=!0,Ar=!0,qa=!0),j.id!==P&&(P=j.id,Ar=!0),sl||S!==T){Lt.setValue(z,"projectionMatrix",T.projectionMatrix),Lt.setValue(z,"viewMatrix",T.matrixWorldInverse);const Ht=Lt.map.cameraPosition;Ht!==void 0&&Ht.setValue(z,be.setFromMatrixPosition(T.matrixWorld)),Ce.logarithmicDepthBuffer&&Lt.setValue(z,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&Lt.setValue(z,"isOrthographic",T.isOrthographicCamera===!0),S!==T&&(S=T,Ar=!0,qa=!0)}if($.isSkinnedMesh){Lt.setOptional(z,$,"bindMatrix"),Lt.setOptional(z,$,"bindMatrixInverse");const Ht=$.skeleton;Ht&&(Ce.floatVertexTextures?(Ht.boneTexture===null&&Ht.computeBoneTexture(),Lt.setValue(z,"boneTexture",Ht.boneTexture,We),Lt.setValue(z,"boneTextureSize",Ht.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const ja=X.morphAttributes;if((ja.position!==void 0||ja.normal!==void 0||ja.color!==void 0&&Ce.isWebGL2===!0)&&Le.update($,X,fi),(Ar||qe.receiveShadow!==$.receiveShadow)&&(qe.receiveShadow=$.receiveShadow,Lt.setValue(z,"receiveShadow",$.receiveShadow)),j.isMeshGouraudMaterial&&j.envMap!==null&&(hi.envMap.value=Ie,hi.flipEnvMap.value=Ie.isCubeTexture&&Ie.isRenderTargetTexture===!1?-1:1),Ar&&(Lt.setValue(z,"toneMappingExposure",v.toneMappingExposure),qe.needsLights&&Sh(hi,qa),pe&&j.fog===!0&&ne.refreshFogUniforms(hi,pe),ne.refreshMaterialUniforms(hi,j,D,w,xe),na.upload(z,il(qe),hi,We)),j.isShaderMaterial&&j.uniformsNeedUpdate===!0&&(na.upload(z,il(qe),hi,We),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&Lt.setValue(z,"center",$.center),Lt.setValue(z,"modelViewMatrix",$.modelViewMatrix),Lt.setValue(z,"normalMatrix",$.normalMatrix),Lt.setValue(z,"modelMatrix",$.matrixWorld),j.isShaderMaterial||j.isRawShaderMaterial){const Ht=j.uniformsGroups;for(let $a=0,bh=Ht.length;$a0&&We.useMultisampledRTT(T)===!1?$=Ge.get(T).__webglMultisampledFramebuffer:Array.isArray(Oe)?$=Oe[X]:$=Oe,E.copy(T.viewport),O.copy(T.scissor),k=T.scissorTest}else E.copy(H).multiplyScalar(D).floor(),O.copy(N).multiplyScalar(D).floor(),k=G;if(Re.bindFramebuffer(z.FRAMEBUFFER,$)&&Ce.drawBuffers&&j&&Re.drawBuffers(T,$),Re.viewport(E),Re.scissor(O),Re.setScissorTest(k),pe){const Ie=Ge.get(T.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+B,Ie.__webglTexture,X)}else if(ye){const Ie=Ge.get(T.texture),Ve=B||0;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ie.__webglTexture,X||0,Ve)}P=-1},this.readRenderTargetPixels=function(T,B,X,j,$,pe,ye){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Te=Ge.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&ye!==void 0&&(Te=Te[ye]),Te){Re.bindFramebuffer(z.FRAMEBUFFER,Te);try{const Ie=T.texture,Ve=Ie.format,Oe=Ie.type;if(Ve!==fn&&et.convert(Ve)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ke=Oe===qr&&(ge.has("EXT_color_buffer_half_float")||Ce.isWebGL2&&ge.has("EXT_color_buffer_float"));if(Oe!==ai&&et.convert(Oe)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Oe===ii&&(Ce.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=T.width-j&&X>=0&&X<=T.height-$&&z.readPixels(B,X,j,$,et.convert(Ve),et.convert(Oe),pe)}finally{const Ie=C!==null?Ge.get(C).__webglFramebuffer:null;Re.bindFramebuffer(z.FRAMEBUFFER,Ie)}}},this.copyFramebufferToTexture=function(T,B,X=0){const j=Math.pow(2,-X),$=Math.floor(B.image.width*j),pe=Math.floor(B.image.height*j);We.setTexture2D(B,0),z.copyTexSubImage2D(z.TEXTURE_2D,X,0,0,T.x,T.y,$,pe),Re.unbindTexture()},this.copyTextureToTexture=function(T,B,X,j=0){const $=B.image.width,pe=B.image.height,ye=et.convert(X.format),Te=et.convert(X.type);We.setTexture2D(X,0),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,X.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,X.unpackAlignment),B.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,j,T.x,T.y,$,pe,ye,Te,B.image.data):B.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,j,T.x,T.y,B.mipmaps[0].width,B.mipmaps[0].height,ye,B.mipmaps[0].data):z.texSubImage2D(z.TEXTURE_2D,j,T.x,T.y,ye,Te,B.image),j===0&&X.generateMipmaps&&z.generateMipmap(z.TEXTURE_2D),Re.unbindTexture()},this.copyTextureToTexture3D=function(T,B,X,j,$=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const pe=T.max.x-T.min.x+1,ye=T.max.y-T.min.y+1,Te=T.max.z-T.min.z+1,Ie=et.convert(j.format),Ve=et.convert(j.type);let Oe;if(j.isData3DTexture)We.setTexture3D(j,0),Oe=z.TEXTURE_3D;else if(j.isDataArrayTexture)We.setTexture2DArray(j,0),Oe=z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,j.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,j.unpackAlignment);const ke=z.getParameter(z.UNPACK_ROW_LENGTH),ut=z.getParameter(z.UNPACK_IMAGE_HEIGHT),zt=z.getParameter(z.UNPACK_SKIP_PIXELS),xt=z.getParameter(z.UNPACK_SKIP_ROWS),An=z.getParameter(z.UNPACK_SKIP_IMAGES),lt=X.isCompressedTexture?X.mipmaps[0]:X.image;z.pixelStorei(z.UNPACK_ROW_LENGTH,lt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,lt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,T.min.x),z.pixelStorei(z.UNPACK_SKIP_ROWS,T.min.y),z.pixelStorei(z.UNPACK_SKIP_IMAGES,T.min.z),X.isDataTexture||X.isData3DTexture?z.texSubImage3D(Oe,$,B.x,B.y,B.z,pe,ye,Te,Ie,Ve,lt.data):X.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),z.compressedTexSubImage3D(Oe,$,B.x,B.y,B.z,pe,ye,Te,Ie,lt.data)):z.texSubImage3D(Oe,$,B.x,B.y,B.z,pe,ye,Te,Ie,Ve,lt),z.pixelStorei(z.UNPACK_ROW_LENGTH,ke),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,ut),z.pixelStorei(z.UNPACK_SKIP_PIXELS,zt),z.pixelStorei(z.UNPACK_SKIP_ROWS,xt),z.pixelStorei(z.UNPACK_SKIP_IMAGES,An),$===0&&j.generateMipmaps&&z.generateMipmap(Oe),Re.unbindTexture()},this.initTexture=function(T){T.isCubeTexture?We.setTextureCube(T,0):T.isData3DTexture?We.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?We.setTexture2DArray(T,0):We.setTexture2D(T,0),Re.unbindTexture()},this.resetState=function(){R=0,L=0,C=null,Re.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return zn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Ac?"display-p3":"srgb",t.unpackColorSpace=tt.workingColorSpace===Ua?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Mt?Ai:Vd}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ai?Mt:Gn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class Lv extends cf{}Lv.prototype.isWebGL1Renderer=!0;class Pv extends Ft{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class Iv extends _s{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ue(16777215),this.specular=new Ue(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Gd,this.normalScale=new je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Tc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class lf extends Ft{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ue(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const Ao=new mt,Au=new F,Ru=new F;class Dv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new je(512,512),this.map=null,this.mapPass=null,this.matrix=new mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Lc,this._frameExtents=new je(1,1),this._viewportCount=1,this._viewports=[new at(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Au.setFromMatrixPosition(e.matrixWorld),t.position.copy(Au),Ru.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ru),t.updateMatrixWorld(),Ao.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ao),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Ao)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const Cu=new mt,Dr=new F,Ro=new F;class Uv extends Dv{constructor(){super(new Wt(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new je(4,2),this._viewportCount=6,this._viewports=[new at(2,1,1,1),new at(0,1,1,1),new at(3,1,1,1),new at(1,1,1,1),new at(3,0,1,1),new at(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Dr.setFromMatrixPosition(e.matrixWorld),i.position.copy(Dr),Ro.copy(i.position),Ro.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Ro),i.updateMatrixWorld(),r.makeTranslation(-Dr.x,-Dr.y,-Dr.z),Cu.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cu)}}class da extends lf{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Uv}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Nv extends lf{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Ov{constructor(e,t,i=0,r=1/0){this.ray=new $d(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Cc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return Qo(e,this,i,t),i.sort(Lu),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r{t.setSize(window.innerWidth,window.innerHeight),e.aspect=window.innerWidth/window.innerHeight,e.updateProjectionMatrix()}),{scene:n,camera:e,renderer:t,lights:i}}const Du=[new Ue(0,.7,.6),new Ue(1,1,1)],zv=[new Ue(.3,.3,.3),new Ue(.5,.5,0),new Ue(1,0,0)],Hv=new Ue(.8,.2,.8),Uu=new Ue(.2,1,.5),Qn=1,tr=.3,ei=.2,Vv=2,Gv=.1,Wv=.04;class Xv{constructor(e,t){this.nodes=new Map,this.transactions=new Map,this.addressCount=0,this.loadedBlocks=new Map,this.loadingBlocks=new Map,this.loadedBars=new Map,this.blocksToClear=[],this.scene=e,this.blocks=[],this.canDrag=!0,this.canHover=!0,this.displayFrom,this.displayTo,this.displayAmount,this.maxRange=0,this.nodeArray,this.toggleSort=0,this.toggleScale=0,this.isLoaded=!1,this.dataToLoad,this.tempBlocks=[],this.viewTransitioning=!1,this.camera=t,this.allTimeMax=.01,this.allTimeMaxNumTrans=1,this.allTimeMaxBar=.01,this.allTimeMaxNumTransBar=1,this.symmetrical=!1,this.dataType=0}addNode(e){this.nodes.set(e,new qv(e))}addTransaction(e,t,i,r){let s=this.nodes.get(e),a=this.nodes.get(t);s.addTransactionIn(a,i,r),a.addTransactionOut(s,i,r);let o=[t,e].toString();if(this.transactions.get(o)||this.transactions.set(o,[]),this.transactions.get(o).push({amount:i,time:r}),this.symmetrical){a.addTransactionIn(s,i,r),s.addTransactionOut(a,i,r);let u=[e,t].toString();this.transactions.get(u)||this.transactions.set(u,[]),this.transactions.get(u).push({amount:i,time:r})}let c=0,l=0;this.transactions.get(o).forEach(u=>{c+=u.amount,l+=1}),c>this.allTimeMax&&(this.allTimeMax=c),l>this.allTimeMaxNumTrans&&(this.allTimeMaxNumTrans=l),s.totalTransactionsValueOut>this.allTimeMaxBar&&(this.allTimeMaxBar=s.totalTransactionsValueOut),a.totalTransactionsValueOut>this.allTimeMaxBar&&(this.allTimeMaxBar=a.totalTransactionsValueOut),s.numTransactionsOut>this.allTimeMaxNumTransBar&&(this.allTimeMaxNumTransBar=s.numTransactionsOut),a.numTransactionsOut>this.allTimeMaxNumTransBar&&(this.allTimeMaxNumTransBar=a.numTransactionsOut)}getTransactions(e,t){let i=this.transactions.get([e,t].toString());return i||[]}getTransactionsValue(e,t){let i=this.transactions.get([e,t].toString());if(i){let r=0;return i.forEach(s=>r+=s.amount),r}else return 0}getTotalNumTransactions(e,t){let i=this.transactions.get([e,t].toString());return i?i.length:0}compareNodeNumTransactions(e,t){return t.node.numTransactionsOut-e.node.numTransactionsOut}compareNodeTotals(e,t){return t.node.totalTransactionsValueOut-e.node.totalTransactionsValueOut}compareLargestTransaction(e,t){return Math.max(t.node.largestTransactionOut,t.node.largestTransactionIn)-Math.max(e.node.largestTransactionOut,e.node.largestTransactionIn)}loadData(e,t=-1,i=-1){this.dataToLoad=e,this.isLoaded=!1}loadDataHelper(e,t=-1,i=-1){this.allTimeMax=.01,this.allTimeMaxNumTrans=1,this.allTimeMaxBar=.01,this.allTimeMaxNumTransBar=1;let r=e.transactions;e.nodes.forEach(s=>this.addNode(s)),r.forEach(s=>{this.nodes.get(s.from)&&this.nodes.get(s.to)?this.addTransaction(s.from,s.to,Number(s.amount),s.timestamp):console.log("failed to add transaction")}),this.nodeArray=Array.from(this.nodes,([s,a])=>({id:s,node:a})),this.toggleSort==0?this.nodeArray.sort(this.compareNodeTotals):this.toggleSort==1?this.nodeArray.sort(this.compareNodeNumTransactions):this.toggleSort==2?this.nodeArray.sort(this.compareLargestTransaction):console.log("Sorting method unrecognized:",this.toggleSort),this.isLoaded=!0}loadBlocks(e,t,i,r=!1){if(!this.isLoaded)return;let s=e+i=this.allTimeMax,this.scene.add(_.getCube()),this.loadedBlocks.set([o,c].toString(),_),this.loadingBlocks.set([o,c].toString(),_),this.blocks.push(_)}}createTempBlocks(){}clearTempBlocks(){}unloadBlocks(e,t,i){if(!this.isLoaded)return;let r=e+i({key:p,value:g})).forEach(p=>{p.value.forEach(g=>{s+=g.amount,a+=1,o.push({to:p.key,amount:g.amount,time:g.time})})});let l=this.toggleSort==1?a:s,u=this.toggleSort==1?this.allTimeMaxNumTransBar:this.allTimeMaxBar,d=new Nu(this.nodeArray[r].id,null,o,l,u);d.setPosition(r*(Qn+tr),0*(Qn+tr)),d.pos=[r,0],this.scene.add(d.getCube()),this.loadedBlocks.set([r,0].toString(),d),this.loadingBlocks.set([r,0].toString(),d),this.blocks.push(d)}}getBlocks(){return this.blocks}clearBlocks(){for(let e=0;e0){this.blocksToClear.forEach(e=>{this.scene.remove(e.getCube())});for(let e=0;e0&&(t.getCube().material.opacity-=.01)}}else this.clearing=!1,this.blocks=[],this.loadedBlocks=new Map}clearData(){for(let e=0;e({key:t,val:i})).forEach(t=>{let i=t.val,r=i.pos[1];i.getCube().material.opacity=3-.2*r})}update(){if(this.isLoaded){let e=Array.from(this.loadingBlocks,([t,i])=>({key:t,val:i}));e.length>0,e.forEach(t=>{let i=t.val,r=i.yScale+(i.finalScale-i.yScale)*.1;i.getCube().material.opacity<=1&&(i.getCube().material.opacity+=.05),i.yScale=1&&(i.getCube().material.opacity=1,this.loadingBlocks.delete(t.key.toString()))}),e.length==0&&this.clearTempBlocks()}else{let e=Array.from(this.loadedBlocks,([t,i])=>({key:t,val:i}));e.forEach(t=>{let i=t.val,r=ei+(i.yScale-ei)*.9;i.getCube().material.opacity>0&&(i.getCube().material.opacity-=Wv),i.yScale>ei&&(i.getCube().geometry.scale(1,1/i.yScale,1),r-.1{r+=s.amount}),r>this.largestTransactionOut&&(this.largestTransactionOut=r)}addTransactionIn(e,t,i=0){this.transactionsIn.get(e.id)||this.transactionsIn.set(e.id,[]),this.transactionsIn.get(e.id).push({amount:t,time:i}),this.numTransactionsIn+=1,this.totalTransactionsValueIn+=t;let r=0;this.transactionsIn.get(e.id).forEach(s=>{r+=s.amount}),r>this.largestTransactionIn&&(this.largestTransactionIn=r)}}class uf{constructor(e,t){this.name=e,this.domParent=t,this.div=document.createElement("div"),this.div.id=e.replaceAll(" ","-")+"-div",this.div.classList.add("elementDiv"),this.id=e.replaceAll(" ","-"),t=="body"?this.domElement=document.body:this.domParent=document.getElementById(t),this.elements=[],this.endBreak=document.createElement("BR"),this.domParent.appendChild(this.div),this.labelBreak=document.createElement("BR"),this.label=document.createElement("label"),this.label.id=e.replaceAll(" ","-"),this.label.innerHTML=e,this.tooltip=""}createLineBreak(){return document.createElement("BR")}addElements(){this.elements.forEach(e=>{this.div.appendChild(e)})}removeDiv(){this.div.remove()}addDiv(){this.domParent.appendChild(this.div)}hideLabel(){this.label.remove(),this.labelBreak.remove()}showLabel(){this.div.prepend(this.labelBreak),this.div.prepend(this.label)}removeElement(e){this.elements[e].remove(),this.elements.splice(e,1)}addElement(e){this.elements.push(e),this.domParent.appendChild(e)}addClass(e){this.div.classList.add(e)}setToolTip(e,t){this.div.classList.contains("tooltip")||this.div.classList.add("tooltip");let i=document.createElement("span");i.classList.add("tooltiptext"),i.classList.add(t),i.innerHTML=e,this.tooltip=e,this.elements.push(i),this.div.appendChild(i)}}class Gr{constructor(e,t,i=!1){this.div=document.createElement("div"),this.div.id=e,i?this.div.classList.add("verticalContainer"):this.div.classList.add("horizontalContainer"),t=="body"?this.domElement=document.body:this.domParent=document.getElementById(t),this.domParent.appendChild(this.div)}addBlock(){let e=Array.prototype.slice.call(arguments);for(let t=0;t{this.showing?(this.hideOptions(),this.showing=!1):(this.showOptions(),this.showing=!0)}),this.button.button.innerHTML=i+": "+r[0][0],this.buttons=[],this.selected=this.options[0],this.text=i,this.name=e,this.container.addBlock(this.button)}showOptions(){this.button.div.remove();for(let e=0;e{this.selected!=this.options[e]&&(this.selected=this.options[e],this.options[e][1](),this.button.button.innerHTML=this.text+": "+this.options[e][0]),this.showing=!1,this.hideOptions()});t.div.classList.add("option"),this.options[e].length>=3&&(t.setToolTip(this.button.tooltip,"topTooltip"),t.setToolTip(this.options[e][2],"bottomTooltip")),this.buttons.push(t),this.container.addBlock(t)}this.container.addBlock(this.button),this.container.div.style.marginTop="-"+Number(this.button.div.offsetHeight*this.options.length*2)+"px"}hideOptions(){this.buttons.forEach(e=>{e.div.remove()}),this.container.div.style.marginTop="0px"}}const Ou=15,Bu=.99,jv=40,$v=5,Dn=10,Ks=5,Fu=10,ku=1,zu=.3,Po=2e4,Hu=0,Js=["yellow",2,10,1],Qs=["purple",80,20,2],Vu=1;function nr(n,e,t){return n+(e-n)*t}class Zv{constructor(e,t,i){this.scene=e,this.camera=t,this.transactionsGrid=i,this.mouse=new je,this.lastMouse=new je,this.raycaster=new Ov,this.isMouseHold=!1,this.cameraAccel=new je,this.highlightedBlock=null,this.clickedBlock=null,this.selectedBlock=null,this.selectedDiv,this.hlLight,this.hoverLight,this.hoverLightExists=!1,this.canScroll=!0,this.loadedChunks=new Map,this.isDataLoaded=!1,this.cameraMode=0,this.transitioning=!1,this.resettingCamera=!1,this.sideBarTransactionsToLoad=[],this.transitionSpeed=.008,this.cameraGridView={position:new F(0,10,0),lookAtDelta:new F(0,-1,0)},this.cameraBarView={position:new F(0,2,8),lookAtDelta:new F(0,-1,-3)},this.storedCamera,this.cameraTVal=0,this.addressDiv1=document.createElement("div"),this.addressDiv1.id="addressDiv1",document.body.appendChild(this.addressDiv1),this.addressDiv2=document.createElement("div"),this.addressDiv2.id="addressDiv2",document.body.appendChild(this.addressDiv2),this.selects=[]}mouseUpdate(){(this.lastMouse.x!=this.mouse.x||this.lastMouseY!=this.mouse.y)&&this.updateHighlight(),this.lastMouse.x=this.mouse.x,this.lastMouse.y=this.mouse.y,this.mouse.x=event.clientX/window.innerWidth*2-1,this.mouse.y=-(event.clientY/window.innerHeight)*2+1}updateHighlight(){let e=this.transactionsGrid.getBlocks(),t=e.flat().map(r=>r.getCube());this.raycaster.setFromCamera(this.mouse,this.camera);let i=this.raycaster.intersectObjects(t,!1);if(i.length>0&&this.transactionsGrid.canHover){let r=i[0].object;e.flat().forEach(s=>{r==s.getCube()?(s.toggleHighlight(!0),this.highlightedBlock=s):s.toggleHighlight(!1)})}else this.highlightedBlock&&this.highlightedBlock.toggleHighlight(!1),this.highlightedBlock=null;if(this.highlightedBlock&&this.transactionsGrid.displayFrom){this.transactionsGrid.displayFrom.label.innerHTML="From: "+this.highlightedBlock.node1,this.transactionsGrid.displayTo.label.innerHTML="To: "+this.highlightedBlock.node2,this.transactionsGrid.toggleSort==1?this.transactionsGrid.displayAmount.label.innerHTML="Number of Transactions: "+this.highlightedBlock.getTransactionsValue():this.transactionsGrid.displayAmount.label.innerHTML="Transactions Sum: "+this.highlightedBlock.getTransactionsValue();let r=this.highlightedBlock.getCube().position.clone();r.y+=this.highlightedBlock.yScale/2,r.project(this.transactionsGrid.camera);let s=(r.x+1)*window.innerWidth/2,a=(1-r.y)*window.innerHeight/2;if(this.addressDiv1.style.left=s-Po-Hu+"px",this.addressDiv1.style.top=a+"px",this.addressDiv2.style.left=s-Po/2+"px",this.addressDiv2.style.top=a-Po/2-Hu+"px",!this.hoverLightExists){let o=this.cameraMode==1?Vu:0;this.hoverLight=new da(Js[0],Js[1],Js[2],Js[3]),this.hoverLight.position.x=this.highlightedBlock.getCube().position.x,this.hoverLight.position.y=this.highlightedBlock.getCube().position.y+this.highlightedBlock.yScale/2+1,this.hoverLight.position.z=this.highlightedBlock.getCube().position.z+o,this.scene.add(this.hoverLight),this.hoverLightExists=!0}}else this.addressDiv1.style.left="-100000px",this.addressDiv1.style.top="-100000px",this.addressDiv2.style.left="-100000px",this.addressDiv2.style.top="-10000px",this.hoverLightExists&&(this.scene.remove(this.hoverLight),this.hoverLightExists=!1)}onMouseMove(e){if(this.mouseUpdate(),this.isMouseHold&&this.transactionsGrid.canDrag){let t=this.mouse.x-this.lastMouse.x,i=this.mouse.y-this.lastMouse.y;this.camera.position.x+=-t*Ou,this.camera.position.z+=i*Ou*(window.innerHeight/window.innerWidth),this.cameraAccel.x=t,this.cameraAccel.y=i,this.bindCamera()}}onMouseDown(e){this.mouseUpdate(),this.isMouseHold=!0}onMouseClick(e){this.mouseUpdate()}onMouseDblClick(e){if(this.mouseUpdate(),this.isMouseHold=!1,this.transactionsGrid.canDrag=!0,this.clickedBlock&&this.transactionsGrid.canHover&&this.highlightedBlock){this.selectedBlock&&this.selectedBlock.toggleSelect(!1),this.selectedBlock=this.clickedBlock;let t=document.getElementById("sideDiv");t.style.width="300px",t.style.padding="10px";let i=this.cameraMode==1?Vu:0;this.hlLight=new da(Qs[0],Qs[1],Qs[2],Qs[3]),this.hlLight.position.x=this.selectedBlock.getCube().position.x,this.hlLight.position.y=this.selectedBlock.getCube().position.y+this.selectedBlock.yScale/2+1,this.hlLight.position.z=this.selectedBlock.getCube().position.z+i,this.scene.add(this.hlLight),this.selectedDiv&&this.selectedDiv.removeDiv(),this.selectedDiv=new Gr("transaction select","sideDiv",!0);let r=new Kt("transaction from","sideDiv","From: "+String(this.clickedBlock.node1).substring(0,20)+"...");if(this.clickedBlock.node2){let s=new Kt("transaction to","sideDiv","To: "+String(this.clickedBlock.node2).substring(0,20)+"...");this.selectedDiv.addBlock(r,s)}else this.selectedDiv.addBlock(r);if(this.clickedBlock.transactions.sort(function(s,a){return new Date(a.time)-new Date(s.time)}),this.clickedBlock.transactions.forEach(s=>{this.sideBarTransactionsToLoad.push(s)}),this.sideBarTransactionsToLoad.length==0){let s=new Gr("tCont","sideDiv",!0),a=new Kt("transaction","sideDiv","Amount: NA");s.addBlock(a),this.selectedDiv.addBlock(s)}this.selectedBlock.toggleSelect(!0)}}addTransactionsToSideBar(e){if(e.amount>0){let t=new Gr("tCont","sideDiv",!0),i;e.to&&(i=new Kt("transaction to inner","sideDiv","To: "+String(e.to)));let r=new Kt("transaction amount","sideDiv","Amount: "+String(e.amount)),s;if(this.transactionsGrid.dataType==0){let a=new Date(e.time),o=String(a.getHours());o.length==1&&(o="0"+o);let c=String(a.getMinutes());c.length==1&&(c="0"+c);let l=String(a.getSeconds());l.length==1&&(l="0"+l);let u=String(a.getFullYear())+"-"+String(a.getMonth())+"-"+String(a.getDay())+" "+o+":"+c+":"+l;u=="NaN-NaN-NaN NaN:NaN:NaN"&&(u="N/A"),s=new Kt("transaction time","sideDiv","Time: "+u)}else{let a=e.time;s=new Kt("transaction time","sideDiv","Time: "+a)}i?t.addBlock(i,r,s):t.addBlock(r,s),this.selectedDiv.addBlock(t)}}onWheelEvent(e){if(!this.canScroll)return;e.deltaX;let t=e.deltaY;t>0&&this.camera.position.y$v&&this.cameraMode==0&&(this.camera.position.y-=.2,this.updateHighlight())}unselectBlock(){if(this.clickedBlock){this.clickedBlock.toggleSelect(!1);let e=document.getElementById("sideDiv");e.style.width="0px",e.style.padding="10px 0px 10px 0px",this.scene.remove(this.hlLight)}this.sideBarTransactionsToLoad=[]}onMouseUp(e){this.isMouseHold=!1,this.transactionsGrid.canDrag=!0,this.lastMouse.x==this.mouse.x&&this.lastMouse.y==this.mouse.y&&(this.unselectBlock(),this.clickedBlock=this.highlightedBlock)}update(){if(this.sideBarTransactionsToLoad.length>0){let e=this.sideBarTransactionsToLoad.shift();this.addTransactionsToSideBar(e)}if(this.transitioning){this.cameraTVal+=this.transitionSpeed,this.cameraTVal>=1&&(this.transitioning=!1,this.resettingCamera=!1,this.cameraTVal=1);let e;this.cameraMode==0?e=this.cameraGridView:e=this.cameraBarView;let t=nr(this.storedCamera.position.x,e.position.x,this.cameraTVal),i=nr(this.storedCamera.position.y,e.position.y,this.cameraTVal),r=nr(this.storedCamera.position.z,e.position.z,this.cameraTVal),s=nr(this.storedCamera.lookAtDelta.x,e.lookAtDelta.x,this.cameraTVal),a=nr(this.storedCamera.lookAtDelta.y,e.lookAtDelta.y,this.cameraTVal),o=nr(this.storedCamera.lookAtDelta.z,e.lookAtDelta.z,this.cameraTVal);this.resettingCamera?this.camera.position.set(t,i,r):this.camera.position.set(this.camera.position.x,i,r),this.camera.lookAt(this.camera.position.x+s,this.camera.position.y+a,this.camera.position.z+o),this.cameraTVal>=1&&(this.cameraTVal=0)}else this.isMouseHold||(this.cameraAccel.x*=Bu,this.cameraAccel.y*=Bu,Math.abs(this.cameraAccel.x)<.005&&(this.cameraAccel.x=0),Math.abs(this.cameraAccel.y)<.005&&(this.cameraAccel.y=0),this.camera.position.x+=-this.cameraAccel.x,this.camera.position.z+=this.cameraAccel.y,this.bindCamera()),this.cameraMode==1&&(this.camera.position.z=this.cameraBarView.position.z);if(this.isDataLoaded&&this.transactionsGrid.isLoaded){let e=(ku+zu)*Dn;for(let s=-Ks;s<=Ks;s++)for(let a=-Ks;a<=Ks;a++){let o=Math.floor(this.camera.position.x/e)+s,c=Math.floor(this.camera.position.z/e)+a;o>=0&&c>=0&&(this.loadedChunks.get([o,c].toString())||(this.loadedChunks.set([o,c].toString(),!0),this.cameraMode==0?this.transactionsGrid.loadBlocks(o*Dn,c*Dn,Dn,!1):this.transactionsGrid.loadBars(o*Dn,Dn)))}let t=Math.floor(this.camera.position.x/e),i=Math.floor(this.camera.position.z/e);Array.from(this.loadedChunks).forEach(s=>{let a=s[0].split(",").map(o=>Number(o));this.loadedChunks.get([a[0],a[1]].toString())&&(Math.abs(a[0]-t)>Fu||Math.abs(a[1]-i)>Fu)&&(this.loadedChunks.set([a[0],a[1]].toString(),!1),this.transactionsGrid.unloadBlocks(a[0]*Dn,a[1]*Dn,Dn))})}this.bindCamera()}clearChunks(){this.loadedChunks=new Map}setCamera(e){this.unselectBlock(),this.transitionSpeed=.008,this.transitioning=!0,e==0?(this.storedCamera={position:this.camera.position.clone(),lookAtDelta:this.cameraBarView.lookAtDelta},this.addressDiv1.style.height="2px",this.addressDiv2.style.height="2px"):e==1&&(this.storedCamera={position:this.camera.position.clone(),lookAtDelta:this.cameraGridView.lookAtDelta},this.addressDiv1.style.height="0px",this.addressDiv2.style.height="0px"),this.cameraMode=e}resetCamera(){this.transitioning=!0,this.resettingCamera=!0,this.transitionSpeed=.05,this.storedCamera={position:this.camera.position.clone(),lookAtDelta:this.cameraGridView.lookAtDelta},this.cameraAccel=new je}bindCamera(){if(this.isDataLoaded){if(!this.transactionsGrid.nodeArray)return;let e=(ku+zu)*this.transactionsGrid.nodeArray.length;this.camera.position.x>e&&(this.camera.position.x=e),this.camera.position.x<0&&(this.camera.position.x=0),this.camera.position.z>e&&(this.camera.position.z=e),this.camera.position.z<0&&(this.camera.position.z=0)}}}function df(n,e){return function(){return n.apply(e,arguments)}}const{toString:Yv}=Object.prototype,{getPrototypeOf:Dc}=Object,Ba=(n=>e=>{const t=Yv.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),wn=n=>(n=n.toLowerCase(),e=>Ba(e)===n),Fa=n=>e=>typeof e===n,{isArray:wr}=Array,jr=Fa("undefined");function Kv(n){return n!==null&&!jr(n)&&n.constructor!==null&&!jr(n.constructor)&&en(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const ff=wn("ArrayBuffer");function Jv(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&ff(n.buffer),e}const Qv=Fa("string"),en=Fa("function"),hf=Fa("number"),ka=n=>n!==null&&typeof n=="object",ey=n=>n===!0||n===!1,ia=n=>{if(Ba(n)!=="object")return!1;const e=Dc(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ty=wn("Date"),ny=wn("File"),iy=wn("Blob"),ry=wn("FileList"),sy=n=>ka(n)&&en(n.pipe),ay=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||en(n.append)&&((e=Ba(n))==="formdata"||e==="object"&&en(n.toString)&&n.toString()==="[object FormData]"))},oy=wn("URLSearchParams"),cy=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vs(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),wr(n))for(i=0,r=n.length;i0;)if(r=t[i],e===r.toLowerCase())return r;return null}const mf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gf=n=>!jr(n)&&n!==mf;function tc(){const{caseless:n}=gf(this)&&this||{},e={},t=(i,r)=>{const s=n&&pf(e,r)||r;ia(e[s])&&ia(i)?e[s]=tc(e[s],i):ia(i)?e[s]=tc({},i):wr(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i(vs(e,(r,s)=>{t&&en(r)?n[s]=df(r,t):n[s]=r},{allOwnKeys:i}),n),uy=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),dy=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},fy=(n,e,t,i)=>{let r,s,a;const o={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)a=r[s],(!i||i(a,n,e))&&!o[a]&&(e[a]=n[a],o[a]=!0);n=t!==!1&&Dc(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},hy=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},py=n=>{if(!n)return null;if(wr(n))return n;let e=n.length;if(!hf(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},my=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Dc(Uint8Array)),gy=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(n,s[0],s[1])}},_y=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},vy=wn("HTMLFormElement"),yy=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),Gu=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),xy=wn("RegExp"),_f=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};vs(t,(r,s)=>{let a;(a=e(r,s,n))!==!1&&(i[s]=a||r)}),Object.defineProperties(n,i)},Sy=n=>{_f(n,(e,t)=>{if(en(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(en(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Ey=(n,e)=>{const t={},i=r=>{r.forEach(s=>{t[s]=!0})};return wr(n)?i(n):i(String(n).split(e)),t},by=()=>{},My=(n,e)=>(n=+n,Number.isFinite(n)?n:e),Io="abcdefghijklmnopqrstuvwxyz",Wu="0123456789",vf={DIGIT:Wu,ALPHA:Io,ALPHA_DIGIT:Io+Io.toUpperCase()+Wu},Ty=(n=16,e=vf.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function wy(n){return!!(n&&en(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Ay=n=>{const e=new Array(10),t=(i,r)=>{if(ka(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=wr(i)?[]:{};return vs(i,(a,o)=>{const c=t(a,r+1);!jr(c)&&(s[o]=c)}),e[r]=void 0,s}}return i};return t(n,0)},Ry=wn("AsyncFunction"),Cy=n=>n&&(ka(n)||en(n))&&en(n.then)&&en(n.catch),K={isArray:wr,isArrayBuffer:ff,isBuffer:Kv,isFormData:ay,isArrayBufferView:Jv,isString:Qv,isNumber:hf,isBoolean:ey,isObject:ka,isPlainObject:ia,isUndefined:jr,isDate:ty,isFile:ny,isBlob:iy,isRegExp:xy,isFunction:en,isStream:sy,isURLSearchParams:oy,isTypedArray:my,isFileList:ry,forEach:vs,merge:tc,extend:ly,trim:cy,stripBOM:uy,inherits:dy,toFlatObject:fy,kindOf:Ba,kindOfTest:wn,endsWith:hy,toArray:py,forEachEntry:gy,matchAll:_y,isHTMLForm:vy,hasOwnProperty:Gu,hasOwnProp:Gu,reduceDescriptors:_f,freezeMethods:Sy,toObjectSet:Ey,toCamelCase:yy,noop:by,toFiniteNumber:My,findKey:pf,global:mf,isContextDefined:gf,ALPHABET:vf,generateString:Ty,isSpecCompliantForm:wy,toJSONObject:Ay,isAsyncFn:Ry,isThenable:Cy};function Ze(n,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r)}K.inherits(Ze,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const yf=Ze.prototype,xf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{xf[n]={value:n}});Object.defineProperties(Ze,xf);Object.defineProperty(yf,"isAxiosError",{value:!0});Ze.from=(n,e,t,i,r,s)=>{const a=Object.create(yf);return K.toFlatObject(n,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),Ze.call(a,n.message,e,t,i,r),a.cause=n,a.name=n.name,s&&Object.assign(a,s),a};const Ly=null;function nc(n){return K.isPlainObject(n)||K.isArray(n)}function Sf(n){return K.endsWith(n,"[]")?n.slice(0,-2):n}function Xu(n,e,t){return n?n.concat(e).map(function(r,s){return r=Sf(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function Py(n){return K.isArray(n)&&!n.some(nc)}const Iy=K.toFlatObject(K,{},null,function(e){return/^is[A-Z]/.test(e)});function za(n,e,t){if(!K.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=K.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!K.isUndefined(h[m])});const i=t.metaTokens,r=t.visitor||u,s=t.dots,a=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(e);if(!K.isFunction(r))throw new TypeError("visitor must be a function");function l(_){if(_===null)return"";if(K.isDate(_))return _.toISOString();if(!c&&K.isBlob(_))throw new Ze("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(_)||K.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function u(_,m,h){let f=_;if(_&&!h&&typeof _=="object"){if(K.endsWith(m,"{}"))m=i?m:m.slice(0,-2),_=JSON.stringify(_);else if(K.isArray(_)&&Py(_)||(K.isFileList(_)||K.endsWith(m,"[]"))&&(f=K.toArray(_)))return m=Sf(m),f.forEach(function(v,M){!(K.isUndefined(v)||v===null)&&e.append(a===!0?Xu([m],M,s):a===null?m:m+"[]",l(v))}),!1}return nc(_)?!0:(e.append(Xu(h,m,s),l(_)),!1)}const d=[],p=Object.assign(Iy,{defaultVisitor:u,convertValue:l,isVisitable:nc});function g(_,m){if(!K.isUndefined(_)){if(d.indexOf(_)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(_),K.forEach(_,function(f,b){(!(K.isUndefined(f)||f===null)&&r.call(e,f,K.isString(b)?b.trim():b,m,p))===!0&&g(f,m?m.concat(b):[b])}),d.pop()}}if(!K.isObject(n))throw new TypeError("data must be an object");return g(n),e}function qu(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Uc(n,e){this._pairs=[],n&&za(n,this,e)}const Ef=Uc.prototype;Ef.append=function(e,t){this._pairs.push([e,t])};Ef.toString=function(e){const t=e?function(i){return e.call(this,i,qu)}:qu;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function Dy(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bf(n,e,t){if(!e)return n;const i=t&&t.encode||Dy,r=t&&t.serialize;let s;if(r?s=r(e,t):s=K.isURLSearchParams(e)?e.toString():new Uc(e,t).toString(i),s){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}class ju{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,function(i){i!==null&&e(i)})}}const Mf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uy=typeof URLSearchParams<"u"?URLSearchParams:Uc,Ny=typeof FormData<"u"?FormData:null,Oy=typeof Blob<"u"?Blob:null,By={isBrowser:!0,classes:{URLSearchParams:Uy,FormData:Ny,Blob:Oy},protocols:["http","https","file","blob","url","data"]},Tf=typeof window<"u"&&typeof document<"u",Fy=(n=>Tf&&["ReactNative","NativeScript","NS"].indexOf(n)<0)(typeof navigator<"u"&&navigator.product),ky=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Tf,hasStandardBrowserEnv:Fy,hasStandardBrowserWebWorkerEnv:ky},Symbol.toStringTag,{value:"Module"})),xn={...zy,...By};function Hy(n,e){return za(n,new xn.classes.URLSearchParams,Object.assign({visitor:function(t,i,r,s){return xn.isNode&&K.isBuffer(t)?(this.append(i,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Vy(n){return K.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gy(n){const e={},t=Object.keys(n);let i;const r=t.length;let s;for(i=0;i=t.length;return a=!a&&K.isArray(r)?r.length:a,c?(K.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i,!o):((!r[a]||!K.isObject(r[a]))&&(r[a]=[]),e(t,i,r[a],s)&&K.isArray(r[a])&&(r[a]=Gy(r[a])),!o)}if(K.isFormData(n)&&K.isFunction(n.entries)){const t={};return K.forEachEntry(n,(i,r)=>{e(Vy(i),r,t,0)}),t}return null}function Wy(n,e,t){if(K.isString(n))try{return(e||JSON.parse)(n),K.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}const ys={transitional:Mf,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,s=K.isObject(e);if(s&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return r?JSON.stringify(wf(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Hy(e,this.formSerializer).toString();if((o=K.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return za(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),Wy(e)):e}],transformResponse:[function(e){const t=this.transitional||ys.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(e&&K.isString(e)&&(i&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?Ze.from(o,Ze.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xn.classes.FormData,Blob:xn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],n=>{ys.headers[n]={}});const Xy=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qy=n=>{const e={};let t,i,r;return n&&n.split(` `).forEach(function(a){r=a.indexOf(":"),t=a.substring(0,r).trim().toLowerCase(),i=a.substring(r+1).trim(),!(!t||e[t]&&Xy[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},$u=Symbol("internals");function Ur(n){return n&&String(n).trim().toLowerCase()}function ra(n){return n===!1||n==null?n:K.isArray(n)?n.map(ra):String(n)}function jy(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const $y=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Do(n,e,t,i,r){if(K.isFunction(i))return i.call(this,e,t);if(r&&(e=t),!!K.isString(e)){if(K.isString(i))return e.indexOf(i)!==-1;if(K.isRegExp(i))return i.test(e)}}function Zy(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function Yy(n,e){const t=K.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(r,s,a){return this[i].call(this,e,r,s,a)},configurable:!0})})}class tn{constructor(e){e&&this.set(e)}set(e,t,i){const r=this;function s(o,c,l){const u=Ur(c);if(!u)throw new Error("header name must be a non-empty string");const d=K.findKey(r,u);(!d||r[d]===void 0||l===!0||l===void 0&&r[d]!==!1)&&(r[d||c]=ra(o))}const a=(o,c)=>K.forEach(o,(l,u)=>s(l,u,c));return K.isPlainObject(e)||e instanceof this.constructor?a(e,t):K.isString(e)&&(e=e.trim())&&!$y(e)?a(qy(e),t):e!=null&&s(t,e,i),this}get(e,t){if(e=Ur(e),e){const i=K.findKey(this,e);if(i){const r=this[i];if(!t)return r;if(t===!0)return jy(r);if(K.isFunction(t))return t.call(this,r,i);if(K.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ur(e),e){const i=K.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||Do(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let r=!1;function s(a){if(a=Ur(a),a){const o=K.findKey(i,a);o&&(!t||Do(i,i[o],o,t))&&(delete i[o],r=!0)}}return K.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let i=t.length,r=!1;for(;i--;){const s=t[i];(!e||Do(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,i={};return K.forEach(this,(r,s)=>{const a=K.findKey(i,s);if(a){t[a]=ra(r),delete t[s];return}const o=e?Zy(s):String(s).trim();o!==s&&delete t[s],t[o]=ra(r),i[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return K.forEach(this,(i,r)=>{i!=null&&i!==!1&&(t[r]=e&&K.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[$u]=this[$u]={accessors:{}}).accessors,r=this.prototype;function s(a){const o=Ur(a);i[o]||(Yy(r,a),i[o]=!0)}return K.isArray(e)?e.forEach(s):s(e),this}}tn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.reduceDescriptors(tn.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});K.freezeMethods(tn);function Uo(n,e){const t=this||ys,i=e||t,r=tn.from(i.headers);let s=i.data;return K.forEach(n,function(o){s=o.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function Af(n){return!!(n&&n.__CANCEL__)}function xs(n,e,t){Ze.call(this,n??"canceled",Ze.ERR_CANCELED,e,t),this.name="CanceledError"}K.inherits(xs,Ze,{__CANCEL__:!0});function Ky(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new Ze("Request failed with status code "+t.status,[Ze.ERR_BAD_REQUEST,Ze.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const Jy=xn.hasStandardBrowserEnv?{write(n,e,t,i,r,s){const a=[n+"="+encodeURIComponent(e)];K.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),K.isString(i)&&a.push("path="+i),K.isString(r)&&a.push("domain="+r),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Qy(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function ex(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Rf(n,e){return n&&!Qy(e)?ex(n,e):e}const tx=xn.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function r(s){let a=s;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=r(window.location.href),function(a){const o=K.isString(a)?r(a):a;return o.protocol===i.protocol&&o.host===i.host}}():function(){return function(){return!0}}();function nx(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function ix(n,e){n=n||10;const t=new Array(n),i=new Array(n);let r=0,s=0,a;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),u=i[s];a||(a=l),t[r]=c,i[r]=l;let d=s,p=0;for(;d!==r;)p+=t[d++],d=d%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),l-a{const s=r.loaded,a=r.lengthComputable?r.total:void 0,o=s-t,c=i(o),l=s<=a;t=s;const u={loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&l?(a-s)/c:void 0,event:r};u[e?"download":"upload"]=!0,n(u)}}const rx=typeof XMLHttpRequest<"u",sx=rx&&function(n){return new Promise(function(t,i){let r=n.data;const s=tn.from(n.headers).normalize();let{responseType:a,withXSRFToken:o}=n,c;function l(){n.cancelToken&&n.cancelToken.unsubscribe(c),n.signal&&n.signal.removeEventListener("abort",c)}let u;if(K.isFormData(r)){if(xn.hasStandardBrowserEnv||xn.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((u=s.getContentType())!==!1){const[m,...h]=u?u.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...h].join("; "))}}let d=new XMLHttpRequest;if(n.auth){const m=n.auth.username||"",h=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";s.set("Authorization","Basic "+btoa(m+":"+h))}const p=Rf(n.baseURL,n.url);d.open(n.method.toUpperCase(),bf(p,n.params,n.paramsSerializer),!0),d.timeout=n.timeout;function g(){if(!d)return;const m=tn.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),f={data:!a||a==="text"||a==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:m,config:n,request:d};Ky(function(v){t(v),l()},function(v){i(v),l()},f),d=null}if("onloadend"in d?d.onloadend=g:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(g)},d.onabort=function(){d&&(i(new Ze("Request aborted",Ze.ECONNABORTED,n,d)),d=null)},d.onerror=function(){i(new Ze("Network Error",Ze.ERR_NETWORK,n,d)),d=null},d.ontimeout=function(){let h=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const f=n.transitional||Mf;n.timeoutErrorMessage&&(h=n.timeoutErrorMessage),i(new Ze(h,f.clarifyTimeoutError?Ze.ETIMEDOUT:Ze.ECONNABORTED,n,d)),d=null},xn.hasStandardBrowserEnv&&(o&&K.isFunction(o)&&(o=o(n)),o||o!==!1&&tx(p))){const m=n.xsrfHeaderName&&n.xsrfCookieName&&Jy.read(n.xsrfCookieName);m&&s.set(n.xsrfHeaderName,m)}r===void 0&&s.setContentType(null),"setRequestHeader"in d&&K.forEach(s.toJSON(),function(h,f){d.setRequestHeader(f,h)}),K.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),a&&a!=="json"&&(d.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&d.addEventListener("progress",Zu(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Zu(n.onUploadProgress)),(n.cancelToken||n.signal)&&(c=m=>{d&&(i(!m||m.type?new xs(null,n,d):m),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(c),n.signal&&(n.signal.aborted?c():n.signal.addEventListener("abort",c)));const _=nx(p);if(_&&xn.protocols.indexOf(_)===-1){i(new Ze("Unsupported protocol "+_+":",Ze.ERR_BAD_REQUEST,n));return}d.send(r||null)})},ic={http:Ly,xhr:sx};K.forEach(ic,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Yu=n=>`- ${n}`,ax=n=>K.isFunction(n)||n===null||n===!1,Cf={getAdapter:n=>{n=K.isArray(n)?n:[n];const{length:e}=n;let t,i;const r={};for(let s=0;s`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since : `+s.map(Yu).join(` diff --git a/dist/assets/index-CjdOPXMW.css b/dist/assets/index-DWoiVoB9.css similarity index 74% rename from dist/assets/index-CjdOPXMW.css rename to dist/assets/index-DWoiVoB9.css index 0ae44fab..375a65b3 100644 --- a/dist/assets/index-CjdOPXMW.css +++ b/dist/assets/index-DWoiVoB9.css @@ -1 +1 @@ -html,body{box-sizing:border-box;margin:0;padding:0;overflow:hidden;font-family:Lucida Console}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:#ffffff80;border-radius:5px}::-webkit-scrollbar-thumb{background:#055e79cc;border-radius:5px}.horizontalContainer{width:100%}.horizontalContainer>div{width:auto;display:inline-block;margin-right:20px;vertical-align:middle}.checkDiv{text-align:right}.checkDiv>div{display:inline-block}input[type=file]{color:#0000;width:90px;margin-right:0}button{background-color:#0a0a0a;opacity:.8;border:none;color:#fff;font-family:Lucida Console}button:hover{cursor:pointer;background-color:#a5a5a5;transition:.3s}#tCont{padding:10px}#titleDiv{color:#fff;width:320px!important;height:90px;position:fixed;top:10px;right:10px;padding:10px;font-size:50px;font-family:Impact;text-align:center;background-color:#0000004d}#helpDiv{color:#fff;width:300px!important;height:30px;position:fixed;top:130px;right:10px;padding:20px;font-size:30px;text-align:center;text-overflow:wrap;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}#helpDiv:hover{cursor:pointer;background-color:#a5a5a5;transition:.3s}#topDiv{color:#fff;width:700px!important;height:90px;position:fixed;font-size:20px;top:10px;left:10px;padding:10px;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}#sideDiv{color:#fff;height:calc(100% - 240px);position:fixed;overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis;top:130px;left:10px;padding:10px 0;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;transition:.3s}.tooltip .tooltiptext{visibility:hidden;background-color:#0000004d;color:#fff;padding:10px;opacity:0;transition:opacity .2s;white-space:normal}.tooltip:hover .tooltiptext{opacity:1;visibility:visible}.topTooltip{position:fixed;top:10px;left:740px;width:calc(100% - 1120px);height:20px;font-size:14px;text-align:center}.bottomTooltip{position:fixed;top:60px;left:740px;width:calc(100% - 1120px);height:40px;font-size:14px;text-align:left}#sideDiv>*{overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis}#topDiv>*{padding:5px}#bottomDiv{color:#fff;position:fixed;text-align:center;bottom:10px;left:10px;width:calc(100% - 20px);height:50px;padding:10px;font-size:30px;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}#innerBottom>*{height:30px;width:15%;padding:0;left:0;bottom:0}#innerBottom>*>button{height:100%;width:100%;padding:0;left:0;bottom:0}#innerBottom>*>div{height:100%;width:100%;padding:0;left:0;bottom:0;border-radius:0}#innerBottom>*>*>button{height:100%;width:100%;padding:0;left:0;bottom:0;border-radius:0}#SwitchButton-div{padding:5px}#SwitchButton-div>*{height:30px}#ToggleSortButton-div{padding:5px}#ToggleSortButton-div>*{height:30px}#ToggleView-div{padding:5px}#ToggleView-div>*{height:30px}#addressDiv1{color:#fff;width:3000px;height:2px;position:absolute;padding:0;font-size:12px;text-align:right;background-color:#00ff00b3}#addressDiv2{color:#fff;width:3000px;height:2px;position:absolute;padding:0;font-size:12px;text-align:right;background-color:#00ffffb3;transform:rotate(90deg)}#from-display-div{color:#0ff}#to-display-div{color:#0f0}#transaction-from-div,#transaction-to-div{color:#f9f}input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:95%;left:2.5%;outline:none;position:absolute;margin:auto;top:40%;bottom:0;background-color:transparent;pointer-events:none}#sliderBar-div{width:95%;left:2.5%;height:5px;position:absolute;margin:auto;top:40%;bottom:0;border-radius:5px;background-color:#fff}input[type=range]::-webkit-slider-runnable-track{-webkit-appearance:none;height:5px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:1.7em;width:1.7em;background-color:#3264fe;cursor:pointer;margin-top:-9px;pointer-events:auto;border-radius:50%}input[type=range]:active::-webkit-slider-thumb{background-color:#fff;border:3px solid #3264fe} +html,body{box-sizing:border-box;margin:0;padding:0;overflow:hidden;font-family:Lucida Console}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:#ffffff80;border-radius:5px}::-webkit-scrollbar-thumb{background:#055e79cc;border-radius:5px}.horizontalContainer{width:100%}.horizontalContainer>div{width:auto;display:inline-block;margin-right:20px;vertical-align:middle}.checkDiv{text-align:right}.checkDiv>div{display:inline-block}input[type=file]{color:#0000;width:90px;margin-right:0}button{background-color:#0a0a0a;opacity:.8;border:none;color:#fff;font-family:Lucida Console}button:hover{cursor:pointer;background-color:#a5a5a5;transition:.3s}#tCont{padding:10px}#titleDiv{color:#fff;width:320px!important;height:90px;position:fixed;top:10px;right:10px;padding:10px;font-size:50px;font-family:Impact;text-align:center;background-color:#0000004d}#helpDiv{color:#fff;width:300px!important;height:30px;position:fixed;top:130px;right:10px;padding:20px;font-size:30px;text-align:center;text-overflow:wrap;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}#helpDiv:hover{cursor:pointer;background-color:#a5a5a5;transition:.3s}#topDiv{color:#fff;width:700px!important;height:90px;position:fixed;font-size:20px;top:10px;left:10px;padding:10px;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}#sideDiv{color:#fff;height:calc(100% - 240px);position:fixed;overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis;top:130px;left:10px;padding:10px 0;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;transition:.3s}.tooltip .tooltiptext{visibility:hidden;background-color:#0000004d;color:#fff;padding:10px;opacity:0;transition:opacity .2s;white-space:normal}.tooltip:hover .tooltiptext{opacity:1;visibility:visible}.topTooltip{position:fixed;top:10px;left:740px;width:calc(100% - 1120px);height:20px;font-size:14px;text-align:center}.bottomTooltip{position:fixed;top:60px;left:740px;width:calc(100% - 1120px);height:40px;font-size:14px;text-align:left}#sideDiv>*{overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis}#topDiv>*{padding:5px}#bottomDiv{color:#fff;position:fixed;text-align:center;bottom:10px;left:10px;width:calc(100% - 20px);height:50px;padding:10px;font-size:30px;background-color:#0000004d;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}#innerBottom>*{height:30px;width:15%;padding:0;left:0;bottom:0}#innerBottom>*>button{height:100%;width:100%;padding:0;left:0;bottom:0}#innerBottom>*>div{height:100%;width:100%;padding:0;left:0;bottom:0;border-radius:0}#innerBottom>*>*>button{height:100%;width:100%;padding:0;left:0;bottom:0;border-radius:0}#SwitchButton-div{padding:5px}#SwitchButton-div>*{height:30px}#ToggleSortButton-div{padding:5px}#ToggleSortButton-div>*{height:30px}#ToggleView-div{padding:5px}#ToggleView-div>*{height:30px}#addressDiv1{color:#fff;width:20000px;height:2px;position:absolute;padding:0;font-size:12px;text-align:right;background-color:#00ff00b3}#addressDiv2{color:#fff;width:20000px;height:2px;position:absolute;padding:0;font-size:12px;text-align:right;background-color:#00ffffb3;transform:rotate(90deg)}#from-display-div{color:#0ff}#to-display-div{color:#0f0}#transaction-from-div,#transaction-to-div{color:#f9f}input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:95%;left:2.5%;outline:none;position:absolute;margin:auto;top:40%;bottom:0;background-color:transparent;pointer-events:none}#sliderBar-div{width:95%;left:2.5%;height:5px;position:absolute;margin:auto;top:40%;bottom:0;border-radius:5px;background-color:#fff}input[type=range]::-webkit-slider-runnable-track{-webkit-appearance:none;height:5px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:1.7em;width:1.7em;background-color:#3264fe;cursor:pointer;margin-top:-9px;pointer-events:auto;border-radius:50%}input[type=range]:active::-webkit-slider-thumb{background-color:#fff;border:3px solid #3264fe} diff --git a/dist/index.html b/dist/index.html index 790e0851..4ceb09dd 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,8 +7,8 @@ - - + + diff --git a/js/UIInit.js b/js/UIInit.js index c2fba044..571ffb2e 100644 --- a/js/UIInit.js +++ b/js/UIInit.js @@ -1,4 +1,4 @@ -import { Button, Checkbox, Slider, TextBox, Element, Container, Select, CustomSelect } from "./pageElements" +import { Button, Checkbox, Slider, TextBox, Element, Container, Select, CustomSelect } from "./pageElements.js" import { getData } from './endpoint.js'; // import * as T from 'three'; // import { TextGeometry } from 'three/addons/geometries/TextGeometry.js'; diff --git a/js/control.js b/js/control.js index e054c176..bc165a13 100644 --- a/js/control.js +++ b/js/control.js @@ -11,7 +11,7 @@ const LOAD_RANGE = 5; const UNLOAD_RANGE = 10; const BLOCK_WIDTH = 1.0; const SPACING = 0.3; -const ADDRESS_WIDTH = 10000 +const ADDRESS_WIDTH = 20000 const ADDRESS_SPACING = 0 const HOVER_LIGHT_OPTIONS = ["yellow", 2, 10, 1] const HL_LIGHT_OPTIONS = ["purple", 80, 20, 2] // color, strength, range, decay