1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4057],{59489:function(e,t,r){r.d(t,{default:function(){return i}});let n=new Float32Array(1),a=new Int32Array(n.buffer);var i={fromHalf:function(e){let t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*6103515625e-14*(n/1024):31===r?n?NaN:1/0*(t?-1:1):(t?-1:1)*2**(r-15)*(1+n/1024)},toHalf:function(e){n[0]=e;let t=a[0],r=t>>16&32768,i=t>>12&2047,o=t>>23&255;return o<103?r:o>142?(r|=31744,r|=(255===o?0:1)&&8388607&t):o<113?(i|=2048,r|=(i>>114-o)+(i>>113-o&1)):(r|=o-112<<10|i>>1,r+=1&i)}}},16010:function(e,t,r){r.d(t,{default:function(){return s}});var n=r(27934),a=r(50423);let{ObjectType:i}=a.default,o={objectType:i.ARRAY_BUFFER,context:null,allocatedGPUMemoryInBytes:0};function l(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,o,r),n.m.obj(e,t),n.m.get(e,t,["_openGLRenderWindow","allocatedGPUMemoryInBytes"]),n.m.moveToProtected(e,t,["openGLRenderWindow"]),function(e,t){function r(e){switch(e){case i.ELEMENT_ARRAY_BUFFER:return t.context.ELEMENT_ARRAY_BUFFER;case i.TEXTURE_BUFFER:if("TEXTURE_BUFFER"in t.context)return t.context.TEXTURE_BUFFER;case i.ARRAY_BUFFER:default:return t.context.ARRAY_BUFFER}}t.classHierarchy.push("vtkOpenGLBufferObject");let n=null,a=null,o=!0,l="";e.getType=()=>n,e.setType=e=>{n=e},e.getHandle=()=>a,e.isReady=()=>!1===o,e.generateBuffer=e=>{let i=r(e);return null===a&&(a=t.context.createBuffer(),n=e),r(n)===i},e.upload=(i,s)=>e.generateBuffer(s)?(t.context.bindBuffer(r(n),a),t.context.bufferData(r(n),i,t.context.STATIC_DRAW),t.allocatedGPUMemoryInBytes=i.length*i.BYTES_PER_ELEMENT,o=!1,!0):(l="Trying to upload array buffer to incompatible buffer.",!1),e.bind=()=>!!a&&(t.context.bindBuffer(r(n),a),!0),e.release=()=>!!a&&(t.context.bindBuffer(r(n),null),!0),e.releaseGraphicsResources=()=>{null!==a&&(t.context.bindBuffer(r(n),null),t.context.deleteBuffer(a),a=null,t.allocatedGPUMemoryInBytes=0)},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))},e.getError=()=>l}(e,t)}var s={newInstance:n.m.newInstance(l),extend:l,...a.default}},50423:function(e,t,r){r.d(t,{L:function(){return n},default:function(){return a}});let n={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2};var a={ObjectType:n}},27267:function(e,t,r){r.d(t,{default:function(){return T}});var n=r(27934),a=r(18476),i=r(32877),o=r(65832),l=r(16010),s=r(50423),u=r(768);let{vtkErrorMacro:d}=n.m,f={elementCount:0,stride:0,colorBOStride:0,vertexOffset:0,normalOffset:0,tCoordOffset:0,tCoordComponents:0,colorOffset:0,colorComponents:0,tcoordBO:null,customData:[],coordShift:null,coordScale:null,coordShiftAndScaleEnabled:!1,inverseShiftAndScaleMatrix:null};var c=n.m.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,f,r),l.default.extend(e,t,r),n.m.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),n.m.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(s.L.ARRAY_BUFFER),e.createVBO=function(r,n,a,i){let o,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(!r.getData()||!r.getData().length)return t.elementCount=0,0;t.blockSize=3,t.vertexOffset=0,t.normalOffset=0,t.tCoordOffset=0,t.tCoordComponents=0,t.colorComponents=0,t.colorOffset=0,t.customData=[];let f=i.points.getData(),c=null,p=null,m=null,g=i.colors?i.colors.getNumberOfComponents():0,h=i.tcoords?i.tcoords.getNumberOfComponents():0;i.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,c=i.normals.getData()),i.customAttributes&&i.customAttributes.forEach(e=>{e&&(t.customData.push({data:e.getData(),offset:4*t.blockSize,components:e.getNumberOfComponents(),name:e.getName()}),t.blockSize+=e.getNumberOfComponents())}),i.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=h,t.blockSize+=h,p=i.tcoords.getData()),i.colors?(t.colorComponents=i.colors.getNumberOfComponents(),t.colorOffset=0,m=i.colors.getData(),t.colorBO||(t.colorBO=l.default.newInstance()),t.colorBO.setOpenGLRenderWindow(t._openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;let y=0,T=0,b=0,x=0,S=0,E=0,v={anythingToPoints(e,t,r,n){for(let a=0;a<e;++a)o(t[r+a],n)},linesToWireframe(e,t,r,n){for(let a=0;a<e-1;++a)o(t[r+a],n),o(t[r+a+1],n)},polysToWireframe(e,t,r,n){if(e>2)for(let a=0;a<e;++a)o(t[r+a],n),o(t[r+(a+1)%e],n)},stripsToWireframe(e,t,r,n){if(e>2){for(let a=0;a<e-1;++a)o(t[r+a],n),o(t[r+a+1],n);for(let a=0;a<e-2;a++)o(t[r+a],n),o(t[r+a+2],n)}},polysToSurface(e,t,r,n){for(let a=0;a<e-2;a++)o(t[r+0],n),o(t[r+a+1],n),o(t[r+a+2],n)},stripsToSurface(e,t,r,n){for(let a=0;a<e-2;a++)o(t[r+a],n),o(t[r+a+1+a%2],n),o(t[r+a+1+(a+1)%2],n)}},I={anythingToPoints:(e,t)=>e,linesToWireframe:(e,t)=>
1e>1?(e-1)*2:0,polysToWireframe:(e,t)=>e>2?2*e:0,stripsToWireframe:(e,t)=>e>2?4*e-6:0,polysToSurface:(e,t)=>e>2?(e-2)*3:0,stripsToSurface:(e,t,r)=>e>2?(e-2)*3:0},A=null,R=null;a===u.hX.POINTS||"verts"===n?(A=v.anythingToPoints,R=I.anythingToPoints):a===u.hX.WIREFRAME||"lines"===n?(A=v[`${n}ToWireframe`],R=I[`${n}ToWireframe`]):(A=v[`${n}ToSurface`],R=I[`${n}ToSurface`]);let P=r.getData(),_=P.length,O=0;for(let e=0;e<_;)O+=R(P[e],P),e+=P[e]+1;let G=null,L=new Float32Array(O*t.blockSize);m&&(G=new Uint8Array(4*O));let w=0,B=0,F=0,D=0;for(let e=0;e<3;++e){let t=i.points.getRange(e),r=t[1]-t[0];F+=r*r;let n=.5*(t[1]+t[0]);D+=n*n}if(F>0&&(Math.abs(D)/F>1e6||Math.abs(Math.log10(F))>3||0===F&&D>1e6)){let t=new Float64Array(3),r=new Float64Array(3);for(let e=0;e<3;++e){let n=i.points.getRange(e),a=n[1]-n[0];t[e]=.5*(n[1]+n[0]),r[e]=a>0?1/a:1}e.setCoordShiftAndScale(t,r)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);if(d){if(d.points||d.cells){let e=new Int32Array(O+d.points.length);e.set(d.points),d.points=e;let t=new Int32Array(O+d.cells.length);t.set(d.cells),d.cells=t}else d.points=new Int32Array(O),d.cells=new Int32Array(O)}let N=i.vertexOffset;o=function(e,r){if(d&&(d.points[N]=e,d.cells[N]=E+i.cellOffset),++N,y=3*e,t.coordShiftAndScaleEnabled?(L[w++]=(f[y++]-t.coordShift[0])*t.coordScale[0],L[w++]=(f[y++]-t.coordShift[1])*t.coordScale[1],L[w++]=(f[y++]-t.coordShift[2])*t.coordScale[2]):(L[w++]=f[y++],L[w++]=f[y++],L[w++]=f[y++]),null!==c&&(T=i.haveCellNormals?(E+i.cellOffset)*3:3*e,L[w++]=c[T++],L[w++]=c[T++],L[w++]=c[T++]),t.customData.forEach(t=>{S=e*t.components;for(let e=0;e<t.components;++e)L[w++]=t.data[S++]}),null!==p){b=i.useTCoordsPerCell?r*h:e*h;for(let e=0;e<h;++e)L[w++]=p[b++]}null!==m&&(x=i.haveCellScalars?(E+i.cellOffset)*g:e*g,G[B++]=m[x++],G[B++]=m[x++],G[B++]=m[x++],G[B++]=4===g?m[x++]:255)};for(let e=0;e<_;e+=P[e]+1,E++)A(P[e],P,e+1,E+i.cellOffset);return t.elementCount=O,e.upload(L,s.L.ARRAY_BUFFER),t.colorBO&&(t.colorBOStride=4,t.colorBO.upload(G,s.L.ARRAY_BUFFER)),E},e.setCoordShiftAndScale=(e,r)=>{var n,l;if(null!==e&&(e.constructor!==Float64Array||3!==e.length)){d("Wrong type for coordShift, expected vec3 or null");return}if(null!==r&&(r.constructor!==Float64Array||3!==r.length)){d("Wrong type for coordScale, expected vec3 or null");return}null!==t.coordShift&&null!==e&&a.fS(e,t.coordShift)||(t.coordShift=e),null!==t.coordScale&&null!==r&&a.fS(r,t.coordScale)||(t.coordScale=r),t.coordShiftAndScaleEnabled=(n=t.coordShift,l=t.coordScale,null!==n&&null!==l&&!(a.I6(n,[0,0,0])&&a.I6(l,[1,1,1]))),t.coordShiftAndScaleEnabled?t.inverseShiftAndScaleMatrix=function(e,t){let r=new Float64Array(3);a.SO(r,t);let n=new Float64Array(16);return i.fromRotationTranslationScale(n,o.Ue(),e,r),n}(t.coordShift,t.coordScale):t.inverseShiftAndScaleMatrix=null}}),p=r(63415),m=r(65810);let g={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},h={context:null,program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0,pointPicking:!1};function y(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,h,r),n.m.obj(e,t),t.shaderSourceTime={},n.m.obj(t.shaderSourceTime),t.attributeUpdateTime={},n.m.obj(t.attributeUpdateTime),n.m.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType","pointPicking"]),t.program=p.Z.newInstance(),t.VAO=m.ZP.newInstance(),t.CABO=c(),t.classHierarchy.push("vtkOpenGLHelper"),e.setOpenGLRenderWindow=e=>{t.context=e.getContext(),t.program.setContext(t.context),t.VAO.setOpenGLRenderWindow(e),t.CABO.setOpenGLRenderWindow(e)},e.releaseGraphicsResources=e=>{t.VAO.releaseGraphicsResources(),t.CABO.releaseGraphicsResources(),t.CABO.setElementCount(0)},e.drawArrays=(r,n,a,i)=>{if(t.CABO.getElementCount()){let o=e.getOpenGLMode(a),l=e.haveWideLines(r,n),s=t.context,u=s.getParameter(s.DEPTH_WRITEMASK);t.pointPicking&&s.depthMask(!1),o===s.LINES&&l?(e.updateShaders(r,n,i),s.drawArraysInstanced(o,0,t.CABO.getElementCount(),2*Math.ceil(n.getProperty().getLineWidth()))):(s.lineWidth(n.getProperty().getLineWidth()),e.updateShaders(r,n,i),s.drawArrays(o,0,t.CABO.getElementCount()),s.lineWidth(1));let d=(o===s.POINTS?1:0)||(o===s.LINES?2:3);return t.pointPicking&&s.depthMask(u),t.CABO.getElementCount()/d}return 0},e.getOpenGLMode=e=>{if(t.pointPicking)return t.context.POINTS;let r=t.primitiveType;return e===u.hX.POINTS||r===g.Points?t.context.POINTS:e===u.hX.WIREFRAME||r===g.Lines||r===g.TrisEdges||r===g.TriStripsEdges?t.context.LINES:t.context.TRIANGLES},e.haveWideLines=(e,r)=>r.getProperty().getLineWidth()>1&&!(t.CABO.getOpenGLRenderWindow()&&t.CABO.getOpenGLRenderWindow().getHardwareMaximumLineWidth()>=r.getProperty().getLineWidth()),e.getNeedToRebuildShaders=(t,r,n)=>!!(n.getNeedToRebuildShaders(e,t,r)||0===e.getProgram()||e.getShaderSourceTime().getMTime()<n.getMTime()||e.getShaderSourceTime().getMTime()<r.getMTime()),e.updateShaders=(r,n,a)=>
1{if(e.getNeedToRebuildShaders(r,n,a)){let i={Vertex:null,Fragment:null,Geometry:null};a.buildShaders(i,r,n);let o=t.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgramArray(i.Vertex,i.Fragment,i.Geometry);o!==e.getProgram()&&(e.setProgram(o),e.getVAO().releaseGraphicsResources()),e.getShaderSourceTime().modified()}else t.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgram(e.getProgram());e.getVAO().bind(),a.setMapperShaderParameters(e,r,n),a.setPropertyShaderParameters(e,r,n),a.setCameraShaderParameters(e,r,n),a.setLightingShaderParameters(e,r,n),a.invokeShaderCallbacks(e,r,n)},e.setMapperShaderParameters=(r,n,a)=>{if(e.haveWideLines(r,n)){e.getProgram().setUniform2f("viewportSize",a.usize,a.vsize);let t=parseFloat(n.getProperty().getLineWidth());e.getProgram().setUniformf("lineWidthStepSize",t/Math.ceil(t)),e.getProgram().setUniformf("halfLineWidth",t/2)}t.primitiveType===g.Points||n.getProperty().getRepresentation()===u.hX.POINTS?e.getProgram().setUniformf("pointSize",n.getProperty().getPointSize()):t.pointPicking&&e.getProgram().setUniformf("pointSize",e.getPointPickingPrimitiveSize())},e.replaceShaderPositionVC=(r,n,a)=>{let i=r.Vertex;i=p.Z.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform float pointSize;"]).result,i=p.Z.substitute(i,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = pointSize;"],!1).result,e.getOpenGLMode(a.getProperty().getRepresentation())===t.context.LINES&&e.haveWideLines(n,a)&&(i=p.Z.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform vec2 viewportSize;","uniform float lineWidthStepSize;","uniform float halfLineWidth;"]).result,i=p.Z.substitute(i,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," if (halfLineWidth > 0.0)"," {"," float offset = float(gl_InstanceID / 2) * lineWidthStepSize - halfLineWidth;"," vec4 tmpPos = gl_Position;"," vec3 tmpPos2 = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 2.0 * mod(float(gl_InstanceID), 2.0) * offset / viewportSize[0];"," tmpPos2.y = tmpPos2.y + 2.0 * mod(float(gl_InstanceID + 1), 2.0) * offset / viewportSize[1];"," gl_Position = vec4(tmpPos2.xyz * tmpPos.w, tmpPos.w);"," }"]).result),r.Vertex=i},e.getPointPickingPrimitiveSize=()=>t.primitiveType===g.Points?2:t.primitiveType===g.Lines?4:6,e.getAllocatedGPUMemoryInBytes=()=>e.getCABO().getAllocatedGPUMemoryInBytes()}var T={newInstance:n.m.newInstance(y),extend:y,primTypes:g}},63415:function(e,t,r){r.d(t,{Z:function(){return d}});var n=r(27934);let{vtkErrorMacro:a}=n.m,i={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};var o=n.m.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,i,r),n.m.obj(e,t),n.m.setGet(e,t,["shaderType","source","error","handle","context"]),t.classHierarchy.push("vtkShader"),e.compile=()=>{let e=t.context.VERTEX_SHADER;if(!t.source||!t.source.length||"Unknown"===t.shaderType)return!1;if(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),e="Fragment"===t.shaderType?t.context.FRAGMENT_SHADER:t.context.VERTEX_SHADER,t.handle=t.context.createShader(e),t.context.shaderSource(t.handle,t.source),t.context.compileShader(t.handle),!t.context.getShaderParameter(t.handle,t.context.COMPILE_STATUS)){let e=t.context.getShaderInfoLog(t.handle);return a(`Error compiling shader '${t.source}': ${e}`),t.context.deleteShader(t.handle),t.handle=0,!1}return!0},e.cleanup=()=>{"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0,t.dirty=!0)}},"vtkShader");let{vtkErrorMacro:l}=n.m,s={vertexShaderHandle:0,fragmentShaderHandle:0,geometryShaderHandle:0,vertexShader:null,fragmentShader:null,geometryShader:null,linked:!1,bound:!1,compiled:!1,error:"",handle:0,numberOfOutputs:0,attributesLocs:null,uniformLocs:null,md5Hash:0,context:null,lastCameraMTime:null};function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,s,r),t.attributesLocs={},t.uniformLocs={},t.vertexShader=o(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=o(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=o(),t.geometryShader.setShaderType("Geometry"),n.m.obj(e,t),n.m.get(e,t,["lastCameraMTime"]),n.m.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),t.classHierarchy.push("vtkShaderProgram"),e.compileShader=()=>t.vertexShader.compile()?t.fragmentShader.compile()?e.attachShader(t.vertexShader)&&e.attachShader(t.fragmentShader)?e.link()?(e.setCompiled(!0),1):(l(`Links failed: ${t.error}`),0):(l(t.error),0):(l(t.fragmentShader.getSource().split("\n").map((e,t)=>`${t}: ${e}`).join("\n")),l(t.fragmentShader.getError()),0):(l(t.vertexShader.getSource().split("\n").map((e,t)=>`${t}: ${e}`).join("\n")),l(t.vertexShader.getError()),0),e.cleanup=()=>{"Unknown"!==t.shaderType&&0!==t.handle&&(e.release(),0!==t.vertexShaderHandle&&(t.context.detachShader(t.handle,t.vertexShaderHandle),t.vertexShaderHandle=0),0!==t.fragmentShaderHandle&&(t.context.detachShader(t.handle,t.fragmentShaderHandle),t.fragmentShaderHandle=0),t.context.deleteProgram(t.handle),t.handle=0,e.setCompiled(!1))},e.bind=()=>!!(t.linked||e.link())&&(t.context.useProgram(t.handle),e.setBound(!0),!0),e.isBound=()=>!!t.bound,e.release=()=>{t.context.useProgram(null),e.setBound(!1)},e.setContext=e=>{t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.link=()=>
1{if(t.linked)return!0;if(0===t.handle)return t.error="Program has not been initialized, and/or does not have shaders.",!1;if(t.uniformLocs={},t.context.linkProgram(t.handle),!t.context.getProgramParameter(t.handle,t.context.LINK_STATUS)){let e=t.context.getProgramInfoLog(t.handle);return l(`Error linking shader ${e}`),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=(r,n)=>{let a=e.findUniform(r);if(-1===a)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;let i=new Float32Array(n);return t.context.uniformMatrix4fv(a,!1,i),!0},e.setUniformMatrix3x3=(r,n)=>{let a=e.findUniform(r);if(-1===a)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;let i=new Float32Array(n);return t.context.uniformMatrix3fv(a,!1,i),!0},e.setUniformf=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1f(a,n),!0)},e.setUniformfv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1fv(a,n),!0)},e.setUniformi=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1i(a,n),!0)},e.setUniformiv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1iv(a,n),!0)},e.setUniform2f=(r,n,a)=>{let i=e.findUniform(r);if(-1===i)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(void 0===a)throw RangeError("Invalid number of values for array");return t.context.uniform2f(i,n,a),!0},e.setUniform2fv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform2fv(a,n),!0)},e.setUniform2i=(r,n,a)=>{let i=e.findUniform(r);if(-1===i)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(void 0===a)throw RangeError("Invalid number of values for array");return t.context.uniform2i(i,n,a),!0},e.setUniform2iv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform2iv(a,n),!0)},e.setUniform3f=(r,n,a,i)=>{let o=e.findUniform(r);if(-1===o)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(void 0===i)throw RangeError("Invalid number of values for array");return t.context.uniform3f(o,n,a,i),!0},e.setUniform3fArray=(r,n)=>{let a=e.findUniform(r);if(-1===a)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(!Array.isArray(n)||3!==n.length)throw RangeError("Invalid number of values for array");return t.context.uniform3f(a,n[0],n[1],n[2]),!0},e.setUniform3fv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform3fv(a,n),!0)},e.setUniform3i=function(r){let n=e.findUniform(r);if(-1===n)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;for(var a=arguments.length,i=Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];let l=i;if(1===l.length&&Array.isArray(l[0])&&(l=l[0]),3!==l.length)throw RangeError("Invalid number of values for array");return t.context.uniform3i(n,l[0],l[1],l[2]),!0},e.setUniform3iv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform3iv(a,n),!0)},e.setUniform4f=function(r){let n=e.findUniform(r);if(-1===n)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;for(var a=arguments.length,i=Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];let l=i;if(1===l.length&&Array.isArray(l[0])&&(l=l[0]),4!==l.length)throw RangeError("Invalid number of values for array");return t.context.uniform4f(n,l[0],l[1],l[2],l[3]),!0},e.setUniform4fv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform4fv(a,n),!0)},e.setUniform4i=function(r){let n=e.findUniform(r);if(-1===n)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;for(var a=arguments.length,i=Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];let l=i;if(1===l.length&&Array.isArray(l[0])&&(l=l[0]),4!==l.length)throw RangeError("Invalid number of values for array");return t.context.uniform4i(n,l[0],l[1],l[2],l[3]),!0},e.setUniform4iv=(r,n)=>{let a=e.findUniform(r);return -1===a?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform4iv(a,n),!0)},e.findUniform=e=>{if(!e||!t.linked)return -1;let r=t.uniformLocs[e];return void 0!==r?r:null===(r=t.context.getUniformLocation(t.handle,e))?(t.error=`Uniform ${e} not found in current shader program.`,t.uniformLocs[e]=-1,-1):(t.uniformLocs[e]=r,r)}
1,e.isUniformUsed=e=>{if(!e)return!1;let r=t.uniformLocs[e];return void 0!==r?null!==r:t.linked?(r=t.context.getUniformLocation(t.handle,e),t.uniformLocs[e]=r,null!==r):(l("attempt to find uniform when the shader program is not linked"),!1)},e.isAttributeUsed=e=>{if(!e)return!1;if(e in t.attributeLocs)return!0;if(!t.linked)return l("attempt to find uniform when the shader program is not linked"),!1;let r=t.context.getAttribLocation(t.handle,e);return -1!==r&&(t.attributeLocs[e]=r,!0)},e.attachShader=r=>{if(0===r.getHandle())return t.error="Shader object was not initialized, cannot attach it.",!1;if("Unknown"===r.getShaderType())return t.error="Shader object is of type Unknown and cannot be used.",!1;if(0===t.handle){let e=t.context.createProgram();if(0===e)return t.error="Could not create shader program.",!1;t.handle=e,t.linked=!1}return"Vertex"===r.getShaderType()&&(0!==t.vertexShaderHandle&&t.context.detachShader(t.handle,t.vertexShaderHandle),t.vertexShaderHandle=r.getHandle()),"Fragment"===r.getShaderType()&&(0!==t.fragmentShaderHandle&&t.context.detachShader(t.handle,t.fragmentShaderHandle),t.fragmentShaderHandle=r.getHandle()),t.context.attachShader(t.handle,r.getHandle()),e.setLinked(!1),!0},e.detachShader=e=>{if(0===e.getHandle())return t.error="shader object was not initialized, cannot attach it.",!1;if("Unknown"===e.getShaderType())return t.error="Shader object is of type Unknown and cannot be used.",!1;switch(0===t.handle&&(t.error="This shader program has not been initialized yet."),e.getShaderType()){case"Vertex":if(t.vertexShaderHandle!==e.getHandle())return t.error="The supplied shader was not attached to this program.",!1;return t.context.detachShader(t.handle,e.getHandle()),t.vertexShaderHandle=0,t.linked=!1,!0;case"Fragment":if(t.fragmentShaderHandle!==e.getHandle())return t.error="The supplied shader was not attached to this program.",!1;return t.context.detachShader(t.handle,e.getHandle()),t.fragmentShaderHandle=0,t.linked=!1,!0;default:return!1}},e.setContext=e=>{t.context=e,t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.setLastCameraMTime=e=>{t.lastCameraMTime=e}}var d={newInstance:n.m.newInstance(u,"vtkShaderProgram"),extend:u,substitute:function(e,t,r,n){let a="string"==typeof r?r:r.join("\n"),i=!1===n?t:RegExp(t,"g"),o=e.replace(i,a);return{replace:o!==a,result:o}}}},56682:function(e,t,r){let n;r.d(t,{default:function(){return S}});var a=r(84349),i=r(59489),o=r(27934),l=r(53725),s=r(75655),u=r(52496),d=r(18496);let{Wrap:f,Filter:c}=a.default,{VtkDataTypes:p}=l.default,{vtkDebugMacro:m,vtkErrorMacro:g,vtkWarningMacro:h}=o.c,{toHalf:y}=i.default,T={_openGLRenderWindow:null,_forceInternalFormat:!1,context:null,handle:0,sendParametersTime:null,textureBuildTime:null,numberOfDimensions:0,target:0,format:0,openGLDataType:0,components:0,width:0,height:0,depth:0,autoParameters:!0,wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,wrapR:f.CLAMP_TO_EDGE,minificationFilter:c.NEAREST,magnificationFilter:c.NEAREST,minLOD:-1e3,maxLOD:1e3,baseLevel:0,maxLevel:1e3,generateMipmap:!1,oglNorm16Ext:null,allocatedGPUMemoryInBytes:0,enableUseHalfFloat:!0,canUseHalfFloat:!1};function b(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,T,r),u.Z.extend(e,t,r),t.sendParametersTime={},(0,o.o)(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},(0,o.o)(t.textureBuildTime,{mtime:0}),(0,o.s)(e,t,["format","openGLDataType"]),(0,o.e)(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap","oglNorm16Ext"]),(0,o.g)(e,t,["width","height","volumeInfo","components","handle","target","allocatedGPUMemoryInBytes"]),(0,o.i)(e,t,["openGLRenderWindow"]),function(e,t){t.classHierarchy.push("vtkOpenGLTexture"),e.render=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(r?t._openGLRenderWindow=r:(t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow")),t.context=t._openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(c.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(c.LINEAR),e.setMagnificationFilter(c.LINEAR)):(e.setMinificationFilter(c.NEAREST),e.setMagnificationFilter(c.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(f.REPEAT),e.setWrapS(f.REPEAT),e.setWrapT(f.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){if(null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(c.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getCanvas()){t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(c.LINEAR_MIPMAP_LINEAR));let r=t.renderable.getCanvas();e.create2DFromRaw(r.width,r.height,4,p.UNSIGNED_CHAR,r,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}if(null!==t.renderable.getJsImageData()){let r=t.renderable.getJsImageData();t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(c.LINEAR_MIPMAP_LINEAR)),e.create2DFromRaw(r.width,r.height,4,p.UNSIGNED_CHAR,r.data,!0),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}let r=t.renderable.getInputData(0);if(r&&r.getPointData().getScalars()){let n=r.getExtent(),a=r.getPointData().getScalars(),i=[];for(let e=0;e<t.renderable.getNumberOfInputPorts();++e){let r=t.renderable.getInputData(e),n=r?r.getPointData().getScalars().getData():null;n&&i.push(n)}t.renderable.getInterpolate()&&4===a.getNumberOfComponents()&&(t.generateMipmap=!0,e.setMinificationFilter(c.LINEAR_MIPMAP_LINEAR)),i.length%6==0?e.createCubeFromRaw(n[1]-n[0]+1,n[3]-n[2]+1,a.getNumberOfComponents(),a.getDataType(),i):e.create2DFromRaw(n[1]-n[0]+1,n[3]-n[2]+1,a.getNumberOfComponents(),a.getDataType(),a.getData()),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}}t.handle&&e.activate()};let r=()=>{if(t.minificationFilter!==c.LINEAR&&t.magnificationFilter!==c.LINEAR||(void 0===n&&(n=function(){try{let e=new Int16Array([0,32767]),t=document.createElement("canvas");
1t.width=4,t.height=4;let r=t.getContext("webgl2");if(!r)return!1;let n=r.getExtension("EXT_texture_norm16");if(!n)return!1;let a=`#version 300 es 2 void main() { 3 gl_PointSize = 4.0; 4 gl_Position = vec4(0, 0, 0, 1); 5 } 6 `,i=`#version 300 es 7 precision highp float; 8 precision highp int; 9 precision highp sampler2D; 10 11 uniform sampler2D u_image; 12 13 out vec4 color; 14 15 void main() { 16 vec4 intColor = texture(u_image, gl_PointCoord.xy); 17 color = vec4(vec3(intColor.rrr), 1); 18 } 19 `,o=r.createShader(r.VERTEX_SHADER);if(r.shaderSource(o,a),r.compileShader(o),!r.getShaderParameter(o,r.COMPILE_STATUS))return!1;let l=r.createShader(r.FRAGMENT_SHADER);if(r.shaderSource(l,i),r.compileShader(l),!r.getShaderParameter(l,r.COMPILE_STATUS))return!1;let s=r.createProgram();if(r.attachShader(s,o),r.attachShader(s,l),r.linkProgram(s),!r.getProgramParameter(s,r.LINK_STATUS))return!1;let u=r.createTexture();r.bindTexture(r.TEXTURE_2D,u),r.texImage2D(r.TEXTURE_2D,0,n.R16_SNORM_EXT,2,1,0,r.RED,r.SHORT,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.useProgram(s),r.drawArrays(r.POINTS,0,1);let d=new Uint8Array(4);r.readPixels(1,1,1,1,r.RGBA,r.UNSIGNED_BYTE,d);let[f,c,p]=d,m=r.getExtension("WEBGL_lose_context");return m&&m.loseContext(),f===c&&c===p&&0!==f}catch(e){return!1}}()),n))return t.oglNorm16Ext};function a(e){if(t._openGLRenderWindow.getWebgl2())return e;let r=[],n=t.width,a=t.height,o=t.components;if(e&&(!(0,s.V)(n)||!(0,s.V)(a))){let l=t.context.getExtension("OES_texture_half_float"),u=(0,s.R)(n),d=(0,s.R)(a),f=u*d*t.components;for(let s=0;s<e.length;s++)if(null!==e[s]){let c=null,p=a/d,m=n/u,g=!1;t.openGLDataType===t.context.FLOAT?c=new Float32Array(f):l&&t.openGLDataType===l.HALF_FLOAT_OES?(c=new Uint16Array(f),g=!0):c=new Uint8Array(f);for(let t=0;t<d;t++){let r=t*u*o,l=t*p,d=Math.floor(l),f=Math.ceil(l);f>=a&&(f=a-1);let h=l-d,y=1-h;d=d*n*o,f=f*n*o;for(let t=0;t<u;t++){let a=t*o,l=t*m,u=Math.floor(l),p=Math.ceil(l);p>=n&&(p=n-1);let T=l-u;u*=o,p*=o;for(let t=0;t<o;t++)g?c[r+a+t]=i.default.toHalf(i.default.fromHalf(e[s][d+u+t])*y*(1-T)+i.default.fromHalf(e[s][d+p+t])*y*T+i.default.fromHalf(e[s][f+u+t])*h*(1-T)+i.default.fromHalf(e[s][f+p+t])*h*T):c[r+a+t]=e[s][d+u+t]*y*(1-T)+e[s][d+p+t]*y*T+e[s][f+u+t]*h*(1-T)+e[s][f+p+t]*h*T}}r.push(c),t.width=u,t.height=d}else r.push(null)}if(0===r.length)for(let t=0;t<e.length;t++)r.push(e[t]);return r}function u(e){if(t._openGLRenderWindow){if(t.resizable||t.renderable?.getResizable())return!1;if(t._openGLRenderWindow.getWebgl2())return!(t._openGLRenderWindow.getGLInformations().RENDERER.value.match(/WebKit/gi)&&navigator.platform.match(/Mac/gi)&&r())||e!==p.UNSIGNED_SHORT&&e!==p.SHORT}return!1}function d(r,n){let a=r.getNumberOfComponents(),i=r.getDataType(),o=r.getData(),l=Array(a),s=Array(a);for(let e=0;e<a;++e){let[t,n]=r.getRange(e);l[e]=t,s[e]=n}let u=function(e,t,r){let n=Array(r),a=Array(r);for(let i=0;i<r;++i)n[i]=e[i],a[i]=t[i]-e[i]||1;return{scale:a,offset:n}}(l,s,a);return function(r,n,a,i){e.getOpenGLDataType(r);let o=function(e,t){for(let r=0;r<e.length;r++){let n=e[r],a=t[r]+n;if(n<-2048||n>2048||a<-2048||a>2048)return!1}return!0}(n,a)||i,l=!1;if(t._openGLRenderWindow.getWebgl2())l=t.openGLDataType===t.context.FLOAT&&null===t.context.getExtension("OES_texture_float_linear")&&o||t.openGLDataType===t.context.HALF_FLOAT;else{let e=t.context.getExtension("OES_texture_half_float");l=e&&t.openGLDataType===e.HALF_FLOAT_OES}t.canUseHalfFloat=l&&o}(i,u.offset,u.scale,n),e.useHalfFloat()||e.getOpenGLDataType(i,!0),{numComps:a,dataType:i,data:o,scaleOffsets:u}}e.destroyTexture=()=>{e.deactivate(),t.context&&t.handle&&t.context.deleteTexture(t.handle),t.handle=0,t.numberOfDimensions=0,t.target=0,t.components=0,t.width=0,t.height=0,t.depth=0,e.resetFormatAndType()},e.createTexture=()=>{!t.handle&&(t.handle=t.context.createTexture(),t.target&&(t.context.bindTexture(t.target,t.handle),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t._openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.bindTexture(t.target,null)))},e.getTextureUnit=()=>t._openGLRenderWindow?t._openGLRenderWindow.getTextureUnitForTexture(e):-1,e.activate=()=>{t._openGLRenderWindow.activateTexture(e),e.bind()},e.deactivate=()=>{t._openGLRenderWindow&&t._openGLRenderWindow.deactivateTexture(e)},e.releaseGraphicsResources=r=>{r&&t.handle&&(r.activateTexture(e),r.deactivateTexture(e),t.context.deleteTexture(t.handle),t.handle=0,t.numberOfDimensions=0,t.target=0,t.internalFormat=0,t.format=0,t.openGLDataType=0,t.components=0,t.width=0,t.height=0,t.depth=0,t.allocatedGPUMemoryInBytes=0),t.shaderProgram&&(t.shaderProgram.releaseGraphicsResources(r),t.shaderProgram=null)},e.bind=()=>{t.context.bindTexture(t.target,t.handle),t.autoParameters&&e.getMTime()>t.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=()=>{let e=!1;if(t.context&&t.handle){let r=0;t.target===t.context.TEXTURE_2D?r=t.context.TEXTURE_BINDING_2D:h("impossible case"),e=t.context.getIntegerv(r)===t.handle}return e},e.sendParameters=()=>{t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t._openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t._openGLRenderWindow.getWebgl2()&&(t.context.texParameteri(t.target,t.context.TEXTURE_BASE_LEVEL,t.baseLevel),t.context.texParameteri(t.target,t.context.TEXTURE_MAX_LEVEL,t.maxLevel)),t.sendParametersTime.modified()},e.getInternalFormat=(r,n)=>(t._forceInternalFormat||(t.internalFormat=e.getDefaultInternalFormat(r,n)),t.internalFormat||m(`Unable to find suitable internal format for T=${r} NC= ${n}`),[t.context.R32F,t.context.RG32F,t.context.RGB32F,t.context.RGBA32F].includes(t.internalFormat)&&!t.context.getExtension("OES_texture_float_linear")&&h("Failed to load OES_texture_float_linear. Texture filtering is not available for *32F
19internal formats."),t.internalFormat),e.getDefaultInternalFormat=(n,a)=>{let i=0;return(i=t._openGLRenderWindow.getDefaultTextureInternalFormat(n,a,r(),e.useHalfFloat()))||i||(m("Unsupported internal texture type!"),m(`Unable to find suitable internal format for T=${n} NC= ${a}`)),i},e.useHalfFloat=()=>t.enableUseHalfFloat&&t.canUseHalfFloat,e.setInternalFormat=r=>{t._forceInternalFormat=!0,r!==t.internalFormat&&(t.internalFormat=r,e.modified())},e.getFormat=(r,n)=>(t.format=e.getDefaultFormat(r,n),t.format),e.getDefaultFormat=(e,r)=>{if(t._openGLRenderWindow.getWebgl2())switch(r){case 1:return t.context.RED;case 2:return t.context.RG;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}else switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}},e.resetFormatAndType=()=>{t.format=0,t.internalFormat=0,t._forceInternalFormat=!1,t.openGLDataType=0},e.getDefaultDataType=n=>{let a=e.useHalfFloat();if(t._openGLRenderWindow.getWebgl2())switch(n){case p.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case r()&&!a&&p.SHORT:return t.context.SHORT;case r()&&!a&&p.UNSIGNED_SHORT:return t.context.UNSIGNED_SHORT;case a&&p.SHORT:case a&&p.UNSIGNED_SHORT:return t.context.HALF_FLOAT;case p.FLOAT:case p.VOID:default:return t.context.FLOAT}switch(n){case p.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case p.FLOAT:case p.VOID:default:if(t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear"))return t.context.FLOAT;{let e=t.context.getExtension("OES_texture_half_float");if(e&&t.context.getExtension("OES_texture_half_float_linear"))return e.HALF_FLOAT_OES}return t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(r){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(!t.openGLDataType||n)&&(t.openGLDataType=e.getDefaultDataType(r)),t.openGLDataType},e.getShiftAndScale=()=>{let e=0,r=1;switch(t.openGLDataType){case t.context.BYTE:e=(r=127.5)-128;break;case t.context.UNSIGNED_BYTE:r=255,e=0;break;case t.context.SHORT:e=(r=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:r=65536,e=0;break;case t.context.INT:e=(r=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:r=4294967295,e=0;case t.context.FLOAT:}return{shift:e,scale:r}},e.getOpenGLFilterMode=e=>{switch(e){case c.NEAREST:return t.context.NEAREST;case c.LINEAR:return t.context.LINEAR;case c.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case c.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case c.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case c.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=e=>{switch(e){case f.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case f.REPEAT:return t.context.REPEAT;case f.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.updateArrayDataTypeForGL=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],i=t.width*t.height*t.components;if(n&&(i*=t.depth),e!==p.FLOAT&&t.openGLDataType===t.context.FLOAT)for(let e=0;e<r.length;e++)if(r[e]){let t=r[e].length>i?r[e].subarray(0,i):r[e];a.push(new Float32Array(t))}else a.push(null);if(e!==p.UNSIGNED_CHAR&&t.openGLDataType===t.context.UNSIGNED_BYTE)for(let e=0;e<r.length;e++)if(r[e]){let t=r[e].length>i?r[e].subarray(0,i):r[e];a.push(new Uint8Array(t))}else a.push(null);let o=!1;if(t._openGLRenderWindow.getWebgl2())o=t.openGLDataType===t.context.HALF_FLOAT;else{let e=t.context.getExtension("OES_texture_half_float");o=e&&t.openGLDataType===e.HALF_FLOAT_OES}if(o)for(let e=0;e<r.length;e++)if(r[e]){let t=new Uint16Array(i),n=r[e];for(let e=0;e<i;e++)t[e]=y(n[e]);a.push(t)}else a.push(null);if(0===a.length)for(let e=0;e<r.length;e++)a.push(r[e]);return a},e.create2DFromRaw=function(n,i,o,l,s){let d=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.getOpenGLDataType(l,!0),e.getInternalFormat(l,o),e.getFormat(l,o),!t.internalFormat||!t.format||!t.openGLDataType)return g("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=o,t.width=n,t.height=i,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();let f=a(e.updateArrayDataTypeForGL(l,[s]));return t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,d),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),u(l)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=f[0]&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,f[0])):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,f[0]),t.generateMipmap&&t.context.generateMipmap(t.target),d&&t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,!1),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*o*t._openGLRenderWindow.getDefaultTextureByteSize(l,r(),e.useHalfFloat()),e.deactivate(),!0},e.createCubeFromRaw=(n,i,l,s,d)=>
19{if(e.getOpenGLDataType(s),e.getInternalFormat(s,l),e.getFormat(s,l),!t.internalFormat||!t.format||!t.openGLDataType)return g("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=l,t.width=n,t.height=i,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),t.maxLevel=d.length/6-1,e.createTexture(),e.bind();let f=a(e.updateArrayDataTypeForGL(s,d)),c=[],p=t.width,m=t.height;for(let e=0;e<f.length;e++){e%6==0&&0!==e&&(p/=2,m/=2),c[e]=(0,o.a)(s,m*p*t.components);for(let r=0;r<m;++r){let n=r*p*t.components,a=(m-r-1)*p*t.components;c[e].set(f[e].slice(a,a+p*t.components),n)}}t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),u(s)&&t.context.texStorage2D(t.target,6,t.internalFormat,t.width,t.height);for(let e=0;e<6;e++){let r=0,n=t.width,a=t.height;for(;n>=1&&a>=1;){let i=null;r<=t.maxLevel&&(i=c[6*r+e]),u(s)?null!=i&&t.context.texSubImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,n,a,t.format,t.openGLDataType,i):t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,t.internalFormat,n,a,0,t.format,t.openGLDataType,i),r++,n/=2,a/=2}}return t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*l*t._openGLRenderWindow.getDefaultTextureByteSize(s,r(),e.useHalfFloat()),e.deactivate(),!0},e.createDepthFromRaw=(n,a,i,o)=>(e.getOpenGLDataType(i),t.format=t.context.DEPTH_COMPONENT,t._openGLRenderWindow.getWebgl2()?i===p.FLOAT?t.internalFormat=t.context.DEPTH_COMPONENT32F:t.internalFormat=t.context.DEPTH_COMPONENT16:t.internalFormat=t.context.DEPTH_COMPONENT,t.internalFormat&&t.format&&t.openGLDataType)?(t.target=t.context.TEXTURE_2D,t.components=1,t.width=n,t.height=a,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),u(i)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=o&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,o)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,o),t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(i,r(),e.useHalfFloat()),e.deactivate(),!0):(g("Failed to determine texture parameters."),!1),e.create2DFromImage=n=>{if(e.getOpenGLDataType(p.UNSIGNED_CHAR),e.getInternalFormat(p.UNSIGNED_CHAR,4),e.getFormat(p.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return g("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);let a=!t._openGLRenderWindow.getWebgl2()&&(!(0,s.V)(n.width)||!(0,s.V)(n.height)),i=document.createElement("canvas");i.width=a?(0,s.R)(n.width):n.width,i.height=a?(0,s.R)(n.height):n.height,t.width=i.width,t.height=i.height;let o=i.getContext("2d");return o.translate(0,i.height),o.scale(1,-1),o.drawImage(n,0,0,n.width,n.height,0,0,i.width,i.height),u(p.UNSIGNED_CHAR)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=i&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,i)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,i),t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(p.UNSIGNED_CHAR,r(),e.useHalfFloat()),e.deactivate(),!0},e.create2DFilterableFromRaw=function(t,r,n,a,i){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return e.create2DFilterableFromDataArray(t,r,l.default.newInstance({numberOfComponents:n,dataType:a,values:i}),o)},e.create2DFilterableFromDataArray=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],{numComps:i,dataType:o,data:l}=d(n,a);e.create2DFromRaw(t,r,i,o,l)},e.updateVolumeInfoForGL=(n,a)=>{let i=!1,o=e.useHalfFloat();t.volumeInfo?.scale&&t.volumeInfo?.offset||(t.volumeInfo={scale:Array(a),offset:Array(a)});for(let e=0;e<a;++e)t.volumeInfo.scale[e]=1,t.volumeInfo.offset[e]=0;
19if(r()&&!o&&n===p.SHORT){for(let e=0;e<a;++e)t.volumeInfo.scale[e]=32767;i=!0}if(r()&&!o&&n===p.UNSIGNED_SHORT){for(let e=0;e<a;++e)t.volumeInfo.scale[e]=65535;i=!0}if(n===p.UNSIGNED_CHAR){for(let e=0;e<a;++e)t.volumeInfo.scale[e]=255;i=!0}return(n===p.FLOAT||o&&(n===p.SHORT||n===p.UNSIGNED_SHORT))&&(i=!0),i},e.create3DFromRaw=(n,i,o,l,s,d)=>{let f=s,c=d;if(!e.updateVolumeInfoForGL(f,l)&&c){let e=n*i*o,r=structuredClone(t.volumeInfo),a=new Float32Array(e*l);t.volumeInfo.offset=r.offset,t.volumeInfo.scale=r.scale;let s=0,u=r.scale.map(e=>1/e);for(let t=0;t<e;t++)for(let e=0;e<l;e++)a[s]=(c[s]-r.offset[e])*u[e],s++;f=p.FLOAT,c=a}if(e.getOpenGLDataType(f),e.getInternalFormat(f,l),e.getFormat(f,l),!t.internalFormat||!t.format||!t.openGLDataType)return g("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_3D,t.components=l,t.width=n,t.height=i,t.depth=o,t.numberOfDimensions=3,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();let m=[c],h=a(e.updateArrayDataTypeForGL(f,m,!0));return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),u(f)?(t.context.texStorage3D(t.target,1,t.internalFormat,t.width,t.height,t.depth),null!=h[0]&&t.context.texSubImage3D(t.target,0,0,0,0,t.width,t.height,t.depth,t.format,t.openGLDataType,h[0])):t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,h[0]),t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(f,r(),e.useHalfFloat()),e.deactivate(),!0},e.create3DFilterableFromRaw=function(t,r,n,a,i,o){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return e.create3DFilterableFromDataArray(t,r,n,l.default.newInstance({numberOfComponents:a,dataType:i,values:o}),s)},e.create3DFilterableFromDataArray=function(r,n,a,i){let o,l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],{numComps:f,dataType:c,data:m,scaleOffsets:h}=d(i,l),y=[],T=[];for(let e=0;e<f;++e)y[e]=0,T[e]=1;if(t.volumeInfo={scale:T,offset:y,dataComputedScale:h.scale,dataComputedOffset:h.offset,width:r,height:n,depth:a},t._openGLRenderWindow.getWebgl2())return e.create3DFromRaw(r,n,a,f,c,m);let b=r*n*a,x=structuredClone(h),S=(e,t,r,n,a)=>{e[t]=r},E=p.UNSIGNED_CHAR;if(c===p.UNSIGNED_CHAR)for(let e=0;e<f;++e)x.offset[e]=0,x.scale[e]=255;else t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear")?(E=p.FLOAT,S=(e,t,r,n,a)=>{e[t]=(r-n)/a}):(E=p.UNSIGNED_CHAR,S=(e,t,r,n,a)=>{e[t]=255*(r-n)/a});if(e.getOpenGLDataType(E),e.getInternalFormat(E,f),e.getFormat(E,f),!t.internalFormat||!t.format||!t.openGLDataType)return g("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=f,t.depth=1,t.numberOfDimensions=2;let v=t.context.getParameter(t.context.MAX_TEXTURE_SIZE);v>4096&&(E===p.FLOAT||f>=3)&&(v=4096);let I=1,A=1;b>v*v&&(A=I=Math.ceil(Math.sqrt(b/(v*v))));let R=Math.sqrt(b)/I,P=Math.floor((R=(0,s.R)(R))*I/r),_=Math.ceil(a/P),O=(0,s.R)(n*_/A);t.width=R,t.height=O,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=P,t.volumeInfo.yreps=_,t.volumeInfo.xstride=I,t.volumeInfo.ystride=A,t.volumeInfo.offset=x.offset,t.volumeInfo.scale=x.scale;let G=R*O*f;o=E===p.FLOAT?new Float32Array(G):new Uint8Array(G);let L=0,w=Math.floor(r/I),B=Math.floor(n/A);for(let e=0;e<_;e++){let i=Math.min(P,a-e*P),l=f*(t.width-i*Math.floor(r/I));for(let t=0;t<B;t++){for(let a=0;a<i;a++){let i=f*((e*P+a)*r*n+A*t*r);for(let e=0;e<w;e++)for(let t=0;t<f;t++)S(o,L,m[i+I*e*f+t],x.offset[t],x.scale[t]),L++}L+=l}}return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),u(E)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=o&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,o)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,o),e.deactivate(),!0},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))},e.getMaximumTextureSize=e=>e&&e.isCurrent()?e.getIntegerv(e.MAX_TEXTURE_SIZE):-1,e.enableUseHalfFloat=e=>{t.enableUseHalfFloat=e}}(e,t)}let x=(0,o.n)(b,"vtkOpenGLTexture");var S={newInstance:x,extend:b,...a.default};(0,d.vw)("vtkTexture",x)},84349:function(e,t,r){r.d(t,{E:function(){return n},default:function(){return i},w:function(){return a}});let n={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},a={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5};var i={Wrap:n,Filter:a}},65810:function(e,t,r){r.d(t,{ZP:function(){return l}});var n=r(27934),a=r(50423);let i={forceEmulation:!1,handleVAO:0,handleProgram:0,supported:!0,buffers:null,context:null};function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,i,r),t.buffers=[],n.m.obj(e,t),n.m.get(e,t,["supported"]),n.m.setGet(e,t,["forceEmulation"]),t.classHierarchy.push("vtkOpenGLVertexArrayObject"),e.exposedMethod=()=>{},e.initialize=()=>
19{t.instancingExtension=null,t._openGLRenderWindow.getWebgl2()||(t.instancingExtension=t.context.getExtension("ANGLE_instanced_arrays")),!t.forceEmulation&&t._openGLRenderWindow&&t._openGLRenderWindow.getWebgl2()?(t.extension=null,t.supported=!0,t.handleVAO=t.context.createVertexArray()):(t.extension=t.context.getExtension("OES_vertex_array_object"),!t.forceEmulation&&t.extension?(t.supported=!0,t.handleVAO=t.extension.createVertexArrayOES()):t.supported=!1)},e.isReady=()=>0!==t.handleVAO||!1===t.supported,e.bind=()=>{if(e.isReady()||e.initialize(),e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(t.handleVAO):t.context.bindVertexArray(t.handleVAO);else if(e.isReady()){let e=t.context;for(let r=0;r<t.buffers.length;++r){let n=t.buffers[r];t.context.bindBuffer(e.ARRAY_BUFFER,n.buffer);for(let r=0;r<n.attributes.length;++r){let a=n.attributes[r],i=a.isMatrix?a.size:1;for(let r=0;r<i;++r)e.enableVertexAttribArray(a.index+r),e.vertexAttribPointer(a.index+r,a.size,a.type,a.normalize,a.stride,a.offset+a.stride*r/a.size),a.divisor>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(a.index+r,1):e.vertexAttribDivisor(a.index+r,1))}}}},e.release=()=>{if(e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(null):t.context.bindVertexArray(null);else if(e.isReady()){let e=t.context;
19for(let r=0;r<t.buffers.length;++r){let n=t.buffers[r];t.context.bindBuffer(e.ARRAY_BUFFER,n.buffer);for(let r=0;r<n.attributes.length;++r){let a=n.attributes[r],i=a.isMatrix?a.size:1;for(let r=0;r<i;++r)e.enableVertexAttribArray(a.index+r),e.vertexAttribPointer(a.index+r,a.size,a.type,a.normalize,a.stride,a.offset+a.stride*r/a.size),a.divisor>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(a.index+r,0):e.vertexAttribDivisor(a.index+r,0)),e.disableVertexAttribArray(a.index+r)}}}},e.shaderProgramChanged=()=>{e.release(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.handleProgram=0},e.releaseGraphicsResources=()=>{e.shaderProgramChanged(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.supported=!0,t.handleProgram=0},e.addAttributeArray=(t,r,n,a,i,o,l,s)=>e.addAttributeArrayWithDivisor(t,r,n,a,i,o,l,s,0,!1),e.addAttributeArrayWithDivisor=(r,n,i,o,l,s,u,d,f,c)=>{if(!r||!r.isBound()||0===n.getHandle()||n.getType()!==a.L.ARRAY_BUFFER||(0===t.handleProgram&&(t.handleProgram=r.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==r.getHandle()))return!1;let p=t.context,m={};if(m.name=i,m.index=p.getAttribLocation(t.handleProgram,i),m.offset=o,m.stride=l,m.type=s,m.size=u,m.normalize=d,m.isMatrix=c,m.divisor=f,-1===m.Index)return!1;if(n.bind(),p.enableVertexAttribArray(m.index),p.vertexAttribPointer(m.index,m.size,m.type,m.normalize,m.stride,m.offset),f>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(m.index,1):p.vertexAttribDivisor(m.index,1)),m.buffer=n.getHandle(),!t.supported){let e=!1;for(let r=0;r<t.buffers.length;++r){let n=t.buffers[r];if(n.buffer===m.buffer){e=!0;let t=!1;for(let e=0;e<n.attributes.length;++e)n.attributes[e].name===i&&(t=!0,n.attributes[e]=m);t||n.attributes.push(m)}}e||t.buffers.push({buffer:m.buffer,attributes:[m]})}return!0},e.addAttributeMatrixWithDivisor=(r,n,a,i,o,l,s,u,d)=>{let f=e.addAttributeArrayWithDivisor(r,n,a,i,o,l,s,u,d,!0);if(!f)return f;let c=t.context,p=c.getAttribLocation(t.handleProgram,a);for(let e=1;e<s;e++)c.enableVertexAttribArray(p+e),c.vertexAttribPointer(p+e,s,l,u,o,i+o*e/s),d>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+e,1):c.vertexAttribDivisor(p+e,1));return!0},e.removeAttributeArray=r=>{if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(let e=0;e<t.buffers.length;++e){let n=t.buffers[e];for(let a=0;a<n.attributes.length;++a)if(n.attributes[a].name===r)return n.attributes.splice(a,1),n.attributes.length||t.buffers.splice(e,1),!0}return!0},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))}}var l={newInstance:n.m.newInstance(o,"vtkOpenGLVertexArrayObject"),extend:o}},18496:function(e,t,r){r.d(t,{ZP:function(){return u},vw:function(){return o}});var n=r(27934),a=r(11290);let i=Object.create(null);function o(e,t){i[e]=t}let l={};function s(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,l,r),t.overrides=i,a.ZP.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}(0,t)}var u={newInstance:n.m.newInstance(s,"vtkOpenGLViewNodeFactory"),extend:s}},52496:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(27934);let{vtkErrorMacro:a}=n.m,i={renderable:null,myFactory:null,children:[],visited:!1};function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,i,r),n.m.obj(e,t),n.m.event(e,t,"event"),t._renderableChildMap=new Map,n.m.get(e,t,["visited"]),n.m.setGet(e,t,["_parent","renderable","myFactory"]),n.m.getArray(e,t,["children"]),n.m.moveToProtected(e,t,["parent"]),function(e,t){t.classHierarchy.push("vtkViewNode"),e.build=e=>{},e.render=e=>{},e.traverse=r=>{let n=e[r.getTraverseOperation()];if(n){n(r);return}e.apply(r,!0);for(let e=0;e<t.children.length;e++)t.children[e].traverse(r);e.apply(r,!1)},e.apply=(t,r)=>{let n=e[t.getOperation()];n&&n(r,t)},e.getViewNodeFor=r=>{if(t.renderable===r)return e;for(let e=0;e<t.children.length;++e){let n=t.children[e].getViewNodeFor(r);if(n)return n}},e.getFirstAncestorOfType=e=>t._parent?t._parent.isA(e)?t._parent:t._parent.getFirstAncestorOfType(e):null,e.getLastAncestorOfType=e=>t._parent?t._parent.getLastAncestorOfType(e)||(t._parent.isA(e)?t._parent:null):null,e.addMissingNode=r=>{if(!r)return;let n=t._renderableChildMap.get(r);if(void 0!==n)return n.setVisited(!0),n;let a=e.createViewNode(r);if(a)return a.setParent(e),a.setVisited(!0),t._renderableChildMap.set(r,a),t.children.push(a),a},e.addMissingNodes=t=>{if(t&&t.length)for(let r=0;r<t.length;++r){let n=t[r];e.addMissingNode(n)}},e.addMissingChildren=r=>{if(r&&r.length)for(let n=0;n<r.length;++n){let a=r[n];if(-1===t.children.indexOf(a)){a.setParent(e),t.children.push(a);let r=a.getRenderable();r&&t._renderableChildMap.set(r,a)}a.setVisited(!0)}},e.removeNode=e=>{let r=t.children.findIndex(t=>t===e);if(r<0)return!1;let n=e.getRenderable();return n&&t._renderableChildMap.delete(n),e.delete(),t.children.splice(r,1),!0},e.prepareNodes=()=>{for(let e=0;e<t.children.length;++e)t.children[e].setVisited(!1)},e.setVisited=e=>{t.visited=e},e.removeUnusedNodes=()=>{let e=0;for(let r=0;r<t.children.length;++r){let n=t.children[r];if(n.getVisited())t.children[e++]=n,n.setVisited(!1);else{let e=n.getRenderable();e&&t._renderableChildMap.delete(e),n.delete()}}t.children.length=e},e.createViewNode=e=>{if(!t.myFactory)return a("Cannot create view nodes without my own factory"),null;let r=t.myFactory.createNode(e);return r&&r.setRenderable(e),r};let r=e.delete;e.delete=()=>{for(let e=0;e<t.children.length;e++)t.children[e].delete();r()}}(e,t)}var l={newInstance:n.m.newInstance(o,"vtkViewNode"),extend:o,PASS_TYPES:["Build","Render"]}},11290:function(e,t,r){r.d(t,{ZP:function(){return o}});var n=r(27934);let a={};function i(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,a,r),n.m.obj(e,t),t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=r=>{if(r.isDeleted())return null;let n=0,a=r.getClassName(n++),i=!1,o=Object.keys(t.overrides);for(;a&&!i;)-1!==o.indexOf(a)?i=!0:a=r.getClassName(n++);if(!i)return null;let l=t.overrides[a]();return l.setMyFactory(e),l}}var o={newInstance:n.m.newInstance(i,"vtkViewNodeFactory"),extend:i}},16907:function(e,t,r){r.d(t,{ZP:function(){return o}});var n=r(27934);let a={device:null,handle:null,label:null};function i(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,a,r),n.m.obj(e,t),t.bindables=[],t.bindGroupTime={},n.m.obj(t.bindGroupTime,{mtime:0}),n.m.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),n.m.setGet(e,t,["label","device","arrayInformation"]),t.classHierarchy.push("vtkWebGPUBindGroup"),e.setBindables=r=>{if(t.bindables.length===r.length){let e=!0;for(let n=0;n<t.bindables.length;n++)t.bindables[n]!==r[n]&&(e=!1);if(e)return}t.bindables=r,e.modified()},e.getBindGroupLayout=e=>{let r=[];for(let e=0;e<t.bindables.length;e++){let n=t.bindables[e].getBindGroupLayoutEntry();
19n.binding=e,r.push(n)}return e.getBindGroupLayout({entries:r})},e.getBindGroup=r=>{let n=e.getMTime();for(let e=0;e<t.bindables.length;e++){let r=t.bindables[e].getBindGroupTime().getMTime();n=r>n?r:n}if(n<t.bindGroupTime.getMTime())return t.bindGroup;let a=[];for(let e=0;e<t.bindables.length;e++){let r=t.bindables[e].getBindGroupEntry();r.binding=e,a.push(r)}return t.bindGroup=r.getHandle().createBindGroup({layout:e.getBindGroupLayout(r),entries:a,label:t.label}),t.bindGroupTime.modified(),t.bindGroup},e.getShaderCode=e=>{let r=[],n=e.getBindGroupLayoutCount(t.label);for(let e=0;e<t.bindables.length;e++)r.push(t.bindables[e].getShaderCode(e,n));return r.join("\n")}}var o={newInstance:n.m.newInstance(i),extend:i}},33398:function(e,t,r){r.d(t,{ZP:function(){return s}});var n=r(27934),a=r(61251);let i=["getMappedRange","mapAsync","unmap"],o={device:null,handle:null,sizeInBytes:0,strideInBytes:0,arrayInformation:null,usage:null,label:null,sourceTime:null};function l(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,o,r),n.m.obj(e,t),n.m.get(e,t,["handle","sizeInBytes","usage"]),n.m.setGet(e,t,["strideInBytes","device","arrayInformation","label","sourceTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=(e,r)=>{t.handle=t.device.getHandle().createBuffer({size:e,usage:r,label:t.label}),t.sizeInBytes=e,t.usage=r},e.write=e=>{!function(e,t,r,n){let a=n.byteLength,i=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0});new Uint8Array(i.getMappedRange(0,a)).set(new Uint8Array(n)),i.unmap();let o=e.createCommandEncoder();o.copyBufferToBuffer(i,0,t,0,a);let l=o.finish();e.queue.submit([l]),i.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=(e,r)=>{t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:r,mappedAtCreation:!0,label:t.label}),t.sizeInBytes=e.byteLength,t.usage=r,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(let r=0;r<i.length;r++)e[i[r]]=function(){return t.handle[i[r]](...arguments)}}(e,t)}var s={newInstance:n.m.newInstance(l),extend:l,...a.default}},11910:function(e,t,r){let n;r.d(t,{default:function(){return O}});var a=r(27934),i=r(75655),o=r(53725),l=r(33398),s=r(61251);let{Representation:u}=r(71344).default,{PrimitiveTypes:d}=s.default;class f{constructor(){this.keys=new Uint32Array(10),this.values=new Uint32Array(10),this.count=0}clear(){this.count=0}has(e){for(let t=0;t<this.count;t++)if(this.keys[t]===e)return!0}get(e){for(let t=0;t<this.count;t++)if(this.keys[t]===e)return this.values[t]}set(e,t){this.count<9&&(this.keys[this.count]=e,this.values[this.count++]=t)}}function c(e,t,r){let n=e.pointIdToFlatId[t];return n<0&&(n=e.flatId,e.pointIdToFlatId[t]=n,e.flatIdToPointId[e.flatId]=t,e.flatIdToCellId[e.flatId]=r,e.flatId++),n}function p(e,t,r){let n=e.length;for(let a=0;a<n;a++){let i=e[a];if(r.cellProvokedMap.has(i)){r.ibo[r.iboId++]=r.cellProvokedMap.get(i);for(let o=a+1;o<a+n;o++){let a=c(r,i=e[o%n],t);r.ibo[r.iboId++]=a}return}}for(let a=0;a<n;a++){let i=e[a];if(!r.provokedPointIds[i]){let o=c(r,i,t);r.provokedPointIds[i]=1,r.cellProvokedMap.set(i,o),r.flatIdToCellId[o]=t,r.ibo[r.iboId++]=o;for(let l=a+1;l<a+n;l++)o=c(r,i=e[l%n],t),r.ibo[r.iboId++]=o;return}}let a=e[0],i=r.flatId;r.cellProvokedMap.set(a,i),r.flatIdToPointId[r.flatId]=a,r.flatIdToCellId[r.flatId]=t,r.flatId++,r.ibo[r.iboId++]=i;for(let o=1;o<n;o++)i=c(r,a=e[o],t),r.ibo[r.iboId++]=i}function m(e,t,r){let n=e.length;r.iboSize+=n;for(let t=0;t<n;t++){let n=e[t];if(r.cellProvokedMap.has(n))return}for(let t=0;t<n;t++){let n=e[t];if(!r.provokedPointIds[n]){r.provokedPointIds[n]=1,r.cellProvokedMap.set(n,1);return}}r.cellProvokedMap.set(e[0],1),r.extraPoints++}let g=new Uint32Array(1),h=new Uint32Array(2),y=new Uint32Array(3),T={anythingToPoints(e,t,r,a,i){for(let o=0;o<e;++o)g[0]=t[r+o],n(g,a,i)},linesToWireframe(e,t,r,a,i){for(let o=0;o<e-1;++o)h[0]=t[r+o],h[1]=t[r+o+1],n(h,a,i)},polysToWireframe(e,t,r,a,i){if(e>2)for(let o=0;o<e;++o)h[0]=t[r+o],h[1]=t[r+(o+1)%e],n(h,a,i)}
19,stripsToWireframe(e,t,r,a,i){if(e>2){for(let o=0;o<e-1;++o)h[0]=t[r+o],h[1]=t[r+o+1],n(h,a,i);for(let o=0;o<e-2;o++)h[0]=t[r+o],h[1]=t[r+o+2],n(h,a,i)}},polysToSurface(e,t,r,a,i){for(let o=0;o<e-2;o++)y[0]=t[r],y[1]=t[r+o+1],y[2]=t[r+o+2],n(y,a,i)},stripsToSurface(e,t,r,a,i){for(let o=0;o<e-2;o++)y[0]=t[r+o],y[1]=t[r+o+1+o%2],y[2]=t[r+o+1+(o+1)%2],n(y,a,i)}},b={flatIdToPointId:null,flatIdToCellId:null,flatSize:0,indexCount:0};function x(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,b,r),l.ZP.extend(e,t,r),a.m.setGet(e,t,["flatIdToPointId","flatIdToCellId","flatSize","indexCount"]),t.classHierarchy.push("vtkWebGPUIndexBuffer"),e.buildIndexBuffer=e=>{let r=e.cells,a=e.primitiveType,i=e.representation,o=e.cellOffset,l=r.getData(),s=l.length,c=function(e){switch(e){case d.Points:return"points";case d.Lines:return"lines";case d.Triangles:case d.TriangleEdges:return"polys";case d.TriangleStripEdges:case d.TriangleStrips:return"strips";default:return""}}(a),g=e.numberOfPoints,h={provokedPointIds:new Uint8Array(g),extraPoints:0,iboSize:0,flatId:0,iboId:0,cellProvokedMap:new f},y=null;y=i===u.POINTS||a===d.Points?T.anythingToPoints:i===u.WIREFRAME||a===d.Lines?T[`${c}ToWireframe`]:T[`${c}ToSurface`],n=m;let b=o||0;for(let e=0;e<s;)h.cellProvokedMap.clear(),y(l[e],l,e+1,b,h),e+=l[e]+1,b++;g<=65535?h.flatIdToPointId=new Uint16Array(g+h.extraPoints):h.flatIdToPointId=new Uint32Array(g+h.extraPoints),g+h.extraPoints<36863?h.pointIdToFlatId=new Int16Array(g):h.pointIdToFlatId=new Int32Array(g),g+h.extraPoints<=65535?(h.ibo=new Uint16Array(h.iboSize),e.format="uint16"):(h.ibo=new Uint32Array(h.iboSize),e.format="uint32"),b<=65535?h.flatIdToCellId=new Uint16Array(g+h.extraPoints):h.flatIdToCellId=new Uint32Array(g+h.extraPoints),h.pointIdToFlatId.fill(-1),h.provokedPointIds.fill(0),n=p,b=o||0;for(let e=0;e<s;)h.cellProvokedMap.clear(),y(l[e],l,e+1,b,h),e+=l[e]+1,b++;delete h.provokedPointIds,delete h.pointIdToFlatId,e.nativeArray=h.ibo,t.flatIdToPointId=h.flatIdToPointId,t.flatIdToCellId=h.flatIdToCellId,t.flatSize=h.flatId,t.indexCount=h.iboId}}var S={newInstance:a.m.newInstance(x),extend:x,...s.default},E=r(50013);let{BufferUsage:v}=s.default,{vtkErrorMacro:I}=a.c,{VtkDataTypes:A}=o.default;function R(e,t,r,n,i){let o;let l={},s=e.getFlatSize();if(!s)return l;let u=[0,0,0,0];i.shift&&(i.shift.length?u=i.shift:u.fill(i.shift));let d=[1,1,1,1];i.scale&&(i.scale.length?d=i.scale:d.fill(i.scale));let f=!!Object.prototype.hasOwnProperty.call(i,"packExtra")&&i.packExtra,c=0,p=(0,a.a)(n,s*(r+(f?1:0))),m=e.getFlatIdToPointId();i.cellData&&(m=e.getFlatIdToCellId()),1===r?o=function(e){p[c++]=d[0]*t[e]+u[0]}:2===r?o=function(e){p[c++]=d[0]*t[e]+u[0],p[c++]=d[1]*t[e+1]+u[1]}:3!==r||f?3===r&&f?o=function(e){p[c++]=d[0]*t[e]+u[0],p[c++]=d[1]*t[e+1]+u[1],p[c++]=d[2]*t[e+2]+u[2],p[c++]=1*d[3]+u[3]}:4===r&&(o=function(e){p[c++]=d[0]*t[e]+u[0],p[c++]=d[1]*t[e+1]+u[1],p[c++]=d[2]*t[e+2]+u[2],p[c++]=d[3]*t[e+3]+u[3]}):o=function(e){p[c++]=d[0]*t[e]+u[0],p[c++]=d[1]*t[e+1]+u[1],p[c++]=d[2]*t[e+2]+u[2]};for(let e=0;e<s;e++)o(r*m[e]);return l.nativeArray=p,l}let P={device:null,fullScreenQuadBuffer:null};function _(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,P,r),(0,a.o)(e,t),(0,a.e)(e,t,["device"]),function(e,t){function r(e){let r,n;if(e.dataArray&&!e.nativeArray&&(e.nativeArray=e.dataArray.getData()),e.usage===v.Index&&((r=S.newInstance({label:e.label})).setDevice(t.device),n=GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST,r.buildIndexBuffer(e),r.createAndWrite(e.nativeArray,n),r.setArrayInformation([{format:e.format}])),r||(r=l.ZP.newInstance({label:e.label})).setDevice(t.device),e.usage===v.UniformArray&&(n=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,r.createAndWrite(e.nativeArray,n)),e.usage===v.Storage&&(n=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,r.createAndWrite(e.nativeArray,n)),e.usage===v.Texture&&(n=GPUBufferUsage.COPY_SRC,r.createAndWrite(e.nativeArray,n)),e.usage===v.PointArray){n=GPUBufferUsage.VERTEX;let t=E.Z.getNativeTypeFromBufferFormat(e.format),a=R(e.indexBuffer,e.dataArray.getData(),e.dataArray.getNumberOfComponents(),t,{packExtra:e.packExtra,shift:e.shift,scale:e.scale,cellData:e.cellData,cellOffset:e.cellOffset});r.createAndWrite(a.nativeArray,n),r.setStrideInBytes(E.Z.getByteStrideFromBufferFormat(e.format)),r.setArrayInformation([{offset:0,format:e.format,interpolation:e.cellData?"flat":"perspective"}])}if(e.usage===v.NormalsFromPoints){n=GPUBufferUsage.VERTEX;let t=E.Z.getNativeTypeFromBufferFormat(e.format),a=function(e,t){let r=t.getData(),n=e.getData();if(!n||!r)return null;let a=new Int8Array(4*e.getNumberOfCells()),o=n.length,l=0;for(let e=0;e<o;){let t=function(e,t,r,n){let a=[e[3*n]-e[3*r],e[3*n+1]-e[3*r+1],e[3*n+2]-e[3*r+2]],o=[e[3*t]-e[3*r],e[3*t+1]-e[3*r+1],e[3*t+2]-e[3*r+2]],l=[];return(0,i.j)(a,o,l),(0,i.l)(l),l}(r,n[e+1],n[e+2],n[e+3]);a[l++]=127*t[0],a[l++]=127*t[1],a[l++]=127*t[2],a[l++]=127,e+=n[e]+1}return a}(e.cells,e.dataArray),o=R(e.indexBuffer,a,4,t,{cellData:!0});r.createAndWrite(o.nativeArray,n),r.setStrideInBytes(E.Z.getByteStrideFromBufferFormat(e.format)),r.setArrayInformation([{offset:0,format:e.format,interpolation:"flat"}])}return e.usage===v.RawVertex&&(n=GPUBufferUsage.VERTEX,r.createAndWrite(e.nativeArray,n),r.setStrideInBytes(E.Z.getByteStrideFromBufferFormat(e.format)),r.setArrayInformation([{offset:0,format:e.format}])),r.setSourceTime(e.time),r}t.classHierarchy.push("vtkWebGPUBufferManager"),e.hasBuffer=e=>t.device.hasCachedObject(e),e.getBuffer=e=>e.hash?t.device.getCachedObject(e.hash,r,e):r(e),e.getBufferForPointArray=(t,r)=>{let n=function(e){let t;switch(e.getDataType()){case A.UNSIGNED_CHAR:t="uint8";break;case A.FLOAT:t="float32";break;case A.UNSIGNED_INT:t="uint32";break;case A.INT:t="sint32";break;case A.DOUBLE:t="float32";break;case A.UNSIGNED_SHORT:t="uint16";break;case A.SHORT:t="sin16";break;default:t="float32"}switch(e.getNumberOfComponents()){case 2:t+="x2";break;case 3:t.includes("32")||I(`unsupported x3 type for ${t}`),t+="x3";break;case 4:t+="x4"}return t}(t),a={hash:`${t.getMTime()}I${r.getMTime()}${n}`,usage:v.PointArray,format:n,dataArray:t,indexBuffer:r};return e.getBuffer(a)},e.getFullScreenQuadBuffer=()=>{if(t.fullScreenQuadBuffer)return t.fullScreenQuadBuffer;t.fullScreenQuadBuffer=l.ZP.newInstance(),t.fullScreenQuadBuffer.setDevice(t.device);let e=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,1,0]);return t.fullScreenQuadBuffer.createAndWrite(e,GPUBufferUsage.VERTEX),t.fullScreenQuadBuffer.setStrideInBytes(12),t.fullScreenQuadBuffer.setArrayInformation([{offset:0,format:"float32x3"}]),t.fullScreenQuadBuffer}}(e,t)}var O={newInstance:(0,a.n)(_),extend:_,...s.default}},61251:function(e,t,r){r.d(t,{default:function(){return n}});var n={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12,Index:13},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}}},74871:function(e,t,r){r.d(t,{ZP:function(){return s}});var n=r(27934),a=r(83097),i=r(42193);let o={};function l(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,o,r),i.ZP.extend(e,t,r),t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=(e,t,r)=>{let n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4<f32>","@builtin(position) Position"),n.addOutput("vec4<f32>","vertexVC");let i=n.getCode();i=a.ZP.substitute(i,"//VTK::Position::Impl",["output.tcoordVS = vec2<f32>(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4<f32>(vertexBC, 1.0);","output.vertexVC = vec4<f32>(vertexBC, 1);"]).result,n.setCode(i)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.updateBuffers=()=>{let e=t.device.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(e,["vertexBC"]),t.numberOfVertices=6}}var s={newInstance:n.m.newInstance(l,"vtkWebGPUFullScreenQuad"),extend:l}},14943:function(e,t,r){r.d(t,{ZP:function(){return o}});var n=r(27934);let a={device:null,handle:null,label:null,options:null};function i(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,a,r),n.m.obj(e,t),t.options={},t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},n.m.obj(t.bindGroupTime,{mtime:0}),n.m.get(e,t,["bindGroupTime","handle","options"]),n.m.setGet(e,t,["bindGroupLayoutEntry","device","label"]),t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.options.addressModeU=r.addressModeU?r.addressModeU:"clamp-to-edge",t.options.addressModeV=r.addressModeV?r.addressModeV:"clamp-to-edge",t.options.addressModeW=r.addressModeW?r.addressModeW:"clamp-to-edge",t.options.magFilter=r.magFilter?r.magFilter:"nearest",t.options.minFilter=r.minFilter?r.minFilter:"nearest",t.options.mipmapFilter=r.mipmapFilter?r.mipmapFilter:"nearest",t.options.label=t.label,t.handle=t.device.getHandle().createSampler(t.options),t.bindGroupTime.modified()},e.getShaderCode=(e,r)=>`@binding(${e}) @group(${r}) var ${t.label}: sampler;`,e.getBindGroupEntry=()=>({resource:t.handle})}var o={newInstance:n.m.newInstance(i),extend:i}},83097:function(e,t,r){r.d(t,{ZP:function(){return s}});var n=r(27934);let a={device:null,handle:null};var i=n.m.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,a,r),n.m.obj(e,t),n.m.get(e,t,["lastCameraMTime"]),n.m.setGet(e,t,["device","handle"]),t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=(e,r)=>{t.device=e,t.handle=t.device.getHandle().createShaderModule({code:r.getCode()})}},"vtkWebGPUShaderModule");let o={shaderModules:null,device:null,window:null};function l(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,o,r),t._shaderModules=new Map,n.m.obj(e,t),n.m.setGet(e,t,["device","window"]),t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=e=>{let r=e.getType(),n=e.getHash(),a=t._shaderModules.keys();for(let e=0;e<a.length;e++){let i=a[e];if(i.getHash()===n&&i.getType()===r)return t._shaderModules.get(i)}let o=i();return o.initialize(t.device,e),t._shaderModules.set(e,o),o}}var s={newInstance:n.m.newInstance(l,"vtkWebGPUShaderCache"),extend:l,substitute:function(e,t,r){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],a=Array.isArray(r)?r.join("\n"):r,i=!1;-1!==e.search(t)&&(i=!0);let o="";n&&(o="g");let l=new RegExp(t,o);return{replace:i,result:e.replace(l,a)}}}},42193:function(e,t,r){r.d(t,{ZP:function(){return T}});var n=r(27934),a=r(52496),i=r(16907);let o={handle:null,layouts:null,renderEncoder:null,shaderDescriptions:null,vertexState:null,topology:null,pipelineDescription:null};var l={newInstance:(0,n.n)(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,o,r),(0,n.o)(e,t),t.layouts=[],t.shaderDescriptions=[],(0,n.g)(e,t,["handle","pipelineDescription"]),(0,n.e)(e,t,["device","renderEncoder","to
19pology","vertexState"]),t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=()=>t.shaderDescriptions,e.initialize=(e,r)=>{t.pipelineDescription=t.renderEncoder.getPipelineSettings(),t.pipelineDescription.primitive.topology=t.topology,t.pipelineDescription.vertex=t.vertexState,t.pipelineDescription.label=r;let n=[];for(let e=0;e<t.layouts.length;e++)n.push(t.layouts[e].layout);t.pipelineLayout=e.getHandle().createPipelineLayout({bindGroupLayouts:n}),t.pipelineDescription.layout=t.pipelineLayout;for(let r=0;r<t.shaderDescriptions.length;r++){let n=t.shaderDescriptions[r],a=e.getShaderModule(n);"vertex"===n.getType()&&(t.pipelineDescription.vertex.module=a.getHandle(),t.pipelineDescription.vertex.entryPoint="main"),"fragment"===n.getType()&&(t.pipelineDescription.fragment.module=a.getHandle(),t.pipelineDescription.fragment.entryPoint="main")}t.handle=e.getHandle().createRenderPipeline(t.pipelineDescription)},e.getShaderDescription=e=>{for(let r=0;r<t.shaderDescriptions.length;r++)if(t.shaderDescriptions[r].getType()===e)return t.shaderDescriptions[r];return null},e.addBindGroupLayout=e=>{e&&t.layouts.push({layout:e.getBindGroupLayout(t.device),label:e.getLabel()})},e.getBindGroupLayout=e=>t.layouts[e].layout,e.getBindGroupLayoutCount=e=>{for(let r=0;r<t.layouts.length;r++)if(t.layouts[r].label===e)return r;return 0},e.bindVertexInput=(e,t)=>{t.bindBuffers(e)}},"vtkWebGPUPipeline")},s=r(83097);let u={type:null,hash:null,code:null,outputNames:null,outputTypes:null};var d=n.m.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};
19Object.assign(t,u,r),t.outputNames=[],t.outputTypes=[],t.outputInterpolations=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],n.m.obj(e,t),n.m.setGet(e,t,["type","hash","code"]),n.m.getArray(e,t,["outputTypes","outputNames","outputInterpolations"]),t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=e=>t.outputNames.includes(e),e.addOutput=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.outputTypes.push(e),t.outputNames.push(r),t.outputInterpolations.push(n)},e.addBuiltinOutput=(e,r)=>{t.builtinOutputTypes.push(e),t.builtinOutputNames.push(r)},e.addBuiltinInput=(e,r)=>{t.builtinInputTypes.push(e),t.builtinInputNames.push(r)},e.replaceShaderCode=(e,r)=>{let n=[],a=[];if(r&&n.push(r.getShaderCode()),e||t.builtinInputNames.length){let r=[];if(r.push(`struct ${t.type}Input 20{`),e){let t=e.getOutputNamesByReference(),n=e.getOutputTypesByReference(),a=e.getOutputInterpolationsByReference();for(let e=0;e<t.length;e++)void 0!==a[e]?r.push(` @location(${e}) @interpolate(${a[e]}) ${t[e]} : ${n[e]},`):r.push(` @location(${e}) ${t[e]} : ${n[e]},`)}for(let e=0;e<t.builtinInputNames.length;e++)r.push(` ${t.builtinInputNames[e]} : ${t.builtinInputTypes[e]},`);r.length>1&&(r.push("};"),a=r,n[n.length-1]+=",",n.push(`input: ${t.type}Input`))}if(n.length&&(t.code=s.ZP.substitute(t.code,"//VTK::IOStructs::Input",n).result),t.outputN
20ames.length+t.builtinOutputNames.length){let e=[`struct ${t.type}Output 21{`];for(let r=0;r<t.outputNames.length;r++)void 0!==t.outputInterpolations[r]?e.push(` @location(${r}) @interpolate(${t.outputInterpolations[r]}) ${t.outputNames[r]} : ${t.outputTypes[r]},`):e.push(` @location(${r}) ${t.outputNames[r]} : ${t.outputTypes[r]},`);for(let r=0;r<t.builtinOutputNames.length;r++)e.push(` ${t.builtinOutputNames[r]} : ${t.builtinOutputTypes[r]},`);e.push("};"),a=a.concat(e),t.code=s.ZP.substitute(t.code,"//VTK::IOStructs::Output",[`-> ${t.type}Output`]).result}t.code=s.ZP.substitute(t.code,"//VTK::IOStructs::Dec",a).result}},"vtkWebGPUShaderDescription"),f=r(50013);let c={inputs:null,bindingDescriptions:!1,attributeDescriptions:null,indexBuffer:null};var p=(0,n.n)(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,c,r),(0,n.o)(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],(0,n.e)(e,t,["created","device","handle","indexBuffer"]),t.classHierarchy.push("vtkWebGPUVertexInput"),e.addBuffer=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertex",a=r;Array.isArray(a)||(a=[a]);for(let r=0;r<t.inputs.length;r++)if(function(e,t){if(e===t)return!0;if(null==e||null==t||e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!t.includes(e[r]))return!1;return!0}(t.inputs[r].names,a)){if(t.inputs[r].buffer===e)return;t.inputs[r].buffer=e;return}t.inputs.push({buffer:e,stepMode:n,names:a}),t.inputs=t.inputs.sort((e,t)=>e.names[0]<t.names[0]?-1:e.names[0]>t.names[0]?1:0)},e.removeBufferIfPresent=e=>{for(let r=0;r<t.inputs.length;r++)t.inputs[r].names.includes(e)&&t.inputs.splice(r,1)},e.getBuffer=e=>{for(let r=0;r<t.inputs.length;r++)if(t.inputs[r].names.includes(e))return t.inputs[r].buffer;return null},e.hasAttribute=e=>{for(let r=0;r<t.inputs.length;r++)if(t.inputs[r].names.includes(e))return!0;return!1},e.getAttributeTime=e=>{for(let r=0;r<t.inputs.length;r++)if(t.inputs[r].names.includes(e))return t.inputs[r].buffer.getSourceTime();return 0},e.getShaderCode=()=>{let e="",r=0;for(let n=0;n<t.inputs.length;n++)for(let a=0;a<t.inputs[n].names.length;a++){let i=t.inputs[n].buffer.getArrayInformation()[a],o=f.Z.getShaderTypeFromBufferFormat(i.format);r>0&&(e+=",\n"),e=`${e} @location(${r}) ${t.inputs[n].names[a]} : ${o}`,r++}return e},e.getVertexInputInformation=()=>{let e={};if(t.inputs.length){let r=[],n=0;for(let e=0;e<t.inputs.length;e++){let a=t.inputs[e].buffer,i={arrayStride:a.getStrideInBytes(),stepMode:t.inputs[e].stepMode,attributes:[]},o=a.getArrayInformation();for(let r=0;r<t.inputs[e].names.length;r++)i.attributes.push({shaderLocation:n,offset:o[r].offset,format:o[r].format}),n++;r.push(i)}e.buffers=r}return e},e.bindBuffers=e=>{for(let r=0;r<t.inputs.length;r++)e.setVertexBuffer(r,t.inputs[r].buffer.getHandle());t.indexBuffer&&e.setIndexBuffer(t.indexBuffer.getHandle(),t.indexBuffer.getArrayInformation()[0].format)},e.getReady=()=>{},e.releaseGraphicsResources=()=>{t.created&&(t.inputs=[],t.bindingDescriptions=[],t.attributeDescriptions=[])}},"vtkWebGPUVertexInput");let m=` 22//VTK::Renderer::Dec 23 24//VTK::Color::Dec 25 26//VTK::Normal::Dec 27 28//VTK::TCoord::Dec 29 30//VTK::Select::Dec 31 32//VTK::Mapper::Dec 33 34//VTK::IOStructs::Dec 35 36@vertex 37fn main( 38//VTK::IOStructs::Input 39) 40//VTK::IOStructs::Output 41{ 42 var output : vertexOutput; 43 44 // var vertex: vec4<f32> = vertexBC; 45 46 //VTK::Color::Impl 47 48 //VTK::Normal::Impl 49 50 //VTK::TCoord::Impl 51 52 //VTK::Select::Impl 53 54 //VTK::Position::Impl 55 56 return output; 57} 58`,g=` 59//VTK::Renderer::Dec 60 61//VTK::Color::Dec 62 63//VTK::Normal::Dec 64 65//VTK::TCoord::Dec 66 67//VTK::Select::Dec 68 69//VTK::RenderEncoder::Dec 70 71//VTK::Mapper::Dec 72 73//VTK::IOStructs::Dec 74 75@fragment 76fn main( 77//VTK::IOStructs::Input 78) 79//VTK::IOStructs::Output 80{ 81 var output : fragmentOutput; 82 83 //VTK::Color::Impl 84 85 //VTK::Normal::Impl 86 87 //VTK::Light::Impl 88 89 //VTK::TCoord::Impl 90 91 //VTK::Select::Impl 92 93 // var computedColor:vec4<f32> = vec4<f32>(1.0,0.5,0.5,1.0); 94 95 //VTK::RenderEncoder::Impl 96 return output; 97} 98`,h={additionalBindables:void 0,bindGroup:null,device:null,fragmentShaderTemplate:null,numberOfInstances:1,numberOfVertices:0,pipelineHash:null,
98shaderReplacements:null,SSBO:null,textureViews:null,topology:"triangle-list",UBO:null,vertexShaderTemplate:null,WebGPURenderer:null};function y(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,h,r),a.Z.extend(e,t,r),t.textureViews=[],t.vertexInput=p(),t.bindGroup=i.ZP.newInstance({label:"mapperBG"}),t.additionalBindables=[],t.fragmentShaderTemplate=t.fragmentShaderTemplate||g,t.vertexShaderTemplate=t.vertexShaderTemplate||m,t.shaderReplacements=new Map,n.m.get(e,t,["pipeline","vertexInput"]),n.m.setGet(e,t,["additionalBindables","device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),t.classHierarchy.push("vtkWebGPUSimpleMapper"),e.generateShaderDescriptions=(r,n,a)=>{let i=d({type:"vertex",hash:r,code:t.vertexShaderTemplate}),o=d({type:"fragment",hash:r,code:t.fragmentShaderTemplate}),l=n.getShaderDescriptions();l.push(i),l.push(o);let s=t.vertexShaderTemplate+t.fragmentShaderTemplate,u=RegExp("//VTK::[^:]*::","g"),f=s.match(u).filter((e,t,r)=>r.indexOf(e)===t).map(e=>`replaceShader${e.substring(7,e.length-2)}`);for(let e=0;e<f.length;e++){let i=f[e];"replaceShaderIOStructs"!==i&&t.shaderReplacements.has(i)&&t.shaderReplacements.get(i)(r,n,a)}e.replaceShaderIOStructs(r,n,a)},e.replaceShaderIOStructs=(e,t,r)=>{let n=t.getShaderDescription("vertex");n.replaceShaderCode(null,r),t.getShaderDescription("fragment").replaceShaderCode(n)},e.replaceShaderRenderEncoder=(e,r,n)=>{t.renderEncoder.replaceShaderCode(r)},t.shaderReplacements.set("replaceShaderRenderEncoder",e.replaceShaderRenderEncoder),e.replaceShaderRenderer=(e,r,n)=>{if(!t.WebGPURenderer)return;let a=t.WebGPURenderer.getBindGroup().getShaderCode(r),i=r.getShaderDescription("vertex"),o=i.getCode();o=s.ZP.substitute(o,"//VTK::Renderer::Dec",[a]).result,i.setCode(o);let l=r.getShaderDescription("fragment");o=l.getCode(),o=s.ZP.substitute(o,"//VTK::Renderer::Dec",[a]).result,l.setCode(o)},t.shaderReplacements.set("replaceShaderRenderer",e.replaceShaderRenderer),e.replaceShaderMapper=(e,r,n)=>{let a=t.bindGroup.getShaderCode(r),i=r.getShaderDescription("vertex"),o=i.getCode();o=s.ZP.substitute(o,"//VTK::Mapper::Dec",[a]).result,i.setCode(o);let l=r.getShaderDescription("fragment");l.addBuiltinInput("bool","@builtin(front_facing) frontFacing"),o=l.getCode(),o=s.ZP.substitute(o,"//VTK::Mapper::Dec",[a]).result,l.setCode(o)},t.shaderReplacements.set("replaceShaderMapper",e.replaceShaderMapper),e.replaceShaderPosition=(e,t,r)=>{let n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4<f32>","@builtin(position) Position");let a=n.getCode();a=s.ZP.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,n.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=(e,t,r)=>{t.getShaderDescription("vertex").addOutput("vec2<f32>","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=e=>{t.textureViews.includes(e)||t.textureViews.push(e)},e.prepareToDraw=r=>{t.renderEncoder=r,e.updateInput(),e.updateBuffers(),e.updateBindings(),e.updatePipeline()},e.updateInput=()=>{},e.updateBuffers=()=>{},e.updateBindings=()=>{t.bindGroup.setBindables(e.getBindables())},e.computePipelineHash=()=>{},e.registerDrawCallback=r=>{r.registerDrawCallback(t.pipeline,e.draw)},e.prepareAndDraw=r=>{e.prepareToDraw(r),r.setPipeline(t.pipeline),e.draw(r)},e.draw=e=>{let r=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(e),r.bindVertexInput(e,t.vertexInput);let n=t.vertexInput.getIndexBuffer();n?e.drawIndexed(n.getIndexCount(),t.numberOfInstances,0,0,0):e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.getBindables=()=>{let e=[...t.additionalBindables];t.UBO&&e.push(t.UBO),t.SSBO&&e.push(t.SSBO);for(let r=0;r<t.textureViews.length;r++){e.push(t.textureViews[r]);let n=t.textureViews[r].getSampler();n&&e.push(n)}return e},e.updatePipeline=()=>{e.computePipelineHash(),t.pipeline=t.device.getPipeline(t.pipelineHash),t.pipeline||(t.pipeline=l.newInstance(),t.pipeline.setDevice(t.device),t.WebGPURenderer&&t.pipeline.addBindGroupLayout(t.WebGPURenderer.getBindGroup()),t.pipeline.addBindGroupLayout(t.bindGroup),e.generateShaderDescriptions(t.pipelineHash,t.pipeline,t.vertexInput),t.pipeline.setTopology(t.to
98pology),t.pipeline.setRenderEncoder(t.renderEncoder),t.pipeline.setVertexState(t.vertexInput.getVertexInputInformation()),t.device.createPipeline(t.pipelineHash,t.pipeline))}}var T={newInstance:n.m.newInstance(y,"vtkWebGPUSimpleMapper"),extend:y}},33810:function(e,t,r){r.d(t,{ZP:function(){return d}});var n=r(27934),a=r(11910),i=r(50013);let{BufferUsage:o}=a.default,{vtkErrorMacro:l}=n.m,s={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,numberOfInstances:1};function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,s,r),n.m.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},n.m.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},n.m.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},n.m.get(e,t,["bindGroupTime"]),n.m.setGet(e,t,["device","bindGroupLayoutEntry","label","numberOfInstances","sizeInBytes"]),t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=(e,r)=>{if(t._bufferEntryNames.has(e)){l(`entry named ${e} already exists`);return}t._bufferEntryNames.set(e,t.bufferEntries.length);let n=i.Z.getByteStrideFromShaderFormat(r);t.bufferEntries.push({name:e,type:r,sizeInBytes:n,offset:t.sizeInBytes,nativeType:i.Z.getNativeTypeFromShaderFormat(r)}),t.sizeInBytes+=n},e.send=e=>{if(!t._buffer){let r={nativeArray:t.Float32Array,usage:o.Storage,label:t.label};t._buffer=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),t._sendTime.modified();return}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=e=>{e in t==!1&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=n.m.newTypedArray(e,t.arrayBuffer))},e.setValue=(r,n,a)=>{let i=t._bufferEntryNames.get(r);if(void 0===i){l(`entry named ${r} not found in UBO`);return}let o=t.bufferEntries[i];e.createView(o.nativeType);let s=t[o.nativeType];s[(o.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a},e.setArray=(r,n,a)=>{let i=t._bufferEntryNames.get(r);if(void 0===i){l(`entry named ${r} not found in UBO`);return}let o=t.bufferEntries[i];e.createView(o.nativeType);let s=t[o.nativeType],u=(o.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT;for(let e=0;e<a.length;e++)s[u+e]=a[e]},e.setAllInstancesFromArray=(r,n)=>{let a=t._bufferEntryNames.get(r);if(void 0===a){l(`entry named ${r} not found in UBO`);return}let i=t.bufferEntries[a];e.createView(i.nativeType);let o=t[i.nativeType],s=n.length/t.numberOfInstances;for(let e=0;e<t.numberOfInstances;e++){let r=(i.offset+e*t.sizeInBytes)/o.BYTES_PER_ELEMENT;for(let t=0;t<s;t++)o[r+t]=n[e*s+t]}},e.setAllInstancesFromArrayColorToFloat=(r,n)=>{let a=t._bufferEntryNames.get(r);if(void 0===a){l(`entry named ${r} not found in UBO`);return}let i=t.bufferEntries[a];e.createView(i.nativeType);let o=t[i.nativeType],s=n.length/t.numberOfInstances;for(let e=0;e<t.numberOfInstances;e++){let r=(i.offset+e*t.sizeInBytes)/o.BYTES_PER_ELEMENT;for(let t=0;t<s;t++)o[r+t]=n[e*s+t]/255}},e.setAllInstancesFromArray3x3To4x4=(r,n)=>{let a=t._bufferEntryNames.get(r);if(void 0===a){l(`entry named ${r} not found in UBO`);return}let i=t.bufferEntries[a];e.createView(i.nativeType);let o=t[i.nativeType];for(let e=0;e<t.numberOfInstances;e++){let r=(i.offset+e*t.sizeInBytes)/o.BYTES_PER_ELEMENT;for(let t=0;t<3;t++)for(let a=0;a<3;a++)o[r+4*t+a]=n[9*e+3*t+a]}},e.getSendTime=()=>t._sendTime.getMTime(),e.getShaderCode=(e,r)=>{let n=[`struct ${t.label}StructEntry 99{`];for(let e=0;e<t.bufferEntries.length;e++){let r=t.bufferEntries[e];n.push(` ${r.name}: ${r.type},`)}return n.push(` 100}; 101struct ${t.label}Struct 102{ 103 values: array<${t.label}StructEntry>, 104}; 105@binding(${e}) @group(${r}) var<storage, read> ${t.label}: ${t.label}Struct; 106`),n.join("\n")},e.getBindGroupEntry=()=>({resource:{buffer:t._buffer.getHandle()}}),e.clearData=()=>{t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}var d={newInstance:n.m.newInstance(u,"vtkWebGPUStorageBuffer"),extend:u}},50013:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(27934);let a={r8unorm:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"float"},r8snorm:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"float"},r8uint:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},r8sint:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"sint"},r16uint:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"uint"},r16sint:{numComponents:1,nativeType:Int16Array,stride:2,elementSize:2,sampleType:"sint"}
106,r16float:{numComponents:1,nativeType:Float32Array,stride:2,elementSize:2,sampleType:"float"},rg8unorm:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"float"},rg8snorm:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"float"},rg8uint:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"uint"},rg8sint:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"sint"},r32uint:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:4,sampleType:"uint"},r32sint:{numComponents:1,nativeType:Int32Array,stride:4,elementSize:4,sampleType:"sint"},r32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"unfilterable-float"},rg16uint:{numComponents:2,nativeType:Uint16Array,stride:4,elementSize:2,sampleType:"uint"},rg16sint:{numComponents:2,nativeType:Int16Array,stride:4,elementSize:2,sampleType:"sint"},rg16float:{numComponents:2,nativeType:Float32Array,stride:4,elementSize:2,sampleType:"float"},rgba8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"rgba8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgba8snorm:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"float"},rgba8uint:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"uint"},rgba8sint:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"sint"},bgra8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"bgra8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgb9e5ufloat:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rgb10a2unorm:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rg11b10ufloat:{numComponents:4,nativeType:Float32Array,stride:4,sampleType:"float"},rg32uint:{numComponents:2,nativeType:Uint32Array,stride:8,elementSize:4,sampleType:"uint"},rg32sint:{numComponents:2,nativeType:Int32Array,stride:8,elementSize:4,sampleType:"sint"},rg32float:{numComponents:2,nativeType:Float32Array,stride:8,elementSize:4,sampleType:"unfilterable-float"},rgba16uint:{numComponents:4,nativeType:Uint16Array,stride:8,elementSize:2,sampleType:"uint"},rgba16sint:{numComponents:4,nativeType:Int16Array,stride:8,elementSize:2,sampleType:"sint"},rgba16float:{numComponents:4,nativeType:Float32Array,stride:8,elementSize:2,sampleType:"float"},rgba32uint:{numComponents:4,nativeType:Uint32Array,stride:16,elementSize:4,sampleType:"uint"},rgba32sint:{numComponents:4,nativeType:Int32Array,stride:16,elementSize:4,sampleType:"sint"},rgba32float:{numComponents:4,nativeType:Float32Array,stride:16,elementSize:4,sampleType:"unfilterable-float"},stencil8:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},depth16unorm:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"depth"},depth24plus:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:3,sampleType:"depth"},"depth24plus-stencil8":{numComponents:2,nativeType:Uint32Array,stride:4,sampleType:"mixed"},depth32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"depth"}};var i={getDetailsFromTextureFormat:function(e){return!e||e.length<6?0:e in a==!0?a[e]:((0,n.r)(`unknown format ${e}`),null)},getByteStrideFromBufferFormat:function(e){if(!e||e.length<5)return 0;let t=1;"x"===e[e.length-2]&&(t=Number(e[e.length-1]));let r=1===t?e.length-1:e.length-3,a=Number(e[r]);return Number.isNaN(a)?((0,n.r)(`unknown format ${e}`),0):t*(5-a/2)},getNumberOfComponentsFromBufferFormat:function(e){if(!e||e.length<5)return 0;let t=1;return"x"===e[e.length-2]&&(t=Number(e[e.length-1])),t},getNativeTypeFromBufferFormat:function(e){let t;if(!e||e.length<5)return 0;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else if("u"===e[0])t="Uint";else{(0,n.r)(`unknown format ${e}`);return}let r=e.split("x")[0],a=Number(r[r.length-1]);if(Number.isNaN(a)){(0,n.r)(`unknown format ${e}`);return}return t+(8*(5-a/2)+"Array")},getShaderTypeFromBufferFormat:function(e){let t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else if("u"===e[0]&&"i"===e[1])t="u32";else{(0,n.r)(`unknown format ${e}`);return}let r=1;return("x"===e[e.length-2]&&(r=Number(e[e.length-1])),4===r)?`vec4<${t}>`:3===r?`vec3<${t}>`:2===r?`vec2<${t}>`:t},getByteStrideFromShaderFormat:function(e){if(!e)return 0;let t=1;return"vec"===e.substring(0,3)?t=Number(e[3]):"mat"===e.substring(0,3)&&(t=e[3]*e[5]
106),4*t},getNativeTypeFromShaderFormat:function(e){if(e){if(e.includes("f32"))return"Float32Array";if(e.includes("i32"))return"Int32Array";if(e.includes("u32"))return"Uint32Array";(0,n.r)(`unknown format ${e}`)}}}},19355:function(e,t,r){r.d(t,{ZP:function(){return d}});var n=r(27934),a=r(11910),i=r(50013);let{BufferUsage:o}=a.default,{vtkErrorMacro:l}=n.m,s={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,bindGroupLayoutEntry:null,bindGroupEntry:null};function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,s,r),n.m.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},n.m.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},n.m.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,n.m.get(e,t,["binding","bindGroupTime"]),n.m.setGet(e,t,["bindGroupLayoutEntry","device","label","sizeInBytes"]),t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=(e,r)=>{if(t._bufferEntryNames.has(e)){l(`entry named ${e} already exists`);return}t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:r,sizeInBytes:i.Z.getByteStrideFromShaderFormat(r),offset:-1,nativeType:i.Z.getNativeTypeFromShaderFormat(r),packed:!1})},e.sortBufferEntries=()=>{if(!t.sortDirty)return;let e=0,r=[],n=4;for(let e=0;e<t.bufferEntries.length;e++){let r=t.bufferEntries[e];r.sizeInBytes%16==0&&(n=Math.max(16,n)),r.sizeInBytes%8==0&&(n=Math.max(8,n))}for(let n=0;n<t.bufferEntries.length;n++){let a=t.bufferEntries[n];!1===a.packed&&a.sizeInBytes%16==0&&(a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes)}for(let n=0;n<t.bufferEntries.length;n++){let a=t.bufferEntries[n];if(!1===a.packed&&12===a.sizeInBytes)for(let n=0;n<t.bufferEntries.length;n++){let i=t.bufferEntries[n];if(!1===i.packed&&4===i.sizeInBytes){a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes,i.packed=!0,i.offset=e,r.push(i),e+=i.sizeInBytes;break}}}for(let n=0;n<t.bufferEntries.length;n++){let a=t.bufferEntries[n];if(!a.packed&&a.sizeInBytes%8==0)for(let i=n+1;i<t.bufferEntries.length;i++){let n=t.bufferEntries[i];if(!n.packed&&n.sizeInBytes%8==0){a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes,n.packed=!0,n.offset=e,r.push(n),e+=n.sizeInBytes;break}}}for(let n=0;n<t.bufferEntries.length;n++){let a=t.bufferEntries[n];if(!a.packed&&a.sizeInBytes%8==0){let n=!1;for(let i=0;!n&&i<t.bufferEntries.length;i++){let o=t.bufferEntries[i];if(!o.packed&&4===o.sizeInBytes)for(let l=i+1;l<t.bufferEntries.length;l++){let i=t.bufferEntries[l];if(!i.packed&&4===i.sizeInBytes){a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes,o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes,i.packed=!0,i.offset=e,r.push(i),e+=i.sizeInBytes,n=!0;break}}}}}for(let n=0;n<t.bufferEntries.length;n++){let a=t.bufferEntries[n];!a.packed&&a.sizeInBytes>4&&(a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes)}for(let n=0;n<t.bufferEntries.length;n++){let a=t.bufferEntries[n];a.packed||(a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes)}t.bufferEntries=r,t._bufferEntryNames.clear();for(let e=0;e<t.bufferEntries.length;e++)t._bufferEntryNames.set(t.bufferEntries[e].name,e);t.sizeInBytes=e,t.sizeInBytes=n*Math.ceil(t.sizeInBytes/n),t.sortDirty=!1},e.sendIfNeeded=e=>{if(!t.UBO){let r={nativeArray:t.Float32Array,usage:o.UniformArray,label:t.label};t.UBO=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),t.sendDirty=!1}t.sendDirty&&(e.getHandle().queue.writeBuffer(t.UBO.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes),t.sendDirty=!1),t.sendTime.modified()},e.createView=e=>{e in t==!1&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes)),t[e]=n.m.newTypedArray(e,t.arrayBuffer))},e.setValue=(r,n)=>{e.sortBufferEntries();let a=t._bufferEntryNames.get(r);if(void 0===a){l(`entry named ${r} not found in UBO`);return}let i=t.bufferEntries[a];e.createView(i.nativeType);let o=t[i.nativeType];i.lastValue!==n&&(o[i.offset/o.BYTES_PER_ELEMENT]=n,t.sendDirty=!0),i.lastValue=n},e.setArray=(r,n)=>{e.sortBufferEntries();let a=t._bufferEntryNames.get(r);if(void 0===a){l(`entry named ${r} not found in UBO`);return}let i=t.bufferEntries[a];e.createView(i.nativeType);let o=t[i.nativeType],s=!1;for(let e=0;e<n.length;e++)i.lastValue&&i.lastValue[e]===n[e]||(o[i.offset/o.BYTES_PER_ELEMENT+e]=n[e],s=!0);s&&(t.sendDirty=!0,i.lastValue=[...n])},e.getBindGroupEntry=()=>({resource:{buffer:t.UBO.getHandle()}}),e.getSendTime=()=>t.sendTime.getMTime(),e.getShaderCode=(r,n)=>{e.sortBufferEntries();let a=[`struct ${t.label}Struct 107{`];for(let e=0;e<t.bufferEntries.length;e++){let r=t.bufferEntries[e];a.push(` ${r.name}: ${r.type},`)}return a.push(`}; 108@binding(${r}) @group(${n}) var<uniform> ${t.label}: ${t.label}Struct;`),a.join("\n")}}var d={newInstance:n.m.newInstance(u,"vtkWebGPUUniformBuffer"),extend:u}},33379:function(e,t,r){r.d(t,{ZP:function(){return u},vw:function(){return o}});var n=r(27934),a=r(11290);let i=Object.create(null);function o(e,t){i[e]=t}let l={};function s(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,l,r),t.overrides=i,a.ZP.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}(0,t)}var u={newInstance:n.m.newInstance(s,"vtkWebGPUViewNodeFactory"),extend:s}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.