From 4ddbde143276ac04d1137ac5ea481caedc080fe3 Mon Sep 17 00:00:00 2001 From: Jo-Byr Date: Tue, 26 May 2026 15:22:00 +0200 Subject: [PATCH] fix(vue-vtk-js): bump vue-vtk-js to 3.3.5 --- .fetch_externals.sh | 2 +- .../modules/common/serve/trame-vtk.js | 2476 +++++++++-------- 2 files changed, 1319 insertions(+), 1159 deletions(-) diff --git a/.fetch_externals.sh b/.fetch_externals.sh index 6795d9d..6fbfc15 100755 --- a/.fetch_externals.sh +++ b/.fetch_externals.sh @@ -3,7 +3,7 @@ set -e mkdir -p ./src/trame_vtk/modules/common/serve -curl --fail https://unpkg.com/vue-vtk-js@3.3.4 -Lo ./src/trame_vtk/modules/common/serve/trame-vtk.js +curl --fail https://unpkg.com/vue-vtk-js@3.3.5 -Lo ./src/trame_vtk/modules/common/serve/trame-vtk.js curl --fail https://kitware.github.io/vtk-js/examples/OfflineLocalView/index.html -Lo ./src/trame_vtk/tools/static_viewer.html if ! sha256sum --check .externals.sha256 ; then diff --git a/src/trame_vtk/modules/common/serve/trame-vtk.js b/src/trame_vtk/modules/common/serve/trame-vtk.js index 3d1080d..ee2878b 100644 --- a/src/trame_vtk/modules/common/serve/trame-vtk.js +++ b/src/trame_vtk/modules/common/serve/trame-vtk.js @@ -1,4 +1,22 @@ -(function(Ht,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],se):(Ht=typeof globalThis<"u"?globalThis:Ht||self,se(Ht.vue_vtk={},Ht.Vue))})(this,function(Ht,se){"use strict";var Pe=1e-6,yt=typeof Float32Array<"u"?Float32Array:Array,Rd=Math.PI/180;function Ld(t){return t*Rd}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function an(){var t=new yt(9);return yt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Vn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function Fd(t){var e=new yt(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function kd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Vd(t,e,a,n,r,i,o,s,c){var l=new yt(9);return l[0]=t,l[1]=e,l[2]=a,l[3]=n,l[4]=r,l[5]=i,l[6]=o,l[7]=s,l[8]=c,l}function Xc(t,e,a,n,r,i,o,s,c,l){return t[0]=e,t[1]=a,t[2]=n,t[3]=r,t[4]=i,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t}function It(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Br(t,e){if(t===e){var a=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=a,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Tn(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],p=e[8],u=p*o-s*l,f=-p*i+s*c,h=l*i-o*c,d=a*u+n*f+r*h;return d?(d=1/d,t[0]=u*d,t[1]=(-p*n+r*l)*d,t[2]=(s*n-r*o)*d,t[3]=f*d,t[4]=(p*a-r*c)*d,t[5]=(-s*a+r*i)*d,t[6]=h*d,t[7]=(-l*a+n*c)*d,t[8]=(o*a-n*i)*d,t):null}function Ad(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],p=e[8];return t[0]=o*p-s*l,t[1]=r*l-n*p,t[2]=n*s-r*o,t[3]=s*c-i*p,t[4]=a*p-r*c,t[5]=r*i-a*s,t[6]=i*l-o*c,t[7]=n*c-a*l,t[8]=a*o-n*i,t}function Bd(t){var e=t[0],a=t[1],n=t[2],r=t[3],i=t[4],o=t[5],s=t[6],c=t[7],l=t[8];return e*(l*i-o*c)+a*(-l*r+o*s)+n*(c*r-i*s)}function Qn(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],l=e[6],p=e[7],u=e[8],f=a[0],h=a[1],d=a[2],v=a[3],m=a[4],x=a[5],y=a[6],g=a[7],C=a[8];return t[0]=f*n+h*o+d*l,t[1]=f*r+h*s+d*p,t[2]=f*i+h*c+d*u,t[3]=v*n+m*o+x*l,t[4]=v*r+m*s+x*p,t[5]=v*i+m*c+x*u,t[6]=y*n+g*o+C*l,t[7]=y*r+g*s+C*p,t[8]=y*i+g*c+C*u,t}function Ud(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],l=e[6],p=e[7],u=e[8],f=a[0],h=a[1];return t[0]=n,t[1]=r,t[2]=i,t[3]=o,t[4]=s,t[5]=c,t[6]=f*n+h*o+l,t[7]=f*r+h*s+p,t[8]=f*i+h*c+u,t}function Gd(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],l=e[6],p=e[7],u=e[8],f=Math.sin(a),h=Math.cos(a);return t[0]=h*n+f*o,t[1]=h*r+f*s,t[2]=h*i+f*c,t[3]=h*o-f*n,t[4]=h*s-f*r,t[5]=h*c-f*i,t[6]=l,t[7]=p,t[8]=u,t}function Id(t,e,a){var n=a[0],r=a[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Pd(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function zd(t,e){var a=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function jd(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Wd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function $d(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=a+a,s=n+n,c=r+r,l=a*o,p=n*o,u=n*s,f=r*o,h=r*s,d=r*c,v=i*o,m=i*s,x=i*c;return t[0]=1-u-d,t[3]=p-x,t[6]=f+m,t[1]=p+x,t[4]=1-l-d,t[7]=h-v,t[2]=f-m,t[5]=h+v,t[8]=1-l-u,t}function Hd(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],p=e[8],u=e[9],f=e[10],h=e[11],d=e[12],v=e[13],m=e[14],x=e[15],y=a*s-n*o,g=a*c-r*o,C=a*l-i*o,S=n*c-r*s,T=n*l-i*s,w=r*l-i*c,_=p*v-u*d,E=p*m-f*d,D=p*x-h*d,O=u*m-f*v,M=u*x-h*v,N=f*x-h*m,R=y*N-g*M+C*O+S*D-T*E+w*_;return R?(R=1/R,t[0]=(s*N-c*M+l*O)*R,t[1]=(c*D-o*N-l*E)*R,t[2]=(o*M-s*D+l*_)*R,t[3]=(r*M-n*N-i*O)*R,t[4]=(a*N-r*D+i*E)*R,t[5]=(n*D-a*M-i*_)*R,t[6]=(v*w-m*T+x*S)*R,t[7]=(m*C-d*w-x*g)*R,t[8]=(d*T-v*C+x*y)*R,t):null}function Kd(t,e,a){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Xd(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qd(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Yd(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t[6]=e[6]+a[6],t[7]=e[7]+a[7],t[8]=e[8]+a[8],t}function qc(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t[6]=e[6]-a[6],t[7]=e[7]-a[7],t[8]=e[8]-a[8],t}function Jd(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*a,t}function Zd(t,e,a,n){return t[0]=e[0]+a[0]*n,t[1]=e[1]+a[1]*n,t[2]=e[2]+a[2]*n,t[3]=e[3]+a[3]*n,t[4]=e[4]+a[4]*n,t[5]=e[5]+a[5]*n,t[6]=e[6]+a[6]*n,t[7]=e[7]+a[7]*n,t[8]=e[8]+a[8]*n,t}function Qd(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function e2(t,e){var a=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],l=t[7],p=t[8],u=e[0],f=e[1],h=e[2],d=e[3],v=e[4],m=e[5],x=e[6],y=e[7],g=e[8];return Math.abs(a-u)<=Pe*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(n-f)<=Pe*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-h)<=Pe*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=Pe*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-v)<=Pe*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-m)<=Pe*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-x)<=Pe*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(l-y)<=Pe*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(p-g)<=Pe*Math.max(1,Math.abs(p),Math.abs(g))}var t2=Qn,n2=qc;const r2=Object.freeze(Object.defineProperty({__proto__:null,add:Yd,adjoint:Ad,clone:Fd,copy:kd,create:an,determinant:Bd,equals:e2,exactEquals:Qd,frob:qd,fromMat2d:Wd,fromMat4:Vn,fromQuat:$d,fromRotation:zd,fromScaling:jd,fromTranslation:Pd,fromValues:Vd,identity:It,invert:Tn,mul:t2,multiply:Qn,multiplyScalar:Jd,multiplyScalarAndAdd:Zd,normalFromMat4:Hd,projection:Kd,rotate:Gd,scale:Id,set:Xc,str:Xd,sub:n2,subtract:qc,translate:Ud,transpose:Br},Symbol.toStringTag,{value:"Module"}));function Ur(){var t=new yt(16);return yt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function a2(t){var e=new yt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function i2(t,e,a,n,r,i,o,s,c,l,p,u,f,h,d,v){var m=new yt(16);return m[0]=t,m[1]=e,m[2]=a,m[3]=n,m[4]=r,m[5]=i,m[6]=o,m[7]=s,m[8]=c,m[9]=l,m[10]=p,m[11]=u,m[12]=f,m[13]=h,m[14]=d,m[15]=v,m}function o2(t,e,a,n,r,i,o,s,c,l,p,u,f,h,d,v,m){return t[0]=e,t[1]=a,t[2]=n,t[3]=r,t[4]=i,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=p,t[10]=u,t[11]=f,t[12]=h,t[13]=d,t[14]=v,t[15]=m,t}function Te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function We(t,e){if(t===e){var a=e[1],n=e[2],r=e[3],i=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=a,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=r,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Et(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],p=e[8],u=e[9],f=e[10],h=e[11],d=e[12],v=e[13],m=e[14],x=e[15],y=a*s-n*o,g=a*c-r*o,C=a*l-i*o,S=n*c-r*s,T=n*l-i*s,w=r*l-i*c,_=p*v-u*d,E=p*m-f*d,D=p*x-h*d,O=u*m-f*v,M=u*x-h*v,N=f*x-h*m,R=y*N-g*M+C*O+S*D-T*E+w*_;return R?(R=1/R,t[0]=(s*N-c*M+l*O)*R,t[1]=(r*M-n*N-i*O)*R,t[2]=(v*w-m*T+x*S)*R,t[3]=(f*T-u*w-h*S)*R,t[4]=(c*D-o*N-l*E)*R,t[5]=(a*N-r*D+i*E)*R,t[6]=(m*C-d*w-x*g)*R,t[7]=(p*w-f*C+h*g)*R,t[8]=(o*M-s*D+l*_)*R,t[9]=(n*D-a*M-i*_)*R,t[10]=(d*T-v*C+x*y)*R,t[11]=(u*C-p*T-h*y)*R,t[12]=(s*E-o*O-c*_)*R,t[13]=(a*O-n*E+r*_)*R,t[14]=(v*g-d*S-m*y)*R,t[15]=(p*S-u*g+f*y)*R,t):null}function s2(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],p=e[8],u=e[9],f=e[10],h=e[11],d=e[12],v=e[13],m=e[14],x=e[15];return t[0]=s*(f*x-h*m)-u*(c*x-l*m)+v*(c*h-l*f),t[1]=-(n*(f*x-h*m)-u*(r*x-i*m)+v*(r*h-i*f)),t[2]=n*(c*x-l*m)-s*(r*x-i*m)+v*(r*l-i*c),t[3]=-(n*(c*h-l*f)-s*(r*h-i*f)+u*(r*l-i*c)),t[4]=-(o*(f*x-h*m)-p*(c*x-l*m)+d*(c*h-l*f)),t[5]=a*(f*x-h*m)-p*(r*x-i*m)+d*(r*h-i*f),t[6]=-(a*(c*x-l*m)-o*(r*x-i*m)+d*(r*l-i*c)),t[7]=a*(c*h-l*f)-o*(r*h-i*f)+p*(r*l-i*c),t[8]=o*(u*x-h*v)-p*(s*x-l*v)+d*(s*h-l*u),t[9]=-(a*(u*x-h*v)-p*(n*x-i*v)+d*(n*h-i*u)),t[10]=a*(s*x-l*v)-o*(n*x-i*v)+d*(n*l-i*s),t[11]=-(a*(s*h-l*u)-o*(n*h-i*u)+p*(n*l-i*s)),t[12]=-(o*(u*m-f*v)-p*(s*m-c*v)+d*(s*f-c*u)),t[13]=a*(u*m-f*v)-p*(n*m-r*v)+d*(n*f-r*u),t[14]=-(a*(s*m-c*v)-o*(n*m-r*v)+d*(n*c-r*s)),t[15]=a*(s*f-c*u)-o*(n*f-r*u)+p*(n*c-r*s),t}function c2(t){var e=t[0],a=t[1],n=t[2],r=t[3],i=t[4],o=t[5],s=t[6],c=t[7],l=t[8],p=t[9],u=t[10],f=t[11],h=t[12],d=t[13],v=t[14],m=t[15],x=e*o-a*i,y=e*s-n*i,g=e*c-r*i,C=a*s-n*o,S=a*c-r*o,T=n*c-r*s,w=l*d-p*h,_=l*v-u*h,E=l*m-f*h,D=p*v-u*d,O=p*m-f*d,M=u*m-f*v;return x*M-y*O+g*D+C*E-S*_+T*w}function Ee(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],l=e[6],p=e[7],u=e[8],f=e[9],h=e[10],d=e[11],v=e[12],m=e[13],x=e[14],y=e[15],g=a[0],C=a[1],S=a[2],T=a[3];return t[0]=g*n+C*s+S*u+T*v,t[1]=g*r+C*c+S*f+T*m,t[2]=g*i+C*l+S*h+T*x,t[3]=g*o+C*p+S*d+T*y,g=a[4],C=a[5],S=a[6],T=a[7],t[4]=g*n+C*s+S*u+T*v,t[5]=g*r+C*c+S*f+T*m,t[6]=g*i+C*l+S*h+T*x,t[7]=g*o+C*p+S*d+T*y,g=a[8],C=a[9],S=a[10],T=a[11],t[8]=g*n+C*s+S*u+T*v,t[9]=g*r+C*c+S*f+T*m,t[10]=g*i+C*l+S*h+T*x,t[11]=g*o+C*p+S*d+T*y,g=a[12],C=a[13],S=a[14],T=a[15],t[12]=g*n+C*s+S*u+T*v,t[13]=g*r+C*c+S*f+T*m,t[14]=g*i+C*l+S*h+T*x,t[15]=g*o+C*p+S*d+T*y,t}function Ye(t,e,a){var n=a[0],r=a[1],i=a[2],o,s,c,l,p,u,f,h,d,v,m,x;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*i+e[12],t[13]=e[1]*n+e[5]*r+e[9]*i+e[13],t[14]=e[2]*n+e[6]*r+e[10]*i+e[14],t[15]=e[3]*n+e[7]*r+e[11]*i+e[15]):(o=e[0],s=e[1],c=e[2],l=e[3],p=e[4],u=e[5],f=e[6],h=e[7],d=e[8],v=e[9],m=e[10],x=e[11],t[0]=o,t[1]=s,t[2]=c,t[3]=l,t[4]=p,t[5]=u,t[6]=f,t[7]=h,t[8]=d,t[9]=v,t[10]=m,t[11]=x,t[12]=o*n+p*r+d*i+e[12],t[13]=s*n+u*r+v*i+e[13],t[14]=c*n+f*r+m*i+e[14],t[15]=l*n+h*r+x*i+e[15]),t}function An(t,e,a){var n=a[0],r=a[1],i=a[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function mt(t,e,a,n){var r=n[0],i=n[1],o=n[2],s=Math.hypot(r,i,o),c,l,p,u,f,h,d,v,m,x,y,g,C,S,T,w,_,E,D,O,M,N,R,B;return s0?(a[0]=(s*o+p*n+c*i-l*r)*2/u,a[1]=(c*o+p*r+l*n-s*i)*2/u,a[2]=(l*o+p*i+s*r-c*n)*2/u):(a[0]=(s*o+p*n+c*i-l*r)*2,a[1]=(c*o+p*r+l*n-s*i)*2,a[2]=(l*o+p*i+s*r-c*n)*2),Jc(t,e,a),t}function Zc(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function mi(t,e){var a=e[0],n=e[1],r=e[2],i=e[4],o=e[5],s=e[6],c=e[8],l=e[9],p=e[10];return t[0]=Math.hypot(a,n,r),t[1]=Math.hypot(i,o,s),t[2]=Math.hypot(c,l,p),t}function xi(t,e){var a=new yt(3);mi(a,e);var n=1/a[0],r=1/a[1],i=1/a[2],o=e[0]*n,s=e[1]*r,c=e[2]*i,l=e[4]*n,p=e[5]*r,u=e[6]*i,f=e[8]*n,h=e[9]*r,d=e[10]*i,v=o+p+d,m=0;return v>0?(m=Math.sqrt(v+1)*2,t[3]=.25*m,t[0]=(u-h)/m,t[1]=(f-c)/m,t[2]=(s-l)/m):o>p&&o>d?(m=Math.sqrt(1+o-p-d)*2,t[3]=(u-h)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(f+c)/m):p>d?(m=Math.sqrt(1+p-o-d)*2,t[3]=(f-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(u+h)/m):(m=Math.sqrt(1+d-o-p)*2,t[3]=(s-l)/m,t[0]=(f+c)/m,t[1]=(u+h)/m,t[2]=.25*m),t}function Qc(t,e,a,n){var r=e[0],i=e[1],o=e[2],s=e[3],c=r+r,l=i+i,p=o+o,u=r*c,f=r*l,h=r*p,d=i*l,v=i*p,m=o*p,x=s*c,y=s*l,g=s*p,C=n[0],S=n[1],T=n[2];return t[0]=(1-(d+m))*C,t[1]=(f+g)*C,t[2]=(h-y)*C,t[3]=0,t[4]=(f-g)*S,t[5]=(1-(u+m))*S,t[6]=(v+x)*S,t[7]=0,t[8]=(h+y)*T,t[9]=(v-x)*T,t[10]=(1-(u+d))*T,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function h2(t,e,a,n,r){var i=e[0],o=e[1],s=e[2],c=e[3],l=i+i,p=o+o,u=s+s,f=i*l,h=i*p,d=i*u,v=o*p,m=o*u,x=s*u,y=c*l,g=c*p,C=c*u,S=n[0],T=n[1],w=n[2],_=r[0],E=r[1],D=r[2],O=(1-(v+x))*S,M=(h+C)*S,N=(d-g)*S,R=(h-C)*T,B=(1-(f+x))*T,I=(m+y)*T,P=(d+g)*w,L=(m-y)*w,k=(1-(f+v))*w;return t[0]=O,t[1]=M,t[2]=N,t[3]=0,t[4]=R,t[5]=B,t[6]=I,t[7]=0,t[8]=P,t[9]=L,t[10]=k,t[11]=0,t[12]=a[0]+_-(O*_+R*E+P*D),t[13]=a[1]+E-(M*_+B*E+L*D),t[14]=a[2]+D-(N*_+I*E+k*D),t[15]=1,t}function Gr(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=a+a,s=n+n,c=r+r,l=a*o,p=n*o,u=n*s,f=r*o,h=r*s,d=r*c,v=i*o,m=i*s,x=i*c;return t[0]=1-u-d,t[1]=p+x,t[2]=f-m,t[3]=0,t[4]=p-x,t[5]=1-l-d,t[6]=h+v,t[7]=0,t[8]=f+m,t[9]=h-v,t[10]=1-l-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g2(t,e,a,n,r,i,o){var s=1/(a-e),c=1/(r-n),l=1/(i-o);return t[0]=i*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*c,t[6]=0,t[7]=0,t[8]=(a+e)*s,t[9]=(r+n)*c,t[10]=(o+i)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*l,t[15]=0,t}function eu(t,e,a,n,r){var i=1/Math.tan(e/2),o;return t[0]=i/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,r!=null&&r!==1/0?(o=1/(n-r),t[10]=(r+n)*o,t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t}var d2=eu;function v2(t,e,a,n,r){var i=1/Math.tan(e/2),o;return t[0]=i/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,r!=null&&r!==1/0?(o=1/(n-r),t[10]=r*o,t[14]=r*n*o):(t[10]=-1,t[14]=-n),t}function y2(t,e,a,n){var r=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),l=2/(r+i);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-((o-s)*c*.5),t[9]=(r-i)*l*.5,t[10]=n/(a-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*a/(a-n),t[15]=0,t}function tu(t,e,a,n,r,i,o){var s=1/(e-a),c=1/(n-r),l=1/(i-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+a)*s,t[13]=(r+n)*c,t[14]=(o+i)*l,t[15]=1,t}var nu=tu;function m2(t,e,a,n,r,i,o){var s=1/(e-a),c=1/(n-r),l=1/(i-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+a)*s,t[13]=(r+n)*c,t[14]=i*l,t[15]=1,t}function ru(t,e,a,n){var r,i,o,s,c,l,p,u,f,h,d=e[0],v=e[1],m=e[2],x=n[0],y=n[1],g=n[2],C=a[0],S=a[1],T=a[2];return Math.abs(d-C)0&&(h=1/Math.sqrt(h),p*=h,u*=h,f*=h);var d=c*f-l*u,v=l*p-s*f,m=s*u-c*p;return h=d*d+v*v+m*m,h>0&&(h=1/Math.sqrt(h),d*=h,v*=h,m*=h),t[0]=d,t[1]=v,t[2]=m,t[3]=0,t[4]=u*m-f*v,t[5]=f*d-p*m,t[6]=p*v-u*d,t[7]=0,t[8]=p,t[9]=u,t[10]=f,t[11]=0,t[12]=r,t[13]=i,t[14]=o,t[15]=1,t}function C2(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function S2(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function T2(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t[6]=e[6]+a[6],t[7]=e[7]+a[7],t[8]=e[8]+a[8],t[9]=e[9]+a[9],t[10]=e[10]+a[10],t[11]=e[11]+a[11],t[12]=e[12]+a[12],t[13]=e[13]+a[13],t[14]=e[14]+a[14],t[15]=e[15]+a[15],t}function au(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t[6]=e[6]-a[6],t[7]=e[7]-a[7],t[8]=e[8]-a[8],t[9]=e[9]-a[9],t[10]=e[10]-a[10],t[11]=e[11]-a[11],t[12]=e[12]-a[12],t[13]=e[13]-a[13],t[14]=e[14]-a[14],t[15]=e[15]-a[15],t}function w2(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12]*a,t[13]=e[13]*a,t[14]=e[14]*a,t[15]=e[15]*a,t}function _2(t,e,a,n){return t[0]=e[0]+a[0]*n,t[1]=e[1]+a[1]*n,t[2]=e[2]+a[2]*n,t[3]=e[3]+a[3]*n,t[4]=e[4]+a[4]*n,t[5]=e[5]+a[5]*n,t[6]=e[6]+a[6]*n,t[7]=e[7]+a[7]*n,t[8]=e[8]+a[8]*n,t[9]=e[9]+a[9]*n,t[10]=e[10]+a[10]*n,t[11]=e[11]+a[11]*n,t[12]=e[12]+a[12]*n,t[13]=e[13]+a[13]*n,t[14]=e[14]+a[14]*n,t[15]=e[15]+a[15]*n,t}function E2(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function D2(t,e){var a=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],l=t[7],p=t[8],u=t[9],f=t[10],h=t[11],d=t[12],v=t[13],m=t[14],x=t[15],y=e[0],g=e[1],C=e[2],S=e[3],T=e[4],w=e[5],_=e[6],E=e[7],D=e[8],O=e[9],M=e[10],N=e[11],R=e[12],B=e[13],I=e[14],P=e[15];return Math.abs(a-y)<=Pe*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(n-g)<=Pe*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(r-C)<=Pe*Math.max(1,Math.abs(r),Math.abs(C))&&Math.abs(i-S)<=Pe*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(o-T)<=Pe*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-w)<=Pe*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(c-_)<=Pe*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(l-E)<=Pe*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(p-D)<=Pe*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(u-O)<=Pe*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(f-M)<=Pe*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(h-N)<=Pe*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-R)<=Pe*Math.max(1,Math.abs(d),Math.abs(R))&&Math.abs(v-B)<=Pe*Math.max(1,Math.abs(v),Math.abs(B))&&Math.abs(m-I)<=Pe*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(x-P)<=Pe*Math.max(1,Math.abs(x),Math.abs(P))}var iu=Ee,O2=au;const va=Object.freeze(Object.defineProperty({__proto__:null,add:T2,adjoint:s2,clone:a2,copy:gt,create:Ur,determinant:c2,equals:D2,exactEquals:E2,frob:S2,fromQuat:Gr,fromQuat2:p2,fromRotation:Yc,fromRotationTranslation:Jc,fromRotationTranslationScale:Qc,fromRotationTranslationScaleOrigin:h2,fromScaling:yi,fromTranslation:fs,fromValues:i2,fromXRotation:u2,fromYRotation:l2,fromZRotation:f2,frustum:g2,getRotation:xi,getScaling:mi,getTranslation:Zc,identity:Te,invert:Et,lookAt:ru,mul:iu,multiply:Ee,multiplyScalar:w2,multiplyScalarAndAdd:_2,ortho:nu,orthoNO:tu,orthoZO:m2,perspective:d2,perspectiveFromFieldOfView:y2,perspectiveNO:eu,perspectiveZO:v2,rotate:mt,rotateX:di,rotateY:da,rotateZ:vi,scale:An,set:o2,str:C2,sub:O2,subtract:au,targetTo:x2,translate:Ye,transpose:We},Symbol.toStringTag,{value:"Module"}));function ou(){var t=new yt(3);return yt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ya(t){var e=t[0],a=t[1],n=t[2];return Math.hypot(e,a,n)}function Ci(t,e,a){var n=new yt(3);return n[0]=t,n[1]=e,n[2]=a,n}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function on(t,e,a,n){return t[0]=e,t[1]=a,t[2]=n,t}function Ti(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t}function sn(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t}function su(t,e,a){return t[0]=e[0]*a[0],t[1]=e[1]*a[1],t[2]=e[2]*a[2],t}function Kt(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function b2(t,e){var a=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return Math.hypot(a,n,r)}function cu(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function wi(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cn(t,e){var a=e[0],n=e[1],r=e[2],i=a*a+n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function _i(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ir(t,e,a){var n=e[0],r=e[1],i=e[2],o=a[0],s=a[1],c=a[2];return t[0]=r*c-i*s,t[1]=i*o-n*c,t[2]=n*s-r*o,t}function _e(t,e,a){var n=e[0],r=e[1],i=e[2],o=a[3]*n+a[7]*r+a[11]*i+a[15];return o=o||1,t[0]=(a[0]*n+a[4]*r+a[8]*i+a[12])/o,t[1]=(a[1]*n+a[5]*r+a[9]*i+a[13])/o,t[2]=(a[2]*n+a[6]*r+a[10]*i+a[14])/o,t}function Ei(t,e,a){var n=e[0],r=e[1],i=e[2];return t[0]=n*a[0]+r*a[3]+i*a[6],t[1]=n*a[1]+r*a[4]+i*a[7],t[2]=n*a[2]+r*a[5]+i*a[8],t}function M2(t){return t[0]=0,t[1]=0,t[2]=0,t}function ma(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function uu(t,e){var a=t[0],n=t[1],r=t[2],i=e[0],o=e[1],s=e[2];return Math.abs(a-i)<=Pe*Math.max(1,Math.abs(a),Math.abs(i))&&Math.abs(n-o)<=Pe*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=Pe*Math.max(1,Math.abs(r),Math.abs(s))}var lu=sn,N2=su,R2=b2,L2=ya;(function(){var t=ou();return function(e,a,n,r,i,o){var s,c;for(a||(a=3),n||(n=0),r?c=Math.min(r*a+n,e.length):c=e.length,s=n;s0&&(o=1/Math.sqrt(o)),t[0]=a*o,t[1]=n*o,t[2]=r*o,t[3]=i*o,t}function er(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3];return t[0]=a[0]*n+a[4]*r+a[8]*i+a[12]*o,t[1]=a[1]*n+a[5]*r+a[9]*i+a[13]*o,t[2]=a[2]*n+a[6]*r+a[10]*i+a[14]*o,t[3]=a[3]*n+a[7]*r+a[11]*i+a[15]*o,t}(function(){var t=F2();return function(e,a,n,r,i,o){var s,c;for(a||(a=4),n||(n=0),r?c=Math.min(r*a+n,e.length):c=e.length,s=n;sPe?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),a}function Oi(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=a[0],c=a[1],l=a[2],p=a[3];return t[0]=n*p+o*s+r*l-i*c,t[1]=r*p+o*c+i*s-n*l,t[2]=i*p+o*l+n*c-r*s,t[3]=o*p-n*s-r*c-i*l,t}function bi(t,e,a,n){var r=e[0],i=e[1],o=e[2],s=e[3],c=a[0],l=a[1],p=a[2],u=a[3],f,h,d,v,m;return h=r*c+i*l+o*p+s*u,h<0&&(h=-h,c=-c,l=-l,p=-p,u=-u),1-h>Pe?(f=Math.acos(h),d=Math.sin(f),v=Math.sin((1-n)*f)/d,m=Math.sin(n*f)/d):(v=1-n,m=n),t[0]=v*r+m*c,t[1]=v*i+m*l,t[2]=v*o+m*p,t[3]=v*s+m*u,t}function ps(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function U2(t,e){var a=e[0]+e[4]+e[8],n;if(a>0)n=Math.sqrt(a+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[r*3+r]&&(r=2);var i=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[r*3+r]-e[i*3+i]-e[o*3+o]+1),t[r]=.5*n,n=.5/n,t[3]=(e[i*3+o]-e[o*3+i])*n,t[i]=(e[i*3+r]+e[r*3+i])*n,t[o]=(e[o*3+r]+e[r*3+o])*n}return t}var pu=k2,Mi=B2;(function(){var t=ou(),e=Ci(1,0,0),a=Ci(0,1,0);return function(n,r,i){var o=_i(r,i);return o<-.999999?(Ir(t,e,r),L2(t)<1e-6&&Ir(t,a,r),cn(t,t),Di(n,t,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ir(t,r,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+o,Mi(n,n))}})(),function(){var t=Bn(),e=Bn();return function(a,n,r,i,o,s){return bi(t,n,o,s),bi(e,r,i,s),bi(a,t,e,2*s*(1-s)),a}}(),function(){var t=an();return function(e,a,n,r){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-a[0],t[5]=-a[1],t[8]=-a[2],Mi(e,U2(e,t))}}();var Vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G2(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var a=function n(){if(this instanceof n){var r=[null];r.push.apply(r,arguments);var i=Function.bind.apply(e,r);return new i}return e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}),a}var hs=function t(e,a){if(e===a)return!0;if(e&&a&&typeof e=="object"&&typeof a=="object"){if(e.constructor!==a.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=a.length)return!1;for(r=n;r--!==0;)if(!t(e[r],a[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===a.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(a).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(a,i[r]))return!1;for(r=n;r--!==0;){var o=i[r];if(!t(e[o],a[o]))return!1}return!0}return e!==e&&a!==a},hu=Object.prototype.toString,gu=function(e){var a=hu.call(e),n=a==="[object Arguments]";return n||(n=a!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&hu.call(e.callee)==="[object Function]"),n},gs,du;function I2(){if(du)return gs;du=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,n=gu,r=Object.prototype.propertyIsEnumerable,i=!r.call({toString:null},"toString"),o=r.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var h=f.constructor;return h&&h.prototype===f},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!l["$"+f]&&e.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),u=function(f){if(typeof window>"u"||!p)return c(f);try{return c(f)}catch{return!1}};t=function(h){var d=h!==null&&typeof h=="object",v=a.call(h)==="[object Function]",m=n(h),x=d&&a.call(h)==="[object String]",y=[];if(!d&&!v&&!m)throw new TypeError("Object.keys called on a non-object");var g=o&&v;if(x&&h.length>0&&!e.call(h,0))for(var C=0;C0)for(var S=0;S"u"?Ue:un(Uint8Array),nr={"%AggregateError%":typeof AggregateError>"u"?Ue:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ue:ArrayBuffer,"%ArrayIteratorPrototype%":jr?un([][Symbol.iterator]()):Ue,"%AsyncFromSyncIteratorPrototype%":Ue,"%AsyncFunction%":Wr,"%AsyncGenerator%":Wr,"%AsyncGeneratorFunction%":Wr,"%AsyncIteratorPrototype%":Wr,"%Atomics%":typeof Atomics>"u"?Ue:Atomics,"%BigInt%":typeof BigInt>"u"?Ue:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ue:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ue:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ue:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Ue:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ue:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ue:FinalizationRegistry,"%Function%":Cu,"%GeneratorFunction%":Wr,"%Int8Array%":typeof Int8Array>"u"?Ue:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ue:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ue:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jr?un(un([][Symbol.iterator]())):Ue,"%JSON%":typeof JSON=="object"?JSON:Ue,"%Map%":typeof Map>"u"?Ue:Map,"%MapIteratorPrototype%":typeof Map>"u"||!jr?Ue:un(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ue:Promise,"%Proxy%":typeof Proxy>"u"?Ue:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Ue:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ue:Set,"%SetIteratorPrototype%":typeof Set>"u"||!jr?Ue:un(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ue:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jr?un(""[Symbol.iterator]()):Ue,"%Symbol%":jr?Symbol:Ue,"%SyntaxError%":Pr,"%ThrowTypeError%":e3,"%TypedArray%":t3,"%TypeError%":zr,"%Uint8Array%":typeof Uint8Array>"u"?Ue:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ue:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ue:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ue:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Ue:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ue:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ue:WeakSet};try{null.error}catch(t){var n3=un(un(t));nr["%Error.prototype%"]=n3}var r3=function t(e){var a;if(e==="%AsyncFunction%")a=vs("async function () {}");else if(e==="%GeneratorFunction%")a=vs("function* () {}");else if(e==="%AsyncGeneratorFunction%")a=vs("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(a=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var r=t("%AsyncGenerator%");r&&(a=un(r.prototype))}return nr[e]=a,a},Su={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xa=xu,Ri=Q2,a3=xa.call(Function.call,Array.prototype.concat),i3=xa.call(Function.apply,Array.prototype.splice),Tu=xa.call(Function.call,String.prototype.replace),Li=xa.call(Function.call,String.prototype.slice),o3=xa.call(Function.call,RegExp.prototype.exec),s3=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,c3=/\\(\\)?/g,u3=function(e){var a=Li(e,0,1),n=Li(e,-1);if(a==="%"&&n!=="%")throw new Pr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&a!=="%")throw new Pr("invalid intrinsic syntax, expected opening `%`");var r=[];return Tu(e,s3,function(i,o,s,c){r[r.length]=s?Tu(c,c3,"$1"):o||i}),r},l3=function(e,a){var n=e,r;if(Ri(Su,n)&&(r=Su[n],n="%"+r[0]+"%"),Ri(nr,n)){var i=nr[n];if(i===Wr&&(i=r3(n)),typeof i>"u"&&!a)throw new zr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new Pr("intrinsic "+e+" does not exist!")},f3=function(e,a){if(typeof e!="string"||e.length===0)throw new zr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new zr('"allowMissing" argument must be a boolean');if(o3(/^%?[^%]*%?$/,e)===null)throw new Pr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=u3(e),r=n.length>0?n[0]:"",i=l3("%"+r+"%",a),o=i.name,s=i.value,c=!1,l=i.alias;l&&(r=l[0],i3(n,a3([0,1],l)));for(var p=1,u=!0;p=n.length){var v=tr(s,f);u=!!v,u&&"get"in v&&!("originalValue"in v.get)?s=v.get:s=s[f]}else u=Ri(s,f),s=s[f];u&&!c&&(nr[o]=s)}}return s},p3=f3,ms=p3("%Object.defineProperty%",!0),xs=function(){if(ms)try{return ms({},"a",{value:1}),!0}catch{return!1}return!1};xs.hasArrayLengthDefineBug=function(){if(!xs())return null;try{return ms([],"length",{value:1}).length!==1}catch{return!0}};var h3=xs,g3=j2,d3=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",v3=Object.prototype.toString,y3=Array.prototype.concat,wu=Object.defineProperty,m3=function(t){return typeof t=="function"&&v3.call(t)==="[object Function]"},x3=h3(),_u=wu&&x3,C3=function(t,e,a,n){if(e in t){if(n===!0){if(t[e]===a)return}else if(!m3(n)||!n())return}_u?wu(t,e,{configurable:!0,enumerable:!1,value:a,writable:!0}):t[e]=a},Eu=function(t,e){var a=arguments.length>2?arguments[2]:{},n=g3(e);d3&&(n=y3.call(n,Object.getOwnPropertySymbols(e)));for(var r=0;rnull};function wt(t){if(t==null||t.isA)return t;if(!t.vtkClass)return Xt.console&&Xt.console.error&&Xt.console.error("Invalid VTK object"),null;const e=Nu[t.vtkClass];if(!e)return Xt.console&&Xt.console.error&&Xt.console.error(`No vtk class found for Object of type ${t.vtkClass}`),null;const a={...t};Object.keys(a).forEach(r=>{a[r]&&typeof a[r]=="object"&&a[r].vtkClass&&(a[r]=wt(a[r]))});const n=e(a);return n&&n.modified&&n.modified(),n}function N3(t,e){Nu[t]=e}wt.register=N3;class Ss extends Array{push(){for(let e=0;e{throw new Error(`Named parameter '${t}' is missing`)},Lu=Symbol("void");function R3(){return Ts}const Fu={};function rr(){}["log","debug","info","warn","error","time","timeEnd","group","groupEnd"].forEach(t=>{Fu[t]=rr}),Xt.console=console.hasOwnProperty("log")?console:Fu;const Un={debug:rr,error:Xt.console.error||rr,info:Xt.console.info||rr,log:Xt.console.log||rr,warn:Xt.console.warn||rr};function ku(t,e){Un[t]&&(Un[t]=e||rr)}function Vu(){Un.log(...arguments)}function Au(){Un.info(...arguments)}function ki(){Un.debug(...arguments)}function ze(){Un.error(...arguments)}function Vi(){Un.warn(...arguments)}const Bu={};function Uu(t){Bu[t]||(Un.error(t),Bu[t]=!0)}const xt=Object.create(null);xt.Float32Array=Float32Array,xt.Float64Array=Float64Array,xt.Uint8Array=Uint8Array,xt.Int8Array=Int8Array,xt.Uint16Array=Uint16Array,xt.Int16Array=Int16Array,xt.Uint32Array=Uint32Array,xt.Int32Array=Int32Array,xt.Uint8ClampedArray=Uint8ClampedArray;try{xt.BigInt64Array=BigInt64Array,xt.BigUint64Array=BigUint64Array}catch{}function ar(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n1?e-1:0),n=1;n1&&arguments[1]!==void 0?arguments[1]:2,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e3;const n=["TB","GB","MB","KB"];let r=Number(t),i="B";for(;r>a;)r/=a,i=n.pop();return`${r.toFixed(e)} ${i}`}function Pu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";const a=[];let n=t;for(;n>1e3;)a.push(`000${n%1e3}`.slice(-3)),n=Math.floor(n/1e3);return n>0&&a.push(n),a.reverse(),a.join(e)}function zu(t){Object.keys(t).forEach(e=>{Array.isArray(t[e])&&(t[e]=[].concat(t[e]))})}function L3(t){return Object.values(xt).some(e=>t instanceof e)}function F3(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let a=0;at[a]===e)}function ju(t){return t&&t.isA?t.getState():t}function ws(t){setTimeout(t,0)}function Wu(t,e){const a=performance.now();t.finally(()=>{const n=performance.now()-a;e(n)})}function ut(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};zu(e);const a=[];if(Number.isInteger(e.mtime)||(e.mtime=++Ts),!("classHierarchy"in e))e.classHierarchy=new Ss("vtkObject");else if(!(e.classHierarchy instanceof Ss)){const i=new Ss;for(let o=0;o!!e.deleted,t.modified=i=>{if(e.deleted){ze("instance deleted - cannot call any method");return}i&&io&&o(t)))},t.onModified=i=>{if(e.deleted)return ze("instance deleted - cannot call any method"),null;const o=a.length;return a.push(i),r(o)},t.getMTime=()=>e.mtime,t.isA=i=>{let o=e.classHierarchy.length;for(;o--;)if(e.classHierarchy[o]===i)return!0;return!1},t.getClassName=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.classHierarchy[e.classHierarchy.length-1-i]},t.set=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=!1;return Object.keys(i).forEach(l=>{const p=s?null:t[`set${$r(l)}`];p&&Array.isArray(i[l])&&p.length>1?c=p(...i[l])||c:p?c=p(i[l])||c:(["mtime"].indexOf(l)===-1&&!o&&Vi(`Warning: Set value to model directly ${l}, ${i[l]}`),c=e[l]!==i[l]||c,e[l]=i[l])}),c},t.get=function(){for(var i=arguments.length,o=new Array(i),s=0;s{c[l]=e[l]}),c},t.getReferenceByName=i=>e[i],t.delete=()=>{Object.keys(e).forEach(i=>delete e[i]),a.forEach((i,o)=>n(o)),e.deleted=!0},t.getState=()=>{if(e.deleted)return null;const i={...e,vtkClass:t.getClassName()};Object.keys(i).forEach(s=>{i[s]===null||i[s]===void 0||s[0]==="_"?delete i[s]:i[s].isA?i[s]=i[s].getState():Array.isArray(i[s])?i[s]=i[s].map(ju):L3(i[s])&&(i[s]=Array.from(i[s]))});const o={};return Object.keys(i).sort().forEach(s=>{o[s]=i[s]}),o.mtime&&delete o.mtime,o},t.shallowCopy=function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(i.getClassName()!==t.getClassName())throw new Error(`Cannot ShallowCopy ${i.getClassName()} into ${t.getClassName()}`);const s=i.get(),c=Object.keys(e).sort();Object.keys(s).sort().forEach(p=>{const u=c.indexOf(p);u===-1?o&&ki(`add ${p} in shallowCopy`):c.splice(u,1),e[p]=s[p]}),c.length&&o&&ki(`Untouched keys: ${c.join(", ")}`),t.modified()},t.toJSON=function(){return t.getState()},t}const V3={object(t,e,a){return function(){return{...e[a.name]}}}};function At(t,e,a){a.forEach(n=>{if(typeof n=="object"){const r=V3[n.type];r?t[`get${ot(n.name)}`]=r(t,e,n):t[`get${ot(n.name)}`]=()=>e[n.name]}else t[`get${ot(n)}`]=()=>e[n]})}const $u={enum(t,e,a){const n=`_on${ot(a.name)}Changed`;return r=>{var i;if(typeof r=="string"){if(a.enum[r]!==void 0)return e[a.name]!==a.enum[r]?(e[a.name]=a.enum[r],t.modified(),!0):!1;throw ze(`Set Enum with invalid argument ${a}, ${r}`),new RangeError("Set Enum with invalid string argument")}if(typeof r=="number"){if(e[a.name]!==r){if(Object.keys(a.enum).map(o=>a.enum[o]).indexOf(r)!==-1){const o=e[a.name];return e[a.name]=r,(i=e[n])==null||i.call(e,t,e,r,o),t.modified(),!0}throw ze(`Set Enum outside numeric range ${a}, ${r}`),new RangeError("Set Enum outside numeric range")}return!1}throw ze(`Set Enum with invalid argument (String/Number) ${a}, ${r}`),new TypeError("Set Enum with invalid argument (String/Number)")}},object(t,e,a){var r;((r=a.params)==null?void 0:r.length)===1&&Vi('Setter of type "object" with a single "param" field is not supported');const n=`_on${ot(a.name)}Changed`;return function(){var l,p;for(var i=arguments.length,o=new Array(i),s=0;s1&&((l=a.params)!=null&&l.length)?c=a.params.reduce((u,f,h)=>Object.assign(u,{[f]:o[h]}),{}):c=o[0],!hs(e[a.name],c)){const u=e[a.name];return e[a.name]=c,(p=e[n])==null||p.call(e,t,e,c,u),t.modified(),!0}return!1}}};function Hu(t){if(typeof t=="object"){const e=$u[t.type];if(e)return(a,n)=>e(a,n,t);throw ze(`No setter for field ${t}`),new TypeError("No setter for field")}return function(a,n){const r=`_on${ot(t)}Changed`;return function(o){var s;if(n.deleted)return ze("instance deleted - cannot call any method"),!1;if(n[t]!==o){const c=n[t.name];return n[t]=o,(s=n[r])==null||s.call(n,a,n,o,c),a.modified(),!0}return!1}}}function Ca(t,e,a){a.forEach(n=>{typeof n=="object"?t[`set${ot(n.name)}`]=Hu(n)(t,e):t[`set${ot(n)}`]=Hu(n)(t,e)})}function pt(t,e,a){At(t,e,a),Ca(t,e,a)}function Sa(t,e,a){a.forEach(n=>{t[`get${ot(n)}`]=()=>e[n]?Array.from(e[n]):e[n],t[`get${ot(n)}ByReference`]=()=>e[n]})}function _s(t,e,a,n){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0;a.forEach(i=>{if(e[i]&&n&&e[i].length!==n)throw new RangeError(`Invalid initial number of values for array (${i})`);const o=`_on${ot(i)}Changed`;t[`set${ot(i)}`]=function(){var h;if(e.deleted)return ze("instance deleted - cannot call any method"),!1;for(var s=arguments.length,c=new Array(s),l=0;l=0)&&(p=p[0],f=!0),p==null)u=e[i]!==p;else{if(n&&p.length!==n)if(p.length{const c=e[i];s.forEach((l,p)=>{c[p]=l})}})}function Bi(t,e,a,n){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0;Sa(t,e,a),_s(t,e,a,n,r)}function Ta(t,e,a){for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:0;if(e.deleted){ze("instance deleted - cannot call any method");return}if(d>=e.numberOfInputs){ze(`algorithm ${t.getClassName()} only has ${e.numberOfInputs} input ports. To add more input ports, use addInputData()`);return}(e.inputData[d]!==h||e.inputConnection[d])&&(e.inputData[d]=h,e.inputConnection[d]=null,t.modified&&t.modified())}function i(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.inputConnection[h]&&(e.inputData[h]=e.inputConnection[h]()),e.inputData[h]}function o(h){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e.deleted){ze("instance deleted - cannot call any method");return}if(d>=e.numberOfInputs){let v=`algorithm ${t.getClassName()} only has `;v+=`${e.numberOfInputs}`,v+=" input ports. To add more input ports, use addInputConnection()",ze(v);return}e.inputData[d]=null,e.inputConnection[d]=h}function s(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.inputConnection[h]}function c(){let h=e.numberOfInputs;for(;h&&!e.inputData[h-1]&&!e.inputConnection[h-1];)h--;return h===e.numberOfInputs&&e.numberOfInputs++,h}function l(h){if(e.deleted){ze("instance deleted - cannot call any method");return}o(h,c())}function p(h){if(e.deleted){ze("instance deleted - cannot call any method");return}r(h,c())}function u(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.deleted?(ze("instance deleted - cannot call any method"),null):(t.shouldUpdate()&&t.update(),e.output[h])}t.shouldUpdate=()=>{var m,x;const h=t.getMTime();let d=1/0,v=n;for(;v--;){if(!e.output[v]||e.output[v].isDeleted())return!0;const y=e.output[v].getMTime();if(yd)return!0;return!1};function f(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;const d=()=>u(h);return d.filter=t,d}if(e.numberOfInputs){let h=e.numberOfInputs;for(;h--;)e.inputData.push(null),e.inputConnection.push(null);t.setInputData=r,t.setInputConnection=o,t.addInputData=p,t.addInputConnection=l,t.getInputData=i,t.getInputConnection=s}n&&(t.getOutputData=u,t.getOutputPort=f),t.update=()=>{const h=[];if(e.numberOfInputs){let d=0;for(;de.numberOfInputs,t.getNumberOfOutputPorts=()=>n||e.output.length,t.getInputArrayToProcess=h=>{const d=e.inputArrayToProcess[h],v=e.inputData[h];return d&&v?v[`get${d.fieldAssociation}`]().getArray(d.arrayName):null},t.setInputArrayToProcess=function(h,d,v){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"Scalars";for(;e.inputArrayToProcess.lengthu.apply(t,arguments),1-f);else if(u.apply(t,arguments)===Ds)break}}}t[`invoke${ot(a)}`]=c,t[`on${ot(a)}`]=function(l){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!l.apply)return console.error(`Invalid callback for event ${a}`),null;if(e.deleted)return ze("instance deleted - cannot call any method"),null;const u=i++;return n.push([u,l,p]),n.sort((f,h)=>h[2]-f[2]),s(u)},t.delete=()=>{r(),n.forEach(l=>{let[p]=l;return o(p)})}}function Je(t,e){const a=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r={},i={};return t(i,r,n),Object.freeze(i)};return e&&wt.register(e,a),a}function Gn(){for(var t=arguments.length,e=new Array(t),a=0;a!!o).map(o=>o(...r))}}function Os(t){return t&&t.isA&&t.isA("vtkObject")}function wa(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];if(Os(t)){if(n.indexOf(t)>=0)return a;n.push(t);const r=e(t);r!==void 0&&a.push(r);const i=t.get();Object.keys(i).forEach(o=>{const s=i[o];Array.isArray(s)?s.forEach(c=>{wa(c,e,a,n)}):wa(s,e,a,n)})}return a}function wn(t,e,a){var n=this;let r;const i=function(){for(var o=arguments.length,s=new Array(o),c=0;c{r=null,a||t.apply(l,s)},u=a&&!r;clearTimeout(r),r=setTimeout(p,e),u&&t.apply(l,s)};return i.cancel=()=>clearTimeout(r),i}function Ku(t,e){let a=!1,n=null;function r(){a=!1,n!==null&&(i(...n),n=null)}function i(){for(var o=arguments.length,s=new Array(o),c=0;c2&&arguments[2]!==void 0?arguments[2]:{};e.keystore=Object.assign(e.keystore||{},a),t.setKey=(n,r)=>{e.keystore[n]=r},t.getKey=n=>e.keystore[n],t.getAllKeys=()=>Object.keys(e.keystore),t.deleteKey=n=>delete e.keystore[n],t.clearKeystore=()=>t.getAllKeys().forEach(n=>delete e.keystore[n])}let A3=1;const Ui="__root__";function Xu(t,e){bs(t,e);const a=t.delete;e.proxyId=`${A3++}`,e.ui=JSON.parse(JSON.stringify(e.ui||[])),At(t,e,["proxyId","proxyGroup","proxyName"]),pt(t,e,["proxyManager"]);const n={},r={};function i(l,p){r[p]||(r[p]=[]);const u=r[p];for(let f=0;f{e.ui=JSON.parse(JSON.stringify(l||[])),Object.keys(n).forEach(p=>delete n[p]),Object.keys(r).forEach(p=>delete r[p]),i(e.ui,Ui),t.modified()};function o(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ui;return r[l]}t.updateProxyProperty=(l,p)=>{const u=n[l];u?Object.assign(u,p):n[l]={...p}},t.activate=()=>{if(e.proxyManager){const l=`setActive${ot(t.getProxyGroup().slice(0,-1))}`;e.proxyManager[l]&&e.proxyManager[l](t)}},e.propertyLinkSubscribers={},t.registerPropertyLinkForGC=(l,p)=>{p in e.propertyLinkSubscribers||(e.propertyLinkSubscribers[p]=[]),e.propertyLinkSubscribers[p].push(l)},t.gcPropertyLinks=l=>{const p=e.propertyLinkSubscribers[l]||[];for(;p.length;)p.pop().unbind(t)},e.propertyLinkMap={},t.getPropertyLink=function(l){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.propertyLinkMap[l])return e.propertyLinkMap[l];let u=null;const f=[];let h=0,d=!1;function v(C){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(d)return null;const T=[];let w=null;for(h=f.length;h--;){const E=f[h];E.instance===C?w=E:T.push(E)}if(!w)return null;const _=w.instance[`get${ot(w.propertyName)}`]();if(!F3(_,u)||S){for(u=_,d=!0;T.length;){const E=T.pop();E.instance.set({[E.propertyName]:u})}d=!1}return e.propertyLinkMap[l].persistent&&(e.propertyLinkMap[l].value=_),_}function m(C,S){const T=[];for(h=f.length;h--;){const w=f[h];w.instance===C&&(w.propertyName===S||S===void 0)&&(w.subscription.unsubscribe(),T.push(h))}for(;T.length;)f.splice(T.pop(),1)}function x(C,S){let T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const w=C.onModified(v),_=f[0];return f.push({instance:C,propertyName:S,subscription:w}),T&&(e.propertyLinkMap[l].persistent&&e.propertyLinkMap[l].value!==void 0?C.set({[S]:e.propertyLinkMap[l].value}):_&&v(_.instance,!0)),{unsubscribe:()=>m(C,S)}}function y(){for(;f.length;)f.pop().subscription.unsubscribe()}const g={bind:x,unbind:m,unsubscribe:y,persistent:p};return e.propertyLinkMap[l]=g,g};function s(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ui;const p=[],u=e.proxyId,f=o(l)||[];for(let h=0;hs().map(l=>l.name),t.getPropertyByName=l=>s().find(p=>p.name===l),t.getPropertyDomainByName=l=>(n[l]||{}).domain,t.getProxySection=()=>({id:e.proxyId,name:e.proxyGroup,ui:e.ui,properties:s()}),t.delete=()=>{const l=Object.keys(e.propertyLinkMap);let p=l.length;for(;p--;)e.propertyLinkMap[l[p]].unsubscribe();Object.keys(e.propertyLinkSubscribers).forEach(t.gcPropertyLinks),a()},t.getState=()=>null;function c(){if(e.links)for(let l=0;l{for(;r.length;)r.pop().unsubscribe();n()}}function Yu(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};e.this=t;function r(s){const c=Object.keys(s);let l=c.length;for(;l--;){const p=c[l];e[p].set(s[p])}}const i=Object.keys(n);let o=i.length;for(;o--;){const s=i[o];e[s]=n[s];const c=a[s];t[`set${ot(s)}`]=l=>{if(l!==e[s]){e[s]=l;const p=c[l];r(p),t.modified()}}}i.length&&At(t,e,i)}const Ju=10,Zu=40,Qu=800;function el(t){let e=0,a=0,n=0,r=0;return"detail"in t&&(a=t.detail),"wheelDelta"in t&&(a=-t.wheelDelta/120),"wheelDeltaY"in t&&(a=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=a,a=0),n=e*Ju,r=a*Ju,"deltaY"in t&&(r=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||r)&&t.deltaMode&&(t.deltaMode===1?(n*=Zu,r*=Zu):(n*=Qu,r*=Qu)),n&&!e&&(e=n<1?-1:1),r&&!a&&(a=r<1?-1:1),{spinX:e,spinY:a||e,pixelX:n,pixelY:r||n}}var V={algo:Es,capitalize:$r,chain:Gn,debounce:wn,enumToString:k3,event:Hr,EVENT_ABORT:Ds,formatBytesToProperUnit:Iu,formatNumbersWithThousandSeparator:Pu,get:At,getArray:Sa,getCurrentGlobalMTime:R3,getStateArrayMapFunc:ju,isVtkObject:Os,keystore:bs,measurePromiseExecution:Wu,moveToProtected:Ta,newInstance:Je,newTypedArray:ar,newTypedArrayFrom:Ai,normalizeWheel:el,obj:ut,proxy:Xu,proxyPropertyMapping:qu,proxyPropertyState:Yu,safeArrays:zu,set:Ca,setArray:_s,setGet:pt,setGetArray:Bi,setImmediate:ws,setLoggerFunction:ku,throttle:Ku,traverseInstanceTree:wa,TYPED_ARRAYS:xt,uncapitalize:Gu,VOID:Lu,vtkDebugMacro:ki,vtkErrorMacro:ze,vtkInfoMacro:Au,vtkLogMacro:Vu,vtkOnceErrorMacro:Uu,vtkWarningMacro:Vi,objectSetterMap:$u,requiredParam:Ru},Dt=Object.freeze({__proto__:null,requiredParam:Ru,VOID:Lu,setLoggerFunction:ku,vtkLogMacro:Vu,vtkInfoMacro:Au,vtkDebugMacro:ki,vtkErrorMacro:ze,vtkWarningMacro:Vi,vtkOnceErrorMacro:Uu,TYPED_ARRAYS:xt,newTypedArray:ar,newTypedArrayFrom:Ai,capitalize:$r,_capitalize:ot,uncapitalize:Gu,formatBytesToProperUnit:Iu,formatNumbersWithThousandSeparator:Pu,setImmediateVTK:ws,measurePromiseExecution:Wu,obj:ut,get:At,set:Ca,setGet:pt,getArray:Sa,setArray:_s,setGetArray:Bi,moveToProtected:Ta,algo:Es,EVENT_ABORT:Ds,event:Hr,newInstance:Je,chain:Gn,isVtkObject:Os,traverseInstanceTree:wa,debounce:wn,throttle:Ku,keystore:bs,proxy:Xu,proxyPropertyMapping:qu,proxyPropertyState:Yu,normalizeWheel:el,default:V});const{vtkErrorMacro:B3}=V,U3=["Build","Render"];function G3(t,e){e.classHierarchy.push("vtkViewNode");function a(r,i){for(let o=0;o{},t.render=r=>{},t.traverse=r=>{const i=r.getTraverseOperation(),o=t[i];if(o){o(r);return}t.apply(r,!0);for(let s=0;s{const o=t[r.getOperation()];o&&o(i,r)},t.getViewNodeFor=function(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(i&&i.renderable===r)return i;if(e.renderable===r)return t;for(let o=0;oe._parent?e._parent.isA(r)?e._parent:e._parent.getFirstAncestorOfType(r):null,t.getLastAncestorOfType=r=>{if(!e._parent)return null;const i=e._parent.getLastAncestorOfType(r);return i||(e._parent.isA(r)?e._parent:null)},t.addMissingNode=r=>{if(!r)return;const i=e._renderableChildMap.get(r);if(i!==void 0)return i.setVisited(!0),i;const o=t.createViewNode(r);if(o)return o.setParent(t),o.setVisited(!0),e._renderableChildMap.set(r,o),e.children.push(o),o},t.addMissingNodes=function(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!r||!r.length)return;let o;for(let s=0;s{if(!(!r||!r.length))for(let i=0;i{const i=e.children.findIndex(s=>s===r);if(i<0)return!1;const o=r.getRenderable();return o&&e._renderableChildMap.delete(o),r.delete(),e.children.splice(i,1),!0},t.prepareNodes=()=>{for(let r=0;r{e.visited=r},t.removeUnusedNodes=()=>{let r=0;for(let i=0;i{if(!e.myFactory)return B3("Cannot create view nodes without my own factory"),null;const i=e.myFactory.createNode(r);return i&&i.setRenderable(r),i};const n=t.delete;t.delete=()=>{for(let r=0;r2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,I3,a),V.obj(t,e),V.event(t,e,"event"),e._renderableChildMap=new Map,V.get(t,e,["visited"]),V.setGet(t,e,["_parent","renderable","myFactory"]),V.getArray(t,e,["children"]),V.moveToProtected(t,e,["parent"]),G3(t,e)}var Ct={newInstance:V.newInstance(tl,"vtkViewNode"),extend:tl,PASS_TYPES:U3};function P3(t,e){e.overrides||(e.overrides={}),e.classHierarchy.push("vtkViewNodeFactory"),t.createNode=a=>{if(a.isDeleted())return null;let n=0,r=a.getClassName(n++),i=!1;const o=Object.keys(e.overrides);for(;r&&!i;)o.indexOf(r)!==-1?i=!0:r=a.getClassName(n++);if(!i)return null;const s=e.overrides[r]();return s.setMyFactory(t),s}}const z3={};function nl(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,z3,a),V.obj(t,e),P3(t,e)}var j3={newInstance:V.newInstance(nl,"vtkViewNodeFactory"),extend:nl};const rl=Object.create(null);function st(t,e){rl[t]=e}function W3(t,e){e.classHierarchy.push("vtkOpenGLViewNodeFactory")}const $3={};function al(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,$3,a),e.overrides=rl,j3.extend(t,e,a),W3(t,e)}var H3={newInstance:V.newInstance(al,"vtkOpenGLViewNodeFactory"),extend:al};function K3(t,e){e.classHierarchy.push("vtkOpenGLCamera"),t.buildPass=a=>{a&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.context=e._openGLRenderWindow.getContext())},t.opaquePass=a=>{if(a){const n=e._openGLRenderer.getTiledSizeAndOrigin();e.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),e.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},t.translucentPass=t.opaquePass,t.zBufferPass=t.opaquePass,t.opaqueZBufferPass=t.opaquePass,t.volumePass=t.opaquePass,t.getKeyMatrices=a=>{if(a!==e.lastRenderer||e._openGLRenderWindow.getMTime()>e.keyMatrixTime.getMTime()||t.getMTime()>e.keyMatrixTime.getMTime()||a.getMTime()>e.keyMatrixTime.getMTime()||e.renderable.getMTime()>e.keyMatrixTime.getMTime()){gt(e.keyMatrices.wcvc,e.renderable.getViewMatrix()),Vn(e.keyMatrices.normalMatrix,e.keyMatrices.wcvc),Tn(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix),We(e.keyMatrices.wcvc,e.keyMatrices.wcvc);const n=e._openGLRenderer.getAspectRatio();gt(e.keyMatrices.vcpc,e.renderable.getProjectionMatrix(n,-1,1)),We(e.keyMatrices.vcpc,e.keyMatrices.vcpc),Ee(e.keyMatrices.wcpc,e.keyMatrices.vcpc,e.keyMatrices.wcvc),e.keyMatrixTime.modified(),e.lastRenderer=a}return e.keyMatrices}}const X3={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function q3(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,X3,a),Ct.extend(t,e,a),e.keyMatrixTime={},ut(e.keyMatrixTime),e.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},pt(t,e,["context","keyMatrixTime"]),K3(t,e)}const Y3=Je(q3);st("vtkCamera",Y3);const{vtkDebugMacro:J3}=Dt;function Z3(t,e){e.classHierarchy.push("vtkOpenGLRenderer"),t.buildPass=a=>{if(a){if(!e.renderable)return;t.updateLights(),t.prepareNodes(),t.addMissingNode(e.renderable.getActiveCamera()),t.addMissingNodes(e.renderable.getViewPropsWithNestedProps(),!0),t.removeUnusedNodes()}},t.updateLights=()=>{let a=0;const n=e.renderable.getLightsByReference();for(let r=0;r0&&a++;return a||(J3("No lights are on, creating one."),e.renderable.createLight()),a},t.zBufferPass=a=>{if(a){let n=0;const r=e.context;e.renderable.getTransparent()||(e.context.clearColor(1,0,0,1),n|=r.COLOR_BUFFER_BIT),e.renderable.getPreserveDepthBuffer()||(r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT,e.context.depthMask(!0));const i=t.getTiledSizeAndOrigin();r.enable(r.SCISSOR_TEST),r.scissor(i.lowerLeftU,i.lowerLeftV,i.usize,i.vsize),r.viewport(i.lowerLeftU,i.lowerLeftV,i.usize,i.vsize),r.colorMask(!0,!0,!0,!0),n&&r.clear(n),r.enable(r.DEPTH_TEST)}},t.opaqueZBufferPass=a=>t.zBufferPass(a),t.cameraPass=a=>{a&&t.clear()},t.getAspectRatio=()=>{const a=e._parent.getSizeByReference(),n=e.renderable.getViewportByReference();return a[0]*(n[2]-n[0])/((n[3]-n[1])*a[1])},t.getTiledSizeAndOrigin=()=>{const a=e.renderable.getViewportByReference(),n=[0,0,1,1],r=a[0]-n[0],i=a[1]-n[1],o=e._parent.normalizedDisplayToDisplay(r,i),s=Math.round(o[0]),c=Math.round(o[1]),l=a[2]-n[0],p=a[3]-n[1],u=e._parent.normalizedDisplayToDisplay(l,p);let f=Math.round(u[0])-s,h=Math.round(u[1])-c;return f<0&&(f=0),h<0&&(h=0),{usize:f,vsize:h,lowerLeftU:s,lowerLeftV:c}},t.clear=()=>{let a=0;const n=e.context;if(!e.renderable.getTransparent()){const i=e.renderable.getBackgroundByReference();n.clearColor(i[0],i[1],i[2],i[3]),a|=n.COLOR_BUFFER_BIT}e.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),a|=n.DEPTH_BUFFER_BIT,n.depthMask(!0)),n.colorMask(!0,!0,!0,!0);const r=t.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),n.viewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),a&&n.clear(a),n.enable(n.DEPTH_TEST)},t.releaseGraphicsResources=()=>{e.selector!==null&&e.selector.releaseGraphicsResources(),e.renderable&&e.renderable.getViewProps().forEach(a=>{a.modified()})},t.setOpenGLRenderWindow=a=>{e._openGLRenderWindow!==a&&(t.releaseGraphicsResources(),e._openGLRenderWindow=a,e.context=null,a&&(e.context=e._openGLRenderWindow.getContext()))}}const Q3={context:null,_openGLRenderWindow:null,selector:null};function ev(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Q3,a),Ct.extend(t,e,a),At(t,e,["shaderCache"]),pt(t,e,["selector"]),Ta(t,e,["openGLRenderWindow"]),Z3(t,e)}const tv=Je(ev,"vtkOpenGLRenderer");st("vtkRenderer",tv);function nv(t,e){e.classHierarchy.push("vtkOpenGLActor"),t.buildPass=a=>{if(a){e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNodes(e.renderable.getTextures()),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes(),e.ogltextures=null,e.activeTextures=null;for(let n=0;n{!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseOpaqueZBufferPass=a=>t.traverseOpaquePass(a),t.traverseOpaquePass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||!e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseTranslucentPass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.activateTextures=()=>{if(e.ogltextures){e.activeTextures=[];for(let a=0;a{if(a){if(!e.renderable||!e.renderable.getVisibility())return;e.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},t.zBufferPass=(a,n)=>t.opaquePass(a,n),t.opaqueZBufferPass=(a,n)=>t.opaquePass(a,n),t.opaquePass=(a,n)=>{if(a)e.context.depthMask(!0),t.activateTextures();else if(e.activeTextures)for(let r=0;r{if(a)e.context.depthMask(e._openGLRenderer.getSelector()&&e.renderable.getNestedPickable()),t.activateTextures();else if(e.activeTextures)for(let r=0;r(e.renderable.getMTime()>e.keyMatrixTime.getMTime()&&(e.renderable.computeMatrix(),gt(e.keyMatrices.mcwc,e.renderable.getMatrix()),We(e.keyMatrices.mcwc,e.keyMatrices.mcwc),e.renderable.getIsIdentity()?It(e.keyMatrices.normalMatrix):(Vn(e.keyMatrices.normalMatrix,e.keyMatrices.mcwc),Tn(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix),Br(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix)),e.keyMatrixTime.modified()),e.keyMatrices)}const rv={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};function av(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,rv,a),Ct.extend(t,e,a),e.keyMatrixTime={},ut(e.keyMatrixTime,{mtime:0}),e.keyMatrices={normalMatrix:It(new Float64Array(9)),mcwc:Te(new Float64Array(16))},pt(t,e,["context"]),At(t,e,["activeTextures"]),nv(t,e)}const iv=Je(av);st("vtkActor",iv);function ov(t,e){e.classHierarchy.push("vtkOpenGLActor2D"),t.buildPass=a=>{if(a){if(!e.renderable)return;e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNodes(e.renderable.getTextures()),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes(),e.ogltextures=null,e.activeTextures=null;for(let n=0;n{if(a){if(!e.renderable||!e.renderable.getVisibility())return;n.incrementOverlayActorCount()}},t.traverseOpaquePass=a=>{!e.oglmapper||!e.renderable||!e.renderable.getNestedVisibility()||!e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseTranslucentPass=a=>{!e.oglmapper||!e.renderable||!e.renderable.getNestedVisibility()||e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseOverlayPass=a=>{!e.oglmapper||!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.activateTextures=()=>{if(e.ogltextures){e.activeTextures=[];for(let a=0;a{if(a)e.context.depthMask(!0),t.activateTextures();else if(e.activeTextures)for(let r=0;r{if(a)e.context.depthMask(!1),t.activateTextures();else if(e.activeTextures)for(let r=0;r{if(a)e.context.depthMask(!0),t.activateTextures();else if(e.activeTextures)for(let r=0;r2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,sv,a),Ct.extend(t,e,a),pt(t,e,["context"]),At(t,e,["activeTextures"]),ov(t,e)}const uv=Je(cv);st("vtkActor2D",uv);function Gi(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function lv(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function il(t){let e,a,n;t.length!==2?(e=Gi,a=(s,c)=>Gi(t(s),c),n=(s,c)=>t(s)-c):(e=t===Gi||t===lv?t:fv,a=t,n=t);function r(s,c,l=0,p=s.length){if(l>>1;a(s[u],c)<0?l=u+1:p=u}while(l>>1;a(s[u],c)<=0?l=u+1:p=u}while(ll&&n(s[u-1],c)>-n(s[u],c)?u-1:u}return{left:r,center:o,right:i}}function fv(){return 0}function pv(t){return t===null?NaN:+t}const hv=il(Gi).right;il(pv).center;const gv=hv,dv=Math.sqrt(50),vv=Math.sqrt(10),yv=Math.sqrt(2);function Ii(t,e,a){const n=(e-t)/Math.max(0,a),r=Math.floor(Math.log10(n)),i=n/Math.pow(10,r),o=i>=dv?10:i>=vv?5:i>=yv?2:1;let s,c,l;return r<0?(l=Math.pow(10,-r)/o,s=Math.round(t*l),c=Math.round(e*l),s/le&&--c,l=-l):(l=Math.pow(10,r)*o,s=Math.round(t/l),c=Math.round(e/l),s*le&&--c),c0))return[];if(t===e)return[t];const n=e=r))return[];const s=i-r+1,c=new Array(s);if(n)if(o<0)for(let l=0;l>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):a===8?zi(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):a===4?zi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Tv.exec(t))?new kt(e[1],e[2],e[3],1):(e=wv.exec(t))?new kt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=_v.exec(t))?zi(e[1],e[2],e[3],e[4]):(e=Ev.exec(t))?zi(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Dv.exec(t))?hl(e[1],e[2]/100,e[3]/100,1):(e=Ov.exec(t))?hl(e[1],e[2]/100,e[3]/100,e[4]):sl.hasOwnProperty(t)?ll(sl[t]):t==="transparent"?new kt(NaN,NaN,NaN,0):null}function ll(t){return new kt(t>>16&255,t>>8&255,t&255,1)}function zi(t,e,a,n){return n<=0&&(t=e=a=NaN),new kt(t,e,a,n)}function Nv(t){return t instanceof _a||(t=Oa(t)),t?(t=t.rgb(),new kt(t.r,t.g,t.b,t.opacity)):new kt}function Rs(t,e,a,n){return arguments.length===1?Nv(t):new kt(t,e,a,n??1)}function kt(t,e,a,n){this.r=+t,this.g=+e,this.b=+a,this.opacity=+n}Ns(kt,Rs,ol(_a,{brighter(t){return t=t==null?Pi:Math.pow(Pi,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new kt(ir(this.r),ir(this.g),ir(this.b),ji(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fl,formatHex:fl,formatHex8:Rv,formatRgb:pl,toString:pl}));function fl(){return`#${or(this.r)}${or(this.g)}${or(this.b)}`}function Rv(){return`#${or(this.r)}${or(this.g)}${or(this.b)}${or((isNaN(this.opacity)?1:this.opacity)*255)}`}function pl(){const t=ji(this.opacity);return`${t===1?"rgb(":"rgba("}${ir(this.r)}, ${ir(this.g)}, ${ir(this.b)}${t===1?")":`, ${t})`}`}function ji(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ir(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function or(t){return t=ir(t),(t<16?"0":"")+t.toString(16)}function hl(t,e,a,n){return n<=0?t=e=a=NaN:a<=0||a>=1?t=e=NaN:e<=0&&(t=NaN),new qt(t,e,a,n)}function gl(t){if(t instanceof qt)return new qt(t.h,t.s,t.l,t.opacity);if(t instanceof _a||(t=Oa(t)),!t)return new qt;if(t instanceof qt)return t;t=t.rgb();var e=t.r/255,a=t.g/255,n=t.b/255,r=Math.min(e,a,n),i=Math.max(e,a,n),o=NaN,s=i-r,c=(i+r)/2;return s?(e===i?o=(a-n)/s+(a0&&c<1?0:o,new qt(o,s,c,t.opacity)}function Lv(t,e,a,n){return arguments.length===1?gl(t):new qt(t,e,a,n??1)}function qt(t,e,a,n){this.h=+t,this.s=+e,this.l=+a,this.opacity=+n}Ns(qt,Lv,ol(_a,{brighter(t){return t=t==null?Pi:Math.pow(Pi,t),new qt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new qt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,a=this.l,n=a+(a<.5?a:1-a)*e,r=2*a-n;return new kt(Ls(t>=240?t-240:t+120,r,n),Ls(t,r,n),Ls(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new qt(dl(this.h),Wi(this.s),Wi(this.l),ji(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ji(this.opacity);return`${t===1?"hsl(":"hsla("}${dl(this.h)}, ${Wi(this.s)*100}%, ${Wi(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dl(t){return t=(t||0)%360,t<0?t+360:t}function Wi(t){return Math.max(0,Math.min(1,t||0))}function Ls(t,e,a){return(t<60?e+(a-e)*t/60:t<180?a:t<240?e+(a-e)*(240-t)/60:e)*255}const Fs=t=>()=>t;function Fv(t,e){return function(a){return t+a*e}}function kv(t,e,a){return t=Math.pow(t,a),e=Math.pow(e,a)-t,a=1/a,function(n){return Math.pow(t+n*e,a)}}function Vv(t){return(t=+t)==1?vl:function(e,a){return a-e?kv(e,a,t):Fs(isNaN(e)?a:e)}}function vl(t,e){var a=e-t;return a?Fv(t,a):Fs(isNaN(t)?e:t)}const yl=function t(e){var a=Vv(e);function n(r,i){var o=a((r=Rs(r)).r,(i=Rs(i)).r),s=a(r.g,i.g),c=a(r.b,i.b),l=vl(r.opacity,i.opacity);return function(p){return r.r=o(p),r.g=s(p),r.b=c(p),r.opacity=l(p),r+""}}return n.gamma=t,n}(1);function Av(t,e){e||(e=[]);var a=t?Math.min(e.length,t.length):0,n=e.slice(),r;return function(i){for(r=0;ra&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,c.push({i:o,x:$i(n,r)})),a=Vs.lastIndex;return ae&&(a=t,t=e,e=a),function(n){return Math.max(t,Math.min(e,n))}}function Xv(t,e,a){var n=t[0],r=t[1],i=e[0],o=e[1];return r2?qv:Xv,c=l=null,u}function u(f){return f==null||isNaN(f=+f)?i:(c||(c=s(t.map(n),e,a)))(n(o(f)))}return u.invert=function(f){return o(r((l||(l=s(e,t.map(n),$i)))(f)))},u.domain=function(f){return arguments.length?(t=Array.from(f,Hv),p()):t.slice()},u.range=function(f){return arguments.length?(e=Array.from(f),p()):e.slice()},u.rangeRound=function(f){return e=Array.from(f),a=Wv,p()},u.clamp=function(f){return arguments.length?(o=f?!0:Xr,p()):o!==Xr},u.interpolate=function(f){return arguments.length?(a=f,p()):a},u.unknown=function(f){return arguments.length?(i=f,u):i},function(f,h){return n=f,r=h,p()}}function Zv(){return Jv()(Xr,Xr)}function Qv(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Hi(t,e){if((a=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var a,n=t.slice(0,a);return[n.length>1?n[0]+n.slice(2):n,+t.slice(a+1)]}function qr(t){return t=Hi(Math.abs(t)),t?t[1]:NaN}function ey(t,e){return function(a,n){for(var r=a.length,i=[],o=0,s=t[0],c=0;r>0&&s>0&&(c+s+1>n&&(s=Math.max(1,n-c)),i.push(a.substring(r-=s,r+s)),!((c+=s+1)>n));)s=t[o=(o+1)%t.length];return i.reverse().join(e)}}function ty(t){return function(e){return e.replace(/[0-9]/g,function(a){return t[+a]})}}var ny=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ki(t){if(!(e=ny.exec(t)))throw new Error("invalid format: "+t);var e;return new Us({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ki.prototype=Us.prototype;function Us(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Us.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ry(t){e:for(var e=t.length,a=1,n=-1,r;a0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(r+1):t}var xl;function ay(t,e){var a=Hi(t,e);if(!a)return t+"";var n=a[0],r=a[1],i=r-(xl=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Hi(t,Math.max(0,e+i-1))[0]}function Cl(t,e){var a=Hi(t,e);if(!a)return t+"";var n=a[0],r=a[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}const Sl={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Qv,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Cl(t*100,e),r:Cl,s:ay,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Tl(t){return t}var wl=Array.prototype.map,_l=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iy(t){var e=t.grouping===void 0||t.thousands===void 0?Tl:ey(wl.call(t.grouping,Number),t.thousands+""),a=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?Tl:ty(wl.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function l(u){u=Ki(u);var f=u.fill,h=u.align,d=u.sign,v=u.symbol,m=u.zero,x=u.width,y=u.comma,g=u.precision,C=u.trim,S=u.type;S==="n"?(y=!0,S="g"):Sl[S]||(g===void 0&&(g=12),C=!0,S="g"),(m||f==="0"&&h==="=")&&(m=!0,f="0",h="=");var T=v==="$"?a:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",w=v==="$"?n:/[%p]/.test(S)?o:"",_=Sl[S],E=/[defgprs%]/.test(S);g=g===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function D(O){var M=T,N=w,R,B,I;if(S==="c")N=_(O)+N,O="";else{O=+O;var P=O<0||1/O<0;if(O=isNaN(O)?c:_(Math.abs(O),g),C&&(O=ry(O)),P&&+O==0&&d!=="+"&&(P=!1),M=(P?d==="("?d:s:d==="-"||d==="("?"":d)+M,N=(S==="s"?_l[8+xl/3]:"")+N+(P&&d==="("?")":""),E){for(R=-1,B=O.length;++RI||I>57){N=(I===46?r+O.slice(R+1):O.slice(R))+N,O=O.slice(0,R);break}}}y&&!m&&(O=e(O,1/0));var L=M.length+O.length+N.length,k=L>1)+M+O+N+k.slice(L);break;default:O=k+M+O+N;break}return i(O)}return D.toString=function(){return u+""},D}function p(u,f){var h=l((u=Ki(u),u.type="f",u)),d=Math.max(-8,Math.min(8,Math.floor(qr(f)/3)))*3,v=Math.pow(10,-d),m=_l[8+d/3];return function(x){return h(v*x)+m}}return{format:l,formatPrefix:p}}var Xi,El,Dl;oy({thousands:",",grouping:[3],currency:["$",""]});function oy(t){return Xi=iy(t),El=Xi.format,Dl=Xi.formatPrefix,Xi}function sy(t){return Math.max(0,-qr(Math.abs(t)))}function cy(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qr(e)/3)))*3-qr(Math.abs(t)))}function uy(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qr(e)-qr(t))+1}function ly(t,e,a,n){var r=xv(t,e,a),i;switch(n=Ki(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(i=cy(r,o))&&(n.precision=i),Dl(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=uy(r,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=sy(r))&&(n.precision=i-(n.type==="%")*2);break}}return El(n)}function fy(t){var e=t.domain;return t.ticks=function(a){var n=e();return mv(n[0],n[n.length-1],a??10)},t.tickFormat=function(a,n){var r=e();return ly(r[0],r[r.length-1],a??10,n)},t.nice=function(a){a==null&&(a=10);var n=e(),r=0,i=n.length-1,o=n[r],s=n[i],c,l,p=10;for(s0;){if(l=Ms(o,s,a),l===c)return n[r]=o,n[i]=s,e(n);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return t},t}function Gs(){var t=Zv();return t.copy=function(){return Yv(t,Gs())},Cv.apply(t,arguments),fy(t)}var Is={},py={get exports(){return Is},set exports(t){Is=t}};(function(t){(function(e,a,n){function r(c){var l=this,p=s();l.next=function(){var u=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=u-(l.c=u|0)},l.c=1,l.s0=p(" "),l.s1=p(" "),l.s2=p(" "),l.s0-=p(c),l.s0<0&&(l.s0+=1),l.s1-=p(c),l.s1<0&&(l.s1+=1),l.s2-=p(c),l.s2<0&&(l.s2+=1),p=null}function i(c,l){return l.c=c.c,l.s0=c.s0,l.s1=c.s1,l.s2=c.s2,l}function o(c,l){var p=new r(c),u=l&&l.state,f=p.next;return f.int32=function(){return p.next()*4294967296|0},f.double=function(){return f()+(f()*2097152|0)*11102230246251565e-32},f.quick=f,u&&(typeof u=="object"&&i(u,p),f.state=function(){return i(p,{})}),f}function s(){var c=4022871197,l=function(p){p=String(p);for(var u=0;u>>0,f-=c,f*=c,c=f>>>0,f-=c,c+=f*4294967296}return(c>>>0)*23283064365386963e-26};return l}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.alea=o})(Vt,t,!1)})(py);var Ps={},hy={get exports(){return Ps},set exports(t){Ps=t}};(function(t){(function(e,a,n){function r(s){var c=this,l="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var u=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^u^u>>>8},s===(s|0)?c.x=s:l+=s;for(var p=0;p>>0)/4294967296};return u.double=function(){do var f=l.next()>>>11,h=(l.next()>>>0)/4294967296,d=(f+h)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,p&&(typeof p=="object"&&i(p,l),u.state=function(){return i(l,{})}),u}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xor128=o})(Vt,t,!1)})(hy);var zs={},gy={get exports(){return zs},set exports(t){zs=t}};(function(t){(function(e,a,n){function r(s){var c=this,l="";c.next=function(){var u=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(u^u<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,s===(s|0)?c.x=s:l+=s;for(var p=0;p>>4),c.next()}function i(s,c){return c.x=s.x,c.y=s.y,c.z=s.z,c.w=s.w,c.v=s.v,c.d=s.d,c}function o(s,c){var l=new r(s),p=c&&c.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var f=l.next()>>>11,h=(l.next()>>>0)/4294967296,d=(f+h)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,p&&(typeof p=="object"&&i(p,l),u.state=function(){return i(l,{})}),u}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xorwow=o})(Vt,t,!1)})(gy);var js={},dy={get exports(){return js},set exports(t){js=t}};(function(t){(function(e,a,n){function r(s){var c=this;c.next=function(){var p=c.x,u=c.i,f,h;return f=p[u],f^=f>>>7,h=f^f<<24,f=p[u+1&7],h^=f^f>>>10,f=p[u+3&7],h^=f^f>>>3,f=p[u+4&7],h^=f^f<<7,f=p[u+7&7],f=f^f<<13,h^=f^f<<9,p[u]=h,c.i=u+1&7,h};function l(p,u){var f,h=[];if(u===(u|0))h[0]=u;else for(u=""+u,f=0;f0;--f)p.next()}l(c,s)}function i(s,c){return c.x=s.x.slice(),c.i=s.i,c}function o(s,c){s==null&&(s=+new Date);var l=new r(s),p=c&&c.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var f=l.next()>>>11,h=(l.next()>>>0)/4294967296,d=(f+h)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,p&&(p.x&&i(p,l),u.state=function(){return i(l,{})}),u}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xorshift7=o})(Vt,t,!1)})(dy);var Ws={},vy={get exports(){return Ws},set exports(t){Ws=t}};(function(t){(function(e,a,n){function r(s){var c=this;c.next=function(){var p=c.w,u=c.X,f=c.i,h,d;return c.w=p=p+1640531527|0,d=u[f+34&127],h=u[f=f+1&127],d^=d<<13,h^=h<<17,d^=d>>>15,h^=h>>>12,d=u[f]=d^h,c.i=f,d+(p^p>>>16)|0};function l(p,u){var f,h,d,v,m,x=[],y=128;for(u===(u|0)?(h=u,u=null):(u=u+"\0",h=0,y=Math.max(y,u.length)),d=0,v=-32;v>>15,h^=h<<4,h^=h>>>13,v>=0&&(m=m+1640531527|0,f=x[v&127]^=h+m,d=f==0?d+1:0);for(d>=128&&(x[(u&&u.length||0)&127]=-1),d=127,v=4*128;v>0;--v)h=x[d+34&127],f=x[d=d+1&127],h^=h<<13,f^=f<<17,h^=h>>>15,f^=f>>>12,x[d]=h^f;p.w=m,p.X=x,p.i=d}l(c,s)}function i(s,c){return c.i=s.i,c.w=s.w,c.X=s.X.slice(),c}function o(s,c){s==null&&(s=+new Date);var l=new r(s),p=c&&c.state,u=function(){return(l.next()>>>0)/4294967296};return u.double=function(){do var f=l.next()>>>11,h=(l.next()>>>0)/4294967296,d=(f+h)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,p&&(p.X&&i(p,l),u.state=function(){return i(l,{})}),u}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xor4096=o})(Vt,t,!1)})(vy);var $s={},yy={get exports(){return $s},set exports(t){$s=t}};(function(t){(function(e,a,n){function r(s){var c=this,l="";c.next=function(){var u=c.b,f=c.c,h=c.d,d=c.a;return u=u<<25^u>>>7^f,f=f-h|0,h=h<<24^h>>>8^d,d=d-u|0,c.b=u=u<<20^u>>>12^f,c.c=f=f-h|0,c.d=h<<16^f>>>16^d,c.a=d-u|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,s===Math.floor(s)?(c.a=s/4294967296|0,c.b=s|0):l+=s;for(var p=0;p>>0)/4294967296};return u.double=function(){do var f=l.next()>>>11,h=(l.next()>>>0)/4294967296,d=(f+h)/(1<<21);while(d===0);return d},u.int32=l.next,u.quick=u,p&&(typeof p=="object"&&i(p,l),u.state=function(){return i(l,{})}),u}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.tychei=o})(Vt,t,!1)})(yy);var Hs={},my={get exports(){return Hs},set exports(t){Hs=t}};const xy=G2(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(t){(function(e,a,n){var r=256,i=6,o=52,s="random",c=n.pow(r,i),l=n.pow(2,o),p=l*2,u=r-1,f;function h(C,S,T){var w=[];S=S==!0?{entropy:!0}:S||{};var _=x(m(S.entropy?[C,g(a)]:C??y(),3),w),E=new d(w),D=function(){for(var O=E.g(i),M=c,N=0;O=p;)O/=2,M/=2,N>>>=1;return(O+N)/M};return D.int32=function(){return E.g(4)|0},D.quick=function(){return E.g(4)/4294967296},D.double=D,x(g(E.S),a),(S.pass||T||function(O,M,N,R){return R&&(R.S&&v(R,E),O.state=function(){return v(E,{})}),N?(n[s]=O,M):O})(D,_,"global"in S?S.global:this==n,S.state)}function d(C){var S,T=C.length,w=this,_=0,E=w.i=w.j=0,D=w.S=[];for(T||(C=[T++]);_bl(`vtkMath::${t} - NOT IMPLEMENTED`)}function Ma(t,e,a,n){let r;for(let i=0;i0&&arguments[0]!==void 0?arguments[0]:3;const e=Array(t);for(let a=0;aMath.PI;function by(t,e){return e>1023?t*2**1023*2**(e-1023):e<-1074?t*2**-1074*2**(e+1074):t*2**e}function Qe(t){return t/180*Math.PI}function Ra(t){return t*180/Math.PI}const{round:La,floor:Ys,ceil:My,min:Ny,max:Ry}=Math;function Ly(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=1/0;for(let r=e,i=t.length;r1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=-1/0;for(let r=e,i=t.length;r1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=1/0,r=-1/0;for(let i=e,o=t.length;i=0;--r)if(a[r]0&&arguments[0]!==void 0?arguments[0]:0;const a=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:1)-t;return t+a*Math.random()}const zy=ba("gaussian");function ur(t,e,a){return a[0]=t[0]+e[0],a[1]=t[1]+e[1],a[2]=t[2]+e[2],a}function He(t,e,a){return a[0]=t[0]-e[0],a[1]=t[1]-e[1],a[2]=t[2]-e[2],a}function Js(t,e){return t[0]*=e,t[1]*=e,t[2]*=e,t}function Rl(t,e){return t[0]*=e,t[1]*=e,t}function Zs(t,e,a,n){return n[0]=t[0]+e[0]*a,n[1]=t[1]+e[1]*a,n[2]=t[2]+e[2]*a,n}function jy(t,e,a,n){return n[0]=t[0]+e[0]*a,n[1]=t[1]+e[1]*a,n}function xe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Wy(t,e,a){a[0]=t[0]*e[0],a[1]=t[0]*e[1],a[2]=t[0]*e[2],a[3]=t[1]*e[0],a[4]=t[1]*e[1],a[5]=t[1]*e[2],a[6]=t[2]*e[0],a[7]=t[2]*e[1],a[8]=t[2]*e[2]}function et(t,e,a){const n=t[1]*e[2]-t[2]*e[1],r=t[2]*e[0]-t[0]*e[2],i=t[0]*e[1]-t[1]*e[0];return a[0]=n,a[1]=r,a[2]=i,a}function St(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;switch(e){case 1:return Math.abs(t);case 2:return Math.sqrt(t[0]*t[0]+t[1]*t[1]);case 3:return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);default:{let a=0;for(let n=0;ni&&r>o?(c=0,l=1,p=2):i>o?(c=1,l=2,p=0):(c=2,l=0,p=1);const u=t[c]/s,f=t[l]/s,h=t[p]/s,d=Math.sqrt(u*u+h*h);if(n!==0){const v=Math.sin(n),m=Math.cos(n);e&&(e[c]=(h*m-u*f*v)/d,e[l]=v*d,e[p]=(-(u*m)-f*h*v)/d),a&&(a[c]=(-(h*v)-u*f*m)/d,a[l]=m*d,a[p]=(u*v-f*h*m)/d)}else e&&(e[c]=h/d,e[l]=0,e[p]=-u/d),a&&(a[c]=-u*f/d,a[l]=d,a[p]=-f*h/d)}function Ky(t,e,a){const n=xe(e,e);if(n===0)return a[0]=0,a[1]=0,a[2]=0,!1;const r=xe(t,e)/n;for(let i=0;i<3;i++)a[i]=e[i];return Js(a,r),!0}function Qs(t,e){return t[0]*e[0]+t[1]*e[1]}function Xy(t,e,a){const n=Qs(e,e);if(n===0)return a[0]=0,a[1]=0,!1;const r=Qs(t,e)/n;for(let i=0;i<2;i++)a[i]=e[i];return Rl(a,r),!0}function dt(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])+(t[2]-e[2])*(t[2]-e[2])}function qy(t,e){const a=[0,0,0];return et(t,e,a),Math.atan2(St(a),xe(t,e))}function Yy(t,e,a){const n=Math.abs(t-a);return 1/Math.sqrt(2*Math.PI*e)*Math.exp(-(n**2)/(2*e))}function Jy(t,e,a){const n=Math.abs(t-a);return Math.exp(-(n**2)/(2*e))}function Zy(t,e,a){a[0]=t[0]*e[0],a[1]=t[0]*e[1],a[2]=t[1]*e[0],a[3]=t[1]*e[1]}function Ll(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Fl(t){const e=Ll(t);return e!==0&&(t[0]/=e,t[1]/=e),e}function it(){for(var t=arguments.length,e=new Array(t),a=0;ar&&(r=n),(n=Math.abs(t[o*3+2]))>r&&(r=n),i[o]=1/r;r=i[0]*Math.abs(t[0]),a=0,(n=i[1]*Math.abs(t[3]))>=r&&(r=n,a=1),(n=i[2]*Math.abs(t[6]))>=r&&(a=2),a!==0&&(Ma(t,3,a,0),i[a]=i[0]),e[0]=a,t[3]/=t[0],t[6]/=t[0],t[4]-=t[3]*t[1],t[7]-=t[6]*t[1],r=i[1]*Math.abs(t[4]),a=1,(n=i[2]*Math.abs(t[7]))>=r&&(a=2,Ma(t,3,1,2),i[2]=i[1]),e[1]=a,t[7]/=t[4],t[5]-=t[3]*t[2],t[8]-=t[6]*t[2]+t[7]*t[5],e[2]=2}function em(t,e,a){let n=a[e[0]];a[e[0]]=a[0],a[0]=n,n=a[e[1]],a[e[1]]=a[1],a[1]=n-t[3]*a[0],n=a[e[2]],a[e[2]]=a[2],a[2]=n-t[6]*a[0]-t[7]*a[1],a[2]/=t[8],a[1]=(a[1]-t[5]*a[2])/t[4],a[0]=(a[0]-t[1]*a[1]-t[2]*a[2])/t[0]}function tm(t,e,a){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],c=t[5],l=t[6],p=t[7],u=t[8],f=+it(s,p,c,u),h=-it(o,l,c,u),d=+it(o,l,s,p),v=-it(r,p,i,u),m=+it(n,l,i,u),x=-it(n,l,r,p),y=+it(r,s,i,c),g=-it(n,o,i,c),C=+it(n,o,r,s),S=n*f+r*h+i*d,T=f*e[0]+v*e[1]+y*e[2],w=h*e[0]+m*e[1]+g*e[2],_=d*e[0]+x*e[1]+C*e[2];a[0]=T/S,a[1]=w/S,a[2]=_/S}function Yi(t,e,a){const n=t[0]*e[0]+t[1]*e[1]+t[2]*e[2],r=t[3]*e[0]+t[4]*e[1]+t[5]*e[2],i=t[6]*e[0]+t[7]*e[1]+t[8]*e[2];a[0]=n,a[1]=r,a[2]=i}function e0(t,e,a){const n=[...t],r=[...e];for(let i=0;i<3;i++)a[i]=n[0]*r[i]+n[1]*r[i+3]+n[2]*r[i+6],a[i+3]=n[3]*r[i]+n[4]*r[i+3]+n[5]*r[i+6],a[i+6]=n[6]*r[i]+n[7]*r[i+3]+n[8]*r[i+6]}function nm(t,e,a,n,r,i,o){n!==r&&bl("Number of columns of A must match number of rows of B.");const s=[...t],c=[...e];for(let l=0;l2&&arguments[2]!==void 0?arguments[2]:Xs;if(t.length!==e.length)return!1;function n(r,i){return Math.abs(r-e[i])<=a}return t.every(n)}const Jr=kl;function Vl(t){for(let e=0;e<3;e++)t[e*3]=t[e*3+1]=t[e*3+2]=0,t[e*3+e]=1}function Al(t,e){for(let a=0;a1&&arguments[1]!==void 0?arguments[1]:Xs;return Jr(t,Ks,e)}function im(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xs;return Jr(t,Dy,e)}function Bl(t,e){const a=t[0]*t[0],n=t[0]*t[1],r=t[0]*t[2],i=t[0]*t[3],o=t[1]*t[1],s=t[2]*t[2],c=t[3]*t[3],l=t[1]*t[2],p=t[1]*t[3],u=t[2]*t[3],f=o+s+c;let h=1/(a+f);const d=(a-f)*h;h*=2,e[0]=o*h+d,e[3]=(l+i)*h,e[6]=(p-r)*h,e[1]=(l-i)*h,e[4]=s*h+d,e[7]=(u+n)*h,e[2]=(p+r)*h,e[5]=(u-n)*h,e[8]=c*h+d}function Zi(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!`${t}`.includes("e"))return+`${Math.round(`${t}e+${e}`)}e-${e}`;const a=`${t}`.split("e");let n="";return+a[1]+e>0&&(n="+"),+`${Math.round(`${+a[0]}e${n}${+a[1]+e}`)}e-${e}`}function t0(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return e[0]=Zi(t[0],a),e[1]=Zi(t[1],a),e[2]=Zi(t[2],a),e}function ka(t,e,a,n){let r,i,o,s,c,l,p,u,f,h,d,v,m,x,y,g;const C=Ze(e),S=Ze(e),T=(_,E,D)=>{x=_[E],m=_[D],_[E]=x-v*(m+x*h),_[D]=m+v*(x-m*h)};for(Al(e,n),c=0;c3&&Math.abs(a[c])+x===Math.abs(a[c])&&Math.abs(a[s])+x===Math.abs(a[s]))t[c*e+s]=0;else if(Math.abs(t[c*e+s])>p){for(m=a[s]-a[c],Math.abs(m)+x===Math.abs(m)?f=t[c*e+s]/m:(u=.5*m/t[c*e+s],f=1/(Math.abs(u)+Math.sqrt(1+u*u)),u<0&&(f=-f)),y=1/Math.sqrt(1+f*f),v=f*y,h=v/(1+y),m=f*t[c*e+s],S[c]-=m,S[s]+=m,a[c]-=m,a[s]+=m,t[c*e+s]=0,i=0;i<=c-1;i++)T(t,i*e+c,i*e+s);for(i=c+1;i<=s-1;i++)T(t,c*e+i,i*e+s);for(i=s+1;i=Nl)return cr("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(i=0;i=g||Math.abs(a[r]-g)>1)+(e&1);for(l=0,r=0;r=0&&l++;if(lh?d:h,r=v>r?v:r,a[f]=1,r!==0&&(a[f]/=r)}const i=Math.abs(e[0])*a[0],o=Math.abs(e[3])*a[1],s=Math.abs(e[6])*a[2];n[0]=0,r=i,o>=r&&(r=o,n[0]=1),s>=r&&(n[0]=2),n[0]!==0&&(Na(e,3,n[0],0),a[n[0]]=a[0]);const c=Math.abs(e[4])*a[1],l=Math.abs(e[7])*a[2];n[1]=1,r=c,l>=r&&(n[1]=2,Na(e,3,1,2)),n[2]=2;let p=0;if(Ji(e)<0){p=1;for(let f=0;f<9;f++)e[f]=-e[f]}const u=Ze(4);if(Ul(e,u),Bl(u,e),p)for(let f=0;f<9;f++)e[f]=-e[f];n[1]!==1&&Na(e,3,n[1],1),n[0]!==0&&Na(e,3,n[0],0)}function Il(t,e,a){let n,r,i,o,s,c;const l=[...t];if(ka(l,3,e,a),e[0]===e[1]&&e[0]===e[2]){Vl(a);return}for(Yr(a,a),n=0;n<3;n++)if(e[(n+1)%3]===e[(n+2)%3]){for(c=Math.abs(a[n*3]),o=0,r=1;r<3;r++)c<(s=Math.abs(a[n*3+r]))&&(c=s,o=r);o!==n&&(s=e[o],e[o]=e[n],e[n]=s,Ma(a,3,n,o)),a[o*3+o]<0&&(a[o*3]=-a[o*3],a[o*3+1]=-a[o*3+1],a[o*3+2]=-a[o*3+2]),r=(o+1)%3,i=(o+2)%3,a[r*3]=0,a[r*3+1]=0,a[r*3+2]=0,a[r*3+r]=1;const p=et([a[o*3],a[o*3+1],a[o*3+2]],[a[r*3],a[r*3+1],a[r*3+2]],[]);Ke(p);const u=et(p,[a[o*3],a[o*3+1],a[o*3+2]],[]);for(let f=0;f<3;f++)a[i*3+f]=p[f],a[r*3+f]=u[f];Yr(a,a);return}for(c=Math.abs(a[0]),o=0,n=1;n<3;n++)c<(s=Math.abs(a[n*3]))&&(c=s,o=n);if(o!==0){const p=e[o];e[o]=e[0],e[0]=p,Ma(a,3,o,0)}if(Math.abs(a[4])o&&(o=p);if(o===0)return cr("Unable to factor linear system"),0;u[n]=1/o}for(r=0;r=o&&(o=l,s=n)}if(r!==s){for(i=0;i=0)for(i=o;i<=r-1;i++)c-=t[r*n+i]*a[i];else c!==0&&(o=r);a[r]=c}for(r=n-1;r>=0;r--){for(c=a[r],i=r+1;i3&&arguments[3]!==void 0?arguments[3]:null,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;const i=n||Ze(a),o=r||Ze(a);if(n0(t,i,a)===0)return null;for(let s=0;sn&&(n=Math.abs(t[r*e+i]));for(let r=0;r6&&arguments[6]!==void 0?arguments[6]:!0;if(tqs&&(c=0,s[f]=0);if(c&&r===1)return cr("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),i0(t,e,a,i);if(c)d=1;else for(f=0;f1&&arguments[1]!==void 0?arguments[1]:[0,.5,1];switch(t.length){case 3:return e[0]=parseInt(t[0],16)*17/255,e[1]=parseInt(t[1],16)*17/255,e[2]=parseInt(t[2],16)*17/255,e;case 4:return e[0]=parseInt(t[1],16)*17/255,e[1]=parseInt(t[2],16)*17/255,e[2]=parseInt(t[3],16)*17/255,e;case 6:return e[0]=parseInt(t.substr(0,2),16)/255,e[1]=parseInt(t.substr(2,2),16)/255,e[2]=parseInt(t.substr(4,2),16)/255,e;case 7:return e[0]=parseInt(t.substr(1,2),16)/255,e[1]=parseInt(t.substr(3,2),16)/255,e[2]=parseInt(t.substr(5,2),16)/255,e;case 9:return e[0]=parseInt(t.substr(1,2),16)/255,e[1]=parseInt(t.substr(3,2),16)/255,e[2]=parseInt(t.substr(5,2),16)/255,e[3]=parseInt(t.substr(7,2),16)/255,e;default:return e}}function Va(t,e){let a,n;const[r,i,o]=t,s=1/3,c=1/6,l=2/3;let p=r,u=r;i>p?p=i:ip?p=o:o0?n=(p-u)/p:n=0,n>0?(r===p?a=c*(i-o)/(p-u):i===p?a=s+c*(o-r)/(p-u):a=l+c*(r-i)/(p-u),a<0&&(a+=1)):a=0,e[0]=a,e[1]=n,e[2]=f}function lr(t,e){const[a,n,r]=t,i=1/3,o=1/6,s=2/3,c=5/6;let l,p,u;a>o&&a<=i?(p=1,l=(i-a)/o,u=0):a>i&&a<=.5?(p=1,u=(a-i)/o,l=0):a>.5&&a<=s?(u=1,p=(s-a)/o,l=0):a>s&&a<=c?(u=1,l=(a-s)/o,p=0):a>c&&a<=1?(l=1,u=(1-a)/o,p=0):(l=1,p=a/o,u=0),l=n*l+(1-n),p=n*p+(1-n),u=n*u+(1-n),l*=r,p*=r,u*=r,e[0]=l,e[1]=p,e[2]=u}function zl(t,e){const[a,n,r]=t;let i=(a+16)/116,o=n/500+i,s=i-r/200;i**3>.008856?i**=3:i=(i-16/116)/7.787,o**3>.008856?o**=3:o=(o-16/116)/7.787,s**3>.008856?s**=3:s=(s-16/116)/7.787;const c=.9505,l=1,p=1.089;e[0]=c*o,e[1]=l*i,e[2]=p*s}function jl(t,e){const[a,n,r]=t,i=.9505,o=1,s=1.089;let c=a/i,l=n/o,p=r/s;c>.008856?c**=1/3:c=7.787*c+16/116,l>.008856?l**=1/3:l=7.787*l+16/116,p>.008856?p**=1/3:p=7.787*p+16/116,e[0]=116*l-16,e[1]=500*(c-l),e[2]=200*(l-p)}function Wl(t,e){const[a,n,r]=t;let i=a*3.2406+n*-1.5372+r*-.4986,o=a*-.9689+n*1.8758+r*.0415,s=a*.0557+n*-.204+r*1.057;i>.0031308?i=1.055*i**(1/2.4)-.055:i*=12.92,o>.0031308?o=1.055*o**(1/2.4)-.055:o*=12.92,s>.0031308?s=1.055*s**(1/2.4)-.055:s*=12.92;let c=i;c1&&(i/=c,o/=c,s/=c),i<0&&(i=0),o<0&&(o=0),s<0&&(s=0),e[0]=i,e[1]=o,e[2]=s}function $l(t,e){let[a,n,r]=t;a>.04045?a=((a+.055)/1.055)**2.4:a/=12.92,n>.04045?n=((n+.055)/1.055)**2.4:n/=12.92,r>.04045?r=((r+.055)/1.055)**2.4:r/=12.92,e[0]=a*.4124+n*.3576+r*.1805,e[1]=a*.2126+n*.7152+r*.0722,e[2]=a*.0193+n*.1192+r*.9505}function fr(t,e){const a=[0,0,0];$l(t,a),jl(a,e)}function Qi(t,e){const a=[0,0,0];zl(t,a),Wl(a,e)}function o0(t){return t[0]=1,t[1]=-1,t[2]=1,t[3]=-1,t[4]=1,t[5]=-1,t}function eo(t){return!(t[1]-t[0]<0)}function pm(t,e,a){return a[0]=Math.min(t[0],e[0]),a[1]=Math.max(t[0],e[0]),a[2]=Math.min(t[1],e[1]),a[3]=Math.max(t[1],e[1]),a[4]=Math.min(t[2],e[2]),a[5]=Math.max(t[2],e[2]),a}function Yt(t,e,a){return ta?a:t}function s0(t,e,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[0,0,0];return n[0]=Yt(t[0],e[0],a[0]),n[1]=Yt(t[1],e[1],a[1]),n[2]=Yt(t[2],e[2],a[2]),n}function hm(t,e){let a=0;return e[0]!==e[1]&&(te[1]?a=e[1]:a=t,a=(a-e[0])/(e[1]-e[0])),a}const gm=ba("GetScalarTypeFittingRange"),dm=ba("GetAdjustedScalarRange");function vm(t,e){if(!t||!e)return 0;for(let a=0;a<6;a+=2)if(t[a]e[a+1]||t[a+1]e[a+1])return 0;return 1}function ym(t,e,a){if(!t||!e)return 0;for(let n=0;n<6;n+=2)if(t[n]+a[n/2]e[n+1]||t[n+1]+a[n/2]e[n+1])return 0;return 1}function mm(t,e,a){if(!t||!e||!a)return 0;for(let n=0;n<3;n++)if(t[n]+a[n]e[2*n+1])return 0;return 1}function xm(t,e,a,n){const r=Ze(3),i=Ze(3),o=Ze(3),s=Ze(3),c=Ze(3),l=Ze(3);for(let C=0;C<3;++C)r[C]=t[C]-e[C],i[C]=e[C]-a[C],o[C]=a[C]-t[C],s[C]=-r[C],c[C]=-i[C],l[C]=-o[C];const p=St(s),u=St(c),f=St(o),h=Ze(3);et(r,i,h);const d=St(h),v=p*u*f/(2*d),m=2*d*d,x=u*u*xe(r,l)/m,y=f*f*xe(s,i)/m,g=p*p*xe(o,c)/m;for(let C=0;C<3;++C)n[C]=x*t[C]+y*e[C]+g*a[C];return v}const Cm=1/0,Sm=-1/0,Hl=t=>!Number.isFinite(t),{isFinite:Tm,isNaN:c0}=Number,to=c0;function In(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function wm(t){let e=-1,a=-1;for(let n=0;ne&&(a=n,e=r)}return a}function Kl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;const a=new Array(e),n=new Array(e);for(let i=0;i0;i--){let o=-1/0,s=0,c=0;for(let l=0;l<=i;++l){const p=a[l];for(let u=0;u<=i;++u){const f=n[u],h=Math.abs(t[p+e*f]);h>o&&(o=h,s=l,c=u)}}[a[i],a[s]]=[a[s],a[i]],[n[i],n[c]]=[n[c],n[i]]}const r=new Array(e*e).fill(0);for(let i=0;i15?e.toString(16):`0${e.toString(16)}`}function _m(t){return`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#"}${t.map(Xl).join("")}`}function no(t){return Math.round(t*255)}function Em(t){return t.length===3?`rgb(${t.map(no).join(", ")})`:`rgba(${no(t[0]||0)}, ${no(t[1]||0)}, ${no(t[2]||0)}, ${t[3]||0})`}var Mt={Pi:Oy,ldexp:by,radiansFromDegrees:Qe,degreesFromRadians:Ra,round:La,floor:Ys,ceil:My,ceilLog2:Vy,min:Ny,max:Ry,arrayMin:Ly,arrayMax:Fy,arrayRange:ky,isPowerOfTwo:Fa,nearestPowerOfTwo:Pt,factorial:Ay,binomial:By,beginCombination:Uy,nextCombination:Gy,randomSeed:Iy,getSeed:Py,random:qi,gaussian:zy,add:ur,subtract:He,multiplyScalar:Js,multiplyScalar2D:Rl,multiplyAccumulate:Zs,multiplyAccumulate2D:jy,dot:xe,outer:Wy,cross:et,norm:St,normalize:Ke,perpendiculars:Hy,projectVector:Ky,projectVector2D:Xy,distance2BetweenPoints:dt,angleBetweenVectors:qy,gaussianAmplitude:Yy,gaussianWeight:Jy,dot2D:Qs,outer2D:Zy,norm2D:Ll,normalize2D:Fl,determinant2x2:it,LUFactor3x3:Qy,LUSolve3x3:em,linearSolve3x3:tm,multiply3x3_vect3:Yi,multiply3x3_mat3:e0,multiplyMatrix:nm,transpose3x3:Yr,invert3x3:rm,identity3x3:Vl,identity:Al,isIdentity:am,isIdentity3x3:im,determinant3x3:Ji,quaternionToMatrix3x3:Bl,areEquals:kl,areMatricesEqual:Jr,roundNumber:Zi,roundVector:t0,matrix3x3ToQuaternion:Ul,multiplyQuaternion:om,orthogonalize3x3:Gl,diagonalize3x3:Il,singularValueDecomposition3x3:sm,solveLinearSystem:Pl,invertMatrix:a0,luFactorLinearSystem:n0,luSolveLinearSystem:r0,estimateMatrixCondition:cm,jacobi:um,jacobiN:ka,solveHomogeneousLeastSquares:i0,solveLeastSquares:lm,hex2float:fm,rgb2hsv:Va,hsv2rgb:lr,lab2xyz:zl,xyz2lab:jl,xyz2rgb:Wl,rgb2xyz:$l,rgb2lab:fr,lab2rgb:Qi,uninitializeBounds:o0,areBoundsInitialized:eo,computeBoundsFromPoints:pm,clampValue:Yt,clampVector:s0,clampAndNormalizeValue:hm,getScalarTypeFittingRange:gm,getAdjustedScalarRange:dm,extentIsWithinOtherExtent:vm,boundsIsWithinOtherBounds:ym,pointIsWithinBounds:mm,solve3PointCircle:xm,inf:Cm,negInf:Sm,isInf:Hl,isNan:c0,isNaN:c0,isFinite:Tm,createUninitializedBounds:In,getMajorAxisIndex:wm,getSparseOrthogonalMatrix:Kl,floatToHex2:Xl,floatRGB2HexCode:_m,float2CssRGBA:Em};function Dm(t,e){e.classHierarchy.push("vtkImplicitFunction"),t.functionValue=a=>{if(!e.transform)return t.evaluateFunction(a);const n=[];return e.transform.transformPoint(a,n),t.evaluateFunction(n)},t.evaluateFunction=a=>{V.vtkErrorMacro("not implemented")}}const Om={};function ql(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Om,a),V.obj(t,e),V.setGet(t,e,["transform"]),Dm(t,e)}var bm={newInstance:V.newInstance(ql,"vtkImplicitFunction"),extend:ql};const u0=1e-6,Yl="coincide",Jl="disjoint";function Mm(t,e,a){return t[0]*(a[0]-e[0])+t[1]*(a[1]-e[1])+t[2]*(a[2]-e[2])}function Zl(t,e,a){const n=a[0]*(t[0]-e[0])+a[1]*(t[1]-e[1])+a[2]*(t[2]-e[2]);return Math.abs(n)}function Ql(t,e,a,n){const r=[];He(t,e,r);const i=xe(a,r);n[0]=t[0]-i*a[0],n[1]=t[1]-i*a[1],n[2]=t[2]-i*a[2]}function ef(t,e,a){const n=xe(t,e);let r=xe(e,e);return r===0&&(r=1),a[0]=t[0]-n*e[0]/r,a[1]=t[1]-n*e[1]/r,a[2]=t[2]-n*e[2]/r,a}function tf(t,e,a,n){const r=[];He(t,e,r);const i=xe(a,r),o=xe(a,a);o!==0?(n[0]=t[0]-i*a[0]/o,n[1]=t[1]-i*a[1]/o,n[2]=t[2]-i*a[2]/o):(n[0]=t[0],n[1]=t[1],n[2]=t[2])}function nf(t,e,a,n){const r={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},i=[],o=[];He(e,t,i),He(a,t,o);const s=xe(n,o),c=xe(n,i);let l,p;return c<0?l=-c:l=c,s<0?p=-s*u0:p=s*u0,l<=p||(r.t=s/c,r.x[0]=t[0]+r.t*i[0],r.x[1]=t[1]+r.t*i[1],r.x[2]=t[2]+r.t*i[2],r.intersection=!0,r.betweenPoints=r.t>=0&&r.t<=1),r}function rf(t,e,a,n){const r={intersection:!1,l0:[],l1:[],error:null},i=[];et(e,n,i);const o=i.map(u=>Math.abs(u));if(o[0]+o[1]+o[2]o[1]&&o[0]>o[2]?s="x":o[1]>o[2]?s="y":s="z";const c=[],l=-xe(e,t),p=-xe(n,a);switch(s){case"x":c[0]=0,c[1]=(p*e[2]-l*n[2])/i[0],c[2]=(l*n[1]-p*e[1])/i[0];break;case"y":c[0]=(l*n[2]-p*e[2])/i[1],c[1]=0,c[2]=(p*e[0]-l*n[0])/i[1];break;case"z":c[0]=(p*e[1]-l*n[1])/i[2],c[1]=(l*n[0]-p*e[0])/i[2],c[2]=0;break}return r.l0=c,ur(c,i,r.l1),r.intersection=!0,r}const Nm={evaluate:Mm,distanceToPlane:Zl,projectPoint:Ql,projectVector:ef,generalizedProjectPoint:tf,intersectWithLine:nf,intersectWithPlane:rf,DISJOINT:Jl,COINCIDE:Yl};function Rm(t,e){e.classHierarchy.push("vtkPlane"),t.distanceToPlane=a=>Zl(a,e.origin,e.normal),t.projectPoint=(a,n)=>{Ql(a,e.origin,e.normal,n)},t.projectVector=(a,n)=>ef(a,e.normal,n),t.push=a=>{if(a!==0)for(let n=0;n<3;n++)e.origin[n]+=a*e.normal[n]},t.generalizedProjectPoint=(a,n)=>{tf(a,e.origin,e.normal,n)},t.evaluateFunction=(a,n,r)=>Array.isArray(a)?e.normal[0]*(a[0]-e.origin[0])+e.normal[1]*(a[1]-e.origin[1])+e.normal[2]*(a[2]-e.origin[2]):e.normal[0]*(a-e.origin[0])+e.normal[1]*(n-e.origin[1])+e.normal[2]*(r-e.origin[2]),t.evaluateGradient=a=>[e.normal[0],e.normal[1],e.normal[2]],t.intersectWithLine=(a,n)=>nf(a,n,e.origin,e.normal),t.intersectWithPlane=(a,n)=>rf(a,n,e.origin,e.normal)}const Lm={normal:[0,0,1],origin:[0,0,0]};function af(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Lm,a),bm.extend(t,e,a),V.setGetArray(t,e,["normal","origin"],3),Rm(t,e)}var fn={newInstance:V.newInstance(af,"vtkPlane"),extend:af,...Nm};const ro=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];function of(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function _n(t){return(t==null?void 0:t.length)>=6&&t[0]<=t[1]&&t[2]<=t[3]&&t[4]<=t[5]}function l0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function f0(t){return l0(t,ro)}function ao(t,e,a,n){const[r,i,o,s,c,l]=t;return t[0]=re?i:e,t[2]=oa?s:a,t[4]=cn?l:n,t}function p0(t,e){if(e.length===0)return t;if(Array.isArray(e[0]))for(let a=0;ai?e:i,t[2]=a,t[3]=a>s?a:s,t[4]=n,t[5]=n>l?n:l,r!==e||o!==a||c!==n}function uf(t,e,a,n){const[r,i,o,s,c,l]=t;return t[0]=en&&(n=r,a=i),e[i]=r>0?1:0;if(a<0)return h0(t,.5);for(let i=0;i<3;++i)if(!e[i]){const o=.005*n;t[i*2]-=o,t[i*2+1]+=o}return t}function g0(t,e,a,n){return _n(t)?(e>=0?(t[0]*=e,t[1]*=e):(t[0]=e*t[1],t[1]=e*t[0]),a>=0?(t[2]*=a,t[3]*=a):(t[2]=a*t[3],t[3]=a*t[2]),n>=0?(t[4]*=n,t[5]*=n):(t[4]=n*t[5],t[5]=n*t[4]),!0):!1}function d0(t){return[.5*(t[0]+t[1]),.5*(t[2]+t[3]),.5*(t[4]+t[5])]}function km(t,e,a,n){if(!_n(t))return!1;const r=d0(t);return t[0]-=r[0],t[1]-=r[0],t[2]-=r[1],t[3]-=r[1],t[4]-=r[2],t[5]-=r[2],g0(t,e,a,n),t[0]+=r[0],t[1]+=r[0],t[2]+=r[1],t[3]+=r[1],t[4]+=r[2],t[5]+=r[2],!0}function Aa(t,e){return t[e*2+1]-t[e*2]}function Ba(t){return[Aa(t,0),Aa(t,1),Aa(t,2)]}function lf(t){return t.slice(0,2)}function ff(t){return t.slice(2,4)}function pf(t){return t.slice(4,6)}function hf(t){const e=Ba(t);return e[0]>e[1]?e[0]>e[2]?e[0]:e[2]:e[1]>e[2]?e[1]:e[2]}function v0(t){if(_n(t)){const e=Ba(t);return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]}return null}function gf(t){const e=v0(t);return e!==null?Math.sqrt(e):null}function io(t){return[t[0],t[2],t[4]]}function oo(t){return[t[1],t[3],t[5]]}function so(t,e){return t<=0&&e>=0||t>=0&&e<=0}function y0(t,e){return e[0]=[t[0],t[2],t[4]],e[1]=[t[0],t[2],t[5]],e[2]=[t[0],t[3],t[4]],e[3]=[t[0],t[3],t[5]],e[4]=[t[1],t[2],t[4]],e[5]=[t[1],t[2],t[5]],e[6]=[t[1],t[3],t[4]],e[7]=[t[1],t[3],t[5]],e}function df(t,e,a){return e[0]=t[0],e[1]=t[2],e[2]=t[4],a[0]=t[1],a[1]=t[3],a[2]=t[5],e}function vf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const n=y0(t,[]);for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:[];return e[0]=.5*(t[1]-t[0]),e[1]=.5*(t[3]-t[2]),e[2]=.5*(t[5]-t[4]),e}function mf(t,e,a,n){const r=[].concat(ro),i=t.getData();for(let o=0;ot[2*h+1]?(o[h]=p,l[h]=t[2*h+1],i=!1):o[h]=f;if(i)return n[0]=e[0],n[1]=e[1],n[2]=e[2],r[0]=0,1;for(let h=0;h<3;h++)o[h]!==f&&a[h]!==0?c[h]=(l[h]-e[h])/a[h]:c[h]=-1;for(let h=0;h<3;h++)c[s]1||c[s]<0)return 0;r[0]=c[s];for(let h=0;h<3;h++)if(s!==h){if(n[h]=e[h]+c[s]*a[h],n[h]t[2*h+1])return 0}else n[h]=l[h];return 1}function Cf(t,e,a){const n=[];let r=0,i=1,o=1;for(let s=4;s<=5;++s){n[2]=t[s];for(let c=2;c<=3;++c){n[1]=t[c];for(let l=0;l<=1;++l)if(n[0]=t[l],r=fn.evaluate(a,e,n),o&&(i=r>=0?1:-1,o=0),r===0||i>0&&r<0||i<0&&r>0)return 1}}return 0}function Sf(t,e){if(!(_n(t)&&_n(e)))return!1;const a=[0,0,0,0,0,0];let n;for(let r=0;r<3;r++)if(n=!1,e[r*2]>=t[r*2]&&e[r*2]<=t[r*2+1]?(n=!0,a[r*2]=e[r*2]):t[r*2]>=e[r*2]&&t[r*2]<=e[r*2+1]&&(n=!0,a[r*2]=t[r*2]),e[r*2+1]>=t[r*2]&&e[r*2+1]<=t[r*2+1]?(n=!0,a[r*2+1]=e[2*r+1]):t[r*2+1]>=e[r*2]&&t[r*2+1]<=e[r*2+1]&&(n=!0,a[r*2+1]=t[r*2+1]),!n)return!1;return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],!0}function co(t,e){if(!(_n(t)&&_n(e)))return!1;for(let a=0;a<3;a++)if(!(e[a*2]>=t[a*2]&&e[a*2]<=t[a*2+1])&&!(t[a*2]>=e[a*2]&&t[a*2]<=e[a*2+1])&&!(e[a*2+1]>=t[a*2]&&e[a*2+1]<=t[a*2+1])&&!(t[a*2+1]>=e[a*2]&&t[a*2+1]<=e[a*2+1]))return!1;return!0}function uo(t,e,a,n){return!(et[1]||at[3]||nt[5])}function Vm(t,e){return!(!co(t,e)||!uo(t,...io(e))||!uo(t,...oo(e)))}function Tf(t,e,a){const n=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],r=[0,0,0,0,0,0,0,0];let i=0;for(let u=0;u<2;u++)for(let f=2;f<4;f++)for(let h=4;h<6;h++){const d=[t[u],t[f],t[h]];r[i++]=fn.evaluate(a,e,d)}let o=2;for(;o--&&!(so(r[n[o][0]],r[n[o][4]])&&so(r[n[o][1]],r[n[o][5]])&&so(r[n[o][2]],r[n[o][6]])&&so(r[n[o][3]],r[n[o][7]])););if(o<0)return!1;const s=Math.sign(a[o]),c=Math.abs((t[o*2+1]-t[o*2])*a[o]);let l=s>0?1:0;for(let u=0;u<4;u++){if(c===0)continue;const f=Math.abs(r[n[o][u]])/c;s>0&&fl&&(l=f)}const p=(1-l)*t[o*2]+l*t[o*2+1];return s>0?t[o*2]=p:t[o*2+1]=p,!0}function wf(t,e){for(let n=0;n<3;++n)e[n]=e[n]<1?1:e[n];let a=e[0]*e[1]*e[2];for(;a>t;){for(let n=0;n<3;++n)e[n]=e[n]>1?e[n]-1:1;a=e[0]*e[1]*e[2]}}function _f(t,e,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];e=e<=0?1:e;let r=0;const i=[0,0,0];let o=-1,s=0;const c=Ba(t),l=c[0]+c[1]+c[2],p=l*(.001/3);for(let v=0;v<3;++v)c[v]>s&&(o=v,s=c[v]),c[v]>p?(i[v]=1,r++):i[v]=0;const u=io(t),f=oo(t);if(r<1)return a[0]=1,a[1]=1,a[2]=1,n[0]=u[0]-.5,n[1]=f[0]+.5,n[2]=u[1]-.5,n[3]=f[1]+.5,n[4]=u[2]-.5,n[5]=f[2]+.5,1;let h=e;h/=i[0]?c[0]/l:1,h/=i[1]?c[1]/l:1,h/=i[2]?c[2]/l:1,h**=1/r;for(let v=0;v<3;++v)a[v]=i[v]?Math.floor(h*c[v]/l):1,a[v]=a[v]<1?1:a[v];wf(e,a);const d=.5*c[o]/a[o];for(let v=0;v<3;++v)i[v]?(n[2*v]=u[v],n[2*v+1]=f[v]):(n[2*v]=u[v]-d,n[2*v+1]=f[v]+d);return a[0]*a[1]*a[2]}function Ef(t,e){if(t[0]>=e[0]&&t[0]<=e[1]&&t[1]>=e[2]&&t[1]<=e[3]&&t[2]>=e[4]&&t[2]<=e[5])return 0;const a=[0,0,0];return t[0]e[1]&&(a[0]=t[0]-e[1]),t[1]e[3]&&(a[1]=t[1]-e[3]),t[2]e[5]&&(a[2]=t[2]-e[5]),xe(a,a)}class Am{constructor(e){this.bounds=e,this.bounds||(this.bounds=new Float64Array(ro))}getBounds(){return this.bounds}equals(e){return of(this.bounds,e)}isValid(){return _n(this.bounds)}setBounds(e){return l0(this.bounds,e)}reset(){return f0(this.bounds)}addPoint(){for(var e=arguments.length,a=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:[];return vf(this.bounds,e,a)}computeScale3(e){return yf(this.bounds,e)}cutWithPlane(e,a){return Tf(this.bounds,e,a)}intersectBox(e,a,n,r){return xf(this.bounds,e,a,n,r)}intersectPlane(e,a){return Cf(this.bounds,e,a)}intersect(e){return Sf(this.bounds,e)}intersects(e){return co(this.bounds,e)}containsPoint(e,a,n){return uo(this.bounds,e,a,n)}contains(e){return co(this.bounds,e)}computeDivisions(e,a){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return _f(this.bounds,e,a,n)}distance2ToBounds(e){return Ef(e,this.bounds)}}function Bm(t){const e=t&&t.bounds;return new Am(e)}var we={newInstance:Bm,...{equals:of,isValid:_n,setBounds:l0,reset:f0,addPoint:ao,addPoints:p0,addBounds:sf,setMinPoint:cf,setMaxPoint:uf,inflate:h0,scale:g0,scaleAboutCenter:km,getCenter:d0,getLength:Aa,getLengths:Ba,getMaxLength:hf,getDiagonalLength:gf,getDiagonalLength2:v0,getMinPoint:io,getMaxPoint:oo,getXRange:lf,getYRange:ff,getZRange:pf,getCorners:y0,computeCornerPoints:df,computeLocalBounds:mf,transformBounds:vf,computeScale3:yf,cutWithPlane:Tf,intersectBox:xf,intersectPlane:Cf,intersect:Sf,intersects:co,containsPoint:uo,contains:Vm,computeDivisions:_f,clampDivisions:wf,distance2ToBounds:Ef,INIT_BOUNDS:ro}},Df={CoordinateSystem:{DISPLAY:0,WORLD:1}};const{CoordinateSystem:m0}=Df;function Of(t){return()=>V.vtkErrorMacro(`vtkProp::${t} - NOT IMPLEMENTED`)}function Um(t,e){e.classHierarchy.push("vtkProp"),t.getMTime=()=>{let a=e.mtime;for(let n=0;na&&(a=r)}return a},t.processSelectorPixelBuffers=(a,n)=>{},t.getNestedProps=()=>null,t.getActors=()=>[],t.getActors2D=()=>[],t.getVolumes=()=>[],t.pick=Of("pick"),t.hasKey=Of("hasKey"),t.getNestedVisibility=()=>e.visibility&&(!e._parentProp||e._parentProp.getNestedVisibility()),t.getNestedPickable=()=>e.pickable&&(!e._parentProp||e._parentProp.getNestedPickable()),t.getNestedDragable=()=>e.dragable&&(!e._parentProp||e._parentProp.getNestedDragable()),t.getRedrawMTime=()=>e.mtime,t.setEstimatedRenderTime=a=>{e.estimatedRenderTime=a,e.savedEstimatedRenderTime=a},t.restoreEstimatedRenderTime=()=>{e.estimatedRenderTime=e.savedEstimatedRenderTime},t.addEstimatedRenderTime=a=>{e.estimatedRenderTime+=a},t.setAllocatedRenderTime=a=>{e.allocatedRenderTime=a,e.savedEstimatedRenderTime=e.estimatedRenderTime,e.estimatedRenderTime=0},t.getSupportsSelection=()=>!1,t.getTextures=()=>e.textures,t.hasTexture=a=>e.textures.indexOf(a)!==-1,t.addTexture=a=>{a&&!t.hasTexture(a)&&(e.textures=e.textures.concat(a),t.modified())},t.removeTexture=a=>{const n=e.textures.filter(r=>r!==a);e.textures.length!==n.length&&(e.textures=n,t.modified())},t.removeAllTextures=()=>{e.textures=[],t.modified()},t.setCoordinateSystemToWorld=()=>t.setCoordinateSystem(m0.WORLD),t.setCoordinateSystemToDisplay=()=>t.setCoordinateSystem(m0.DISPLAY)}const Gm={allocatedRenderTime:10,coordinateSystem:m0.WORLD,dragable:!0,estimatedRenderTime:0,paths:null,pickable:!0,renderTimeMultiplier:1,savedEstimatedRenderTime:0,textures:[],useBounds:!0,visibility:!0};function bf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Gm,a),V.obj(t,e),V.get(t,e,["estimatedRenderTime","allocatedRenderTime"]),V.setGet(t,e,["_parentProp","coordinateSystem","dragable","pickable","renderTimeMultiplier","useBounds","visibility"]),V.moveToProtected(t,e,["parentProp"]),Um(t,e)}var Mf={newInstance:V.newInstance(bf,"vtkProp"),extend:bf,...Df};const Im=1e-6;function Pm(t,e){e.classHierarchy.push("vtkProp3D"),t.addPosition=n=>{e.position=e.position.map((r,i)=>r+n[i]),t.modified()},t.getOrientationWXYZ=()=>{const n=Bn();xi(n,e.rotation);const r=new Float64Array(3),i=fu(r,n);return[Ra(i),r[0],r[1],r[2]]},t.getOrientationQuaternion=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return xi(n,e.rotation)},t.rotateX=n=>{n!==0&&(di(e.rotation,e.rotation,Qe(n)),t.modified())},t.rotateY=n=>{n!==0&&(da(e.rotation,e.rotation,Qe(n)),t.modified())},t.rotateZ=n=>{n!==0&&(vi(e.rotation,e.rotation,Qe(n)),t.modified())},t.rotateWXYZ=(n,r,i,o)=>{if(n===0||r===0&&i===0&&o===0)return;const s=Qe(n),c=Bn();Di(c,[r,i,o],s);const l=new Float64Array(16);Gr(l,c),Ee(e.rotation,e.rotation,l),t.modified()},t.rotateQuaternion=n=>{if(Math.abs(n[3])>=1-Im)return;const r=Gr(new Float64Array(16),n);Ee(e.rotation,e.rotation,r),t.modified()},t.setOrientation=(n,r,i)=>n===e.orientation[0]&&r===e.orientation[1]&&i===e.orientation[2]?!1:(e.orientation=[n,r,i],Te(e.rotation),t.rotateZ(i),t.rotateX(n),t.rotateY(r),t.modified(),!0),t.setOrientationFromQuaternion=n=>{const r=Ur();return Gr(r,n),Jr(r,e.rotation)?!1:(e.rotation=r,t.modified(),!0)},t.setUserMatrix=n=>Jr(e.userMatrix,n)?!1:(gt(e.userMatrix,n),t.modified(),!0),t.getMatrix=()=>(t.computeMatrix(),e.matrix),t.computeMatrix=()=>{if(t.getMTime()>e.matrixMTime.getMTime()){Te(e.matrix),e.userMatrix&&Ee(e.matrix,e.matrix,e.userMatrix),Ye(e.matrix,e.matrix,e.origin),Ye(e.matrix,e.matrix,e.position),Ee(e.matrix,e.matrix,e.rotation),An(e.matrix,e.matrix,e.scale),Ye(e.matrix,e.matrix,[-e.origin[0],-e.origin[1],-e.origin[2]]),We(e.matrix,e.matrix),e.isIdentity=!0;for(let n=0;n<4;++n)for(let r=0;r<4;++r)(n===r?1:0)!==e.matrix[n+r*4]&&(e.isIdentity=!1);e.matrixMTime.modified()}},t.getBoundsByReference=()=>{if(e.mapper===null)return e.bounds;const n=e.mapper.getBounds();if(!n||n.length!==6)return n;if(n[0]>n[1])return e.mapperBounds=n,e.bounds=[...we.INIT_BOUNDS],e.boundsMTime.modified(),n;if(!e.mapperBounds||!n.every((r,i)=>n[i]===e.mapperBounds[i])||t.getMTime()>e.boundsMTime.getMTime()){V.vtkDebugMacro("Recomputing bounds..."),e.mapperBounds=n,t.computeMatrix();const r=new Float64Array(16);We(r,e.matrix),we.transformBounds(n,r,e.bounds),e.boundsMTime.modified()}return e.bounds},t.getBounds=()=>{const n=t.getBoundsByReference();try{return[...n]}catch{return n}},t.getCenter=()=>we.getCenter(e.bounds),t.getLength=()=>we.getLength(e.bounds),t.getXRange=()=>we.getXRange(e.bounds),t.getYRange=()=>we.getYRange(e.bounds),t.getZRange=()=>we.getZRange(e.bounds),t.getUserMatrix=()=>e.userMatrix;function a(){t.computeMatrix()}t.onModified(a),t.getProperty=function(){var r;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.properties[n]==null&&(e.properties[n]=(r=t.makeProperty)==null?void 0:r.call(t)),e.properties[n]},t.getProperties=()=>{var n;return e.properties.length===0&&(e.properties[0]=(n=t.makeProperty)==null?void 0:n.call(t)),e.properties},t.setProperty=(n,r)=>{const i=Number.isInteger(n),[o,s]=i?[n,r]:[0,n];return e.properties[o]===s?!1:(e.properties[o]=s,!0)},t.getMTime=()=>{let n=e.mtime;return e.properties.forEach(r=>{if(r!==null){const i=r.getMTime();n=i>n?i:n}}),n}}const zm={origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],bounds:[...we.INIT_BOUNDS],properties:[],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function Nf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,zm,a),Mf.extend(t,e,a),e.matrixMTime={},V.obj(e.matrixMTime),V.get(t,e,["isIdentity"]),V.getArray(t,e,["orientation"]),V.setGetArray(t,e,["origin","position","scale"],3),V.setGet(t,e,["properties"]),e.matrix=Te(new Float64Array(16)),e.rotation=Te(new Float64Array(16)),e.userMatrix=Te(new Float64Array(16)),e.transform=null,Pm(t,e)}var x0={newInstance:V.newInstance(Nf,"vtkProp3D"),extend:Nf};const Rf={FLAT:0,GOURAUD:1,PHONG:2},Jt={POINTS:0,WIREFRAME:1,SURFACE:2};var Lf={Shading:Rf,Representation:Jt,Interpolation:Rf};const{Representation:Ua,Interpolation:Ga}=Lf;function Ff(t){return()=>V.vtkErrorMacro(`vtkProperty::${t} - NOT IMPLEMENTED`)}function jm(t,e){e.classHierarchy.push("vtkProperty"),t.setColor=(a,n,r)=>{Array.isArray(a)?(e.color[0]!==a[0]||e.color[1]!==a[1]||e.color[2]!==a[2])&&(e.color[0]=a[0],e.color[1]=a[1],e.color[2]=a[2],t.modified()):(e.color[0]!==a||e.color[1]!==n||e.color[2]!==r)&&(e.color[0]=a,e.color[1]=n,e.color[2]=r,t.modified()),t.setDiffuseColor(e.color),t.setAmbientColor(e.color),t.setSpecularColor(e.color)},t.computeCompositeColor=Ff("ComputeCompositeColor"),t.getColor=()=>{let a=0;e.ambient+e.diffuse+e.specular>0&&(a=1/(e.ambient+e.diffuse+e.specular));for(let n=0;n<3;n++)e.color[n]=a*(e.ambient*e.ambientColor[n]+e.diffuse*e.diffuseColor[n]+e.specular*e.specularColor[n]);return[].concat(e.color)},t.setSpecularPower=a=>{const n=1/Math.max(1,a);(e.roughness!==n||e.specularPower!==a)&&(e.specularPower=a,e.roughness=n,t.modified())},t.addShaderVariable=Ff("AddShaderVariable"),t.setInterpolationToFlat=()=>t.setInterpolation(Ga.FLAT),t.setInterpolationToGouraud=()=>t.setInterpolation(Ga.GOURAUD),t.setInterpolationToPhong=()=>t.setInterpolation(Ga.PHONG),t.getInterpolationAsString=()=>V.enumToString(Ga,e.interpolation),t.setRepresentationToWireframe=()=>t.setRepresentation(Ua.WIREFRAME),t.setRepresentationToSurface=()=>t.setRepresentation(Ua.SURFACE),t.setRepresentationToPoints=()=>t.setRepresentation(Ua.POINTS),t.getRepresentationAsString=()=>V.enumToString(Ua,e.representation)}const Wm={color:[1,1,1],ambientColor:[1,1,1],diffuseColor:[1,1,1],specularColor:[1,1,1],edgeColor:[0,0,0],ambient:0,diffuse:1,metallic:0,roughness:.6,normalStrength:1,emission:1,baseIOR:1.45,specular:0,specularPower:1,opacity:1,interpolation:Ga.GOURAUD,representation:Ua.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null,ORMTexture:null,RMTexture:null};function kf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Wm,a),V.obj(t,e),V.setGet(t,e,["lighting","interpolation","ambient","diffuse","metallic","roughness","normalStrength","emission","baseIOR","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation","diffuseTexture","metallicTexture","roughnessTexture","normalTexture","ambientOcclusionTexture","emissionTexture","ORMTexture","RMTexture"]),V.setGetArray(t,e,["ambientColor","specularColor","diffuseColor","edgeColor"],3),jm(t,e)}var pr={newInstance:V.newInstance(kf,"vtkProperty"),extend:kf,...Lf};function $m(t,e){e.classHierarchy.push("vtkActor");const a={...t};t.getActors=()=>[t],t.getIsOpaque=()=>{if(e.forceOpaque)return!0;if(e.forceTranslucent)return!1;e.properties[0]||t.getProperty();let n=e.properties[0].getOpacity()>=1;return n=n&&(!e.texture||!e.texture.isTranslucent()),n=n&&(!e.mapper||e.mapper.getIsOpaque()),n},t.hasTranslucentPolygonalGeometry=()=>e.mapper===null?!1:(e.properties[0]||t.getProperty(),!t.getIsOpaque()),t.makeProperty=pr.newInstance,t.getMTime=()=>{let n=a.getMTime();if(e.backfaceProperty!==null){const r=e.backfaceProperty.getMTime();n=r>n?r:n}return n},t.getRedrawMTime=()=>{let n=e.mtime;if(e.mapper!==null){let r=e.mapper.getMTime();n=r>n?r:n,e.mapper.getInput()!==null&&(e.mapper.getInputAlgorithm().update(),r=e.mapper.getInput().getMTime(),n=r>n?r:n)}return n},t.getSupportsSelection=()=>e.mapper?e.mapper.getSupportsSelection():!1,t.processSelectorPixelBuffers=(n,r)=>{e.mapper&&e.mapper.processSelectorPixelBuffers&&e.mapper.processSelectorPixelBuffers(n,r)}}const Hm={mapper:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1};function Vf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Hm,a),x0.extend(t,e,a),e.boundsMTime={},V.obj(e.boundsMTime),V.setGet(t,e,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),$m(t,e)}var pn={newInstance:V.newInstance(Vf,"vtkActor"),extend:Vf};const lo={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Ne={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",UNSIGNED_CHAR_CLAMPED:"Uint8ClampedArray",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"};var Af={DefaultDataType:Ne.FLOAT,DataTypeByteSize:lo,VtkDataTypes:Ne};const{vtkErrorMacro:Km}=Dt,{DefaultDataType:Xm}=Af,qm=1e-6;function C0(t,e,a){const n=t.length;let r=Number.MAX_VALUE,i=-Number.MAX_VALUE,o,s;for(s=e;si&&(i=o);return{min:r,max:i}}function Ym(){let t=Number.MAX_VALUE,e=-Number.MAX_VALUE,a=0,n=0;return{add(r){t>r&&(t=r),e1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;if(e<0&&a>1){const r=t.length/a,i=new Float64Array(r);for(let o=0,s=0;o1&&arguments[1]!==void 0?arguments[1]:0;const a=t||[];for(;a.length<=e;)a.push(null);return a}function S0(t){return Object.prototype.toString.call(t).slice(8,-1)}function Jm(t){const e=t.getNumberOfComponents();let a=0;const n=new Array(e);for(let r=0;ra&&(a=i)}return a}const Zm={computeRange:Bf,createRangeHelper:Ym,fastComputeRange:C0,getDataType:S0,getMaxNorm:Jm};function Qm(t,e){e.classHierarchy.push("vtkDataArray");function a(n){if(n<0)return!1;const r=t.getNumberOfComponents(),i=e.values.length/(r>0?r:1);if(n===i)return!0;if(n>i){const o=e.values;return e.values=ar(e.dataType,(n+i)*r),e.values.set(o),!0}return e.size>n*r&&(e.size=n*r,t.dataChange()),!0}t.dataChange=()=>{e.ranges=null,t.modified()},t.allocate=n=>{a(t.getNumberOfTuples()+n)},t.resize=n=>{a(n);const r=n*t.getNumberOfComponents();return e.size!==r?(e.size=r,t.dataChange(),!0):!1},t.initialize=()=>(t.resize(0),t),t.getElementComponentSize=()=>e.values.BYTES_PER_ELEMENT,t.getComponent=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.values[n*e.numberOfComponents+r]},t.setComponent=(n,r,i)=>{i!==e.values[n*e.numberOfComponents+r]&&(e.values[n*e.numberOfComponents+r]=i,t.dataChange())},t.getValue=n=>{const r=n/e.numberOfComponents,i=n%e.numberOfComponents;return t.getComponent(r,i)},t.setValue=(n,r)=>{const i=n/e.numberOfComponents,o=n%e.numberOfComponents;t.setComponent(i,o,r)},t.getData=()=>e.size===e.values.length?e.values:e.values.subarray(0,e.size),t.getRange=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,r=n;r<0&&(r=e.numberOfComponents===1?0:e.numberOfComponents);let i=null;return e.ranges||(e.ranges=Uf(e.ranges,e.numberOfComponents)),i=e.ranges[r],i?(e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple):(i=Bf(t.getData(),n,e.numberOfComponents),e.ranges[r]=i,e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple)},t.setRange=(n,r)=>{e.ranges||(e.ranges=Uf(e.ranges,e.numberOfComponents));const i={min:n.min,max:n.max};return e.ranges[r]=i,e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple},t.getRanges=function(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0))return structuredClone(e.ranges);const r=[];for(let i=0;i1){const[i,o]=t.getRange(-1),s={min:i,max:o};r.push(s)}return r},t.setTuple=(n,r)=>{const i=n*e.numberOfComponents;for(let o=0;o{let i=n*e.numberOfComponents;const o=Math.min(r.length,e.size-i);for(let s=0;s(e.size<=n*e.numberOfComponents&&(e.size=(n+1)*e.numberOfComponents,a(n+1)),t.setTuple(n,r),n),t.insertTuples=(n,r)=>{const i=n+r.length/e.numberOfComponents;return e.size{const r=e.size/e.numberOfComponents;return t.insertTuple(r,n)},t.insertNextTuples=n=>{const r=e.size/e.numberOfComponents;return t.insertTuples(r,n)},t.findTuple=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qm;for(let i=0;ir){o=!1;break}if(o)return i/e.numberOfComponents}return-1},t.getTuple=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const i=e.numberOfComponents||1,o=n*i;switch(i){case 4:r[3]=e.values[o+3];case 3:r[2]=e.values[o+2];case 2:r[1]=e.values[o+1];case 1:r[0]=e.values[o];break;default:for(let s=i-1;s>=0;--s)r[s]=e.values[o+s]}return r},t.getTuples=(n,r)=>{const i=(n??0)*e.numberOfComponents,o=(r??t.getNumberOfTuples())*e.numberOfComponents,s=t.getData().subarray(i,o);return s.length>0?s:null},t.getTupleLocation=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:1)*e.numberOfComponents},t.getNumberOfComponents=()=>e.numberOfComponents,t.getNumberOfValues=()=>e.size,t.getNumberOfTuples=()=>e.size/e.numberOfComponents,t.getDataType=()=>e.dataType,t.newClone=()=>If({empty:!0,name:e.name,dataType:e.dataType,numberOfComponents:e.numberOfComponents}),t.getName=()=>(e.name||(t.modified(),e.name=`vtkDataArray${t.getMTime()}`),e.name),t.setData=(n,r)=>{e.values=n,e.size=n.length,e.dataType=S0(n),r&&(e.numberOfComponents=r),e.size%e.numberOfComponents!==0&&(e.numberOfComponents=1),t.dataChange()},t.getState=()=>{if(e.deleted)return null;const n={...e,vtkClass:t.getClassName()};n.values=Array.from(n.values),delete n.buffer,Object.keys(n).forEach(i=>{n[i]||delete n[i]});const r={};return Object.keys(n).sort().forEach(i=>{r[i]=n[i]}),r.mtime&&delete r.mtime,r},t.deepCopy=n=>{const r=t.getDataType(),i=e.values;t.shallowCopy(n),e.ranges=structuredClone(n.getRanges()),(i==null?void 0:i.length)>=n.getNumberOfValues()&&r===n.getDataType()?(i.set(n.getData()),e.values=i,t.dataChange()):t.setData(n.getData().slice())},t.interpolateTuple=(n,r,i,o,s,c)=>{const l=e.numberOfComponents||1;(l!==r.getNumberOfComponents()||l!==o.getNumberOfComponents())&&Km("numberOfComponents must match");const p=r.getTuple(i),u=o.getTuple(s),f=[];switch(f.length=l,l){case 4:f[3]=p[3]+(u[3]-p[3])*c;case 3:f[2]=p[2]+(u[2]-p[2])*c;case 2:f[1]=p[1]+(u[1]-p[1])*c;case 1:f[0]=p[0]+(u[0]-p[0])*c;break;default:for(let h=0;h2&&arguments[2]!==void 0?arguments[2]:{};if(Object.assign(e,e5,a),Array.isArray(a.values)&&a.dataType===void 0&&console.warn("vtkDataArray.newInstance: no dataType provided, converting to Float32Array"),!e.empty&&!e.values&&!e.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");if(e.values?Array.isArray(e.values)&&(e.values=Ai(e.dataType,e.values)):e.values=ar(e.dataType,e.size),e.values&&(e.size=e.size??e.values.length,e.dataType=S0(e.values)),ut(t,e),Ca(t,e,["name","numberOfComponents"]),e.size%e.numberOfComponents!==0)throw new RangeError("model.size is not a multiple of model.numberOfComponents");Qm(t,e)}const If=Je(Gf,"vtkDataArray");var pe={newInstance:If,extend:Gf,...Zm,...Af};function t5(t,e){e.classHierarchy.push("vtkAbstractMapper"),t.update=()=>{t.getInputData()},t.addClippingPlane=a=>a.isA("vtkPlane")?e.clippingPlanes.includes(a)?!1:(e.clippingPlanes.push(a),t.modified(),!0):!1,t.getNumberOfClippingPlanes=()=>e.clippingPlanes.length,t.removeAllClippingPlanes=()=>e.clippingPlanes.length===0?!1:(e.clippingPlanes.length=0,t.modified(),!0),t.removeClippingPlane=a=>{const n=e.clippingPlanes.indexOf(a);return n===-1?!1:(e.clippingPlanes.splice(n,1),t.modified(),!0)},t.getClippingPlanes=()=>e.clippingPlanes,t.setClippingPlanes=a=>{if(a)if(!Array.isArray(a))t.addClippingPlane(a);else{const n=a.length;for(let r=0;r{const i=e.clippingPlanes,o=a;if(i){const s=i.length;if(n>=0&&n2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,n5,a),V.obj(t,e),V.algo(t,e,1,0),e.clippingPlanes||(e.clippingPlanes=[]),t5(t,e)}var a5={extend:r5};function i5(t,e){t.getBounds=()=>(V.vtkErrorMacro("vtkAbstractMapper3D.getBounds - NOT IMPLEMENTED"),In()),t.getCenter=()=>{var n;const a=t.getBounds();return e.center=we.isValid(a)?we.getCenter(a):null,(n=e.center)==null?void 0:n.slice()},t.getLength=()=>{const a=t.getBounds();return we.getDiagonalLength(a)}}const o5=t=>({bounds:[...we.INIT_BOUNDS],center:[0,0,0],viewSpecificProperties:{},...t});function s5(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,o5(a)),a5.extend(t,e,a),V.setGet(t,e,["viewSpecificProperties"]),i5(t,e)}var T0={extend:s5};const{vtkErrorMacro:Pf,vtkWarningMacro:c5}=V;function u5(t,e){e.classHierarchy.push("vtkFieldData");const a=t.getState;e.arrays&&(e.arrays=e.arrays.map(n=>({data:wt(n.data)}))),t.initialize=()=>{t.initializeFields(),t.copyAllOn(),t.clearFieldFlags()},t.initializeFields=()=>{e.arrays=[],e.copyFieldFlags={},t.modified()},t.copyStructure=n=>{t.initializeFields(),e.copyFieldFlags=n.getCopyFieldFlags().map(r=>r),e.arrays=n.getArrays().map(r=>({data:r}))},t.getNumberOfArrays=()=>e.arrays.length,t.getNumberOfActiveArrays=()=>e.arrays.length,t.addArray=n=>{const r=n.getName(),{array:i,index:o}=t.getArrayWithIndex(r);return i!=null?(e.arrays[o]={data:n},o):(e.arrays=[].concat(e.arrays,{data:n}),e.arrays.length-1)},t.removeAllArrays=()=>{e.arrays=[]},t.removeArray=n=>{const r=e.arrays.findIndex(i=>i.data.getName()===n);return t.removeArrayByIndex(r)},t.removeArrayByIndex=n=>n!==-1&&ne.arrays.map(n=>n.data),t.getArray=n=>typeof n=="number"?t.getArrayByIndex(n):t.getArrayByName(n),t.getArrayByName=n=>e.arrays.reduce((r,i,o)=>i.data.getName()===n?i.data:r,null),t.getArrayWithIndex=n=>{const r=e.arrays.findIndex(i=>i.data.getName()===n);return{array:r!==-1?e.arrays[r].data:null,index:r}},t.getArrayByIndex=n=>n>=0&&nt.getArrayWithIndex(n).index>=0,t.getArrayName=n=>{const r=e.arrays[n];return r?r.data.getName():""},t.getCopyFieldFlags=()=>e.copyFieldFlags,t.getFlag=n=>e.copyFieldFlags[n],t.passData=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;n.getArrays().forEach(o=>{const s=t.getFlag(o.getName());if(s!==!1&&!(e.doCopyAllOff&&s!==!0)&&o){let c=t.getArrayByName(o.getName());if(c)if(o.getNumberOfComponents()===c.getNumberOfComponents())if(r>-1&&r-1?i:r;c.insertTuple(l,o.getTuple(r))}else c.insertTuples(0,o.getTuples());else Pf("Unhandled case in passData");else if(r<0||r>o.getNumberOfTuples())t.addArray(o),n.getAttributes(o).forEach(l=>{t.setAttribute(o,l)});else{const l=o.getNumberOfComponents();let p=o.getNumberOfValues();const u=i>-1?i:r;p<=u*l&&(p=(u+1)*l),c=pe.newInstance({name:o.getName(),dataType:o.getDataType(),numberOfComponents:l,values:V.newTypedArray(o.getDataType(),p),size:0}),c.insertTuple(u,o.getTuple(r)),t.addArray(c),n.getAttributes(o).forEach(f=>{t.setAttribute(c,f)})}}})},t.interpolateData=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:.5;n.getArrays().forEach(c=>{const l=t.getFlag(c.getName());if(l!==!1&&!(e.doCopyAllOff&&l!==!0)&&c){let p=t.getArrayByName(c.getName());if(p)if(c.getNumberOfComponents()===p.getNumberOfComponents())if(r>-1&&r-1?o:r;p.interpolateTuple(u,c,r,c,i,s),c5("Unexpected case in interpolateData")}else p.insertTuples(c.getTuples());else Pf("Unhandled case in interpolateData");else if(r<0||i<0||r>c.getNumberOfTuples())t.addArray(c),n.getAttributes(c).forEach(u=>{t.setAttribute(c,u)});else{const u=c.getNumberOfComponents();let f=c.getNumberOfValues();const h=o>-1?o:r;f<=h*u&&(f=(h+1)*u),p=pe.newInstance({name:c.getName(),dataType:c.getDataType(),numberOfComponents:u,values:V.newTypedArray(c.getDataType(),f),size:0}),p.interpolateTuple(h,c,r,c,i,s),t.addArray(p),n.getAttributes(c).forEach(d=>{t.setAttribute(p,d)})}}})},t.copyFieldOn=n=>{e.copyFieldFlags[n]=!0},t.copyFieldOff=n=>{e.copyFieldFlags[n]=!1},t.copyAllOn=()=>{(!e.doCopyAllOn||e.doCopyAllOff)&&(e.doCopyAllOn=!0,e.doCopyAllOff=!1,t.modified())},t.copyAllOff=()=>{(e.doCopyAllOn||!e.doCopyAllOff)&&(e.doCopyAllOn=!1,e.doCopyAllOff=!0,t.modified())},t.clearFieldFlags=()=>{e.copyFieldFlags={}},t.deepCopy=n=>{e.arrays=n.getArrays().map(r=>{const i=r.newClone();return i.deepCopy(r),{data:i}})},t.copyFlags=n=>n.getCopyFieldFlags().map(r=>r),t.reset=()=>e.arrays.forEach(n=>n.data.reset()),t.getMTime=()=>e.arrays.reduce((n,r)=>r.data.getMTime()>n?r.data.getMTime():n,e.mtime),t.getNumberOfComponents=()=>e.arrays.reduce((n,r)=>n+r.data.getNumberOfComponents(),0),t.getNumberOfTuples=()=>e.arrays.length>0?e.arrays[0].getNumberOfTuples():0,t.getState=()=>{const n=a();return n&&(n.arrays=e.arrays.map(r=>({data:r.data.getState()}))),n}}const l5={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function zf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,l5,a),V.obj(t,e),u5(t,e)}var f5={newInstance:V.newInstance(zf,"vtkFieldData"),extend:zf};const jf={SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},p5={MAX:0,EXACT:1,NOLIMIT:2},h5={DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},g5={DUPLICATEPOINT:1,HIDDENPOINT:2},d5={COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},v5="vtkGhostType",hr={DEFAULT:0,SINGLE:1,DOUBLE:2};var Wf={AttributeCopyOperations:d5,AttributeLimitTypes:p5,AttributeTypes:jf,CellGhostTypes:h5,DesiredOutputPrecision:hr,PointGhostTypes:g5,ghostArrayName:v5};const{AttributeTypes:Pn,AttributeCopyOperations:gr}=Wf,{vtkWarningMacro:fo}=V;function y5(t,e){const a=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(o){let s=a.find(c=>Pn[c.toUpperCase()]===o||typeof o!="number"&&c.toLowerCase()===o.toLowerCase());return typeof s>"u"&&(s=null),s}e.classHierarchy.push("vtkDataSetAttributes");const r={...t};t.checkNumberOfComponents=o=>!0,t.setAttribute=(o,s)=>{const c=n(s);if(o&&c.toUpperCase()==="PEDIGREEIDS"&&!o.isA("vtkDataArray"))return fo(`Cannot set attribute ${c}. The attribute must be a vtkDataArray.`),-1;if(o&&!t.checkNumberOfComponents(o,c))return fo(`Cannot set attribute ${c}. Incorrect number of components.`),-1;if(o){const l=t.addArray(o);e[`active${c}`]=l}else e[`active${c}`]=-1;return t.modified(),e[`active${c}`]},t.getAttributes=o=>a.filter(s=>t[`get${s}`]()===o),t.setActiveAttributeByName=(o,s)=>t.setActiveAttributeByIndex(t.getArrayWithIndex(o).index,s),t.setActiveAttributeByIndex=(o,s)=>{const c=n(s);if(o>=0&&o{const s=n(o);return t[`get${s}`]()},t.removeAllArrays=()=>{a.forEach(o=>{e[`active${o}`]=-1}),r.removeAllArrays()},t.removeArrayByIndex=o=>(o!==-1&&a.forEach(s=>{o===e[`active${s}`]?e[`active${s}`]=-1:o{const s=`active${o}`;t[`get${o}`]=()=>t.getArrayByIndex(e[s]),t[`set${o}`]=c=>t.setAttribute(c,o),t[`setActive${o}`]=c=>t.setActiveAttributeByIndex(t.getArrayWithIndex(c).index,o),t[`copy${o}Off`]=()=>{const c=o.toUpperCase();e.copyAttributeFlags[gr.PASSDATA][Pn[c]]=!1},t[`copy${o}On`]=()=>{const c=o.toUpperCase();e.copyAttributeFlags[gr.PASSDATA][Pn[c]]=!0}}),t.initializeAttributeCopyFlags=()=>{e.copyAttributeFlags=[],Object.keys(gr).filter(o=>o!=="ALLCOPY").forEach(o=>{e.copyAttributeFlags[gr[o]]=Object.keys(Pn).filter(s=>s!=="NUM_ATTRIBUTES").reduce((s,c)=>(s[Pn[c]]=!0,s),[])}),e.copyAttributeFlags[gr.COPYTUPLE][Pn.GLOBALIDS]=!1,e.copyAttributeFlags[gr.INTERPOLATE][Pn.GLOBALIDS]=!1,e.copyAttributeFlags[gr.COPYTUPLE][Pn.PEDIGREEIDS]=!1},t.initialize=V.chain(t.initialize,t.initializeAttributeCopyFlags),e.dataArrays&&Object.keys(e.dataArrays).length&&Object.keys(e.dataArrays).forEach(o=>{!e.dataArrays[o].ref&&e.dataArrays[o].type==="vtkDataArray"&&t.addArray(pe.newInstance(e.dataArrays[o]))});const i=t.shallowCopy;t.shallowCopy=(o,s)=>{i(o,s),e.arrays=o.getArrays().map(c=>{const l=c.newClone();return l.shallowCopy(c,s),{data:l}})},t.initializeAttributeCopyFlags()}const m5={activeScalars:-1,activeVectors:-1,activeTensors:-1,activeNormals:-1,activeTCoords:-1,activeGlobalIds:-1,activePedigreeIds:-1};function $f(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,m5,a),f5.extend(t,e,a),V.setGet(t,e,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),e.arrays||(e.arrays={}),y5(t,e)}var Hf={newInstance:V.newInstance($f,"vtkDataSetAttributes"),extend:$f,...Wf};const lt={UNIFORM:0,DATA_OBJECT_FIELD:0,COORDINATE:1,POINT_DATA:1,POINT:2,POINT_FIELD_DATA:2,CELL:3,CELL_FIELD_DATA:3,VERTEX:4,VERTEX_FIELD_DATA:4,EDGE:5,EDGE_FIELD_DATA:5,ROW:6,ROW_DATA:6},w0={FIELD_ASSOCIATION_POINTS:0,FIELD_ASSOCIATION_CELLS:1,FIELD_ASSOCIATION_NONE:2,FIELD_ASSOCIATION_POINTS_THEN_CELLS:3,FIELD_ASSOCIATION_VERTICES:4,FIELD_ASSOCIATION_EDGES:5,FIELD_ASSOCIATION_ROWS:6,NUMBER_OF_ASSOCIATIONS:7};var x5={FieldDataTypes:lt,FieldAssociations:w0};const Ia=["pointData","cellData","fieldData"];function C5(t,e){e.classHierarchy.push("vtkDataSet"),Ia.forEach(r=>{e[r]?e[r]=wt(e[r]):e[r]=Hf.newInstance()}),t.computeBounds=()=>{if(e.modifiedTime&&e.computeTime&&e.modifiedTime>e.computeTime||!e.computeTime){const r=t.getPoints();r!=null&&r.getNumberOfPoints()?we.setBounds(e.bounds,r.getBoundsByReference()):e.bounds=Mt.createUninitializedBounds(),e.computeTime=V.getCurrentGlobalMTime()}},t.getLength2=()=>{const r=t.getBoundsByReference();return!r||r.length!==6?0:we.getDiagonalLength2(r)},t.getLength=()=>Math.sqrt(t.getLength2()),t.getCenter=()=>{const r=t.getBoundsByReference();return!r||r.length!==6?[0,0,0]:we.getCenter(r)},t.getCellBounds=r=>{const i=t.getCell(r);return i?i.getBounds():Mt.createUninitializedBounds()},t.getBounds=V.chain(()=>t.computeBounds,t.getBounds),t.getBoundsByReference=V.chain(()=>t.computeBounds,t.getBoundsByReference);const a=t.shallowCopy;t.shallowCopy=function(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a(r,i),Ia.forEach(o=>{e[o]=Hf.newInstance(),e[o].shallowCopy(r.getReferenceByName(o))})};const n=t.getMTime;t.getMTime=()=>Ia.reduce((r,i)=>{var o;return Math.max(r,((o=e[i])==null?void 0:o.getMTime())??r)},n()),t.initialize=()=>(Ia.forEach(r=>{var i;return(i=e[r])==null?void 0:i.initialize()}),t)}const S5={};function Kf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,S5,a),V.obj(t,e),V.setGet(t,e,Ia),V.getArray(t,e,["bounds"],6),C5(t,e)}var dr={newInstance:V.newInstance(Kf,"vtkDataSet"),extend:Kf,...x5};const zt={UNCHANGED:0,SINGLE_POINT:1,X_LINE:2,Y_LINE:3,Z_LINE:4,XY_PLANE:5,YZ_PLANE:6,XZ_PLANE:7,XYZ_GRID:8,EMPTY:9};var Xf={StructuredType:zt};const{StructuredType:En}=Xf;function T5(t){let e=0;for(let a=0;a<3;++a)t[a*2]t[1]||t[2]>t[3]||t[4]>t[5]?En.EMPTY:e===3?En.XYZ_GRID:e===2?t[0]===t[1]?En.YZ_PLANE:t[2]===t[3]?En.XZ_PLANE:En.XY_PLANE:e===1?t[0]c!==o[l]);return s&&(e.extent=o.slice(),e.dataDescription=w5.getDataDescriptionFromExtent(e.extent),t.modified()),s},t.setDimensions=function(){let n,r,i;if(e.deleted){vr("instance deleted - cannot call any method");return}if(arguments.length===1){const o=arguments.length<=0?void 0:arguments[0];n=o[0],r=o[1],i=o[2]}else if(arguments.length===3)n=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1],i=arguments.length<=2?void 0:arguments[2];else{vr("Bad dimension specification");return}t.setExtent(0,n-1,0,r-1,0,i-1)},t.getDimensions=()=>[e.extent[1]-e.extent[0]+1,e.extent[3]-e.extent[2]+1,e.extent[5]-e.extent[4]+1],t.getNumberOfCells=()=>{const n=t.getDimensions();let r=1;for(let i=0;i<3;i++){if(n[i]===0)return 0;n[i]>1&&(r*=n[i]-1)}return r},t.getNumberOfPoints=()=>{const n=t.getDimensions();return n[0]*n[1]*n[2]},t.getPoint=n=>{const r=t.getDimensions();if(r[0]===0||r[1]===0||r[2]===0)return vr("Requesting a point from an empty image."),null;const i=new Float64Array(3);switch(e.dataDescription){case zt.EMPTY:return null;case zt.SINGLE_POINT:break;case zt.X_LINE:i[0]=n;break;case zt.Y_LINE:i[1]=n;break;case zt.Z_LINE:i[2]=n;break;case zt.XY_PLANE:i[0]=n%r[0],i[1]=n/r[0];break;case zt.YZ_PLANE:i[1]=n%r[1],i[2]=n/r[1];break;case zt.XZ_PLANE:i[0]=n%r[0],i[2]=n/r[0];break;case zt.XYZ_GRID:i[0]=n%r[0],i[1]=n/r[0]%r[1],i[2]=n/(r[0]*r[1]);break;default:vr("Invalid dataDescription");break}const o=[0,0,0];return t.indexToWorld(i,o),o},t.getBounds=()=>t.extentToBounds(t.getSpatialExtent()),t.extentToBounds=n=>we.transformBounds(n,e.indexToWorld),t.getSpatialExtent=()=>we.inflate([...e.extent],.5),t.computeTransforms=()=>{fs(e.indexToWorld,e.origin),e.indexToWorld[0]=e.direction[0],e.indexToWorld[1]=e.direction[1],e.indexToWorld[2]=e.direction[2],e.indexToWorld[4]=e.direction[3],e.indexToWorld[5]=e.direction[4],e.indexToWorld[6]=e.direction[5],e.indexToWorld[8]=e.direction[6],e.indexToWorld[9]=e.direction[7],e.indexToWorld[10]=e.direction[8],An(e.indexToWorld,e.indexToWorld,e.spacing),Et(e.worldToIndex,e.indexToWorld)},t.indexToWorld=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return _e(r,n,e.indexToWorld),r},t.indexToWorldVec3=t.indexToWorld,t.worldToIndex=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return _e(r,n,e.worldToIndex),r},t.worldToIndexVec3=t.worldToIndex,t.indexToWorldBounds=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return we.transformBounds(n,e.indexToWorld,r)},t.worldToIndexBounds=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return we.transformBounds(n,e.worldToIndex,r)},e._onOriginChanged=t.computeTransforms,e._onDirectionChanged=t.computeTransforms,e._onSpacingChanged=t.computeTransforms,t.computeTransforms(),t.getCenter=()=>we.getCenter(t.getBounds()),t.computeHistogram=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const i=[0,0,0,0,0,0];t.worldToIndexBounds(n,i);const o=[0,0,0],s=[0,0,0];we.computeCornerPoints(i,o,s),t0(o,o),t0(s,s);const c=t.getDimensions();s0(o,[0,0,0],[c[0]-1,c[1]-1,c[2]-1],o),s0(s,[0,0,0],[c[0]-1,c[1]-1,c[2]-1],s);const l=c[0],p=c[0]*c[1],u=t.getPointData().getScalars().getData();let f=-1/0,h=1/0,d=0,v=0,m=0;for(let C=o[2];C<=s[2];C++)for(let S=o[1];S<=s[1];S++){let T=o[0]+S*l+C*p;for(let w=o[0];w<=s[0];w++){if(!r||r([w,S,C],i)){const _=u[T];_>f&&(f=_),_0?v/m:0,y=m?Math.abs(d/m-x*x):0,g=Math.sqrt(y);return{minimum:h,maximum:f,average:x,variance:y,sigma:g,count:m}},t.computeIncrements=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const i=[];let o=r;for(let s=0;s<3;++s)i[s]=o,o*=n[s*2+1]-n[s*2]+1;return i},t.computeOffsetIndex=n=>{let[r,i,o]=n;const s=t.getExtent(),c=t.getPointData().getScalars().getNumberOfComponents(),l=t.computeIncrements(s,c);return Math.floor((Math.round(r)-s[0])*l[0]+(Math.round(i)-s[2])*l[1]+(Math.round(o)-s[4])*l[2])},t.getOffsetIndexFromWorld=n=>{const r=t.getExtent(),i=t.worldToIndex(n);for(let o=0;o<3;++o)if(i[o]r[o*2+1])return vr(`GetScalarPointer: Pixel ${i} is not in memory. Current extent = ${r}`),NaN;return t.computeOffsetIndex(i)},t.getScalarValueFromWorld=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const i=t.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=i)return vr(`GetScalarPointer: Scalar Component ${r} is not within bounds. Current Scalar numberOfComponents: ${i}`),NaN;const o=t.getOffsetIndexFromWorld(n);return Number.isNaN(o)?o:t.getPointData().getScalars().getComponent(o,r)};const a=t.initialize;t.initialize=()=>(t.set({direction:It(e.direction),spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:zt.EMPTY}),a())}const E5={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:zt.EMPTY};function qf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,E5,a),dr.extend(t,e,a),e.direction?Array.isArray(e.direction)&&(e.direction=new Float64Array(e.direction.slice(0,9))):e.direction=It(new Float64Array(9)),e.indexToWorld=new Float64Array(16),e.worldToIndex=new Float64Array(16),V.get(t,e,["indexToWorld","worldToIndex"]),V.setGetArray(t,e,["origin","spacing"],3),V.setGetArray(t,e,["direction"],9),V.getArray(t,e,["extent"],6),_5(t,e)}var _0={newInstance:V.newInstance(qf,"vtkImageData"),extend:qf};const D5={MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},E0={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4};var D0={VectorMode:D5,ScalarMappingTarget:E0,Scale:{LINEAR:0,LOG10:1}},O0={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:{DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5}};const{ScalarMappingTarget:Yf,Scale:O5,VectorMode:hn}=D0,{VtkDataTypes:zn}=pe,{ColorMode:po}=O0,{vtkErrorMacro:Jf}=V;function b5(t){return t}function Zf(t){return Math.floor(t*255+.5)}function M5(t,e){e.classHierarchy.push("vtkScalarsToColors"),t.setVectorModeToMagnitude=()=>t.setVectorMode(hn.MAGNITUDE),t.setVectorModeToComponent=()=>t.setVectorMode(hn.COMPONENT),t.setVectorModeToRGBColors=()=>t.setVectorMode(hn.RGBCOLORS),t.build=()=>{},t.isOpaque=()=>!0,t.setAnnotations=(a,n)=>{if(!(a&&!n||!a&&n)){if(a&&n&&a.length!==n.length){Jf("Values and annotations do not have the same number of tuples so ignoring");return}if(e.annotationArray=[],n&&a){const r=n.length;for(let i=0;i{let r=t.checkForAnnotatedValue(a),i=!1;return r>=0?e.annotationArray[r].annotation!==n&&(e.annotationArray[r].annotation=n,i=!0):(e.annotationArray.push({value:a,annotation:n}),r=e.annotationArray.length-1,i=!0),i&&(t.updateAnnotatedValueMap(),t.modified()),r},t.getNumberOfAnnotatedValues=()=>e.annotationArray.length,t.getAnnotatedValue=a=>a<0||a>=e.annotationArray.length?null:e.annotationArray[a].value,t.getAnnotation=a=>e.annotationArray[a]===void 0?null:e.annotationArray[a].annotation,t.getAnnotatedValueIndex=a=>e.annotationArray.length?t.checkForAnnotatedValue(a):-1,t.removeAnnotation=a=>{const n=t.checkForAnnotatedValue(a),r=n>=0;return r&&(e.annotationArray.splice(n,1),t.updateAnnotatedValueMap(),t.modified()),r},t.resetAnnotations=()=>{e.annotationArray=[],e.annotatedValueMap=[],t.modified()},t.getAnnotationColor=(a,n)=>{if(e.indexedLookup){const r=t.getAnnotatedValueIndex(a);t.getIndexedColor(r,n)}else t.getColor(parseFloat(a),n),n[3]=1},t.checkForAnnotatedValue=a=>t.getAnnotatedValueIndexInternal(a),t.getAnnotatedValueIndexInternal=a=>{if(e.annotatedValueMap[a]!==void 0){const n=e.annotationArray.length;return e.annotatedValueMap[a]%n}return-1},t.getIndexedColor=(a,n)=>{n[0]=0,n[1]=0,n[2]=0,n[3]=0},t.updateAnnotatedValueMap=()=>{e.annotatedValueMap=[];const a=e.annotationArray.length;for(let n=0;n{const i=a.getNumberOfComponents();let o=null;if(n===po.DEFAULT&&(a.getDataType()===zn.UNSIGNED_CHAR||a.getDataType()===zn.UNSIGNED_CHAR_CLAMPED)||n===po.DIRECT_SCALARS&&a)o=t.convertToRGBA(a,i,a.getNumberOfTuples());else{const s={type:"vtkDataArray",name:"temp",numberOfComponents:4,dataType:zn.UNSIGNED_CHAR},c=V.newTypedArray(s.dataType,4*a.getNumberOfTuples());s.values=c,s.size=c.length,o=pe.newInstance(s);let l=r;l<0&&i>1?t.mapVectorsThroughTable(a,o,Yf.RGBA,-1,-1):(l<0&&(l=0),l>=i&&(l=i-1),t.mapScalarsThroughTable(a,o,Yf.RGBA,l))}return o},t.mapVectorsToMagnitude=(a,n,r)=>{const i=a.getNumberOfTuples(),o=a.getNumberOfComponents(),s=n.getData(),c=a.getData();for(let l=0;l{let s=t.getVectorMode(),c=o,l=i;const p=a.getNumberOfComponents();s===hn.COMPONENT?(l===-1&&(l=t.getVectorComponent()),l<0&&(l=0),l>=p&&(l=p-1)):(c===-1&&(c=t.getVectorSize()),c<=0?(l=0,c=p):(l<0&&(l=0),l>=p&&(l=p-1),l+c>p&&(c=p-l)),s===hn.MAGNITUDE&&(p===1||c===1)&&(s=hn.COMPONENT));let u=0;switch(l>0&&(u=l),s){case hn.COMPONENT:{t.mapScalarsThroughTable(a,n,r,u);break}case hn.RGBCOLORS:break;case hn.MAGNITUDE:default:{const f=pe.newInstance({numberOfComponents:1,values:new Float32Array(a.getNumberOfTuples())});t.mapVectorsToMagnitude(a,f,c),t.mapScalarsThroughTable(f,n,r,0);break}}},t.luminanceToRGBA=(a,n,r,i)=>{const o=i(r),s=n.getData(),c=a.getData(),l=s.length,p=0,u=1;let f=0;for(let h=p;h{const o=n.getData(),s=a.getData(),c=o.length,l=0,p=2;let u=0;for(let f=l;f{const o=Zf(r),s=n.getData(),c=a.getData(),l=s.length,p=0,u=3;let f=0;for(let h=p;h{const o=n.getData(),s=a.getData(),c=o.length,l=0,p=4;let u=0;for(let f=l;f{let{alpha:i}=e;if(n===4&&i>=1&&a.getDataType()===zn.UNSIGNED_CHAR)return a;const o=pe.newInstance({numberOfComponents:4,empty:!0,size:4*r,dataType:zn.UNSIGNED_CHAR});if(r<=0)return o;i=i>0?i:0,i=i<1?i:1;let s=b5;switch((a.getDataType()===zn.FLOAT||a.getDataType()===zn.DOUBLE)&&(s=Zf),n){case 1:t.luminanceToRGBA(o,a,i,s);break;case 2:t.luminanceAlphaToRGBA(o,a,s);break;case 3:t.rGBToRGBA(o,a,i,s);break;case 4:t.rGBAToRGBA(o,a,i,s);break;default:return Jf("Cannot convert colors"),null}return o},t.usingLogScale=()=>!1,t.getNumberOfAvailableColors=()=>256*256*256,t.setRange=(a,n)=>t.setMappingRange(a,n),t.getRange=()=>t.getMappingRange(),t.areScalarsOpaque=(a,n,r)=>{if(!a)return t.isOpaque();const i=a.getNumberOfComponents();return n===po.DEFAULT&&a.getDataType()===zn.UNSIGNED_CHAR||n===po.DIRECT_SCALARS?i===3||i===1?e.alpha>=1:a.getRange(i-1)[0]===255:!0}}const N5={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:hn.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1,scale:O5.LINEAR};function Qf(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,N5,a),V.obj(t,e),e.mappingRange=[0,255],e.annotationArray=[],e.annotatedValueMap=[],V.setGet(t,e,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),V.setArray(t,e,["mappingRange"],2),V.getArray(t,e,["mappingRange"]),M5(t,e)}var ho={newInstance:V.newInstance(Qf,"vtkScalarsToColors"),extend:Qf,...D0};const{vtkErrorMacro:ep}=V,tp=0,np=1,b0=2;function R5(t,e){e.classHierarchy.push("vtkLookupTable"),t.isOpaque=()=>{if(e.opaqueFlagBuildTime.getMTime()!1,t.getNumberOfAvailableColors=()=>e.table.length/4-3,t.linearIndexLookup=(a,n)=>{let r=0;const i=Number(a);return in.range[1]?r=n.maxIndex+np+1.5:(r=(i+n.shift)*n.scale,r=r{let i=0;to(a)?i=Math.floor(r.maxIndex+1.5+b0):i=t.linearIndexLookup(a,r);const o=4*i;return n.slice(o,o+4)},t.indexedLookupFunction=(a,n,r)=>{let i=t.getAnnotatedValueIndexInternal(a);i===-1&&(i=e.numberOfColors+b0);const o=4*i;return[n[o],n[o+1],n[o+2],n[o+3]]},t.lookupShiftAndScale=(a,n)=>{n.shift=-a[0],n.scale=Number.MAX_VALUE,a[1]>a[0]&&(n.scale=(n.maxIndex+1)/(a[1]-a[0]))},t.mapScalarsThroughTable=(a,n,r,i)=>{let o=t.linearLookup;e.indexedLookup&&(o=t.indexedLookupFunction);const s=t.getMappingRange(),c={maxIndex:t.getNumberOfColors()-1,range:s,shift:0,scale:0};t.lookupShiftAndScale(s,c);const l=t.getAlpha(),p=a.getNumberOfTuples(),u=a.getNumberOfComponents(),f=n.getData(),h=a.getData();if(l>=1){if(r===E0.RGBA)for(let d=0;d{let a=0,n=0,r=0,i=0;const o=e.numberOfColors-1;o&&(a=(e.hueRange[1]-e.hueRange[0])/o,n=(e.saturationRange[1]-e.saturationRange[0])/o,r=(e.valueRange[1]-e.valueRange[0])/o,i=(e.alphaRange[1]-e.alphaRange[0])/o),e.table.length=4*o+16;const s=[],c=[];for(let l=0;l<=o;l++)s[0]=e.hueRange[0]+l*a,s[1]=e.saturationRange[0]+l*n,s[2]=e.valueRange[0]+l*r,lr(s,c),c[3]=e.alphaRange[0]+l*i,e.table[l*4]=c[0]*255+.5,e.table[l*4+1]=c[1]*255+.5,e.table[l*4+2]=c[2]*255+.5,e.table[l*4+3]=c[3]*255+.5;t.buildSpecialColors(),e.buildTime.modified()},t.setTable=a=>{if(Array.isArray(a)){const r=a[0].length;e.numberOfColors=a.length;const i=4-r;let o=0;for(let s=0;s{const{numberOfColors:a}=e,n=e.table;let r=(a+tp)*4;e.useBelowRangeColor||a===0?(n[r]=e.belowRangeColor[0]*255+.5,n[r+1]=e.belowRangeColor[1]*255+.5,n[r+2]=e.belowRangeColor[2]*255+.5,n[r+3]=e.belowRangeColor[3]*255+.5):(n[r]=n[0],n[r+1]=n[1],n[r+2]=n[2],n[r+3]=n[3]),r=(a+np)*4,e.useAboveRangeColor||a===0?(n[r]=e.aboveRangeColor[0]*255+.5,n[r+1]=e.aboveRangeColor[1]*255+.5,n[r+2]=e.aboveRangeColor[2]*255+.5,n[r+3]=e.aboveRangeColor[3]*255+.5):(n[r]=n[4*(a-1)+0],n[r+1]=n[4*(a-1)+1],n[r+2]=n[4*(a-1)+2],n[r+3]=n[4*(a-1)+3]),r=(a+b0)*4,n[r]=e.nanColor[0]*255+.5,n[r+1]=e.nanColor[1]*255+.5,n[r+2]=e.nanColor[2]*255+.5,n[r+3]=e.nanColor[3]*255+.5},t.build=()=>{(e.table.length<1||t.getMTime()>e.buildTime.getMTime()&&e.insertTime.getMTime()<=e.buildTime.getMTime())&&t.forceBuild()},e.table.length>0&&(t.buildSpecialColors(),e.insertTime.modified())}const L5={numberOfColors:256,hueRange:[0,.66667],saturationRange:[1,1],valueRange:[1,1],alphaRange:[1,1],nanColor:[.5,0,0,1],belowRangeColor:[0,0,0,1],aboveRangeColor:[1,1,1,1],useAboveRangeColor:!1,useBelowRangeColor:!1,alpha:1};function rp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,L5,a),ho.extend(t,e,a),e.table||(e.table=[]),e.buildTime={},V.obj(e.buildTime),e.opaqueFlagBuildTime={},V.obj(e.opaqueFlagBuildTime,{mtime:0}),e.insertTime={},V.obj(e.insertTime,{mtime:0}),V.get(t,e,["buildTime"]),V.setGet(t,e,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),V.setArray(t,e,["alphaRange","hueRange","saturationRange","valueRange"],2),V.setArray(t,e,["nanColor","belowRangeColor","aboveRangeColor"],4),V.getArray(t,e,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),R5(t,e)}var ap={newInstance:V.newInstance(rp,"vtkLookupTable"),extend:rp};const Zt={Off:0,PolygonOffset:1};let M0=Zt.PolygonOffset,go=Zt.Off;const F5=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function k5(){return M0}function V5(t){const e=M0===t;return M0=t,e}function A5(){return go}function vo(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;const e=go===t;return go=t,e}function B5(){return vo(Zt.Off)}function U5(){return vo(Zt.Off)}function G5(){return vo(Zt.PolygonOffset)}function I5(){return F5[go]}var N0={Resolve:Zt,getResolveCoincidentTopologyAsString:I5,getResolveCoincidentTopologyPolygonOffsetFaces:k5,getResolveCoincidentTopology:A5,setResolveCoincidentTopology:vo,setResolveCoincidentTopologyPolygonOffsetFaces:V5,setResolveCoincidentTopologyToDefault:B5,setResolveCoincidentTopologyToOff:U5,setResolveCoincidentTopologyToPolygonOffset:G5};function ip(t,e,a){a.forEach(n=>{t[`get${n.method}`]=()=>e[n.key],t[`set${n.method}`]=V.objectSetterMap.object(t,e,{name:n.key,params:["factor","offset"]})})}const R0=["Polygon","Line","Point"],P5={Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},yr={modified:()=>{}};ip(yr,P5,R0.map(t=>({key:t,method:`ResolveCoincidentTopology${t}OffsetParameters`})));function z5(t,e){e.resolveCoincidentTopology===void 0&&(e.resolveCoincidentTopology=!1),V.setGet(t,e,["resolveCoincidentTopology"]),e.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(N0).forEach(a=>{t[a]=N0[a]}),Object.keys(yr).filter(a=>a!=="modified").forEach(a=>{t[a]=yr[a]}),ip(t,e.topologyOffset,R0.map(a=>({key:a,method:`RelativeCoincidentTopology${a}OffsetParameters`}))),t.getCoincidentTopologyPolygonOffsetParameters=()=>{const a=yr.getResolveCoincidentTopologyPolygonOffsetParameters(),n=t.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:a.factor+n.factor,offset:a.offset+n.offset}},t.getCoincidentTopologyLineOffsetParameters=()=>{const a=yr.getResolveCoincidentTopologyLineOffsetParameters(),n=t.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:a.factor+n.factor,offset:a.offset+n.offset}},t.getCoincidentTopologyPointOffsetParameter=()=>{const a=yr.getResolveCoincidentTopologyPointOffsetParameters(),n=t.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:a.factor+n.factor,offset:a.offset+n.offset}}}var yo={implementCoincidentTopologyMethods:z5,staticOffsetAPI:yr,otherStaticMethods:N0,CATEGORIES:R0,Resolve:Zt};const Nt={MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,ID_HIGH24:3,MAX_KNOWN_PASS:3};var op={PassTypes:Nt};const{FieldAssociations:sp}=dr,{staticOffsetAPI:j5,otherStaticMethods:W5}=yo,{ColorMode:mo,ScalarMode:mr,GetArray:L0}=O0,{VectorMode:$5}=D0,{VtkDataTypes:H5}=pe;function Pa(t){return()=>V.vtkErrorMacro(`vtkMapper::${t} - NOT IMPLEMENTED`)}function K5(t,e){const a=t[1]%2===0?1:-1;if(t[0]+=a,t[0]>=e[0]||t[0]<0){const n=t[2]%2===0?1:-1;t[0]-=a,t[1]+=n,(t[1]>=e[1]||t[1]<0)&&(t[1]-=n,t[2]++)}}function X5(t,e){return t[0]+e[0]*(t[1]+e[1]*t[2])}function cp(t,e,a){const n=Math.floor(e),r=n%(2*a[0]);let i,o;r=g,S=i[2]<=1?2:3,T=pe.newInstance({numberOfComponents:S,values:new Float32Array(y*S)}),w=T.getData(),_=[0,0,0];cp(_,r+2,i);let E=0,D=0;const O=[.5,.5,.5];for(let N=0;Nr&&(B=r+1),cp(O,B,i)}else{O[1]=.49;const B=(R-h)*d;B>1e3?O[0]=1e3:B<-1e3?O[0]=-1e3:O[0]=B}for(let B=0;B{const a=t.getInputData();return a?(e.static||t.update(),e.bounds=a.getBounds()):e.bounds=In(),e.bounds},t.setForceCompileOnly=a=>{e.forceCompileOnly=a},t.setSelectionWebGLIdsToVTKIds=a=>{e.selectionWebGLIdsToVTKIds=a},t.createDefaultLookupTable=()=>{e.lookupTable=ap.newInstance()},t.getColorModeAsString=()=>V.enumToString(mo,e.colorMode),t.setColorModeToDefault=()=>t.setColorMode(0),t.setColorModeToMapScalars=()=>t.setColorMode(1),t.setColorModeToDirectScalars=()=>t.setColorMode(2),t.getScalarModeAsString=()=>V.enumToString(mr,e.scalarMode),t.setScalarModeToDefault=()=>t.setScalarMode(0),t.setScalarModeToUsePointData=()=>t.setScalarMode(1),t.setScalarModeToUseCellData=()=>t.setScalarMode(2),t.setScalarModeToUsePointFieldData=()=>t.setScalarMode(3),t.setScalarModeToUseCellFieldData=()=>t.setScalarMode(4),t.setScalarModeToUseFieldData=()=>t.setScalarMode(5),t.getAbstractScalars=(a,n,r,i,o)=>{if(!a||!e.scalarVisibility)return{scalars:null,cellFlag:!1};let s=null,c=!1;if(n===mr.DEFAULT)s=a.getPointData().getScalars(),s||(s=a.getCellData().getScalars(),c=!0);else if(n===mr.USE_POINT_DATA)s=a.getPointData().getScalars();else if(n===mr.USE_CELL_DATA)s=a.getCellData().getScalars(),c=!0;else if(n===mr.USE_POINT_FIELD_DATA){const l=a.getPointData();r===L0.BY_ID?s=l.getArrayByIndex(i):s=l.getArrayByName(o)}else if(n===mr.USE_CELL_FIELD_DATA){const l=a.getCellData();c=!0,r===L0.BY_ID?s=l.getArrayByIndex(i):s=l.getArrayByName(o)}else if(n===mr.USE_FIELD_DATA){const l=a.getFieldData();r===L0.BY_ID?s=l.getArrayByIndex(i):s=l.getArrayByName(o)}return{scalars:s,cellFlag:c}},t.mapScalars=(a,n)=>{const{scalars:r,cellFlag:i}=t.getAbstractScalars(a,e.scalarMode,e.arrayAccessMode,e.arrayId,e.colorByArrayName);if(e.areScalarsMappedFromCells=i,!r){e.colorCoordinates=null,e.colorTextureMap=null,e.colorMapColors=null;return}const o=`${t.getMTime()}${r.getMTime()}${n}`;if(e.colorBuildString!==o){if(e.useLookupTableScalarRange||t.getLookupTable().setRange(e.scalarRange[0],e.scalarRange[1]),t.canUseTextureMapForColoring(r,i))e.mapScalarsToTexture(r,i,n);else{e.colorCoordinates=null,e.colorTextureMap=null;const s=t.getLookupTable();s&&(s.build(),e.colorMapColors=s.mapScalars(r,e.colorMode,e.fieldDataTupleId))}e.colorBuildString=`${t.getMTime()}${r.getMTime()}${n}`}},e.mapScalarsToTexture=(a,n,r)=>{const i=e.lookupTable.getRange(),o=e.lookupTable.usingLogScale(),s=e.lookupTable.getAlpha(),c=o?[Math.log10(i[0]),Math.log10(i[1])]:i;if(e.colorMapColors=null,e.colorTextureMap==null||t.getMTime()>e.colorTextureMap.getMTime()||e.lookupTable.getMTime()>e.colorTextureMap.getMTime()||e.lookupTable.getAlpha()!==r){e.lookupTable.setAlpha(r),e.colorTextureMap=null,e.lookupTable.build();const p=e.lookupTable.getNumberOfAvailableColors(),u=2048,f=u**3-3,d=4096-2,v=2,m=n?f:d;e.numberOfColorsInRange=Math.min(Math.max(p,v),m);const x=e.numberOfColorsInRange+3,y=e.numberOfColorsInRange+2,g=n?[Math.min(Math.ceil(x/u**0),u),Math.min(Math.ceil(x/u**1),u),Math.min(Math.ceil(x/u**2),u)]:[y,2,1],C=g[0]*g[1]*g[2],S=new Float64Array(C);S.fill(NaN);const T=e.numberOfColorsInRange,w=T+2,_=[0,0,0],E=c[0],D=c[1]-c[0];for(let N=0;N1?-1:e.lookupTable.getVectorComponent();e.colorCoordinates=q5(a,l,c,o,e.numberOfColorsInRange,e.colorTextureMap.getDimensions(),n)},t.getIsOpaque=()=>{const a=t.getInputData(),r=t.getAbstractScalars(a,e.scalarMode,e.arrayAccessMode,e.arrayId,e.colorByArrayName).scalars;if(!e.scalarVisibility||r==null)return!0;const i=t.getLookupTable();return i?(i.build(),i.areScalarsOpaque(r,e.colorMode,-1)):!0},t.canUseTextureMapForColoring=(a,n)=>n&&e.colorMode!==mo.DIRECT_SCALARS?!0:!(!e.interpolateScalarsBeforeMapping||e.lookupTable&&e.lookupTable.getIndexedLookup()||!a||e.colorMode===mo.DEFAULT&&a.getDataType()===H5.UNSIGNED_CHAR||e.colorMode===mo.DIRECT_SCALARS),t.clearColorArrays=()=>{e.colorMapColors=null,e.colorCoordinates=null,e.colorTextureMap=null},t.getLookupTable=()=>(e.lookupTable||t.createDefaultLookupTable(),e.lookupTable),t.getMTime=()=>{let a=e.mtime;if(e.lookupTable!==null){const n=e.lookupTable.getMTime();a=n>a?n:a}return a},t.getPrimitiveCount=()=>{const a=t.getInputData();return{points:a.getPoints().getNumberOfValues()/3,verts:a.getVerts().getNumberOfValues()-a.getVerts().getNumberOfCells(),lines:a.getLines().getNumberOfValues()-2*a.getLines().getNumberOfCells(),triangles:a.getPolys().getNumberOfValues()-3*a.getPolys().getNumberOfCells()}},t.acquireInvertibleLookupTable=Pa("AcquireInvertibleLookupTable"),t.valueToColor=Pa("ValueToColor"),t.colorToValue=Pa("ColorToValue"),t.useInvertibleColorFor=Pa("UseInvertibleColorFor"),t.clearInvertibleColor=Pa("ClearInvertibleColor"),t.processSelectorPixelBuffers=(a,n)=>{if(!a||!e.selectionWebGLIdsToVTKIds||!e.populateSelectionSettings)return;const r=a.getRawPixelBuffer(Nt.ID_LOW24),i=a.getRawPixelBuffer(Nt.ID_HIGH24),o=a.getCurrentPass(),s=a.getFieldAssociation();let c=null;s===sp.FIELD_ASSOCIATION_POINTS?c=e.selectionWebGLIdsToVTKIds.points:s===sp.FIELD_ASSOCIATION_CELLS&&(c=e.selectionWebGLIdsToVTKIds.cells),c&&n.forEach(l=>{if(o===Nt.ID_LOW24){let p=0;i&&(p+=i[l],p*=256),p+=r[l+2],p*=256,p+=r[l+1],p*=256,p+=r[l];const u=c[p],f=a.getPixelBuffer(Nt.ID_LOW24);f[l]=u&255,f[l+1]=(u&65280)>>8,f[l+2]=(u&16711680)>>16}else if(o===Nt.ID_HIGH24&&i){let p=0;p+=i[l],p*=256,p+=r[l+2],p*=256,p+=r[l+1],p*=256,p+=r[l];const u=c[p],f=a.getPixelBuffer(Nt.ID_HIGH24);f[l]=(u&4278190080)>>24}})}}const J5={colorMapColors:null,areScalarsMappedFromCells:!1,static:!1,lookupTable:null,scalarVisibility:!0,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,fieldDataTupleId:-1,populateSelectionSettings:!0,selectionWebGLIdsToVTKIds:null,interpolateScalarsBeforeMapping:!1,colorCoordinates:null,colorTextureMap:null,numberOfColorsInRange:0,forceCompileOnly:0,useInvertibleColors:!1,invertibleScalars:null,customShaderAttributes:[]};function lp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,J5,a),T0.extend(t,e,a),V.get(t,e,["areScalarsMappedFromCells","colorCoordinates","colorMapColors","colorTextureMap","numberOfColorsInRange","selectionWebGLIdsToVTKIds"]),V.setGet(t,e,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","populateSelectionSettings","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","customShaderAttributes"]),V.setGetArray(t,e,["scalarRange"],2),yo.implementCoincidentTopologyMethods(t,e),Y5(t,e)}var gn={newInstance:V.newInstance(lp,"vtkMapper"),extend:lp,...j5,...W5,...O0};const{isVtkObject:Z5}=V;function fp(t){let e=0;return t.filter((a,n)=>n===e?(e+=a+1,!0):!1)}function pp(t){let e=0;for(let a=0;a(e.numberOfCells!==void 0&&!n||(e.cellSizes?e.numberOfCells=e.cellSizes.length:e.numberOfCells=pp(t.getData())),e.numberOfCells),t.getCellSizes=n=>(e.cellSizes!==void 0&&!n||(e.cellSizes=fp(t.getData())),e.cellSizes),t.resize=n=>{const r=t.getNumberOfTuples();a.resize(n);const i=t.getNumberOfTuples();i{a.setData(n,1),e.numberOfCells=void 0,e.cellSizes=void 0},t.getCell=n=>{let r=n;const i=e.values[r++];return e.values.subarray(r,r+i)},t.insertNextCell=n=>{let r;Z5(n)?r=n.getPointsIds():r=n;const i=t.getNumberOfCells();return t.insertNextTuples([r.length,...r]),++e.numberOfCells,e.cellSizes!=null&&e.cellSizes.push(r.length),i},t.getMaxCellSize=()=>t.getCellSizes().reduce((n,r)=>Math.max(n,r),0)}function t4(t){return{empty:!0,numberOfComponents:1,dataType:Ne.UNSIGNED_INT,...t}}function hp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};pe.extend(t,e,t4(a)),e4(t,e)}var jn={newInstance:V.newInstance(hp,"vtkCellArray"),extend:hp,...Q5};const{vtkErrorMacro:n4}=V;function r4(t,e){let a=0;e.classHierarchy.push("vtkPoints"),t.getNumberOfPoints=t.getNumberOfTuples,t.setNumberOfPoints=function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;t.getNumberOfPoints()!==i&&(e.size=i*o,e.values=V.newTypedArray(e.dataType,e.size),t.setNumberOfComponents(o),t.modified())},t.setPoint=function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;ct.insertNextTuple([i,o,s]),t.insertPoint=(i,o)=>t.insertTuple(i,o);const n=t.getBounds;t.getBounds=()=>(a(a{if(t.getNumberOfComponents()===3){const i=t.getRange(0);e.bounds[0]=i[0],e.bounds[1]=i[1];const o=t.getRange(1);e.bounds[2]=o[0],e.bounds[3]=o[1];const s=t.getRange(2);e.bounds[4]=s[0],e.bounds[5]=s[1]}else if(t.getNumberOfComponents()===2){const i=t.getRange(0);e.bounds[0]=i[0],e.bounds[1]=i[1];const o=t.getRange(1);e.bounds[2]=o[0],e.bounds[3]=o[1],e.bounds[4]=0,e.bounds[5]=0}else n4(`getBounds called on an array with components of ${t.getNumberOfComponents()}`),o0(e.bounds);a=V.getCurrentGlobalMTime()},t.setNumberOfComponents(e.numberOfComponents<2?3:e.numberOfComponents)}const a4={empty:!0,numberOfComponents:3,dataType:Ne.FLOAT,bounds:[1,-1,1,-1,1,-1]};function gp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,a4,a),pe.extend(t,e,a),V.getArray(t,e,["bounds"],6),r4(t,e)}var dn={newInstance:V.newInstance(gp,"vtkPoints"),extend:gp};function i4(t,e){e.classHierarchy.push("vtkCell"),t.initialize=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(n){e.pointsIds=n;let r=e.points.getData();r.length!==3*e.pointsIds.length&&(r=V.newTypedArray(a.getDataType(),3*e.pointsIds.length));const i=a.getData();e.pointsIds.forEach((o,s)=>{let c=3*o,l=3*s;r[l]=i[c],r[++l]=i[++c],r[++l]=i[++c]}),e.points.setData(r)}else{e.points=a,e.pointsIds=new Array(a.getNumberOfPoints());for(let r=a.getNumberOfPoints()-1;r>=0;--r)e.pointsIds[r]=r}},t.getBounds=()=>e.points.getBounds(),t.getLength2=()=>{const a=we.getLengths(t.getBounds());return a[0]*a[0]+a[1]*a[1]+a[2]*a[2]},t.getParametricDistance=a=>{let n,r=0;for(let i=0;i<3;i++)a[i]<0?n=-a[i]:a[i]>1?n=a[i]-1:n=0,n>r&&(r=n);return r},t.getNumberOfPoints=()=>e.points.getNumberOfPoints(),t.deepCopy=a=>{a.initialize(e.points,e.pointsIds)},t.getCellDimension=()=>{},t.intersectWithLine=(a,n,r,i,o,s,c)=>{},t.evaluatePosition=(a,n,r,i,o,s)=>{V.vtkErrorMacro("vtkCell.evaluatePosition is not implemented.")}}const o4={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function dp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,o4,a),V.obj(t,e),e.points||(e.points=dn.newInstance()),V.get(t,e,["points","pointsIds"]),i4(t,e)}var xr={newInstance:V.newInstance(dp,"vtkCell"),extend:dp};function s4(t,e){let a=e;for(e>=t.array.length&&(a+=t.array.length);a>t.array.length;)t.array.push({ncells:0,cells:null});t.array.length=a}function c4(t,e){e.classHierarchy.push("vtkCellLinks"),t.buildLinks=a=>{const n=a.getPoints().getNumberOfPoints(),r=a.getNumberOfCells(),i=new Uint32Array(n);if(a.isA("vtkPolyData")){for(let o=0;o{t.incrementLinkCount(c)})}t.allocateLinks(n),e.maxId=n-1;for(let o=0;o{t.insertCellReference(c,i[c]++,o)})}}else{for(let o=0;o{t.incrementLinkCount(c)});t.allocateLinks(n),e.maxId=n-1;for(let o=0;o{t.insertCellReference(c,i[c]++,o)})}},t.allocate=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;e.array=Array(a).fill().map(()=>({ncells:0,cells:null})),e.extend=n,e.maxId=-1},t.initialize=()=>{e.array=null},t.getLink=a=>e.array[a],t.getNcells=a=>e.array[a].ncells,t.getCells=a=>e.array[a].cells,t.insertNextPoint=a=>{e.array.push({ncells:a,cells:Array(a)}),++e.maxId},t.insertNextCellReference=(a,n)=>{e.array[a].cells[e.array[a].ncells++]=n},t.deletePoint=a=>{e.array[a].ncells=0,e.array[a].cells=null},t.removeCellReference=(a,n)=>{e.array[n].cells=e.array[n].cells.filter(r=>r!==a),e.array[n].ncells=e.array[n].cells.length},t.addCellReference=(a,n)=>{e.array[n].cells[e.array[n].ncells++]=a},t.resizeCellList=(a,n)=>{e.array[a].cells.length=n},t.squeeze=()=>{s4(e,e.maxId+1)},t.reset=()=>{e.maxId=-1},t.deepCopy=a=>{e.array=[...a.array],e.extend=a.extend,e.maxId=a.maxId},t.incrementLinkCount=a=>{++e.array[a].ncells},t.allocateLinks=a=>{for(let n=0;n{e.array[a].cells[n]=r}}const u4={array:null,maxId:0,extend:0};function vp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,u4,a),V.obj(t,e),c4(t,e)}var l4={newInstance:V.newInstance(vp,"vtkCellLinks"),extend:vp};const $e={VTK_EMPTY_CELL:0,VTK_VERTEX:1,VTK_POLY_VERTEX:2,VTK_LINE:3,VTK_POLY_LINE:4,VTK_TRIANGLE:5,VTK_TRIANGLE_STRIP:6,VTK_POLYGON:7,VTK_PIXEL:8,VTK_QUAD:9,VTK_TETRA:10,VTK_VOXEL:11,VTK_HEXAHEDRON:12,VTK_WEDGE:13,VTK_PYRAMID:14,VTK_PENTAGONAL_PRISM:15,VTK_HEXAGONAL_PRISM:16,VTK_QUADRATIC_EDGE:21,VTK_QUADRATIC_TRIANGLE:22,VTK_QUADRATIC_QUAD:23,VTK_QUADRATIC_POLYGON:36,VTK_QUADRATIC_TETRA:24,VTK_QUADRATIC_HEXAHEDRON:25,VTK_QUADRATIC_WEDGE:26,VTK_QUADRATIC_PYRAMID:27,VTK_BIQUADRATIC_QUAD:28,VTK_TRIQUADRATIC_HEXAHEDRON:29,VTK_QUADRATIC_LINEAR_QUAD:30,VTK_QUADRATIC_LINEAR_WEDGE:31,VTK_BIQUADRATIC_QUADRATIC_WEDGE:32,VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON:33,VTK_BIQUADRATIC_TRIANGLE:34,VTK_CUBIC_LINE:35,VTK_CONVEX_POINT_SET:41,VTK_POLYHEDRON:42,VTK_PARAMETRIC_CURVE:51,VTK_PARAMETRIC_SURFACE:52,VTK_PARAMETRIC_TRI_SURFACE:53,VTK_PARAMETRIC_QUAD_SURFACE:54,VTK_PARAMETRIC_TETRA_REGION:55,VTK_PARAMETRIC_HEX_REGION:56,VTK_HIGHER_ORDER_EDGE:60,VTK_HIGHER_ORDER_TRIANGLE:61,VTK_HIGHER_ORDER_QUAD:62,VTK_HIGHER_ORDER_POLYGON:63,VTK_HIGHER_ORDER_TETRAHEDRON:64,VTK_HIGHER_ORDER_WEDGE:65,VTK_HIGHER_ORDER_PYRAMID:66,VTK_HIGHER_ORDER_HEXAHEDRON:67,VTK_LAGRANGE_CURVE:68,VTK_LAGRANGE_TRIANGLE:69,VTK_LAGRANGE_QUADRILATERAL:70,VTK_LAGRANGE_TETRAHEDRON:71,VTK_LAGRANGE_HEXAHEDRON:72,VTK_LAGRANGE_WEDGE:73,VTK_LAGRANGE_PYRAMID:74,VTK_NUMBER_OF_CELL_TYPES:75},F0=["vtkEmptyCell","vtkVertex","vtkPolyVertex","vtkLine","vtkPolyLine","vtkTriangle","vtkTriangleStrip","vtkPolygon","vtkPixel","vtkQuad","vtkTetra","vtkVoxel","vtkHexahedron","vtkWedge","vtkPyramid","vtkPentagonalPrism","vtkHexagonalPrism","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkQuadraticEdge","vtkQuadraticTriangle","vtkQuadraticQuad","vtkQuadraticTetra","vtkQuadraticHexahedron","vtkQuadraticWedge","vtkQuadraticPyramid","vtkBiQuadraticQuad","vtkTriQuadraticHexahedron","vtkQuadraticLinearQuad","vtkQuadraticLinearWedge","vtkBiQuadraticQuadraticWedge","vtkBiQuadraticQuadraticHexahedron","vtkBiQuadraticTriangle","vtkCubicLine","vtkQuadraticPolygon","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkConvexPointSet","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkParametricCurve","vtkParametricSurface","vtkParametricTriSurface","vtkParametricQuadSurface","vtkParametricTetraRegion","vtkParametricHexRegion","UnknownClass","UnknownClass","UnknownClass","vtkHigherOrderEdge","vtkHigherOrderTriangle","vtkHigherOrderQuad","vtkHigherOrderPolygon","vtkHigherOrderTetrahedron","vtkHigherOrderWedge","vtkHigherOrderPyramid","vtkHigherOrderHexahedron"];function f4(t){return t0&&arguments[0]!==void 0?arguments[0]:512,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;e.size=a>0?a:1,e.extend=n>0?n:1,e.maxId=-1,e.typeArray=new Uint8Array(a),e.locationArray=new Uint32Array(a)},t.insertCell=(a,n,r)=>{e.typeArray[a]=n,e.locationArray[a]=r,a>e.maxId&&(e.maxId=a)},t.insertNextCell=(a,n)=>(t.insertCell(++e.maxId,a,n),e.maxId),t.setCellTypes=(a,n,r)=>{e.size=a,e.typeArray=n,e.locationArray=r,e.maxId=a-1},t.getCellLocation=a=>e.locationArray[a],t.deleteCell=a=>{e.typeArray[a]=$e.VTK_EMPTY_CELL},t.getNumberOfTypes=()=>e.maxId+1,t.isType=a=>{const n=t.getNumberOfTypes();for(let r=0;rt.insertNextCell(a,-1),t.getCellType=a=>e.typeArray[a],t.reset=()=>{e.maxId=-1},t.deepCopy=a=>{t.allocate(a.getSize(),a.getExtend()),e.typeArray.set(a.getTypeArray()),e.locationArray.set(a.getLocationArray()),e.maxId=a.getMaxId()}}const y4={size:0,maxId:-1,extend:1e3};function yp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,y4,a),V.obj(t,e),V.get(t,e,["size","maxId","extend"]),V.getArray(t,e,["typeArray","locationArray"]),v4(t,e)}var m4={newInstance:V.newInstance(yp,"vtkCellTypes"),extend:yp,...d4};const mp={NO_INTERSECTION:0,YES_INTERSECTION:1,ON_LINE:2};var xp={IntersectionState:mp};const{IntersectionState:xo}=xp;function Zr(t,e,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;const r={t:Number.MIN_VALUE,distance:0},i=[];let o;i[0]=a[0]-e[0],i[1]=a[1]-e[1],i[2]=a[2]-e[2];const s=i[0]*(t[0]-e[0])+i[1]*(t[1]-e[1])+i[2]*(t[2]-e[2]),c=xe(i,i);let l=1e-5*s;return c!==0&&(r.t=s/c),l<0&&(l=-l),-l1?o=a:(o=i,i[0]=e[0]+r.t*i[0],i[1]=e[1]+r.t*i[1],i[2]=e[2]+r.t*i[2]),n&&(n[0]=o[0],n[1]=o[1],n[2]=o[2]),r.distance=dt(o,t),r}function Cp(t,e,a,n,r,i){const o=[],s=[],c=[];r[0]=0,i[0]=0,He(e,t,o),He(n,a,s),He(a,t,c);const l=[xe(o,o),-xe(o,s),-xe(o,s),xe(s,s)],p=[];if(p[0]=xe(o,c),p[1]=-xe(s,c),Pl(l,p,2)===0){let u=Number.MAX_VALUE;const f=[t,e,a,n],h=[a,a,t,t],d=[n,n,e,e];i[0],i[0],r[0],r[0],r[0],r[0],i[0],i[0];let v;for(let m=0;m<4;m++)v=Zr(f[m],h[m],d[m]),v.distance=0&&r[0]<=1&&i[0]>=0&&i[0]<=1?xo.YES_INTERSECTION:xo.NO_INTERSECTION}const x4={distanceToLine:Zr,intersection:Cp};function C4(t,e){e.classHierarchy.push("vtkLine");function a(n){return n>=0&&n<=1}t.getCellDimension=()=>1,t.intersectWithLine=(n,r,i,o,s)=>{const c={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};s[1]=0,s[2]=0;const l=[],p=[],u=[];e.points.getPoint(0,p),e.points.getPoint(1,u);const f=[],h=[],d=Cp(n,r,p,u,f,h);if(c.t=f[0],c.betweenPoints=a(c.t),s[0]=h[0],d===xo.YES_INTERSECTION){for(let v=0;v<3;v++)o[v]=p[v]+s[0]*(u[v]-p[v]),l[v]=n[v]+c.t*(r[v]-n[v]);if(dt(o,l)<=i*i)return c.intersect=1,c}else{let v;if(c.t<0)return v=Zr(n,p,u,o),v.distance<=i*i&&(c.t=0,c.intersect=1,c.betweenPoints=!0),c;if(c.t>1)return v=Zr(r,p,u,o),v.distance<=i*i&&(c.t=1,c.intersect=1,c.betweenPoints=!0),c;if(s[0]<0)return s[0]=0,v=Zr(p,n,r,o),c.t=v.t,v.distance<=i*i&&(c.intersect=1),c;if(s[0]>1)return s[0]=1,v=Zr(u,n,r,o),c.t=v.t,v.distance<=i*i&&(c.intersect=1),c}return c},t.evaluateLocation=(n,r,i)=>{const o=[],s=[];e.points.getPoint(0,o),e.points.getPoint(1,s);for(let c=0;c<3;c++)r[c]=o[c]+n[0]*(s[c]-o[c]);i[0]=1-n[0],i[1]=n[0]},t.evaluateOrientation=(n,r,i)=>e.orientations?(bi(r,e.orientations[0],e.orientations[1],n[0]),i[0]=1-n[0],i[1]=n[0],!0):!1}const S4={orientations:null};function Sp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,S4,a),xr.extend(t,e,a),V.setGet(t,e,["orientations"]),C4(t,e)}var Ot={newInstance:V.newInstance(Sp,"vtkLine"),extend:Sp,...x4,...xp};function T4(t,e){e.classHierarchy.push("vtkPointSet"),e.points?e.points=wt(e.points):e.points=dn.newInstance(),t.getNumberOfPoints=()=>e.points.getNumberOfPoints(),t.getBounds=()=>e.points.getBounds(),t.computeBounds=()=>{t.getBounds()};const a=t.shallowCopy;t.shallowCopy=function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a(i,o),e.points=dn.newInstance(),e.points.shallowCopy(i.getPoints())};const n=t.getMTime;t.getMTime=()=>{var o;const i=n();return Math.max(i,((o=e.points)==null?void 0:o.getMTime())??i)};const r=t.initialize;t.initialize=()=>{var i;return(i=e.points)==null||i.initialize(),r()}}const w4={};function Tp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,w4,a),dr.extend(t,e,a),V.setGet(t,e,["points"]),T4(t,e)}var _4={newInstance:V.newInstance(Tp,"vtkPointSet"),extend:Tp};function E4(t,e){e.classHierarchy.push("vtkPolyLine");const a=Ot.newInstance();a.getPoints().setNumberOfPoints(2),t.getCellDimension=()=>1,t.intersectWithLine=(n,r,i,o,s,c,l)=>{const p={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null},u=t.getNumberOfPoints()-1;let f=Number.MAX_VALUE;for(let h=0;h=n&&v.t<=r){p.intersect=1;const m=a.getParametricDistance(d);if(m(a.getPoints().getData().set(e.points.getData().subarray(3*n,3*(n+2))),a.evaluateLocation(r,i,o)),t.evaluateOrientation=(n,r,i,o)=>(e.orientations?a.setOrientations([e.orientations[n],e.orientations[n+1]]):a.setOrientations(null),a.evaluateOrientation(r,i,o)),t.getDistancesToFirstPoint=()=>{const n=e.distancesTime.getMTime();if(n0){const i=new Array(3),o=new Array(3);let s=0;e.distances[0]=s,e.points.getPoint(0,i);for(let c=1;c{const r=t.getDistancesToFirstPoint();if(r.length<2)return-1;let i=0,o=r.length-1;if(nr[o]||r[o]===0)return-1;for(;o-i>1;){const s=Math.floor((i+o)/2);r[s]<=n?i=s:o=s}return i}}const D4={orientations:null,distanceFunction:R2};function wp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,D4,a),xr.extend(t,e,a),V.setGet(t,e,["orientations","distanceFunction"]),e.distancesTime={},V.obj(e.distancesTime,{mtime:0}),E4(t,e)}var O4={newInstance:V.newInstance(wp,"vtkPolyLine"),extend:wp};function b4(t,e){e.classHierarchy.push("vtkPriorityQueue"),t.push=(a,n)=>{const r=e.elements.findIndex(i=>i.priority>a);e.elements.splice(r,0,{priority:a,element:n})},t.pop=()=>e.elements.length>0?e.elements.shift().element:null,t.deleteById=a=>{e.elements=e.elements.filter(n=>{let{element:r}=n;return r.id!==a})},t.length=()=>e.elements.length}const M4={elements:[]};function _p(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,M4,a),V.obj(t,e),b4(t,e)}var N4={newInstance:V.newInstance(_p,"vtkPriorityQueue"),extend:_p};const Co=1e-6,Ep=11920929e-14,R4=1e-8,Cr={FAILURE:-1,OUTSIDE:0,INSIDE:1,INTERSECTION:2,ON_LINE:3};function Dp(t,e,a,n,r){return(n[t]-a[t])*(r[e]-a[e])-(r[t]-a[t])*(n[e]-a[e])}function L4(t,e,a,n){if(t[0]a[1]||t[1]a[3]||t[2]a[5])return Cr.OUTSIDE;if(Ke(n)<=Ep)return Cr.FAILURE;let r=R4*((a[1]-a[0])*(a[1]-a[0])+(a[3]-a[2])*(a[3]-a[2])+(a[5]-a[4])*(a[5]-a[4]));r*=r,r=r===0?Ep:r;const i=[],o=[];for(let p=0;p0&&f<1)return Cr.INSIDE}let s,c;Math.abs(n[0])>Math.abs(n[1])?Math.abs(n[0])>Math.abs(n[2])?(s=1,c=2):(s=0,c=1):Math.abs(n[1])>Math.abs(n[2])?(s=0,c=2):(s=0,c=1);let l=0;for(let p=0;pt[c]&&Dp(s,c,i,o,t)>0&&++l:o[c]<=t[c]&&Dp(s,c,i,o,t)<0&&--l;return l===0?Cr.OUTSIDE:Cr.INSIDE}function F4(t,e,a){const n=t.length,r=[];e.getPoint(t[0],r),a[0]=r[0],a[1]=r[0],a[2]=r[1],a[3]=r[1],a[4]=r[2],a[5]=r[2];for(let o=1;o2&&arguments[2]!==void 0?arguments[2]:[0,0,0];a[0]=0,a[1]=0,a[2]=0;const n=t.length,r=[];for(let i=0;iCo?1:f<-Co?-1:0,d=h<0?1:0;for(let v=l.next.next;v.id!==c.id;v=v.next){const m=v.previous;f=fn.evaluate(u,c.point,v.point);const x=f>Co?1:f<-Co?-1:0;if(x!==h){if(d||(d=x<=0?1:0),Ot.intersection(c.point,l.point,v.point,m.point,[0],[0])===mp.YES_INTERSECTION)return!1;h=x}}return d===1}function i(s,c){e.pointCount-=1;const l=s.previous,p=s.next;e.tris=e.tris.concat(s.point),e.tris=e.tris.concat(p.point),e.tris=e.tris.concat(l.point),l.next=p,p.previous=l,c.deleteById(l.id),c.deleteById(p.id);const u=n(l);u>0&&c.push(u,l);const f=n(p);f>0&&c.push(f,p),s.id===e.firstPoint.id&&(e.firstPoint=p)}function o(){a();const s=N4.newInstance();let c=e.firstPoint;for(let l=0;l0&&s.push(p,c),c=c.next}for(;e.pointCount>2&&s.length()>0;)if(e.pointCount===s.length()){const l=s.pop();i(l,s)}else{const l=s.pop();r(l)&&i(l,s)}return e.pointCount<=2}t.triangulate=()=>e.firstPoint?o():null,t.setPoints=s=>{e.pointCount=s.length,e.firstPoint={id:0,point:s[0],next:null,previous:null};let c=e.firstPoint;for(let l=1;le.tris}const U4={firstPoint:null,pointCount:0,tris:[]};function Op(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,U4,a),V.obj(t,e),B4(t,e)}var G4={newInstance:V.newInstance(Op,"vtkPolygon"),extend:Op,...A4};function k0(t,e,a,n){const r=a[0]-e[0],i=a[1]-e[1],o=a[2]-e[2],s=t[0]-e[0],c=t[1]-e[1],l=t[2]-e[2];n[0]=i*l-o*c,n[1]=o*s-r*l,n[2]=r*c-i*s}function za(t,e,a,n){k0(t,e,a,n);const r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);r!==0&&(n[0]/=r,n[1]/=r,n[2]/=r)}function bp(t){t[0]=-1,t[1]=1,t[2]=0,t[3]=-1,t[4]=0,t[5]=1}function I4(t,e,a,n,r,i){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1e-6,s=!1;const c=[],l=[],p=[],u=[],f=[];za(t,e,a,u),za(n,r,i,f);const h=-xe(u,t),d=-xe(f,n),v=[xe(f,t)+d,xe(f,e)+d,xe(f,a)+d];if(v[0]*v[1]>o&&v[0]*v[2]>o)return{intersect:!1,coplanar:s,pt1:c,pt2:l,surfaceId:p};const m=[xe(u,n)+h,xe(u,r)+h,xe(u,i)+h];if(m[0]*m[1]>o&&m[0]*m[2]>o)return{intersect:!1,coplanar:s,pt1:c,pt2:l,surfaceId:p};if(Math.abs(u[0]-f[0])<1e-9&&Math.abs(u[1]-f[1])<1e-9&&Math.abs(u[2]-f[2])<1e-9&&Math.abs(h-d)<1e-9)return s=!0,{intersect:!1,coplanar:s,pt1:c,pt2:l,surfaceId:p};const x=[t,e,a],y=[n,r,i],g=xe(u,f),C=(h-d*g)/(g*g-1),S=(d-h*g)/(g*g-1),T=[C*u[0]+S*f[0],C*u[1]+S*f[1],C*u[2]+S*f[2]],w=et(u,f,[]);Ke(w);let _=0,E=0;const D=[],O=[];let M=50,N=50;for(let I=0;I<3;I++){const P=I,L=(I+1)%3,k=fn.intersectWithLine(x[P],x[L],n,f);k.intersection&&k.t>0-o&&k.t<1+o&&(k.t<1+o&&k.t>1-o&&(M=_),D[_++]=xe(k.x,w)-xe(T,w));const A=fn.intersectWithLine(y[P],y[L],t,u);A.intersection&&A.t>0-o&&A.t<1+o&&(A.t<1+o&&A.t>1-o&&(N=E),O[E++]=xe(A.x,w)-xe(T,w))}if(_>2){_--;const I=D[2];D[2]=D[M],D[M]=I}if(E>2){E--;const I=O[2];O[2]=O[N],O[N]=I}if(_!==2||E!==2)return{intersect:!1,coplanar:s,pt1:c,pt2:l,surfaceId:p};if(Number.isNaN(D[0])||Number.isNaN(D[1])||Number.isNaN(O[0])||Number.isNaN(O[1]))return{intersect:!1,coplanar:s,pt1:c,pt2:l,surfaceId:p};if(D[0]>D[1]){const I=D[1];D[1]=D[0],D[0]=I}if(O[0]>O[1]){const I=O[1];O[1]=O[0],O[0]=I}let R,B;return D[1]2,t.intersectWithLine=(a,n,r,i,o)=>{const s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};o[2]=0;const c=[],l=r*r,p=[],u=[],f=[];e.points.getPoint(0,p),e.points.getPoint(1,u),e.points.getPoint(2,f);const h=[],d=[];if(za(p,u,f,h),h[0]!==0||h[1]!==0||h[2]!==0){const g=fn.intersectWithLine(a,n,p,h);if(s.betweenPoints=g.betweenPoints,s.t=g.t,i[0]=g.x[0],i[1]=g.x[1],i[2]=g.x[2],!g.intersection)return o[0]=0,o[1]=0,s.intersect=0,s;const C=t.evaluatePosition(i,c,o,d);if(C.evaluation>=0)return C.dist2<=l?(s.intersect=1,s):(s.intersect=C.evaluation,s)}const v=dt(p,u),m=dt(u,f),x=dt(f,p);e.line||(e.line=Ot.newInstance()),v>m&&v>x?(e.line.getPoints().setPoint(0,p),e.line.getPoints().setPoint(1,u)):m>x&&m>v?(e.line.getPoints().setPoint(0,u),e.line.getPoints().setPoint(1,f)):(e.line.getPoints().setPoint(0,f),e.line.getPoints().setPoint(1,p));const y=e.line.intersectWithLine(a,n,r,i,o);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){const g=[],C=[],S=[];for(let T=0;T<3;T++)g[T]=p[T]-f[T],C[T]=u[T]-f[T],S[T]=i[T]-f[T];return o[0]=xe(S,g)/x,o[1]=xe(S,C)/m,s.intersect=1,s}return o[0]=0,o[1]=0,s.intersect=0,s},t.evaluatePosition=(a,n,r,i)=>{const o={subId:0,dist2:0,evaluation:-1};let s,c;const l=[],p=[],u=[],f=[];let h;const d=[],v=[],m=[];let x=0,y=0;const g=[];let C,S,T,w=[];const _=[],E=[],D=[];o.subId=0,r[2]=0,e.points.getPoint(1,l),e.points.getPoint(2,p),e.points.getPoint(0,u),k0(l,p,u,f),fn.generalizedProjectPoint(a,l,f,D);let O=0;for(s=0;s<3;s++)f[s]<0?h=-f[s]:h=f[s],h>O&&(O=h,y=s);for(c=0,s=0;s<3;s++)s!==y&&(g[c++]=s);for(s=0;s<2;s++)d[s]=D[g[s]]-u[g[s]],v[s]=l[g[s]]-u[g[s]],m[s]=p[g[s]]-u[g[s]];if(x=it(v,m),x===0)return r[0]=0,r[1]=0,o.evaluation=-1,o;if(r[0]=it(d,m)/x,r[1]=it(v,d)/x,i[0]=1-(r[0]+r[1]),i[1]=r[0],i[2]=r[1],i[0]>=0&&i[0]<=1&&i[1]>=0&&i[1]<=1&&i[2]>=0&&i[2]<=1)n&&(o.dist2=dt(D,a),n[0]=D[0],n[1]=D[1],n[2]=D[2]),o.evaluation=1;else{let M;if(n){if(i[1]<0&&i[2]<0)for(C=dt(a,u),S=Ot.distanceToLine(a,l,u,M,_),T=Ot.distanceToLine(a,u,p,M,E),C{const i=[],o=[],s=[];e.points.getPoint(0,i),e.points.getPoint(1,o),e.points.getPoint(2,s);const c=1-a[0]-a[1];for(let l=0;l<3;l++)n[l]=i[l]*c+o[l]*a[0]+s[l]*a[1];r[0]=c,r[1]=a[0],r[2]=a[1]},t.getParametricDistance=a=>{let n,r=0;const i=[];i[0]=a[0],i[1]=a[1],i[2]=1-a[0]-a[1];for(let o=0;o<3;o++)i[o]<0?n=-i[o]:i[o]>1?n=i[o]-1:n=0,n>r&&(r=n);return r},t.derivatives=(a,n,r,i,o)=>{const s=e.points.getPoint(0),c=e.points.getPoint(1),l=e.points.getPoint(2),p=[],u=[],f=[],h=[];za(s,c,l,p),He(c,s,u),He(l,s,h),et(p,u,f);const d=Ke(u);if(d<=0||Ke(f)<=0){for(let S=0;S{const i=n[0]-n[1],o=.5*(1-n[0])-n[1],s=2*n[0]+n[1]-1;return i>=0&&o>=0?(r[0]=e.pointsIds[0],r[1]=e.pointsIds[1]):o<0&&s>=0?(r[0]=e.pointsIds[1],r[1]=e.pointsIds[2]):(r[0]=e.pointsIds[2],r[1]=e.pointsIds[0]),!(n[0]<0||n[1]<0||n[0]>1||n[1]>1||1-n[0]-n[1]<0)}}const j4={};function Mp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,j4,a),xr.extend(t,e,a),z4(t,e)}var V0={newInstance:V.newInstance(Mp,"vtkTriangle"),extend:Mp,...P4};function Np(){return{intersected:!1,subId:-1,x:[0,0,0],pCoords:[0,0,0],t:-1}}function W4(t,e){e.classHierarchy.push("vtkQuad"),t.getCellDimension=()=>2,t.getCellType=()=>$e.VTK_QUAD,t.getNumberOfEdges=()=>4,t.getNumberOfFaces=()=>0,t.intersectWithLine=(a,n,r,i,o)=>{let s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1},c;const l=e.points.getPoint(0,[]),p=e.points.getPoint(1,[]),u=e.points.getPoint(2,[]),f=e.points.getPoint(3,[]),h=dt(l,u),d=dt(p,f);if(h===d){let T,w=0,_=0;for(let E=0;E<4;E++)T=e.pointsIds[E],T>w&&(w=T,_=E);_===0||_===2?c=0:c=1}else h{const r=1-a[0],i=1-a[1];n[0]=r*i,n[1]=a[0]*i,n[2]=a[0]*a[1],n[3]=r*a[1]},t.evaluateLocation=(a,n,r)=>{const i=[];t.interpolationFunctions(a,r),n[0]=0,n[1]=0,n[2]=0;for(let o=0;o<4;o++){e.points.getPoint(o,i);for(let s=0;s<3;s++)n[s]+=i[s]*r[o]}}}const $4={};function Rp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,$4,a),xr.extend(t,e,a),W4(t,e)}var H4={newInstance:V.newInstance(Rp,"vtkQuad"),extend:Rp};const{vtkErrorMacro:Lp}=V;function Fp(t){return()=>Lp(`vtkTriangleStrip.${t} - NOT IMPLEMENTED`)}function K4(t,e){if(!Array.isArray(t)||t.length<3){Lp("decomposeStrip - Invalid points array");return}let a=t[0],n=t[1];for(let r=0;r{e.triangle.initialize(n,r),a(n,r)},t.getCellType=()=>$e.VTK_TRIANGLE_STRIP,t.getCellDimension=()=>2,t.getNumberOfEdges=()=>e.pointsIds.length,t.getNumberOfFaces=()=>0,t.evaluatePosition=(n,r,i,o,s)=>{const c=[0,0,0];let l=Number.MAX_VALUE,p=0;const u=[],f=[],h=[];i[2]=0,f[0]=0,f[1]=0,f[2]=0;const d=e.triangle.getPoints();d.setNumberOfPoints(3);const m=e.triangle.getPointsIds().length;for(let x=0;x=0&&(T{const s=[[0,1,2],[1,0,2]],c=n%2,l=e.pointsIds.length;for(let d=0;d{const o=[[0,1,2],[1,0,2]],s=n%2,c=e.triangle.getPointsIds();return c[0]=e.pointsIds[o[s][0]],c[1]=e.pointsIds[o[s][1]],c[2]=e.pointsIds[o[s][2]],e.triangle.cellBoundary(0,r,i)},t.getEdge=n=>{let r,i;const o=e.pointsIds.length;return n===0?(r=0,i=1):n===o-1?(r=n-1,i=n):(r=n-1,i=n+1),e.line.getPointsIds()[0]=e.pointsIds[r],e.line.getPointsIds()[1]=e.pointsIds[i],e.line.getPoints().setPoint(0,e.points.getPoint(r)),e.line.getPoints().setPoint(1,e.points.getPoint(i)),e.line},t.intersectWithLine=(n,r,i,o,s)=>{const c=e.pointsIds.length-2,l=e.triangle.getPoints();l.setNumberOfPoints(3);for(let p=0;p{const n=e.points.getNumberOfPoints()-2;e.tris=new Array(3*n);const r=[[0,1,2],[1,0,2]];for(let i=0;ie.tris,t.derivatives=(n,r,i,o,s)=>{const c=[];e.points.getPoint(n,c);const l=[];e.points.getPoint(n+1,l);const p=[];e.points.getPoint(n+2,p);const u=e.triangle.getPoints();u.setPoint(0,...c),u.setPoint(1,...l),u.setPoint(2,...p),e.triangle.derivatives(0,r,i,o,s)},t.getParametricCenter=n=>(n[0]=.333333,n[1]=.333333,n[2]=0,Math.floor((e.pointsIds.length-2)/2)),t.contour=(n,r,i,o,s,c,l,p,u,f,h)=>Fp("contour")(),t.clip=(n,r,i,o,s,c,l,p,u,f)=>Fp("clip")()}const Y4={line:null,triangle:null,tris:null};function kp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Y4,a),xr.extend(t,e,a),e.line||(e.line=Ot.newInstance()),e.triangle||(e.triangle=V0.newInstance()),q4(t,e)}var J4={newInstance:V.newInstance(kp,"vtkTriangleStrip"),extend:kp,...X4};const Qr=["verts","lines","polys","strips"],{vtkWarningMacro:Vp}=V,Z4={[$e.VTK_LINE]:Ot,[$e.VTK_QUAD]:H4,[$e.VTK_POLY_LINE]:Ot,[$e.VTK_TRIANGLE]:V0,[$e.VTK_TRIANGLE_STRIP]:J4,[$e.VTK_POLY_LINE]:O4,[$e.VTK_POLYGON]:G4};function Q4(t,e){e.classHierarchy.push("vtkPolyData");function a(s){return s.replace(/(?:^\w|[A-Z]|\b\w)/g,c=>c.toUpperCase()).replace(/\s+/g,"")}function n(){e.cells=void 0,e.links=void 0}Qr.forEach(s=>{t[`getNumberOf${a(s)}`]=()=>e[s].getNumberOfCells(),e[s]?e[s]=wt(e[s]):e[s]=jn.newInstance(),e[`_on${a(s)}Changed`]=n}),t.getNumberOfCells=()=>Qr.reduce((s,c)=>s+e[c].getNumberOfCells(),0);const r=t.shallowCopy;t.shallowCopy=function(s){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r(s,c),Qr.forEach(l=>{e[l]=jn.newInstance(),e[l].shallowCopy(s.getReferenceByName(l))})};const i=t.getMTime;t.getMTime=()=>Qr.reduce((s,c)=>{var l;return Math.max(s,((l=e[c])==null?void 0:l.getMTime())??s)},i());const o=t.initialize;t.initialize=()=>(Qr.forEach(s=>{var c;return(c=e[s])==null?void 0:c.initialize()}),n(),o()),t.buildCells=()=>{const s=t.getNumberOfVerts(),c=t.getNumberOfLines(),l=t.getNumberOfPolys(),p=t.getNumberOfStrips(),u=s+c+l+p,f=new Uint8Array(u);let h=f;const d=new Uint32Array(u);let v=d;if(s){let m=0;e.verts.getCellSizes().forEach((x,y)=>{v[y]=m,h[y]=x>1?$e.VTK_POLY_VERTEX:$e.VTK_VERTEX,m+=x+1}),v=v.subarray(s),h=h.subarray(s)}if(c){let m=0;e.lines.getCellSizes().forEach((x,y)=>{v[y]=m,h[y]=x>2?$e.VTK_POLY_LINE:$e.VTK_LINE,x===1&&Vp("Building VTK_LINE ",y," with only one point, but VTK_LINE needs at least two points. Check the input."),m+=x+1}),v=v.subarray(c),h=h.subarray(c)}if(l){let m=0;e.polys.getCellSizes().forEach((x,y)=>{switch(v[y]=m,x){case 3:h[y]=$e.VTK_TRIANGLE;break;case 4:h[y]=$e.VTK_QUAD;break;default:h[y]=$e.VTK_POLYGON;break}x<3&&Vp("Building VTK_TRIANGLE ",y," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),m+=x+1}),v+=v.subarray(l),h+=h.subarray(l)}if(p){let m=0;h.fill($e.VTK_TRIANGLE_STRIP,0,p),e.strips.getCellSizes().forEach((x,y)=>{v[y]=m,m+=x+1})}e.cells=m4.newInstance(),e.cells.setCellTypes(u,f,d)},t.buildLinks=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;e.cells==null&&t.buildCells(),e.links=l4.newInstance(),s>0?e.links.allocate(s):e.links.allocate(t.getPoints().getNumberOfPoints()),e.links.buildLinks(t)},t.getCellType=s=>e.cells.getCellType(s),t.getCellPoints=s=>{const c=t.getCellType(s);let l=null;switch(c){case $e.VTK_VERTEX:case $e.VTK_POLY_VERTEX:l=e.verts;break;case $e.VTK_LINE:case $e.VTK_POLY_LINE:l=e.lines;break;case $e.VTK_TRIANGLE:case $e.VTK_QUAD:case $e.VTK_POLYGON:l=e.polys;break;case $e.VTK_TRIANGLE_STRIP:l=e.strips;break;default:return l=null,{type:0,cellPointIds:null}}const p=e.cells.getCellLocation(s),u=l.getCell(p);return{cellType:c,cellPointIds:u}},t.getPointCells=s=>e.links.getCells(s),t.getCellEdgeNeighbors=(s,c,l)=>{const p=e.links.getLink(c),u=e.links.getLink(l);return p.cells.filter(f=>f!==s&&u.cells.indexOf(f)!==-1)},t.getCell=function(s){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const l=t.getCellPoints(s),p=c||Z4[l.cellType].newInstance();return p.initialize(t.getPoints(),l.cellPointIds),p},t.getMaxCellSize=()=>Qr.reduce((s,c)=>{var l,p;return Math.max(s,((p=(l=e[c])==null?void 0:l.getMaxCellSize)==null?void 0:p.call(l))??0)},0)}const e9={};function Ap(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,e9,a),_4.extend(t,e,a),V.get(t,e,["cells","links"]),V.setGet(t,e,["verts","lines","polys","strips"]),Q4(t,e)}var Xe={newInstance:V.newInstance(Ap,"vtkPolyData"),extend:Ap};function t9(t,e){e.classHierarchy.push("vtkTexture"),t.imageLoaded=()=>{e.image.removeEventListener("load",t.imageLoaded),e.imageLoaded=!0,t.modified()},t.setJsImageData=a=>{e.jsImageData!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.image=null,e.canvas=null,e.imageBitmap=null),e.jsImageData=a,e.imageLoaded=!0,t.modified())},t.setImageBitmap=a=>{e.imageBitmap!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.image=null,e.canvas=null,e.jsImageData=null),e.imageBitmap=a,e.imageLoaded=!0,t.modified())},t.setCanvas=a=>{e.canvas!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.image=null,e.imageBitmap=null,e.jsImageData=null),e.canvas=a,t.modified())},t.setImage=a=>{e.image!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.canvas=null,e.jsImageData=null,e.imageBitmap=null),e.image=a,e.imageLoaded=!1,a.complete?t.imageLoaded():a.addEventListener("load",t.imageLoaded),t.modified())},t.getDimensionality=()=>{let a=0,n=0,r=1;if(t.getInputData()){const o=t.getInputData();a=o.getDimensions()[0],n=o.getDimensions()[1],r=o.getDimensions()[2]}return e.jsImageData&&(a=e.jsImageData.width,n=e.jsImageData.height),e.canvas&&(a=e.canvas.width,n=e.canvas.height),e.image&&(a=e.image.width,n=e.image.height),e.imageBitmap&&(a=e.imageBitmap.width,n=e.imageBitmap.height),(a>1)+(n>1)+(r>1)},t.getInputAsJsImageData=()=>{if(!e.imageLoaded||t.getInputData())return null;if(e.jsImageData)return e.jsImageData;if(e.imageBitmap)return e.imageBitmap;if(e.canvas)return e.canvas.getContext("2d").getImageData(0,0,e.canvas.width,e.canvas.height);if(e.image){const a=e.image.width,n=e.image.height,i=new OffscreenCanvas(a,n).getContext("2d");return i.translate(0,n),i.scale(1,-1),i.drawImage(e.image,0,0,a,n),i.getImageData(0,0,a,n)}return null}}const n9=(t,e,a)=>{const n=` +(function(Kt,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],se):(Kt=typeof globalThis<"u"?globalThis:Kt||self,se(Kt.vue_vtk={},Kt.Vue))})(this,function(Kt,se){"use strict";var nu=Object.defineProperty,jd=(t,e)=>{let a={};for(var n in t)nu(a,n,{get:t[n],enumerable:!0});return e||nu(a,Symbol.toStringTag,{value:"Module"}),a},Vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $d(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var a=function n(){if(this instanceof n){var r=[null];r.push.apply(r,arguments);var i=Function.bind.apply(e,r);return new i}return e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}),a}var ru=Object.prototype.toString,au=function(e){var a=ru.call(e),n=a==="[object Arguments]";return n||(n=a!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&ru.call(e.callee)==="[object Function]"),n},ms,iu;function Hd(){if(iu)return ms;iu=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,n=au,r=Object.prototype.propertyIsEnumerable,i=!r.call({toString:null},"toString"),o=r.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(f){var h=f.constructor;return h&&h.prototype===f},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!c["$"+f]&&e.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{u(window[f])}catch{return!0}}catch{return!0}return!1}(),l=function(f){if(typeof window>"u"||!p)return u(f);try{return u(f)}catch{return!1}};t=function(h){var v=h!==null&&typeof h=="object",m=a.call(h)==="[object Function]",x=n(h),y=v&&a.call(h)==="[object String]",d=[];if(!v&&!m&&!x)throw new TypeError("Object.keys called on a non-object");var g=o&&m;if(y&&h.length>0&&!e.call(h,0))for(var C=0;C0)for(var S=0;S"u"?Ue:on(Uint8Array),nr={"%AggregateError%":typeof AggregateError>"u"?Ue:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ue:ArrayBuffer,"%ArrayIteratorPrototype%":Pr?on([][Symbol.iterator]()):Ue,"%AsyncFromSyncIteratorPrototype%":Ue,"%AsyncFunction%":zr,"%AsyncGenerator%":zr,"%AsyncGeneratorFunction%":zr,"%AsyncIteratorPrototype%":zr,"%Atomics%":typeof Atomics>"u"?Ue:Atomics,"%BigInt%":typeof BigInt>"u"?Ue:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ue:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ue:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ue:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Ue:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ue:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ue:FinalizationRegistry,"%Function%":lu,"%GeneratorFunction%":zr,"%Int8Array%":typeof Int8Array>"u"?Ue:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ue:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ue:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Pr?on(on([][Symbol.iterator]())):Ue,"%JSON%":typeof JSON=="object"?JSON:Ue,"%Map%":typeof Map>"u"?Ue:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Pr?Ue:on(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ue:Promise,"%Proxy%":typeof Proxy>"u"?Ue:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Ue:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ue:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Pr?Ue:on(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ue:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Pr?on(""[Symbol.iterator]()):Ue,"%Symbol%":Pr?Symbol:Ue,"%SyntaxError%":Gr,"%ThrowTypeError%":o2,"%TypedArray%":s2,"%TypeError%":Ir,"%Uint8Array%":typeof Uint8Array>"u"?Ue:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ue:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ue:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ue:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Ue:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ue:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ue:WeakSet};try{null.error}catch(t){var c2=on(on(t));nr["%Error.prototype%"]=c2}var u2=function t(e){var a;if(e==="%AsyncFunction%")a=Cs("async function () {}");else if(e==="%GeneratorFunction%")a=Cs("function* () {}");else if(e==="%AsyncGeneratorFunction%")a=Cs("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(a=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var r=t("%AsyncGenerator%");r&&(a=on(r.prototype))}return nr[e]=a,a},fu={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},va=uu,Ci=i2,l2=va.call(Function.call,Array.prototype.concat),f2=va.call(Function.apply,Array.prototype.splice),pu=va.call(Function.call,String.prototype.replace),Si=va.call(Function.call,String.prototype.slice),p2=va.call(Function.call,RegExp.prototype.exec),h2=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,g2=/\\(\\)?/g,d2=function(e){var a=Si(e,0,1),n=Si(e,-1);if(a==="%"&&n!=="%")throw new Gr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&a!=="%")throw new Gr("invalid intrinsic syntax, expected opening `%`");var r=[];return pu(e,h2,function(i,o,s,u){r[r.length]=s?pu(u,g2,"$1"):o||i}),r},v2=function(e,a){var n=e,r;if(Ci(fu,n)&&(r=fu[n],n="%"+r[0]+"%"),Ci(nr,n)){var i=nr[n];if(i===zr&&(i=u2(n)),typeof i>"u"&&!a)throw new Ir("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new Gr("intrinsic "+e+" does not exist!")},y2=function(e,a){if(typeof e!="string"||e.length===0)throw new Ir("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new Ir('"allowMissing" argument must be a boolean');if(p2(/^%?[^%]*%?$/,e)===null)throw new Gr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=d2(e),r=n.length>0?n[0]:"",i=v2("%"+r+"%",a),o=i.name,s=i.value,u=!1,c=i.alias;c&&(r=c[0],f2(n,l2([0,1],c)));for(var p=1,l=!0;p=n.length){var m=tr(s,f);l=!!m,l&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else l=Ci(s,f),s=s[f];l&&!u&&(nr[o]=s)}}return s},m2=y2,Ts=m2("%Object.defineProperty%",!0),ws=function(){if(Ts)try{return Ts({},"a",{value:1}),!0}catch{return!1}return!1};ws.hasArrayLengthDefineBug=function(){if(!ws())return null;try{return Ts([],"length",{value:1}).length!==1}catch{return!0}};var x2=ws,C2=qd,S2=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",T2=Object.prototype.toString,w2=Array.prototype.concat,hu=Object.defineProperty,_2=function(t){return typeof t=="function"&&T2.call(t)==="[object Function]"},E2=x2(),gu=hu&&E2,D2=function(t,e,a,n){if(e in t){if(n===!0){if(t[e]===a)return}else if(!_2(n)||!n())return}gu?hu(t,e,{configurable:!0,enumerable:!1,value:a,writable:!0}):t[e]=a},du=function(t,e){var a=arguments.length>2?arguments[2]:{},n=C2(e);S2&&(n=w2.call(n,Object.getOwnPropertySymbols(e)));for(var r=0;rnull};function _t(t){if(t==null||t.isA)return t;if(!t.vtkClass)return Xt.console&&Xt.console.error&&Xt.console.error("Invalid VTK object"),null;const e=Cu[t.vtkClass];if(!e)return Xt.console&&Xt.console.error&&Xt.console.error(`No vtk class found for Object of type ${t.vtkClass}`),null;const a={...t};Object.keys(a).forEach(r=>{a[r]&&typeof a[r]=="object"&&a[r].vtkClass&&(a[r]=_t(a[r]))});const n=e(a);return n&&n.modified&&n.modified(),n}function V2(t,e){Cu[t]=e}_t.register=V2;var Es=class extends Array{push(){for(let t=0;tRs,TYPED_ARRAYS:()=>mt,VOID:()=>Tu,_capitalize:()=>st,algo:()=>Ns,capitalize:()=>Wr,chain:()=>In,debounce:()=>En,default:()=>A,event:()=>jr,formatBytesToProperUnit:()=>Nu,formatNumbersWithThousandSeparator:()=>Ru,get:()=>Bt,getArray:()=>ma,isVtkObject:()=>Ls,keystore:()=>Fs,measurePromiseExecution:()=>Fu,moveToProtected:()=>xa,newInstance:()=>qe,newTypedArray:()=>ar,newTypedArrayFrom:()=>Ei,normalizeWheel:()=>Wu,obj:()=>lt,proxy:()=>Bu,proxyPropertyMapping:()=>Uu,proxyPropertyState:()=>Gu,requiredParam:()=>Su,set:()=>ya,setArray:()=>Ms,setGet:()=>ht,setGetArray:()=>Di,setImmediateVTK:()=>bs,setLoggerFunction:()=>_u,throttle:()=>Vu,traverseInstanceTree:()=>Ca,uncapitalize:()=>Mu,vtkDebugMacro:()=>wi,vtkErrorMacro:()=>ze,vtkInfoMacro:()=>Du,vtkLogMacro:()=>Eu,vtkOnceErrorMacro:()=>bu,vtkWarningMacro:()=>_i}),Os=0,Su=t=>{throw new Error(`Named parameter '${t}' is missing`)},Tu=Symbol("void");function B2(){return Os}var wu={};function rr(){}["log","debug","info","warn","error","time","timeEnd","group","groupEnd"].forEach(t=>{wu[t]=rr}),Xt.console=console.hasOwnProperty("log")?console:wu;var Gn={debug:rr,error:Xt.console.error||rr,info:Xt.console.info||rr,log:Xt.console.log||rr,warn:Xt.console.warn||rr};function _u(t,e){Gn[t]&&(Gn[t]=e||rr)}function Eu(...t){Gn.log(...t)}function Du(...t){Gn.info(...t)}function wi(...t){Gn.debug(...t)}function ze(...t){Gn.error(...t)}function _i(...t){Gn.warn(...t)}var Ou={};function bu(t){Ou[t]||(Gn.error(t),Ou[t]=!0)}var mt=Object.create(null);mt.Float32Array=Float32Array,mt.Float64Array=Float64Array,mt.Uint8Array=Uint8Array,mt.Int8Array=Int8Array,mt.Uint16Array=Uint16Array,mt.Int16Array=Int16Array,mt.Uint32Array=Uint32Array,mt.Int32Array=Int32Array,mt.Uint8ClampedArray=Uint8ClampedArray;try{mt.BigInt64Array=BigInt64Array,mt.BigUint64Array=BigUint64Array}catch{}function ar(t,...e){return new(mt[t]||Float64Array)(...e)}function Ei(t,...e){return(mt[t]||Float64Array).from(...e)}function Wr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function st(t){return Wr(t[0]==="_"?t.slice(1):t)}function Mu(t){return t.charAt(0).toLowerCase()+t.slice(1)}function Nu(t,e=2,a=1e3){const n=["TB","GB","MB","KB"];let r=Number(t),i="B";for(;r>a;)r/=a,i=n.pop();return`${r.toFixed(e)} ${i}`}function Ru(t,e=" "){const a=[];let n=t;for(;n>1e3;)a.push(`000${n%1e3}`.slice(-3)),n=Math.floor(n/1e3);return n>0&&a.push(n),a.reverse(),a.join(e)}function Lu(t){Object.keys(t).forEach(e=>{Array.isArray(t[e])&&(t[e]=[].concat(t[e]))})}function U2(t){return Object.values(mt).some(e=>t instanceof e)}function G2(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let a=0;at[a]===e)}function bs(t){setTimeout(t,0)}function Fu(t,e){const a=performance.now();t.finally(()=>{e(performance.now()-a)})}function lt(t={},e={}){Lu(e);const a=[];if(Number.isInteger(e.mtime)||(e.mtime=++Os),!("classHierarchy"in e))e.classHierarchy=new Es("vtkObject");else if(!(e.classHierarchy instanceof Es)){const i=new Es;for(let o=0;o!!e.deleted,t.modified=i=>{if(e.deleted){ze("instance deleted - cannot call any method");return}i&&io&&o(t)))},t.onModified=i=>{if(e.deleted)return ze("instance deleted - cannot call any method"),null;const o=a.length;return a.push(i),r(o)},t.getMTime=()=>e.mtime,t.isA=i=>{let o=e.classHierarchy.length;for(;o--;)if(e.classHierarchy[o]===i)return!0;return!1},t.getClassName=(i=0)=>e.classHierarchy[e.classHierarchy.length-1-i],t.set=(i={},o=!1,s=!1)=>{let u=!1;return Object.keys(i).forEach(c=>{const p=s?null:t[`set${Wr(c)}`];p&&Array.isArray(i[c])&&p.length>1?u=p(...i[c])||u:p?u=p(i[c])||u:(["mtime"].indexOf(c)===-1&&!o&&_i(`Warning: Set value to model directly ${c}, ${i[c]}`),u=e[c]!==i[c]||u,e[c]=i[c])}),u},t.get=(...i)=>{if(!i.length)return e;const o={};return i.forEach(s=>{o[s]=e[s]}),o},t.getReferenceByName=i=>e[i],t.delete=()=>{Object.keys(e).forEach(i=>delete e[i]),a.forEach((i,o)=>n(o)),e.deleted=!0},t.getState=({preserveTypedArrays:i=!1}={})=>{if(e.deleted)return null;const o={preserveTypedArrays:i},s={...e,vtkClass:t.getClassName()};Object.keys(s).forEach(c=>{s[c]===null||s[c]===void 0||c[0]==="_"?delete s[c]:s[c].isA?s[c]=s[c].getState(o):Array.isArray(s[c])?s[c]=s[c].map(p=>p&&p.isA?p.getState(o):p):U2(s[c])&&(i||(s[c]=Array.from(s[c])))});const u={};return Object.keys(s).sort().forEach(c=>{u[c]=s[c]}),u.mtime&&delete u.mtime,u},t.shallowCopy=(i,o=!1)=>{if(i.getClassName()!==t.getClassName())throw new Error(`Cannot ShallowCopy ${i.getClassName()} into ${t.getClassName()}`);const s=i.get(),u=Object.keys(e).sort();Object.keys(s).sort().forEach(c=>{const p=u.indexOf(c);p===-1?o&&wi(`add ${c} in shallowCopy`):u.splice(p,1),e[c]=s[c]}),u.length&&o&&wi(`Untouched keys: ${u.join(", ")}`),t.modified()},t.toJSON=function(){return t.getState()},t}var P2={object(t,e,a){return function(){return{...e[a.name]}}}};function Bt(t,e,a){a.forEach(n=>{if(typeof n=="object"){const r=P2[n.type];r?t[`get${st(n.name)}`]=r(t,e,n):t[`get${st(n.name)}`]=()=>e[n.name]}else t[`get${st(n)}`]=()=>e[n]})}var ku={enum(t,e,a){const n=`_on${st(a.name)}Changed`;return r=>{var i;if(typeof r=="string"){if(a.enum[r]!==void 0)return e[a.name]!==a.enum[r]?(e[a.name]=a.enum[r],t.modified(),!0):!1;throw ze(`Set Enum with invalid argument ${a}, ${r}`),new RangeError("Set Enum with invalid string argument")}if(typeof r=="number"){if(e[a.name]!==r){if(Object.keys(a.enum).map(o=>a.enum[o]).indexOf(r)!==-1){const o=e[a.name];return e[a.name]=r,(i=e[n])==null||i.call(e,t,e,r,o),t.modified(),!0}throw ze(`Set Enum outside numeric range ${a}, ${r}`),new RangeError("Set Enum outside numeric range")}return!1}throw ze(`Set Enum with invalid argument (String/Number) ${a}, ${r}`),new TypeError("Set Enum with invalid argument (String/Number)")}},object(t,e,a){var r;((r=a.params)==null?void 0:r.length)===1&&_i('Setter of type "object" with a single "param" field is not supported');const n=`_on${st(a.name)}Changed`;return(...i)=>{var s,u;let o;if(i.length>1&&((s=a.params)!=null&&s.length)?o=a.params.reduce((c,p,l)=>Object.assign(c,{[p]:i[l]}),{}):o=i[0],!Ds(e[a.name],o)){const c=e[a.name];return e[a.name]=o,(u=e[n])==null||u.call(e,t,e,o,c),t.modified(),!0}return!1}}};function Au(t){if(typeof t=="object"){const e=ku[t.type];if(e)return(a,n)=>e(a,n,t);throw ze(`No setter for field ${t}`),new TypeError("No setter for field")}return function(a,n){const r=`_on${st(t)}Changed`;return function(o){var s;if(n.deleted)return ze("instance deleted - cannot call any method"),!1;if(n[t]!==o){const u=n[t.name];return n[t]=o,(s=n[r])==null||s.call(n,a,n,o,u),a.modified(),!0}return!1}}}function ya(t,e,a){a.forEach(n=>{typeof n=="object"?t[`set${st(n.name)}`]=Au(n)(t,e):t[`set${st(n)}`]=Au(n)(t,e)})}function ht(t,e,a){Bt(t,e,a),ya(t,e,a)}function ma(t,e,a){a.forEach(n=>{t[`get${st(n)}`]=()=>e[n]?Array.from(e[n]):e[n],t[`get${st(n)}ByReference`]=()=>e[n]})}function Ms(t,e,a,n,r=void 0){a.forEach(i=>{if(e[i]&&n&&e[i].length!==n)throw new RangeError(`Invalid initial number of values for array (${i})`);const o=`_on${st(i)}Changed`;t[`set${st(i)}`]=(...s)=>{var l;if(e.deleted)return ze("instance deleted - cannot call any method"),!1;let u=s,c,p=!1;if(u.length===1&&(u[0]==null||u[0].length>=0)&&(u=u[0],p=!0),u==null)c=e[i]!==u;else{if(n&&u.length!==n)if(u.length{const u=e[i];s.forEach((c,p)=>{u[p]=c})}})}function Di(t,e,a,n,r=void 0){ma(t,e,a),Ms(t,e,a,n,r)}function xa(t,e,a){for(let n=0;n=e.numberOfInputs){ze(`algorithm ${t.getClassName()} only has ${e.numberOfInputs} input ports. To add more input ports, use addInputData()`);return}(e.inputData[v]!==h||e.inputConnection[v])&&(e.inputData[v]=h,e.inputConnection[v]=null,t.modified&&t.modified())}function i(h=0){return e.inputConnection[h]&&(e.inputData[h]=e.inputConnection[h]()),e.inputData[h]}function o(h,v=0){if(e.deleted){ze("instance deleted - cannot call any method");return}if(v>=e.numberOfInputs){let m=`algorithm ${t.getClassName()} only has `;m+=`${e.numberOfInputs}`,m+=" input ports. To add more input ports, use addInputConnection()",ze(m);return}e.inputData[v]=null,e.inputConnection[v]=h}function s(h=0){return e.inputConnection[h]}function u(){let h=e.numberOfInputs;for(;h&&!e.inputData[h-1]&&!e.inputConnection[h-1];)h--;return h===e.numberOfInputs&&e.numberOfInputs++,h}function c(h){if(e.deleted){ze("instance deleted - cannot call any method");return}o(h,u())}function p(h){if(e.deleted){ze("instance deleted - cannot call any method");return}r(h,u())}function l(h=0){return e.deleted?(ze("instance deleted - cannot call any method"),null):(t.shouldUpdate()&&t.update(),e.output[h])}t.shouldUpdate=()=>{var x,y;const h=t.getMTime();let v=1/0,m=n;for(;m--;){if(!e.output[m]||e.output[m].isDeleted())return!0;const d=e.output[m].getMTime();if(dv)return!0;return!1};function f(h=0){const v=()=>l(h);return v.filter=t,v}if(e.numberOfInputs){let h=e.numberOfInputs;for(;h--;)e.inputData.push(null),e.inputConnection.push(null);t.setInputData=r,t.setInputConnection=o,t.addInputData=p,t.addInputConnection=c,t.getInputData=i,t.getInputConnection=s}n&&(t.getOutputData=l,t.getOutputPort=f),t.update=()=>{const h=[];if(e.numberOfInputs){let v=0;for(;ve.numberOfInputs,t.getNumberOfOutputPorts=()=>n||e.output.length,t.getInputArrayToProcess=h=>{const v=e.inputArrayToProcess[h],m=e.inputData[h];return v&&m?m[`get${v.fieldAssociation}`]().getArray(v.arrayName):null},t.setInputArrayToProcess=(h,v,m,x="Scalars")=>{for(;e.inputArrayToProcess.lengthl.apply(t,arguments),1-f);else if(l.apply(t,arguments)===Rs)break}}}t[`invoke${st(a)}`]=u,t[`on${st(a)}`]=(c,p=0)=>{if(!c.apply)return console.error(`Invalid callback for event ${a}`),null;if(e.deleted)return ze("instance deleted - cannot call any method"),null;const l=i++;return n.push([l,c,p]),n.sort((f,h)=>h[2]-f[2]),s(l)},t.delete=()=>{r(),n.forEach(([c])=>o(c))}}function qe(t,e){const a=(n={})=>{const r={},i={};return t(i,r,n),Object.freeze(i)};return e&&_t.register(e,a),a}function In(...t){return(...e)=>t.filter(a=>!!a).map(a=>a(...e))}function Ls(t){return t&&t.isA&&t.isA("vtkObject")}function Ca(t,e,a=[],n=[]){if(Ls(t)){if(n.indexOf(t)>=0)return a;n.push(t);const r=e(t);r!==void 0&&a.push(r);const i=t.get();Object.keys(i).forEach(o=>{const s=i[o];Array.isArray(s)?s.forEach(u=>{Ca(u,e,a,n)}):Ca(s,e,a,n)})}return a}function En(t,e,a){let n;const r=(...i)=>{const o=this,s=()=>{n=null,a||t.apply(o,i)},u=a&&!n;clearTimeout(n),n=setTimeout(s,e),u&&t.apply(o,i)};return r.cancel=()=>clearTimeout(n),r}function Vu(t,e){let a=!1,n=null;function r(){a=!1,n!==null&&(i(...n),n=null)}function i(...o){if(a){n=o;return}a=!0,t(...o),setTimeout(r,e)}return i}function Fs(t,e,a={}){e.keystore=Object.assign(e.keystore||{},a),t.setKey=(n,r)=>{e.keystore[n]=r},t.getKey=n=>e.keystore[n],t.getAllKeys=()=>Object.keys(e.keystore),t.deleteKey=n=>delete e.keystore[n],t.clearKeystore=()=>t.getAllKeys().forEach(n=>delete e.keystore[n])}var z2=1,Oi="__root__";function Bu(t,e){Fs(t,e);const a=t.delete;e.proxyId=`${z2++}`,e.ui=JSON.parse(JSON.stringify(e.ui||[])),Bt(t,e,["proxyId","proxyGroup","proxyName"]),ht(t,e,["proxyManager"]);const n={},r={};function i(c,p){r[p]||(r[p]=[]);const l=r[p];for(let f=0;f{e.ui=JSON.parse(JSON.stringify(c||[])),Object.keys(n).forEach(p=>delete n[p]),Object.keys(r).forEach(p=>delete r[p]),i(e.ui,Oi),t.modified()};function o(c=Oi){return r[c]}t.updateProxyProperty=(c,p)=>{const l=n[c];l?Object.assign(l,p):n[c]={...p}},t.activate=()=>{if(e.proxyManager){const c=`setActive${st(t.getProxyGroup().slice(0,-1))}`;e.proxyManager[c]&&e.proxyManager[c](t)}},e.propertyLinkSubscribers={},t.registerPropertyLinkForGC=(c,p)=>{p in e.propertyLinkSubscribers||(e.propertyLinkSubscribers[p]=[]),e.propertyLinkSubscribers[p].push(c)},t.gcPropertyLinks=c=>{const p=e.propertyLinkSubscribers[c]||[];for(;p.length;)p.pop().unbind(t)},e.propertyLinkMap={},t.getPropertyLink=(c,p=!1)=>{if(e.propertyLinkMap[c])return e.propertyLinkMap[c];let l=null;const f=[];let h=0,v=!1;function m(C,S=!1){if(v)return null;const T=[];let w=null;for(h=f.length;h--;){const E=f[h];E.instance===C?w=E:T.push(E)}if(!w)return null;const _=w.instance[`get${st(w.propertyName)}`]();if(!G2(_,l)||S){for(l=_,v=!0;T.length;){const E=T.pop();E.instance.set({[E.propertyName]:l})}v=!1}return e.propertyLinkMap[c].persistent&&(e.propertyLinkMap[c].value=_),_}function x(C,S){const T=[];for(h=f.length;h--;){const w=f[h];w.instance===C&&(w.propertyName===S||S===void 0)&&(w.subscription.unsubscribe(),T.push(h))}for(;T.length;)f.splice(T.pop(),1)}function y(C,S,T=!1){const w=C.onModified(m),_=f[0];return f.push({instance:C,propertyName:S,subscription:w}),T&&(e.propertyLinkMap[c].persistent&&e.propertyLinkMap[c].value!==void 0?C.set({[S]:e.propertyLinkMap[c].value}):_&&m(_.instance,!0)),{unsubscribe:()=>x(C,S)}}function d(){for(;f.length;)f.pop().subscription.unsubscribe()}const g={bind:y,unbind:x,unsubscribe:d,persistent:p};return e.propertyLinkMap[c]=g,g};function s(c=Oi){const p=[],l=e.proxyId,f=o(c)||[];for(let h=0;hs().map(c=>c.name),t.getPropertyByName=c=>s().find(p=>p.name===c),t.getPropertyDomainByName=c=>(n[c]||{}).domain,t.getProxySection=()=>({id:e.proxyId,name:e.proxyGroup,ui:e.ui,properties:s()}),t.delete=()=>{const c=Object.keys(e.propertyLinkMap);let p=c.length;for(;p--;)e.propertyLinkMap[c[p]].unsubscribe();Object.keys(e.propertyLinkSubscribers).forEach(t.gcPropertyLinks),a()},t.getState=()=>null;function u(){if(e.links)for(let c=0;c{for(;r.length;)r.pop().unsubscribe();n()}}function Gu(t,e,a={},n={}){e.this=t;function r(s){const u=Object.keys(s);let c=u.length;for(;c--;){const p=u[c];e[p].set(s[p])}}const i=Object.keys(n);let o=i.length;for(;o--;){const s=i[o];e[s]=n[s];const u=a[s];t[`set${st(s)}`]=c=>{if(c!==e[s]){e[s]=c;const p=u[c];r(p),t.modified()}}}i.length&&Bt(t,e,i)}var Iu=10,Pu=40,zu=800;function Wu(t){let e=0,a=0,n=0,r=0;return"detail"in t&&(a=t.detail),"wheelDelta"in t&&(a=-t.wheelDelta/120),"wheelDeltaY"in t&&(a=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=a,a=0),n=e*Iu,r=a*Iu,"deltaY"in t&&(r=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||r)&&t.deltaMode&&(t.deltaMode===1?(n*=Pu,r*=Pu):(n*=zu,r*=zu)),n&&!e&&(e=n<1?-1:1),r&&!a&&(a=r<1?-1:1),{spinX:e,spinY:a||e,pixelX:n,pixelY:r||n}}var A={algo:Ns,capitalize:Wr,chain:In,debounce:En,enumToString:I2,event:jr,EVENT_ABORT:Rs,formatBytesToProperUnit:Nu,formatNumbersWithThousandSeparator:Ru,get:Bt,getArray:ma,getCurrentGlobalMTime:B2,isVtkObject:Ls,keystore:Fs,measurePromiseExecution:Fu,moveToProtected:xa,newInstance:qe,newTypedArray:ar,newTypedArrayFrom:Ei,normalizeWheel:Wu,obj:lt,proxy:Bu,proxyPropertyMapping:Uu,proxyPropertyState:Gu,safeArrays:Lu,set:ya,setArray:Ms,setGet:ht,setGetArray:Di,setImmediate:bs,setLoggerFunction:_u,throttle:Vu,traverseInstanceTree:Ca,TYPED_ARRAYS:mt,uncapitalize:Mu,VOID:Tu,vtkDebugMacro:wi,vtkErrorMacro:ze,vtkInfoMacro:Du,vtkLogMacro:Eu,vtkOnceErrorMacro:bu,vtkWarningMacro:_i,objectSetterMap:ku,requiredParam:Su},ks=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],W2=[1,0,0,0,1,0,0,0,1],As=1e-6,Vs={},j2={get exports(){return Vs},set exports(t){Vs=t}};(function(t){(function(e,a,n){function r(u){var c=this,p=s();c.next=function(){var l=2091639*c.s0+c.c*23283064365386963e-26;return c.s0=c.s1,c.s1=c.s2,c.s2=l-(c.c=l|0)},c.c=1,c.s0=p(" "),c.s1=p(" "),c.s2=p(" "),c.s0-=p(u),c.s0<0&&(c.s0+=1),c.s1-=p(u),c.s1<0&&(c.s1+=1),c.s2-=p(u),c.s2<0&&(c.s2+=1),p=null}function i(u,c){return c.c=u.c,c.s0=u.s0,c.s1=u.s1,c.s2=u.s2,c}function o(u,c){var p=new r(u),l=c&&c.state,f=p.next;return f.int32=function(){return p.next()*4294967296|0},f.double=function(){return f()+(f()*2097152|0)*11102230246251565e-32},f.quick=f,l&&(typeof l=="object"&&i(l,p),f.state=function(){return i(p,{})}),f}function s(){var u=4022871197,c=function(p){p=String(p);for(var l=0;l>>0,f-=u,f*=u,u=f>>>0,f-=u,u+=f*4294967296}return(u>>>0)*23283064365386963e-26};return c}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.alea=o})(Vt,t,!1)})(j2);var Bs={},$2={get exports(){return Bs},set exports(t){Bs=t}};(function(t){(function(e,a,n){function r(s){var u=this,c="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var l=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^l^l>>>8},s===(s|0)?u.x=s:c+=s;for(var p=0;p>>0)/4294967296};return l.double=function(){do var f=c.next()>>>11,h=(c.next()>>>0)/4294967296,v=(f+h)/(1<<21);while(v===0);return v},l.int32=c.next,l.quick=l,p&&(typeof p=="object"&&i(p,c),l.state=function(){return i(c,{})}),l}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xor128=o})(Vt,t,!1)})($2);var Us={},H2={get exports(){return Us},set exports(t){Us=t}};(function(t){(function(e,a,n){function r(s){var u=this,c="";u.next=function(){var l=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(l^l<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,s===(s|0)?u.x=s:c+=s;for(var p=0;p>>4),u.next()}function i(s,u){return u.x=s.x,u.y=s.y,u.z=s.z,u.w=s.w,u.v=s.v,u.d=s.d,u}function o(s,u){var c=new r(s),p=u&&u.state,l=function(){return(c.next()>>>0)/4294967296};return l.double=function(){do var f=c.next()>>>11,h=(c.next()>>>0)/4294967296,v=(f+h)/(1<<21);while(v===0);return v},l.int32=c.next,l.quick=l,p&&(typeof p=="object"&&i(p,c),l.state=function(){return i(c,{})}),l}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xorwow=o})(Vt,t,!1)})(H2);var Gs={},K2={get exports(){return Gs},set exports(t){Gs=t}};(function(t){(function(e,a,n){function r(s){var u=this;u.next=function(){var p=u.x,l=u.i,f,h;return f=p[l],f^=f>>>7,h=f^f<<24,f=p[l+1&7],h^=f^f>>>10,f=p[l+3&7],h^=f^f>>>3,f=p[l+4&7],h^=f^f<<7,f=p[l+7&7],f=f^f<<13,h^=f^f<<9,p[l]=h,u.i=l+1&7,h};function c(p,l){var f,h=[];if(l===(l|0))h[0]=l;else for(l=""+l,f=0;f0;--f)p.next()}c(u,s)}function i(s,u){return u.x=s.x.slice(),u.i=s.i,u}function o(s,u){s==null&&(s=+new Date);var c=new r(s),p=u&&u.state,l=function(){return(c.next()>>>0)/4294967296};return l.double=function(){do var f=c.next()>>>11,h=(c.next()>>>0)/4294967296,v=(f+h)/(1<<21);while(v===0);return v},l.int32=c.next,l.quick=l,p&&(p.x&&i(p,c),l.state=function(){return i(c,{})}),l}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xorshift7=o})(Vt,t,!1)})(K2);var Is={},X2={get exports(){return Is},set exports(t){Is=t}};(function(t){(function(e,a,n){function r(s){var u=this;u.next=function(){var p=u.w,l=u.X,f=u.i,h,v;return u.w=p=p+1640531527|0,v=l[f+34&127],h=l[f=f+1&127],v^=v<<13,h^=h<<17,v^=v>>>15,h^=h>>>12,v=l[f]=v^h,u.i=f,v+(p^p>>>16)|0};function c(p,l){var f,h,v,m,x,y=[],d=128;for(l===(l|0)?(h=l,l=null):(l=l+"\0",h=0,d=Math.max(d,l.length)),v=0,m=-32;m>>15,h^=h<<4,h^=h>>>13,m>=0&&(x=x+1640531527|0,f=y[m&127]^=h+x,v=f==0?v+1:0);for(v>=128&&(y[(l&&l.length||0)&127]=-1),v=127,m=4*128;m>0;--m)h=y[v+34&127],f=y[v=v+1&127],h^=h<<13,f^=f<<17,h^=h>>>15,f^=f>>>12,y[v]=h^f;p.w=x,p.X=y,p.i=v}c(u,s)}function i(s,u){return u.i=s.i,u.w=s.w,u.X=s.X.slice(),u}function o(s,u){s==null&&(s=+new Date);var c=new r(s),p=u&&u.state,l=function(){return(c.next()>>>0)/4294967296};return l.double=function(){do var f=c.next()>>>11,h=(c.next()>>>0)/4294967296,v=(f+h)/(1<<21);while(v===0);return v},l.int32=c.next,l.quick=l,p&&(p.X&&i(p,c),l.state=function(){return i(c,{})}),l}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.xor4096=o})(Vt,t,!1)})(X2);var Ps={},q2={get exports(){return Ps},set exports(t){Ps=t}};(function(t){(function(e,a,n){function r(s){var u=this,c="";u.next=function(){var l=u.b,f=u.c,h=u.d,v=u.a;return l=l<<25^l>>>7^f,f=f-h|0,h=h<<24^h>>>8^v,v=v-l|0,u.b=l=l<<20^l>>>12^f,u.c=f=f-h|0,u.d=h<<16^f>>>16^v,u.a=v-l|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,s===Math.floor(s)?(u.a=s/4294967296|0,u.b=s|0):c+=s;for(var p=0;p>>0)/4294967296};return l.double=function(){do var f=c.next()>>>11,h=(c.next()>>>0)/4294967296,v=(f+h)/(1<<21);while(v===0);return v},l.int32=c.next,l.quick=l,p&&(typeof p=="object"&&i(p,c),l.state=function(){return i(c,{})}),l}a&&a.exports?a.exports=o:n&&n.amd?n(function(){return o}):this.tychei=o})(Vt,t,!1)})(q2);var zs={},Y2={get exports(){return zs},set exports(t){zs=t}};const J2=$d(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(t){(function(e,a,n){var r=256,i=6,o=52,s="random",u=n.pow(r,i),c=n.pow(2,o),p=c*2,l=r-1,f;function h(C,S,T){var w=[];S=S==!0?{entropy:!0}:S||{};var _=y(x(S.entropy?[C,g(a)]:C??d(),3),w),E=new v(w),D=function(){for(var O=E.g(i),b=u,R=0;O=p;)O/=2,b/=2,R>>>=1;return(O+R)/b};return D.int32=function(){return E.g(4)|0},D.quick=function(){return E.g(4)/4294967296},D.double=D,y(g(E.S),a),(S.pass||T||function(O,b,R,N){return N&&(N.S&&m(N,E),O.state=function(){return m(E,{})}),R?(n[s]=O,b):O})(D,_,"global"in S?S.global:this==n,S.state)}function v(C){var S,T=C.length,w=this,_=0,E=w.i=w.j=0,D=w.S=[];for(T||(C=[T++]);_$u(`vtkMath::${t} - NOT IMPLEMENTED`)}function Ta(t,e,a,n){let r;for(let i=0;iMath.PI;function iv(t,e){return e>1023?t*2**1023*2**(e-1023):e<-1074?t*2**-1074*2**(e+1074):t*2**e}function et(t){return t/180*Math.PI}function _a(t){return t*180/Math.PI}var{round:Ea,floor:Ws,ceil:ov,min:sv,max:cv}=Math;function uv(t,e=0,a=1){let n=1/0;for(let r=e,i=t.length;r=0;--r)if(a[r]i&&r>o?(u=0,c=1,p=2):i>o?(u=1,c=2,p=0):(u=2,c=0,p=1);const l=t[u]/s,f=t[c]/s,h=t[p]/s,v=Math.sqrt(l*l+h*h);if(n!==0){const m=Math.sin(n),x=Math.cos(n);e&&(e[u]=(h*x-l*f*m)/v,e[c]=m*v,e[p]=(-(l*x)-f*h*m)/v),a&&(a[u]=(-(h*m)-l*f*x)/v,a[c]=x*v,a[p]=(l*m-f*h*x)/v)}else e&&(e[u]=h/v,e[c]=0,e[p]=-l/v),a&&(a[u]=-l*f/v,a[c]=v,a[p]=-f*h/v)}function _v(t,e,a){const n=xe(e,e);if(n===0)return a[0]=0,a[1]=0,a[2]=0,!1;const r=xe(t,e)/n;for(let i=0;i<3;i++)a[i]=e[i];return js(a,r),!0}function Hs(t,e){return t[0]*e[0]+t[1]*e[1]}function Ev(t,e,a){const n=Hs(e,e);if(n===0)return a[0]=0,a[1]=0,!1;const r=Hs(t,e)/n;for(let i=0;i<2;i++)a[i]=e[i];return Xu(a,r),!0}function dt(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])+(t[2]-e[2])*(t[2]-e[2])}function Dv(t,e){const a=[0,0,0];return tt(t,e,a),Math.atan2(xt(a),xe(t,e))}function Ov(t,e,a){const n=Math.abs(t-a);return 1/Math.sqrt(2*Math.PI*e)*Math.exp(-(n**2)/(2*e))}function bv(t,e,a){const n=Math.abs(t-a);return Math.exp(-(n**2)/(2*e))}function Mv(t,e,a){a[0]=t[0]*e[0],a[1]=t[0]*e[1],a[2]=t[1]*e[0],a[3]=t[1]*e[1]}function qu(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Yu(t){const e=qu(t);return e!==0&&(t[0]/=e,t[1]/=e),e}function ot(...t){return t.length===2?t[0][0]*t[1][1]-t[1][0]*t[0][1]:t.length===4?t[0]*t[3]-t[1]*t[2]:NaN}function Nv(t,e){let a,n,r;const i=[0,0,0];for(let o=0;o<3;o++)r=Math.abs(t[o*3]),(n=Math.abs(t[o*3+1]))>r&&(r=n),(n=Math.abs(t[o*3+2]))>r&&(r=n),i[o]=1/r;r=i[0]*Math.abs(t[0]),a=0,(n=i[1]*Math.abs(t[3]))>=r&&(r=n,a=1),(n=i[2]*Math.abs(t[6]))>=r&&(a=2),a!==0&&(Ta(t,3,a,0),i[a]=i[0]),e[0]=a,t[3]/=t[0],t[6]/=t[0],t[4]-=t[3]*t[1],t[7]-=t[6]*t[1],r=i[1]*Math.abs(t[4]),a=1,(n=i[2]*Math.abs(t[7]))>=r&&(a=2,Ta(t,3,1,2),i[2]=i[1]),e[1]=a,t[7]/=t[4],t[5]-=t[3]*t[2],t[8]-=t[6]*t[2]+t[7]*t[5],e[2]=2}function Rv(t,e,a){let n=a[e[0]];a[e[0]]=a[0],a[0]=n,n=a[e[1]],a[e[1]]=a[1],a[1]=n-t[3]*a[0],n=a[e[2]],a[e[2]]=a[2],a[2]=n-t[6]*a[0]-t[7]*a[1],a[2]/=t[8],a[1]=(a[1]-t[5]*a[2])/t[4],a[0]=(a[0]-t[1]*a[1]-t[2]*a[2])/t[0]}function Lv(t,e,a){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],u=t[5],c=t[6],p=t[7],l=t[8],f=+ot(s,p,u,l),h=-ot(o,c,u,l),v=+ot(o,c,s,p),m=-ot(r,p,i,l),x=+ot(n,c,i,l),y=-ot(n,c,r,p),d=+ot(r,s,i,u),g=-ot(n,o,i,u),C=+ot(n,o,r,s),S=n*f+r*h+i*v,T=f*e[0]+m*e[1]+d*e[2],w=h*e[0]+x*e[1]+g*e[2],_=v*e[0]+y*e[1]+C*e[2];a[0]=T/S,a[1]=w/S,a[2]=_/S}function Mi(t,e,a){const n=t[0]*e[0]+t[1]*e[1]+t[2]*e[2],r=t[3]*e[0]+t[4]*e[1]+t[5]*e[2],i=t[6]*e[0]+t[7]*e[1]+t[8]*e[2];a[0]=n,a[1]=r,a[2]=i}function Ks(t,e,a){const n=[...t],r=[...e];for(let i=0;i<3;i++)a[i]=n[0]*r[i]+n[1]*r[i+3]+n[2]*r[i+6],a[i+3]=n[3]*r[i]+n[4]*r[i+3]+n[5]*r[i+6],a[i+6]=n[6]*r[i]+n[7]*r[i+3]+n[8]*r[i+6]}function Fv(t,e,a,n,r,i,o){n!==r&&$u("Number of columns of A must match number of rows of B.");const s=[...t],u=[...e];for(let c=0;c0&&(n="+"),+`${Math.round(`${+a[0]}e${n}${+a[1]+e}`)}e-${e}`}function Xs(t,e=[0,0,0],a=0){return e[0]=Ri(t[0],a),e[1]=Ri(t[1],a),e[2]=Ri(t[2],a),e}function Oa(t,e,a,n){let r,i,o,s,u,c,p,l,f,h,v,m,x,y,d,g;const C=Qe(e),S=Qe(e),T=(_,E,D)=>{y=_[E],x=_[D],_[E]=y-m*(x+y*h),_[D]=x+m*(y-x*h)};for(Qu(e,n),u=0;u3&&Math.abs(a[u])+y===Math.abs(a[u])&&Math.abs(a[s])+y===Math.abs(a[s]))t[u*e+s]=0;else if(Math.abs(t[u*e+s])>p){for(x=a[s]-a[u],Math.abs(x)+y===Math.abs(x)?f=t[u*e+s]/x:(l=.5*x/t[u*e+s],f=1/(Math.abs(l)+Math.sqrt(1+l*l)),l<0&&(f=-f)),d=1/Math.sqrt(1+f*f),m=f*d,h=m/(1+d),x=f*t[u*e+s],S[u]-=x,S[s]+=x,a[u]-=x,a[s]+=x,t[u*e+s]=0,i=0;i<=u-1;i++)T(t,i*e+u,i*e+s);for(i=u+1;i<=s-1;i++)T(t,u*e+i,i*e+s);for(i=s+1;i=Ku)return or("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(i=0;i=g||Math.abs(a[r]-g)<1e-12)&&(o=r,g=a[o]);o!==i&&(a[o]=a[i],a[i]=g,wa(n,e,i,o))}const w=(e>>1)+(e&1);for(c=0,r=0;r=0&&c++;if(ch?v:h,r=m>r?m:r,a[f]=1,r!==0&&(a[f]/=r)}const i=Math.abs(e[0])*a[0],o=Math.abs(e[3])*a[1],s=Math.abs(e[6])*a[2];n[0]=0,r=i,o>=r&&(r=o,n[0]=1),s>=r&&(n[0]=2),n[0]!==0&&(wa(e,3,n[0],0),a[n[0]]=a[0]);const u=Math.abs(e[4])*a[1],c=Math.abs(e[7])*a[2];n[1]=1,r=u,c>=r&&(n[1]=2,wa(e,3,1,2)),n[2]=2;let p=0;if(Ni(e)<0){p=1;for(let f=0;f<9;f++)e[f]=-e[f]}const l=Qe(4);if(tl(e,l),el(l,e),p)for(let f=0;f<9;f++)e[f]=-e[f];n[1]!==1&&wa(e,3,n[1],1),n[0]!==0&&wa(e,3,n[0],0)}function rl(t,e,a){let n,r,i,o,s,u;if(Oa([...t],3,e,a),e[0]===e[1]&&e[0]===e[2]){Zu(a);return}for($r(a,a),n=0;n<3;n++)if(e[(n+1)%3]===e[(n+2)%3]){for(u=Math.abs(a[n*3]),o=0,r=1;r<3;r++)u<(s=Math.abs(a[n*3+r]))&&(u=s,o=r);o!==n&&(s=e[o],e[o]=e[n],e[n]=s,Ta(a,3,n,o)),a[o*3+o]<0&&(a[o*3]=-a[o*3],a[o*3+1]=-a[o*3+1],a[o*3+2]=-a[o*3+2]),r=(o+1)%3,i=(o+2)%3,a[r*3]=0,a[r*3+1]=0,a[r*3+2]=0,a[r*3+r]=1;const c=tt([a[o*3],a[o*3+1],a[o*3+2]],[a[r*3],a[r*3+1],a[r*3+2]],[]);He(c);const p=tt(c,[a[o*3],a[o*3+1],a[o*3+2]],[]);for(let l=0;l<3;l++)a[i*3+l]=c[l],a[r*3+l]=p[l];$r(a,a);return}for(u=Math.abs(a[0]),o=0,n=1;n<3;n++)u<(s=Math.abs(a[n*3]))&&(u=s,o=n);if(o!==0){const c=e[o];e[o]=e[0],e[0]=c,Ta(a,3,o,0)}if(Math.abs(a[4])o&&(o=p);if(o===0)return or("Unable to factor linear system"),0;l[n]=1/o}for(r=0;r=o&&(o=c,s=n)}if(r!==s){for(i=0;i=0)for(i=o;i<=r-1;i++)u-=t[r*n+i]*a[i];else u!==0&&(o=r);a[r]=u}for(r=n-1;r>=0;r--){for(u=a[r],i=r+1;in&&(n=Math.abs(t[r*e+i]));for(let r=0;r1e-12&&(u=0,s[f]=0);if(u&&r===1)return or("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),Zs(t,e,a,i);if(u)v=1;else for(f=0;fp?p=i:ip?p=o:o0?n=(p-l)/p:n=0,n>0?(r===p?a=u*(i-o)/(p-l):i===p?a=s+u*(o-r)/(p-l):a=c+u*(r-i)/(p-l),a<0&&(a+=1)):a=0,e[0]=a,e[1]=n,e[2]=f}function cr(t,e){const[a,n,r]=t,i=1/3,o=1/6,s=2/3,u=5/6;let c,p,l;a>o&&a<=i?(p=1,c=(i-a)/o,l=0):a>i&&a<=.5?(p=1,l=(a-i)/o,c=0):a>.5&&a<=s?(l=1,p=(s-a)/o,c=0):a>s&&a<=u?(l=1,c=(a-s)/o,p=0):a>u&&a<=1?(c=1,l=(1-a)/o,p=0):(c=1,p=a/o,l=0),c=n*c+(1-n),p=n*p+(1-n),l=n*l+(1-n),c*=r,p*=r,l*=r,e[0]=c,e[1]=p,e[2]=l}function il(t,e){const[a,n,r]=t;let i=(a+16)/116,o=n/500+i,s=i-r/200;i**3>.008856?i**=3:i=(i-16/116)/7.787,o**3>.008856?o**=3:o=(o-16/116)/7.787,s**3>.008856?s**=3:s=(s-16/116)/7.787;const u=.9505,c=1,p=1.089;e[0]=u*o,e[1]=c*i,e[2]=p*s}function ol(t,e){const[a,n,r]=t,i=.9505,o=1,s=1.089;let u=a/i,c=n/o,p=r/s;u>.008856?u**=1/3:u=7.787*u+16/116,c>.008856?c**=1/3:c=7.787*c+16/116,p>.008856?p**=1/3:p=7.787*p+16/116,e[0]=116*c-16,e[1]=500*(u-c),e[2]=200*(c-p)}function sl(t,e){const[a,n,r]=t;let i=a*3.2406+n*-1.5372+r*-.4986,o=a*-.9689+n*1.8758+r*.0415,s=a*.0557+n*-.204+r*1.057;i>.0031308?i=1.055*i**(1/2.4)-.055:i*=12.92,o>.0031308?o=1.055*o**(1/2.4)-.055:o*=12.92,s>.0031308?s=1.055*s**(1/2.4)-.055:s*=12.92;let u=i;u1&&(i/=u,o/=u,s/=u),i<0&&(i=0),o<0&&(o=0),s<0&&(s=0),e[0]=i,e[1]=o,e[2]=s}function cl(t,e){let[a,n,r]=t;a>.04045?a=((a+.055)/1.055)**2.4:a/=12.92,n>.04045?n=((n+.055)/1.055)**2.4:n/=12.92,r>.04045?r=((r+.055)/1.055)**2.4:r/=12.92,e[0]=a*.4124+n*.3576+r*.1805,e[1]=a*.2126+n*.7152+r*.0722,e[2]=a*.0193+n*.1192+r*.9505}function ur(t,e){const a=[0,0,0];cl(t,a),ol(a,e)}function Li(t,e){const a=[0,0,0];il(t,a),sl(a,e)}function Qs(t){return t[0]=1,t[1]=-1,t[2]=1,t[3]=-1,t[4]=1,t[5]=-1,t}function Fi(t){return!(t[1]-t[0]<0)}function Wv(t,e,a){return a[0]=Math.min(t[0],e[0]),a[1]=Math.max(t[0],e[0]),a[2]=Math.min(t[1],e[1]),a[3]=Math.max(t[1],e[1]),a[4]=Math.min(t[2],e[2]),a[5]=Math.max(t[2],e[2]),a}function qt(t,e,a){return ta?a:t}function e0(t,e,a,n=[0,0,0]){return n[0]=qt(t[0],e[0],a[0]),n[1]=qt(t[1],e[1],a[1]),n[2]=qt(t[2],e[2],a[2]),n}function jv(t,e){let a=0;return e[0]!==e[1]&&(te[1]?a=e[1]:a=t,a=(a-e[0])/(e[1]-e[0])),a}var $v=Sa("GetScalarTypeFittingRange"),Hv=Sa("GetAdjustedScalarRange");function Kv(t,e){if(!t||!e)return 0;for(let a=0;a<6;a+=2)if(t[a]e[a+1]||t[a+1]e[a+1])return 0;return 1}function Xv(t,e,a){if(!t||!e)return 0;for(let n=0;n<6;n+=2)if(t[n]+a[n/2]e[n+1]||t[n+1]+a[n/2]e[n+1])return 0;return 1}function qv(t,e,a){if(!t||!e||!a)return 0;for(let n=0;n<3;n++)if(t[n]+a[n]e[2*n+1])return 0;return 1}function Yv(t,e,a,n){const r=Qe(3),i=Qe(3),o=Qe(3),s=Qe(3),u=Qe(3),c=Qe(3);for(let C=0;C<3;++C)r[C]=t[C]-e[C],i[C]=e[C]-a[C],o[C]=a[C]-t[C],s[C]=-r[C],u[C]=-i[C],c[C]=-o[C];const p=xt(s),l=xt(u),f=xt(o),h=Qe(3);tt(r,i,h);const v=xt(h),m=p*l*f/(2*v),x=2*v*v,y=l*l*xe(r,c)/x,d=f*f*xe(s,i)/x,g=p*p*xe(o,u)/x;for(let C=0;C<3;++C)n[C]=y*t[C]+d*e[C]+g*a[C];return m}var Jv=1/0,Zv=-1/0,ul=t=>!Number.isFinite(t),{isFinite:Qv,isNaN:t0}=Number,ki=t0;function Ai(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function e3(t){let e=-1,a=-1;for(let n=0;ne&&(a=n,e=r)}return a}function t3(t){let e=1/0,a=-1;for(let n=0;n0;i--){let o=-1/0,s=0,u=0;for(let c=0;c<=i;++c){const p=a[c];for(let l=0;l<=i;++l){const f=n[l],h=Math.abs(t[p+e*f]);h>o&&(o=h,s=c,u=l)}}[a[i],a[s]]=[a[s],a[i]],[n[i],n[u]]=[n[u],n[i]]}const r=new Array(e*e).fill(0);for(let i=0;i15?e.toString(16):`0${e.toString(16)}`}function n3(t,e="#"){return`${e}${t.map(fl).join("")}`}function Vi(t){return Math.round(t*255)}function r3(t){return t.length===3?`rgb(${t.map(Vi).join(", ")})`:`rgba(${Vi(t[0]||0)}, ${Vi(t[1]||0)}, ${Vi(t[2]||0)}, ${t[3]||0})`}var Ze={Pi:av,ldexp:iv,radiansFromDegrees:et,degreesFromRadians:_a,round:Ea,floor:Ws,ceil:ov,ceilLog2:pv,min:sv,max:cv,arrayMin:uv,arrayMax:lv,arrayRange:fv,isPowerOfTwo:Da,nearestPowerOfTwo:Pt,factorial:hv,binomial:gv,beginCombination:dv,nextCombination:vv,randomSeed:yv,getSeed:mv,random:bi,gaussian:xv,add:sr,subtract:$e,multiplyScalar:js,multiplyScalar2D:Xu,multiplyAccumulate:$s,multiplyAccumulate2D:Cv,dot:xe,outer:Sv,cross:tt,norm:xt,normalize:He,perpendiculars:wv,projectVector:_v,projectVector2D:Ev,distance2BetweenPoints:dt,angleBetweenVectors:Dv,gaussianAmplitude:Ov,gaussianWeight:bv,dot2D:Hs,outer2D:Mv,norm2D:qu,normalize2D:Yu,determinant2x2:ot,LUFactor3x3:Nv,LUSolve3x3:Rv,linearSolve3x3:Lv,multiply3x3_vect3:Mi,multiply3x3_mat3:Ks,multiplyMatrix:Fv,transpose3x3:$r,invert3x3:kv,identity3x3:Zu,identity:Qu,isIdentity:Av,isIdentity3x3:Vv,determinant3x3:Ni,quaternionToMatrix3x3:el,areEquals:Ju,areMatricesEqual:Hr,roundNumber:Ri,roundVector:Xs,matrix3x3ToQuaternion:tl,multiplyQuaternion:Bv,orthogonalize3x3:nl,diagonalize3x3:rl,singularValueDecomposition3x3:Uv,solveLinearSystem:al,invertMatrix:Js,luFactorLinearSystem:qs,luSolveLinearSystem:Ys,estimateMatrixCondition:Gv,jacobi:Iv,jacobiN:Oa,solveHomogeneousLeastSquares:Zs,solveLeastSquares:Pv,hex2float:zv,rgb2hsv:ba,hsv2rgb:cr,lab2xyz:il,xyz2lab:ol,xyz2rgb:sl,rgb2xyz:cl,rgb2lab:ur,lab2rgb:Li,uninitializeBounds:Qs,areBoundsInitialized:Fi,computeBoundsFromPoints:Wv,clampValue:qt,clampVector:e0,clampAndNormalizeValue:jv,getScalarTypeFittingRange:$v,getAdjustedScalarRange:Hv,extentIsWithinOtherExtent:Kv,boundsIsWithinOtherBounds:Xv,pointIsWithinBounds:qv,solve3PointCircle:Yv,inf:Jv,negInf:Zv,isInf:ul,isNan:t0,isNaN:t0,isFinite:Qv,createUninitializedBounds:Ai,getMajorAxisIndex:e3,getMinorAxisIndex:t3,getSparseOrthogonalMatrix:ll,floatToHex2:fl,floatRGB2HexCode:n3,float2CssRGBA:r3},Bi={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},be={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",UNSIGNED_CHAR_CLAMPED:"Uint8ClampedArray",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"},a3=be.FLOAT,pl={DefaultDataType:a3,DataTypeByteSize:Bi,VtkDataTypes:be},{vtkErrorMacro:i3}=bt,{DefaultDataType:o3}=pl,s3=1e-6;function n0(t,e,a){const n=t.length;let r=Number.MAX_VALUE,i=-Number.MAX_VALUE,o,s;for(s=e;si&&(i=o);return{min:r,max:i}}function c3(){let t=Number.MAX_VALUE,e=-Number.MAX_VALUE,a=0,n=0;return{add(r){t>r&&(t=r),e1){const n=t.length/a,r=new Float64Array(n);for(let i=0,o=0;ia&&(a=i)}return a}var l3={computeRange:hl,createRangeHelper:c3,fastComputeRange:n0,getDataType:r0,getMaxNorm:u3};function f3(t,e){e.classHierarchy.push("vtkDataArray");function a(n){if(n<0)return!1;const r=t.getNumberOfComponents(),i=e.values.length/(r>0?r:1);if(n===i)return!0;if(n>i){const o=e.values;return e.values=ar(e.dataType,(n+i)*r),e.values.set(o),!0}return e.size>n*r&&(e.size=n*r,t.dataChange()),!0}t.dataChange=()=>{e.ranges=null,t.modified()},t.allocate=n=>{a(t.getNumberOfTuples()+n)},t.resize=n=>{a(n);const r=n*t.getNumberOfComponents();return e.size!==r?(e.size=r,t.dataChange(),!0):!1},t.initialize=()=>(t.resize(0),t),t.getElementComponentSize=()=>e.values.BYTES_PER_ELEMENT,t.getComponent=(n,r=0)=>e.values[n*e.numberOfComponents+r],t.setComponent=(n,r,i)=>{i!==e.values[n*e.numberOfComponents+r]&&(e.values[n*e.numberOfComponents+r]=i,t.dataChange())},t.getValue=n=>{const r=n/e.numberOfComponents,i=n%e.numberOfComponents;return t.getComponent(r,i)},t.setValue=(n,r)=>{const i=n/e.numberOfComponents,o=n%e.numberOfComponents;t.setComponent(i,o,r)},t.getData=()=>e.size===e.values.length?e.values:e.values.subarray(0,e.size),t.getRange=(n=-1)=>{let r=n;r<0&&(r=e.numberOfComponents===1?0:e.numberOfComponents);let i=null;return e.ranges||(e.ranges=gl(e.ranges,e.numberOfComponents)),i=e.ranges[r],i?(e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple):(i=hl(t.getData(),n,e.numberOfComponents),e.ranges[r]=i,e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple)},t.setRange=(n,r)=>{e.ranges||(e.ranges=gl(e.ranges,e.numberOfComponents));const i={min:n.min,max:n.max};return e.ranges[r]=i,e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple},t.getRanges=(n=!0)=>{if(!n)return structuredClone(e.ranges);const r=[];for(let i=0;i1){const[i,o]=t.getRange(-1),s={min:i,max:o};r.push(s)}return r},t.setTuple=(n,r)=>{const i=n*e.numberOfComponents;for(let o=0;o{let i=n*e.numberOfComponents;const o=Math.min(r.length,e.size-i);for(let s=0;s(e.size<=n*e.numberOfComponents&&(e.size=(n+1)*e.numberOfComponents,a(n+1)),t.setTuple(n,r),n),t.insertTuples=(n,r)=>{const i=n+r.length/e.numberOfComponents;return e.size{const r=e.size/e.numberOfComponents;return t.insertTuple(r,n)},t.insertNextTuples=n=>{const r=e.size/e.numberOfComponents;return t.insertTuples(r,n)},t.findTuple=(n,r=s3)=>{for(let i=0;ir){o=!1;break}if(o)return i/e.numberOfComponents}return-1},t.getTuple=(n,r=[])=>{const i=e.numberOfComponents||1,o=n*i;switch(i){case 4:r[3]=e.values[o+3];case 3:r[2]=e.values[o+2];case 2:r[1]=e.values[o+1];case 1:r[0]=e.values[o];break;default:for(let s=i-1;s>=0;--s)r[s]=e.values[o+s]}return r},t.getTuples=(n,r)=>{const i=(n??0)*e.numberOfComponents,o=(r??t.getNumberOfTuples())*e.numberOfComponents,s=t.getData().subarray(i,o);return s.length>0?s:null},t.getTupleLocation=(n=1)=>n*e.numberOfComponents,t.getNumberOfComponents=()=>e.numberOfComponents,t.getNumberOfValues=()=>e.size,t.getNumberOfTuples=()=>e.size/e.numberOfComponents,t.getDataType=()=>e.dataType,t.newClone=()=>vl({empty:!0,name:e.name,dataType:e.dataType,numberOfComponents:e.numberOfComponents}),t.getName=()=>(e.name||(t.modified(),e.name=`vtkDataArray${t.getMTime()}`),e.name),t.setData=(n,r)=>{e.values=n,e.size=n.length,e.dataType=r0(n),r&&(e.numberOfComponents=r),e.size%e.numberOfComponents!==0&&(e.numberOfComponents=1),t.dataChange()},t.getState=({preserveTypedArrays:n=!1}={})=>{if(e.deleted)return null;const r={...e,vtkClass:t.getClassName()};n||(r.values=Array.from(r.values)),delete r.buffer,Object.keys(r).forEach(o=>{r[o]||delete r[o]});const i={};return Object.keys(r).sort().forEach(o=>{i[o]=r[o]}),i.mtime&&delete i.mtime,i},t.deepCopy=n=>{const r=t.getDataType(),i=e.values;t.shallowCopy(n),e.ranges=structuredClone(n.getRanges()),(i==null?void 0:i.length)>=n.getNumberOfValues()&&r===n.getDataType()?(i.set(n.getData()),e.values=i,t.dataChange()):t.setData(n.getData().slice())},t.interpolateTuple=(n,r,i,o,s,u)=>{const c=e.numberOfComponents||1;(c!==r.getNumberOfComponents()||c!==o.getNumberOfComponents())&&i3("numberOfComponents must match");const p=r.getTuple(i),l=o.getTuple(s),f=[];switch(f.length=c,c){case 4:f[3]=p[3]+(l[3]-p[3])*u;case 3:f[2]=p[2]+(l[2]-p[2])*u;case 2:f[1]=p[1]+(l[1]-p[1])*u;case 1:f[0]=p[0]+(l[0]-p[0])*u;break;default:for(let h=0;h 0, values");if(e.values?Array.isArray(e.values)&&(e.values=Ei(e.dataType,e.values)):e.values=ar(e.dataType,e.size),e.values&&(e.size=e.size??e.values.length,e.dataType=r0(e.values)),lt(t,e),ya(t,e,["name","numberOfComponents"]),e.size%e.numberOfComponents!==0)throw new RangeError("model.size is not a multiple of model.numberOfComponents");f3(t,e)}var vl=qe(dl,"vtkDataArray"),pe={newInstance:vl,extend:dl,...l3,...pl},yl=new Float32Array(1),h3=new Int32Array(yl.buffer);function g3(t){yl[0]=t;const e=h3[0];let a=e>>16&32768,n=e>>12&2047;const r=e>>23&255;return r<103?a:r>142?(a|=31744,a|=(r===255?0:1)&&e&8388607,a):r<113?(n|=2048,a|=(n>>114-r)+(n>>113-r&1),a):(a|=r-112<<10|n>>1,a+=n&1,a)}function d3(t){const e=(t&32768)>>15,a=(t&31744)>>10,n=t&1023;return a===0?(e?-1:1)*2**-14*(n/2**10):a===31?n?NaN:(e?-1:1)*(1/0):(e?-1:1)*2**(a-15)*(1+n/2**10)}var Kr={fromHalf:d3,toHalf:g3},Ma={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},me={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},ml={Wrap:Ma,Filter:me},{vtkErrorMacro:v3}=A,y3=["Build","Render"];function m3(t,e){e.classHierarchy.push("vtkViewNode");function a(r,i){for(let o=0;o{},t.render=r=>{},t.traverse=r=>{const i=t[r.getTraverseOperation()];if(i){i(r);return}t.apply(r,!0);for(let o=0;o{const o=t[r.getOperation()];o&&o(i,r)},t.getViewNodeFor=(r,i=null)=>{if(i&&i.renderable===r)return i;if(e.renderable===r)return t;for(let o=0;oe._parent?e._parent.isA(r)?e._parent:e._parent.getFirstAncestorOfType(r):null,t.getLastAncestorOfType=r=>{if(!e._parent)return null;const i=e._parent.getLastAncestorOfType(r);return i||(e._parent.isA(r)?e._parent:null)},t.addMissingNode=r=>{if(!r)return;const i=e._renderableChildMap.get(r);if(i!==void 0)return i.setVisited(!0),i;const o=t.createViewNode(r);if(o)return o.setParent(t),o.setVisited(!0),e._renderableChildMap.set(r,o),e.children.push(o),o},t.addMissingNodes=(r,i=!1)=>{if(!r||!r.length)return;let o;for(let s=0;s{if(!(!r||!r.length))for(let i=0;i{const i=e.children.findIndex(s=>s===r);if(i<0)return!1;const o=r.getRenderable();return o&&e._renderableChildMap.delete(o),r.delete(),e.children.splice(i,1),!0},t.prepareNodes=()=>{for(let r=0;r{e.visited=r},t.removeUnusedNodes=()=>{let r=0;for(let i=0;i{if(!e.myFactory)return v3("Cannot create view nodes without my own factory"),null;const i=e.myFactory.createNode(r);return i&&i.setRenderable(r),i};const n=t.delete;t.delete=()=>{for(let r=0;r{if(a.isDeleted())return null;let n=0,r=a.getClassName(n++),i=!1;const o=Object.keys(e.overrides);for(;r&&!i;)o.indexOf(r)!==-1?i=!0:r=a.getClassName(n++);if(!i)return null;const s=e.overrides[r]();return s.setMyFactory(t),s}}var S3={};function Cl(t,e,a={}){Object.assign(e,S3,a),A.obj(t,e),C3(t,e)}var T3=A.newInstance(Cl,"vtkViewNodeFactory"),w3={newInstance:T3,extend:Cl},Sl=Object.create(null);function ct(t,e){Sl[t]=e}function _3(t,e){e.classHierarchy.push("vtkOpenGLViewNodeFactory")}var E3={};function Tl(t,e,a={}){Object.assign(e,E3,a),e.overrides=Sl,w3.extend(t,e,a),_3(t,e)}var D3=A.newInstance(Tl,"vtkOpenGLViewNodeFactory"),O3={newInstance:D3,extend:Tl};function b3(){try{const n=new Int16Array([0,32767]),r=[1,1],i=document.createElement("canvas");i.width=4,i.height=4;const o=i.getContext("webgl2");if(!o)return!1;const s=o.getExtension("EXT_texture_norm16");if(!s)return!1;const u=`#version 300 es + void main() { + gl_PointSize = ${4 .toFixed(1)}; + gl_Position = vec4(0, 0, 0, 1); + } + `,c=`#version 300 es + precision highp float; + precision highp int; + precision highp sampler2D; + + uniform sampler2D u_image; + + out vec4 color; + + void main() { + vec4 intColor = texture(u_image, gl_PointCoord.xy); + color = vec4(vec3(intColor.rrr), 1); + } + `,p=o.createShader(o.VERTEX_SHADER);if(o.shaderSource(p,u),o.compileShader(p),!o.getShaderParameter(p,o.COMPILE_STATUS))return!1;const l=o.createShader(o.FRAGMENT_SHADER);if(o.shaderSource(l,c),o.compileShader(l),!o.getShaderParameter(l,o.COMPILE_STATUS))return!1;const f=o.createProgram();if(o.attachShader(f,p),o.attachShader(f,l),o.linkProgram(f),!o.getProgramParameter(f,o.LINK_STATUS))return!1;const h=o.createTexture();o.bindTexture(o.TEXTURE_2D,h),o.texImage2D(o.TEXTURE_2D,0,s.R16_SNORM_EXT,2,1,0,o.RED,o.SHORT,n),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.useProgram(f),o.drawArrays(o.POINTS,0,1);const v=new Uint8Array(4);o.readPixels(r[0],r[1],1,1,o.RGBA,o.UNSIGNED_BYTE,v);const[m,x,y]=v,d=o.getExtension("WEBGL_lose_context");return d&&d.loseContext(),m===x&&x===y&&m!==0}catch{return!1}}var a0;function M3(){return a0===void 0&&(a0=b3()),a0}var{Wrap:Dn,Filter:gt}=ml,{VtkDataTypes:Fe}=pe,{vtkDebugMacro:i0,vtkErrorMacro:lr,vtkWarningMacro:wl,requiredParam:Ae}=bt,{toHalf:N3}=Kr;function R3(t,e){e.classHierarchy.push("vtkOpenGLTexture");function a(){return{internalFormat:e.internalFormat,format:e.format,openGLDataType:e.openGLDataType,width:e.width,height:e.height}}t.render=(v=null)=>{if(v?e._openGLRenderWindow=v:(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow")),e.context=e._openGLRenderWindow.getContext(),e.renderable.getInterpolate()?(e.generateMipmap?t.setMinificationFilter(gt.LINEAR_MIPMAP_LINEAR):t.setMinificationFilter(gt.LINEAR),t.setMagnificationFilter(gt.LINEAR)):(t.setMinificationFilter(gt.NEAREST),t.setMagnificationFilter(gt.NEAREST)),e.renderable.getRepeat()&&(t.setWrapR(Dn.REPEAT),t.setWrapS(Dn.REPEAT),t.setWrapT(Dn.REPEAT)),e.renderable.getInputData()&&e.renderable.setImage(null),!e.handle||e.renderable.getMTime()>e.textureBuildTime.getMTime()){if(e.renderable.getImageBitmap()!==null&&(e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(gt.LINEAR_MIPMAP_LINEAR)),e.renderable.getImageBitmap()&&e.renderable.getImageLoaded()&&(t.create2DFromImageBitmap(e.renderable.getImageBitmap()),t.activate(),t.sendParameters(),e.textureBuildTime.modified())),e.renderable.getImage()!==null&&(e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(gt.LINEAR_MIPMAP_LINEAR)),e.renderable.getImage()&&e.renderable.getImageLoaded()&&(t.create2DFromImage(e.renderable.getImage()),t.activate(),t.sendParameters(),e.textureBuildTime.modified())),e.renderable.getCanvas()!==null){e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(gt.LINEAR_MIPMAP_LINEAR));const x=e.renderable.getCanvas();t.create2DFromRaw({width:x.width,height:x.height,numComps:4,dataType:Fe.UNSIGNED_CHAR,data:x,flip:!0}),t.activate(),t.sendParameters(),e.textureBuildTime.modified()}if(e.renderable.getJsImageData()!==null){const x=e.renderable.getJsImageData();e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(gt.LINEAR_MIPMAP_LINEAR)),t.create2DFromRaw({width:x.width,height:x.height,numComps:4,dataType:Fe.UNSIGNED_CHAR,data:x.data,flip:!0}),t.activate(),t.sendParameters(),e.textureBuildTime.modified()}const m=e.renderable.getInputData(0);if(m&&m.getPointData().getScalars()){const x=m.getExtent(),y=m.getPointData().getScalars(),d=[];for(let g=0;g{if(!((e.minificationFilter===gt.LINEAR||e.magnificationFilter===gt.LINEAR)&&!M3()))return e.oglNorm16Ext};t.destroyTexture=()=>{t.deactivate(),e.context&&e.handle&&e.context.deleteTexture(e.handle),e._prevTexParams=null,e.handle=0,e.numberOfDimensions=0,e.target=0,e.components=0,e.width=0,e.height=0,e.depth=0,t.resetFormatAndType()},t.createTexture=()=>{e.handle||(e.handle=e.context.createTexture(),e.target&&(e.context.bindTexture(e.target,e.handle),e.context.texParameteri(e.target,e.context.TEXTURE_MIN_FILTER,t.getOpenGLFilterMode(e.minificationFilter)),e.context.texParameteri(e.target,e.context.TEXTURE_MAG_FILTER,t.getOpenGLFilterMode(e.magnificationFilter)),e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_S,t.getOpenGLWrapMode(e.wrapS)),e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_T,t.getOpenGLWrapMode(e.wrapT)),e._openGLRenderWindow.getWebgl2()&&e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_R,t.getOpenGLWrapMode(e.wrapR)),e.context.bindTexture(e.target,null)))},t.getTextureUnit=()=>e._openGLRenderWindow?e._openGLRenderWindow.getTextureUnitForTexture(t):-1,t.activate=()=>{e._openGLRenderWindow.activateTexture(t),t.bind()},t.deactivate=()=>{e._openGLRenderWindow&&e._openGLRenderWindow.deactivateTexture(t)},t.releaseGraphicsResources=v=>{v&&e.handle&&(v.activateTexture(t),v.deactivateTexture(t),e.context.deleteTexture(e.handle),e._prevTexParams=null,e.handle=0,e.numberOfDimensions=0,e.target=0,e.internalFormat=0,e.format=0,e.openGLDataType=0,e.components=0,e.width=0,e.height=0,e.depth=0,e.allocatedGPUMemoryInBytes=0),e.shaderProgram&&(e.shaderProgram.releaseGraphicsResources(v),e.shaderProgram=null)},t.bind=()=>{e.context.bindTexture(e.target,e.handle),e.autoParameters&&t.getMTime()>e.sendParametersTime.getMTime()&&t.sendParameters()},t.isBound=()=>{let v=!1;if(e.context&&e.handle){let m=0;switch(e.target){case e.context.TEXTURE_2D:m=e.context.TEXTURE_BINDING_2D;break;default:wl("impossible case");break}v=e.context.getIntegerv(m)===e.handle}return v},t.sendParameters=()=>{e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_S,t.getOpenGLWrapMode(e.wrapS)),e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_T,t.getOpenGLWrapMode(e.wrapT)),e._openGLRenderWindow.getWebgl2()&&e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_R,t.getOpenGLWrapMode(e.wrapR)),e.context.texParameteri(e.target,e.context.TEXTURE_MIN_FILTER,t.getOpenGLFilterMode(e.minificationFilter)),e.context.texParameteri(e.target,e.context.TEXTURE_MAG_FILTER,t.getOpenGLFilterMode(e.magnificationFilter)),e._openGLRenderWindow.getWebgl2()&&(e.context.texParameteri(e.target,e.context.TEXTURE_BASE_LEVEL,e.baseLevel),e.context.texParameteri(e.target,e.context.TEXTURE_MAX_LEVEL,e.maxLevel)),e.sendParametersTime.modified()},t.getInternalFormat=(v,m)=>(e._forceInternalFormat||(e.internalFormat=t.getDefaultInternalFormat(v,m)),e.internalFormat||i0(`Unable to find suitable internal format for T=${v} NC= ${m}`),[e.context.R32F,e.context.RG32F,e.context.RGB32F,e.context.RGBA32F].includes(e.internalFormat)&&!e.context.getExtension("OES_texture_float_linear")&&wl("Failed to load OES_texture_float_linear. Texture filtering is not available for *32F internal formats."),e.internalFormat),t.getDefaultInternalFormat=(v,m)=>{let x=0;return x=e._openGLRenderWindow.getDefaultTextureInternalFormat(v,m,n(),t.useHalfFloat()),x||(x||(i0("Unsupported internal texture type!"),i0(`Unable to find suitable internal format for T=${v} NC= ${m}`)),x)},t.useHalfFloat=()=>e.enableUseHalfFloat&&e.canUseHalfFloat,t.setInternalFormat=v=>{e._forceInternalFormat=!0,v!==e.internalFormat&&(e.internalFormat=v,t.modified())},t.getFormat=(v,m)=>(e.format=t.getDefaultFormat(v,m),e.format),t.getDefaultFormat=(v,m)=>{if(e._openGLRenderWindow.getWebgl2())switch(m){case 1:return e.context.RED;case 2:return e.context.RG;case 3:return e.context.RGB;case 4:return e.context.RGBA;default:return e.context.RGB}else switch(m){case 1:return e.context.LUMINANCE;case 2:return e.context.LUMINANCE_ALPHA;case 3:return e.context.RGB;case 4:return e.context.RGBA;default:return e.context.RGB}},t.resetFormatAndType=()=>{e._prevTexParams=null,e.format=0,e.internalFormat=0,e._forceInternalFormat=!1,e.openGLDataType=0},t.getDefaultDataType=v=>{const m=t.useHalfFloat();if(e._openGLRenderWindow.getWebgl2())switch(v){case Fe.UNSIGNED_CHAR:return e.context.UNSIGNED_BYTE;case(n()&&!m&&Fe.SHORT):return e.context.SHORT;case(n()&&!m&&Fe.UNSIGNED_SHORT):return e.context.UNSIGNED_SHORT;case(m&&Fe.SHORT):return e.context.HALF_FLOAT;case(m&&Fe.UNSIGNED_SHORT):return e.context.HALF_FLOAT;case Fe.FLOAT:case Fe.VOID:default:return e.context.FLOAT}switch(v){case Fe.UNSIGNED_CHAR:return e.context.UNSIGNED_BYTE;case Fe.FLOAT:case Fe.VOID:default:if(e.context.getExtension("OES_texture_float")&&e.context.getExtension("OES_texture_float_linear"))return e.context.FLOAT;{const x=e.context.getExtension("OES_texture_half_float");if(x&&e.context.getExtension("OES_texture_half_float_linear"))return x.HALF_FLOAT_OES}return e.context.UNSIGNED_BYTE}},t.getOpenGLDataType=(v,m=!1)=>((!e.openGLDataType||m)&&(e.openGLDataType=t.getDefaultDataType(v)),e.openGLDataType),t.getShiftAndScale=()=>{let v=0,m=1;switch(e.openGLDataType){case e.context.BYTE:m=127.5,v=m-128;break;case e.context.UNSIGNED_BYTE:m=255,v=0;break;case e.context.SHORT:m=32767.5,v=m-32768;break;case e.context.UNSIGNED_SHORT:m=65536,v=0;break;case e.context.INT:m=21474836475e-1,v=m-2147483648;break;case e.context.UNSIGNED_INT:m=4294967295,v=0;break;case e.context.FLOAT:}return{shift:v,scale:m}},t.getOpenGLFilterMode=v=>{switch(v){case gt.NEAREST:return e.context.NEAREST;case gt.LINEAR:return e.context.LINEAR;case gt.NEAREST_MIPMAP_NEAREST:return e.context.NEAREST_MIPMAP_NEAREST;case gt.NEAREST_MIPMAP_LINEAR:return e.context.NEAREST_MIPMAP_LINEAR;case gt.LINEAR_MIPMAP_NEAREST:return e.context.LINEAR_MIPMAP_NEAREST;case gt.LINEAR_MIPMAP_LINEAR:return e.context.LINEAR_MIPMAP_LINEAR;default:return e.context.NEAREST}},t.getOpenGLWrapMode=v=>{switch(v){case Dn.CLAMP_TO_EDGE:return e.context.CLAMP_TO_EDGE;case Dn.REPEAT:return e.context.REPEAT;case Dn.MIRRORED_REPEAT:return e.context.MIRRORED_REPEAT;default:return e.context.CLAMP_TO_EDGE}};function r(v){const[m,x,y,d,g,C]=v;return[x-m+1,d-y+1,C-g+1]}function i(v){const[m,x,y]=r(v);return m*x*y}function o(v,m,x,y,d){const[g,C,S,T,w,_]=x,[E,D]=m,O=E*D;let b=d;for(let R=w;R<=_;R++){const N=R*O;for(let L=S;L<=T;L++){const B=N+L*E;for(let P=B+g,F=B+C;P<=F;P++,b++)y[b]=v[P]}}}function s(v,m,x=null){const y=new(x||v.constructor)(m.reduce((C,S)=>C+i(S),0)),d=[e.width,e.height,e.depth];let g=0;return m.forEach(C=>{o(v,d,C,y,g),g+=i(C)}),y}t.updateArrayDataTypeForGL=(v,m,x=!1,y=[])=>{const d=[];let g=e.width*e.height*e.components;x&&(g*=e.depth);const C=!!y.length;if(v!==Fe.FLOAT&&e.openGLDataType===e.context.FLOAT)for(let T=0;Tg?m[T].subarray(0,g):m[T];d.push(new Float32Array(w))}else d.push(null);if(v!==Fe.UNSIGNED_CHAR&&e.openGLDataType===e.context.UNSIGNED_BYTE)for(let T=0;Tg?m[T].subarray(0,g):m[T];d.push(new Uint8Array(w))}else d.push(null);let S=!1;if(e._openGLRenderWindow.getWebgl2())S=e.openGLDataType===e.context.HALF_FLOAT;else{const T=e.context.getExtension("OES_texture_half_float");S=T&&e.openGLDataType===T.HALF_FLOAT_OES}if(S)for(let T=0;T=y&&(B=y-1);const P=N-L,F=1-P;L=L*x*d,B=B*x*d;for(let k=0;k=x&&(X=x-1);const Y=W-H;H*=d,X*=d;for(let q=0;q{if(t.getOpenGLDataType(y,!0),t.getInternalFormat(y,x),t.getFormat(y,x),!e.internalFormat||!e.format||!e.openGLDataType)return lr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_2D,e.components=x,e.width=v,e.height=m,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind();const C=[d],S=u(t.updateArrayDataTypeForGL(y,C));return e.context.pixelStorei(e.context.UNPACK_FLIP_Y_WEBGL,g),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),c(y)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),S[0]!=null&&e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,S[0])):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,S[0]),e.generateMipmap&&e.context.generateMipmap(e.target),g&&e.context.pixelStorei(e.context.UNPACK_FLIP_Y_WEBGL,!1),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*x*e._openGLRenderWindow.getDefaultTextureByteSize(y,n(),t.useHalfFloat()),t.deactivate(),!0},t.createCubeFromRaw=({width:v=Ae("width"),height:m=Ae("height"),numComps:x=Ae("numComps"),dataType:y=Ae("dataType"),data:d=Ae("data")}={})=>{if(t.getOpenGLDataType(y),t.getInternalFormat(y,x),t.getFormat(y,x),!e.internalFormat||!e.format||!e.openGLDataType)return lr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_CUBE_MAP,e.components=x,e.width=v,e.height=m,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),e.maxLevel=d.length/6-1,t.createTexture(),t.bind();const g=u(t.updateArrayDataTypeForGL(y,d)),C=[];let S=e.width,T=e.height;for(let w=0;w=1&&D>=1;){let O=null;_<=e.maxLevel&&(O=C[6*_+w]),c(y)?O!=null&&e.context.texSubImage2D(e.context.TEXTURE_CUBE_MAP_POSITIVE_X+w,_,0,0,E,D,e.format,e.openGLDataType,O):e.context.texImage2D(e.context.TEXTURE_CUBE_MAP_POSITIVE_X+w,_,e.internalFormat,E,D,0,e.format,e.openGLDataType,O),_++,E/=2,D/=2}}return e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*x*e._openGLRenderWindow.getDefaultTextureByteSize(y,n(),t.useHalfFloat()),t.deactivate(),!0},t.createDepthFromRaw=({width:v=Ae("width"),height:m=Ae("height"),dataType:x=Ae("dataType"),data:y=Ae("data")}={})=>(t.getOpenGLDataType(x),e.format=e.context.DEPTH_COMPONENT,e._openGLRenderWindow.getWebgl2()?x===Fe.FLOAT?e.internalFormat=e.context.DEPTH_COMPONENT32F:e.internalFormat=e.context.DEPTH_COMPONENT16:e.internalFormat=e.context.DEPTH_COMPONENT,!e.internalFormat||!e.format||!e.openGLDataType?(lr("Failed to determine texture parameters."),!1):(e.target=e.context.TEXTURE_2D,e.components=1,e.width=v,e.height=m,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind(),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),c(x)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),y!=null&&e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,y)):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,y),e.generateMipmap&&e.context.generateMipmap(e.target),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*e.components*e._openGLRenderWindow.getDefaultTextureByteSize(x,n(),t.useHalfFloat()),t.deactivate(),!0)),t.create2DFromImage=v=>{if(t.getOpenGLDataType(Fe.UNSIGNED_CHAR),t.getInternalFormat(Fe.UNSIGNED_CHAR,4),t.getFormat(Fe.UNSIGNED_CHAR,4),!e.internalFormat||!e.format||!e.openGLDataType)return lr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_2D,e.components=4,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind();const m=!e._openGLRenderWindow.getWebgl2()&&(!Da(v.width)||!Da(v.height));let x=v,y=v.width,d=v.height,g=!0;const C=window.chrome;if(m||C){const S=new OffscreenCanvas(Pt(v.width),Pt(v.height));y=S.width,d=S.height;const T=S.getContext("2d");T.translate(0,S.height),T.scale(1,-1),T.drawImage(v,0,0,v.width,v.height,0,0,S.width,S.height),x=S,g=!1}return e.width=y,e.height=d,e.context.pixelStorei(e.context.UNPACK_FLIP_Y_WEBGL,g),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),c(Fe.UNSIGNED_CHAR)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,x)):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,x),e.generateMipmap&&e.context.generateMipmap(e.target),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*e.components*e._openGLRenderWindow.getDefaultTextureByteSize(Fe.UNSIGNED_CHAR,n(),t.useHalfFloat()),t.deactivate(),!0},t.create2DFromImageBitmap=v=>(t.getOpenGLDataType(Fe.UNSIGNED_CHAR),t.getInternalFormat(Fe.UNSIGNED_CHAR,4),t.getFormat(Fe.UNSIGNED_CHAR,4),!e.internalFormat||!e.format||!e.openGLDataType?(lr("Failed to determine texture parameters."),!1):(e.target=e.context.TEXTURE_2D,e.components=4,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind(),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),e.width=v.width,e.height=v.height,c(Fe.UNSIGNED_CHAR)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,v)):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,v),e.generateMipmap&&e.context.generateMipmap(e.target),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*e.components*e._openGLRenderWindow.getDefaultTextureByteSize(Fe.UNSIGNED_CHAR,n(),t.useHalfFloat()),t.deactivate(),!0));function p(v,m,x){const y=new Array(x),d=new Array(x);for(let g=0;g2048||d<-2048||d>2048)return!1}return!0}function f(v,m,x,y){t.getOpenGLDataType(v);const d=l(m,x)||y;let g=!1;if(e._openGLRenderWindow.getWebgl2())g=e.openGLDataType===e.context.FLOAT&&e.context.getExtension("OES_texture_float_linear")===null&&d||e.openGLDataType===e.context.HALF_FLOAT;else{const C=e.context.getExtension("OES_texture_half_float");g=C&&e.openGLDataType===C.HALF_FLOAT_OES}e.canUseHalfFloat=g&&d}function h(v,m){const x=v.getNumberOfComponents(),y=v.getDataType(),d=v.getData(),g=new Array(x),C=new Array(x);for(let T=0;Tt.create2DFilterableFromDataArray({width:v,height:m,dataArray:pe.newInstance({numberOfComponents:x,dataType:y,values:d,ranges:C}),preferSizeOverAccuracy:g}),t.create2DFilterableFromDataArray=({width:v=Ae("width"),height:m=Ae("height"),dataArray:x=Ae("dataArray"),preferSizeOverAccuracy:y=!1}={})=>{const{numComps:d,dataType:g,data:C}=h(x,y);t.create2DFromRaw({width:v,height:m,numComps:d,dataType:g,data:C})},t.updateVolumeInfoForGL=(v,m)=>{var d,g;let x=!1;const y=t.useHalfFloat();(!((d=e.volumeInfo)!=null&&d.scale)||!((g=e.volumeInfo)!=null&&g.offset))&&(e.volumeInfo={scale:new Array(m),offset:new Array(m)});for(let C=0;C{let S=d,T=g;if(!t.updateVolumeInfoForGL(S,y)&&T){const O=v*m*x,b=structuredClone(e.volumeInfo),R=new Float32Array(O*y);e.volumeInfo.offset=b.offset,e.volumeInfo.scale=b.scale;let N=0;const L=b.scale.map(B=>1/B);for(let B=0;B0,_=!w||!Ds(e._prevTexParams,a()),E=[T],D=u(t.updateArrayDataTypeForGL(S,E,!0,_?[]:C));if(e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),_)c(S)?(e.context.texStorage3D(e.target,1,e.internalFormat,e.width,e.height,e.depth),D[0]!=null&&e.context.texSubImage3D(e.target,0,0,0,0,e.width,e.height,e.depth,e.format,e.openGLDataType,D[0])):e.context.texImage3D(e.target,0,e.internalFormat,e.width,e.height,e.depth,0,e.format,e.openGLDataType,D[0]),e._prevTexParams=a();else if(w){const O=D[0];let b=0;for(let R=0;Rt.create3DFilterableFromDataArray({width:v,height:m,depth:x,dataArray:pe.newInstance({numberOfComponents:y,dataType:d,values:g,ranges:S}),preferSizeOverAccuracy:C,updatedExtents:T}),t.create3DFilterableFromDataArray=({width:v=Ae("width"),height:m=Ae("height"),depth:x=Ae("depth"),dataArray:y=Ae("dataArray"),preferSizeOverAccuracy:d=!1,updatedExtents:g=[]}={})=>{const{numComps:C,dataType:S,data:T,scaleOffsets:w}=h(y,d),_=[],E=[];for(let Q=0;Q{Q[ae]=ne},R=Fe.UNSIGNED_CHAR;if(S===Fe.UNSIGNED_CHAR)for(let Q=0;Q{Q[ae]=(ne-ee)/V}):(R=Fe.UNSIGNED_CHAR,b=(Q,ae,ne,ee,V)=>{Q[ae]=255*(ne-ee)/V});if(t.getOpenGLDataType(R),t.getInternalFormat(R,C),t.getFormat(R,C),!e.internalFormat||!e.format||!e.openGLDataType)return lr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_2D,e.components=C,e.depth=1,e.numberOfDimensions=2;let N=e.context.getParameter(e.context.MAX_TEXTURE_SIZE);N>4096&&(R===Fe.FLOAT||C>=3)&&(N=4096);let L=1,B=1;D>N*N&&(L=Math.ceil(Math.sqrt(D/(N*N))),B=L);let P=Math.sqrt(D)/L;P=Pt(P);const F=Math.floor(P*L/v),k=Math.ceil(x/F),G=Pt(m*k/B);e.width=P,e.height=G,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind(),e.volumeInfo.xreps=F,e.volumeInfo.yreps=k,e.volumeInfo.xstride=L,e.volumeInfo.ystride=B,e.volumeInfo.offset=O.offset,e.volumeInfo.scale=O.scale;let W;const H=P*G*C;R===Fe.FLOAT?W=new Float32Array(H):W=new Uint8Array(H);let X=0;const Y=Math.floor(v/L),q=Math.floor(m/B);for(let Q=0;Q{e._openGLRenderWindow!==v&&(t.releaseGraphicsResources(),e._openGLRenderWindow=v,e.context=null,v&&(e.context=e._openGLRenderWindow.getContext()))},t.getMaximumTextureSize=v=>v&&v.isCurrent()?v.getIntegerv(v.MAX_TEXTURE_SIZE):-1,t.enableUseHalfFloat=v=>{e.enableUseHalfFloat=v}}var L3={_openGLRenderWindow:null,_forceInternalFormat:!1,_prevTexParams:null,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:Dn.CLAMP_TO_EDGE,wrapT:Dn.CLAMP_TO_EDGE,wrapR:Dn.CLAMP_TO_EDGE,minificationFilter:gt.NEAREST,magnificationFilter:gt.NEAREST,minLOD:-1e3,maxLOD:1e3,baseLevel:0,maxLevel:1e3,generateMipmap:!1,oglNorm16Ext:null,allocatedGPUMemoryInBytes:0,enableUseHalfFloat:!0,canUseHalfFloat:!1};function _l(t,e,a={}){Object.assign(e,L3,a),Ct.extend(t,e,a),e.sendParametersTime={},lt(e.sendParametersTime,{mtime:0}),e.textureBuildTime={},lt(e.textureBuildTime,{mtime:0}),ya(t,e,["format","openGLDataType"]),ht(t,e,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap","oglNorm16Ext"]),Bt(t,e,["width","height","volumeInfo","components","handle","target","allocatedGPUMemoryInBytes"]),xa(t,e,["openGLRenderWindow"]),R3(t,e)}var El=qe(_l,"vtkOpenGLTexture"),Ne={newInstance:El,extend:_l,...ml};ct("vtkTexture",El);var Pe=1e-6,St=typeof Float32Array<"u"?Float32Array:Array,F3=Math.PI/180;function k3(t){return t*F3}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function sn(){var t=new St(9);return St!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Pn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function A3(t){var e=new St(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function V3(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function B3(t,e,a,n,r,i,o,s,u){var c=new St(9);return c[0]=t,c[1]=e,c[2]=a,c[3]=n,c[4]=r,c[5]=i,c[6]=o,c[7]=s,c[8]=u,c}function o0(t,e,a,n,r,i,o,s,u,c){return t[0]=e,t[1]=a,t[2]=n,t[3]=r,t[4]=i,t[5]=o,t[6]=s,t[7]=u,t[8]=c,t}function zt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Xr(t,e){if(t===e){var a=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=a,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function cn(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],p=e[8],l=p*o-s*c,f=-p*i+s*u,h=c*i-o*u,v=a*l+n*f+r*h;return v?(v=1/v,t[0]=l*v,t[1]=(-p*n+r*c)*v,t[2]=(s*n-r*o)*v,t[3]=f*v,t[4]=(p*a-r*u)*v,t[5]=(-s*a+r*i)*v,t[6]=h*v,t[7]=(-c*a+n*u)*v,t[8]=(o*a-n*i)*v,t):null}function U3(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],p=e[8];return t[0]=o*p-s*c,t[1]=r*c-n*p,t[2]=n*s-r*o,t[3]=s*u-i*p,t[4]=a*p-r*u,t[5]=r*i-a*s,t[6]=i*c-o*u,t[7]=n*u-a*c,t[8]=a*o-n*i,t}function G3(t){var e=t[0],a=t[1],n=t[2],r=t[3],i=t[4],o=t[5],s=t[6],u=t[7],c=t[8];return e*(c*i-o*u)+a*(-c*r+o*s)+n*(u*r-i*s)}function fr(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],c=e[6],p=e[7],l=e[8],f=a[0],h=a[1],v=a[2],m=a[3],x=a[4],y=a[5],d=a[6],g=a[7],C=a[8];return t[0]=f*n+h*o+v*c,t[1]=f*r+h*s+v*p,t[2]=f*i+h*u+v*l,t[3]=m*n+x*o+y*c,t[4]=m*r+x*s+y*p,t[5]=m*i+x*u+y*l,t[6]=d*n+g*o+C*c,t[7]=d*r+g*s+C*p,t[8]=d*i+g*u+C*l,t}function I3(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],c=e[6],p=e[7],l=e[8],f=a[0],h=a[1];return t[0]=n,t[1]=r,t[2]=i,t[3]=o,t[4]=s,t[5]=u,t[6]=f*n+h*o+c,t[7]=f*r+h*s+p,t[8]=f*i+h*u+l,t}function P3(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],c=e[6],p=e[7],l=e[8],f=Math.sin(a),h=Math.cos(a);return t[0]=h*n+f*o,t[1]=h*r+f*s,t[2]=h*i+f*u,t[3]=h*o-f*n,t[4]=h*s-f*r,t[5]=h*u-f*i,t[6]=c,t[7]=p,t[8]=l,t}function z3(t,e,a){var n=a[0],r=a[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function W3(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function j3(t,e){var a=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function $3(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function H3(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function K3(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=a+a,s=n+n,u=r+r,c=a*o,p=n*o,l=n*s,f=r*o,h=r*s,v=r*u,m=i*o,x=i*s,y=i*u;return t[0]=1-l-v,t[3]=p-y,t[6]=f+x,t[1]=p+y,t[4]=1-c-v,t[7]=h-m,t[2]=f-x,t[5]=h+m,t[8]=1-c-l,t}function X3(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],p=e[8],l=e[9],f=e[10],h=e[11],v=e[12],m=e[13],x=e[14],y=e[15],d=a*s-n*o,g=a*u-r*o,C=a*c-i*o,S=n*u-r*s,T=n*c-i*s,w=r*c-i*u,_=p*m-l*v,E=p*x-f*v,D=p*y-h*v,O=l*x-f*m,b=l*y-h*m,R=f*y-h*x,N=d*R-g*b+C*O+S*D-T*E+w*_;return N?(N=1/N,t[0]=(s*R-u*b+c*O)*N,t[1]=(u*D-o*R-c*E)*N,t[2]=(o*b-s*D+c*_)*N,t[3]=(r*b-n*R-i*O)*N,t[4]=(a*R-r*D+i*E)*N,t[5]=(n*D-a*b-i*_)*N,t[6]=(m*w-x*T+y*S)*N,t[7]=(x*C-v*w-y*g)*N,t[8]=(v*T-m*C+y*d)*N,t):null}function q3(t,e,a){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Y3(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function J3(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Z3(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t[6]=e[6]+a[6],t[7]=e[7]+a[7],t[8]=e[8]+a[8],t}function Dl(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t[6]=e[6]-a[6],t[7]=e[7]-a[7],t[8]=e[8]-a[8],t}function Q3(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*a,t}function e9(t,e,a,n){return t[0]=e[0]+a[0]*n,t[1]=e[1]+a[1]*n,t[2]=e[2]+a[2]*n,t[3]=e[3]+a[3]*n,t[4]=e[4]+a[4]*n,t[5]=e[5]+a[5]*n,t[6]=e[6]+a[6]*n,t[7]=e[7]+a[7]*n,t[8]=e[8]+a[8]*n,t}function t9(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function n9(t,e){var a=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],p=t[8],l=e[0],f=e[1],h=e[2],v=e[3],m=e[4],x=e[5],y=e[6],d=e[7],g=e[8];return Math.abs(a-l)<=Pe*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(n-f)<=Pe*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-h)<=Pe*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-v)<=Pe*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(o-m)<=Pe*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-x)<=Pe*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(u-y)<=Pe*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-d)<=Pe*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(p-g)<=Pe*Math.max(1,Math.abs(p),Math.abs(g))}var r9=fr,a9=Dl;const i9=Object.freeze(Object.defineProperty({__proto__:null,add:Z3,adjoint:U3,clone:A3,copy:V3,create:sn,determinant:G3,equals:n9,exactEquals:t9,frob:J3,fromMat2d:H3,fromMat4:Pn,fromQuat:K3,fromRotation:j3,fromScaling:$3,fromTranslation:W3,fromValues:B3,identity:zt,invert:cn,mul:r9,multiply:fr,multiplyScalar:Q3,multiplyScalarAndAdd:e9,normalFromMat4:X3,projection:q3,rotate:P3,scale:z3,set:o0,str:Y3,sub:a9,subtract:Dl,translate:I3,transpose:Xr},Symbol.toStringTag,{value:"Module"}));function qr(){var t=new St(16);return St!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function o9(t){var e=new St(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function s9(t,e,a,n,r,i,o,s,u,c,p,l,f,h,v,m){var x=new St(16);return x[0]=t,x[1]=e,x[2]=a,x[3]=n,x[4]=r,x[5]=i,x[6]=o,x[7]=s,x[8]=u,x[9]=c,x[10]=p,x[11]=l,x[12]=f,x[13]=h,x[14]=v,x[15]=m,x}function c9(t,e,a,n,r,i,o,s,u,c,p,l,f,h,v,m,x){return t[0]=e,t[1]=a,t[2]=n,t[3]=r,t[4]=i,t[5]=o,t[6]=s,t[7]=u,t[8]=c,t[9]=p,t[10]=l,t[11]=f,t[12]=h,t[13]=v,t[14]=m,t[15]=x,t}function we(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function We(t,e){if(t===e){var a=e[1],n=e[2],r=e[3],i=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=a,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=r,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Et(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],p=e[8],l=e[9],f=e[10],h=e[11],v=e[12],m=e[13],x=e[14],y=e[15],d=a*s-n*o,g=a*u-r*o,C=a*c-i*o,S=n*u-r*s,T=n*c-i*s,w=r*c-i*u,_=p*m-l*v,E=p*x-f*v,D=p*y-h*v,O=l*x-f*m,b=l*y-h*m,R=f*y-h*x,N=d*R-g*b+C*O+S*D-T*E+w*_;return N?(N=1/N,t[0]=(s*R-u*b+c*O)*N,t[1]=(r*b-n*R-i*O)*N,t[2]=(m*w-x*T+y*S)*N,t[3]=(f*T-l*w-h*S)*N,t[4]=(u*D-o*R-c*E)*N,t[5]=(a*R-r*D+i*E)*N,t[6]=(x*C-v*w-y*g)*N,t[7]=(p*w-f*C+h*g)*N,t[8]=(o*b-s*D+c*_)*N,t[9]=(n*D-a*b-i*_)*N,t[10]=(v*T-m*C+y*d)*N,t[11]=(l*C-p*T-h*d)*N,t[12]=(s*E-o*O-u*_)*N,t[13]=(a*O-n*E+r*_)*N,t[14]=(m*g-v*S-x*d)*N,t[15]=(p*S-l*g+f*d)*N,t):null}function u9(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],u=e[6],c=e[7],p=e[8],l=e[9],f=e[10],h=e[11],v=e[12],m=e[13],x=e[14],y=e[15];return t[0]=s*(f*y-h*x)-l*(u*y-c*x)+m*(u*h-c*f),t[1]=-(n*(f*y-h*x)-l*(r*y-i*x)+m*(r*h-i*f)),t[2]=n*(u*y-c*x)-s*(r*y-i*x)+m*(r*c-i*u),t[3]=-(n*(u*h-c*f)-s*(r*h-i*f)+l*(r*c-i*u)),t[4]=-(o*(f*y-h*x)-p*(u*y-c*x)+v*(u*h-c*f)),t[5]=a*(f*y-h*x)-p*(r*y-i*x)+v*(r*h-i*f),t[6]=-(a*(u*y-c*x)-o*(r*y-i*x)+v*(r*c-i*u)),t[7]=a*(u*h-c*f)-o*(r*h-i*f)+p*(r*c-i*u),t[8]=o*(l*y-h*m)-p*(s*y-c*m)+v*(s*h-c*l),t[9]=-(a*(l*y-h*m)-p*(n*y-i*m)+v*(n*h-i*l)),t[10]=a*(s*y-c*m)-o*(n*y-i*m)+v*(n*c-i*s),t[11]=-(a*(s*h-c*l)-o*(n*h-i*l)+p*(n*c-i*s)),t[12]=-(o*(l*x-f*m)-p*(s*x-u*m)+v*(s*f-u*l)),t[13]=a*(l*x-f*m)-p*(n*x-r*m)+v*(n*f-r*l),t[14]=-(a*(s*x-u*m)-o*(n*x-r*m)+v*(n*u-r*s)),t[15]=a*(s*f-u*l)-o*(n*f-r*l)+p*(n*u-r*s),t}function l9(t){var e=t[0],a=t[1],n=t[2],r=t[3],i=t[4],o=t[5],s=t[6],u=t[7],c=t[8],p=t[9],l=t[10],f=t[11],h=t[12],v=t[13],m=t[14],x=t[15],y=e*o-a*i,d=e*s-n*i,g=e*u-r*i,C=a*s-n*o,S=a*u-r*o,T=n*u-r*s,w=c*v-p*h,_=c*m-l*h,E=c*x-f*h,D=p*m-l*v,O=p*x-f*v,b=l*x-f*m;return y*b-d*O+g*D+C*E-S*_+T*w}function Ee(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],c=e[6],p=e[7],l=e[8],f=e[9],h=e[10],v=e[11],m=e[12],x=e[13],y=e[14],d=e[15],g=a[0],C=a[1],S=a[2],T=a[3];return t[0]=g*n+C*s+S*l+T*m,t[1]=g*r+C*u+S*f+T*x,t[2]=g*i+C*c+S*h+T*y,t[3]=g*o+C*p+S*v+T*d,g=a[4],C=a[5],S=a[6],T=a[7],t[4]=g*n+C*s+S*l+T*m,t[5]=g*r+C*u+S*f+T*x,t[6]=g*i+C*c+S*h+T*y,t[7]=g*o+C*p+S*v+T*d,g=a[8],C=a[9],S=a[10],T=a[11],t[8]=g*n+C*s+S*l+T*m,t[9]=g*r+C*u+S*f+T*x,t[10]=g*i+C*c+S*h+T*y,t[11]=g*o+C*p+S*v+T*d,g=a[12],C=a[13],S=a[14],T=a[15],t[12]=g*n+C*s+S*l+T*m,t[13]=g*r+C*u+S*f+T*x,t[14]=g*i+C*c+S*h+T*y,t[15]=g*o+C*p+S*v+T*d,t}function Ye(t,e,a){var n=a[0],r=a[1],i=a[2],o,s,u,c,p,l,f,h,v,m,x,y;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*i+e[12],t[13]=e[1]*n+e[5]*r+e[9]*i+e[13],t[14]=e[2]*n+e[6]*r+e[10]*i+e[14],t[15]=e[3]*n+e[7]*r+e[11]*i+e[15]):(o=e[0],s=e[1],u=e[2],c=e[3],p=e[4],l=e[5],f=e[6],h=e[7],v=e[8],m=e[9],x=e[10],y=e[11],t[0]=o,t[1]=s,t[2]=u,t[3]=c,t[4]=p,t[5]=l,t[6]=f,t[7]=h,t[8]=v,t[9]=m,t[10]=x,t[11]=y,t[12]=o*n+p*r+v*i+e[12],t[13]=s*n+l*r+m*i+e[13],t[14]=u*n+f*r+x*i+e[14],t[15]=c*n+h*r+y*i+e[15]),t}function zn(t,e,a){var n=a[0],r=a[1],i=a[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(t,e,a,n){var r=n[0],i=n[1],o=n[2],s=Math.hypot(r,i,o),u,c,p,l,f,h,v,m,x,y,d,g,C,S,T,w,_,E,D,O,b,R,N,L;return s0?(a[0]=(s*o+p*n+u*i-c*r)*2/l,a[1]=(u*o+p*r+c*n-s*i)*2/l,a[2]=(c*o+p*i+s*r-u*n)*2/l):(a[0]=(s*o+p*n+u*i-c*r)*2,a[1]=(u*o+p*r+c*n-s*i)*2,a[2]=(c*o+p*i+s*r-u*n)*2),bl(t,e,a),t}function Ml(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Pi(t,e){var a=e[0],n=e[1],r=e[2],i=e[4],o=e[5],s=e[6],u=e[8],c=e[9],p=e[10];return t[0]=Math.hypot(a,n,r),t[1]=Math.hypot(i,o,s),t[2]=Math.hypot(u,c,p),t}function zi(t,e){var a=new St(3);Pi(a,e);var n=1/a[0],r=1/a[1],i=1/a[2],o=e[0]*n,s=e[1]*r,u=e[2]*i,c=e[4]*n,p=e[5]*r,l=e[6]*i,f=e[8]*n,h=e[9]*r,v=e[10]*i,m=o+p+v,x=0;return m>0?(x=Math.sqrt(m+1)*2,t[3]=.25*x,t[0]=(l-h)/x,t[1]=(f-u)/x,t[2]=(s-c)/x):o>p&&o>v?(x=Math.sqrt(1+o-p-v)*2,t[3]=(l-h)/x,t[0]=.25*x,t[1]=(s+c)/x,t[2]=(f+u)/x):p>v?(x=Math.sqrt(1+p-o-v)*2,t[3]=(f-u)/x,t[0]=(s+c)/x,t[1]=.25*x,t[2]=(l+h)/x):(x=Math.sqrt(1+v-o-p)*2,t[3]=(s-c)/x,t[0]=(f+u)/x,t[1]=(l+h)/x,t[2]=.25*x),t}function Nl(t,e,a,n){var r=e[0],i=e[1],o=e[2],s=e[3],u=r+r,c=i+i,p=o+o,l=r*u,f=r*c,h=r*p,v=i*c,m=i*p,x=o*p,y=s*u,d=s*c,g=s*p,C=n[0],S=n[1],T=n[2];return t[0]=(1-(v+x))*C,t[1]=(f+g)*C,t[2]=(h-d)*C,t[3]=0,t[4]=(f-g)*S,t[5]=(1-(l+x))*S,t[6]=(m+y)*S,t[7]=0,t[8]=(h+d)*T,t[9]=(m-y)*T,t[10]=(1-(l+v))*T,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function d9(t,e,a,n,r){var i=e[0],o=e[1],s=e[2],u=e[3],c=i+i,p=o+o,l=s+s,f=i*c,h=i*p,v=i*l,m=o*p,x=o*l,y=s*l,d=u*c,g=u*p,C=u*l,S=n[0],T=n[1],w=n[2],_=r[0],E=r[1],D=r[2],O=(1-(m+y))*S,b=(h+C)*S,R=(v-g)*S,N=(h-C)*T,L=(1-(f+y))*T,B=(x+d)*T,P=(v+g)*w,F=(x-d)*w,k=(1-(f+m))*w;return t[0]=O,t[1]=b,t[2]=R,t[3]=0,t[4]=N,t[5]=L,t[6]=B,t[7]=0,t[8]=P,t[9]=F,t[10]=k,t[11]=0,t[12]=a[0]+_-(O*_+N*E+P*D),t[13]=a[1]+E-(b*_+L*E+F*D),t[14]=a[2]+D-(R*_+B*E+k*D),t[15]=1,t}function Yr(t,e){var a=e[0],n=e[1],r=e[2],i=e[3],o=a+a,s=n+n,u=r+r,c=a*o,p=n*o,l=n*s,f=r*o,h=r*s,v=r*u,m=i*o,x=i*s,y=i*u;return t[0]=1-l-v,t[1]=p+y,t[2]=f-x,t[3]=0,t[4]=p-y,t[5]=1-c-v,t[6]=h+m,t[7]=0,t[8]=f+x,t[9]=h-m,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function v9(t,e,a,n,r,i,o){var s=1/(a-e),u=1/(r-n),c=1/(i-o);return t[0]=i*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*u,t[6]=0,t[7]=0,t[8]=(a+e)*s,t[9]=(r+n)*u,t[10]=(o+i)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*c,t[15]=0,t}function Rl(t,e,a,n,r){var i=1/Math.tan(e/2),o;return t[0]=i/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,r!=null&&r!==1/0?(o=1/(n-r),t[10]=(r+n)*o,t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t}var y9=Rl;function m9(t,e,a,n,r){var i=1/Math.tan(e/2),o;return t[0]=i/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,r!=null&&r!==1/0?(o=1/(n-r),t[10]=r*o,t[14]=r*n*o):(t[10]=-1,t[14]=-n),t}function x9(t,e,a,n){var r=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(r+i);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((o-s)*u*.5),t[9]=(r-i)*c*.5,t[10]=n/(a-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*a/(a-n),t[15]=0,t}function Ll(t,e,a,n,r,i,o){var s=1/(e-a),u=1/(n-r),c=1/(i-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+a)*s,t[13]=(r+n)*u,t[14]=(o+i)*c,t[15]=1,t}var Fl=Ll;function C9(t,e,a,n,r,i,o){var s=1/(e-a),u=1/(n-r),c=1/(i-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+a)*s,t[13]=(r+n)*u,t[14]=i*c,t[15]=1,t}function kl(t,e,a,n){var r,i,o,s,u,c,p,l,f,h,v=e[0],m=e[1],x=e[2],y=n[0],d=n[1],g=n[2],C=a[0],S=a[1],T=a[2];return Math.abs(v-C)0&&(h=1/Math.sqrt(h),p*=h,l*=h,f*=h);var v=u*f-c*l,m=c*p-s*f,x=s*l-u*p;return h=v*v+m*m+x*x,h>0&&(h=1/Math.sqrt(h),v*=h,m*=h,x*=h),t[0]=v,t[1]=m,t[2]=x,t[3]=0,t[4]=l*x-f*m,t[5]=f*v-p*x,t[6]=p*m-l*v,t[7]=0,t[8]=p,t[9]=l,t[10]=f,t[11]=0,t[12]=r,t[13]=i,t[14]=o,t[15]=1,t}function T9(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function w9(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function _9(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t[6]=e[6]+a[6],t[7]=e[7]+a[7],t[8]=e[8]+a[8],t[9]=e[9]+a[9],t[10]=e[10]+a[10],t[11]=e[11]+a[11],t[12]=e[12]+a[12],t[13]=e[13]+a[13],t[14]=e[14]+a[14],t[15]=e[15]+a[15],t}function Al(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t[6]=e[6]-a[6],t[7]=e[7]-a[7],t[8]=e[8]-a[8],t[9]=e[9]-a[9],t[10]=e[10]-a[10],t[11]=e[11]-a[11],t[12]=e[12]-a[12],t[13]=e[13]-a[13],t[14]=e[14]-a[14],t[15]=e[15]-a[15],t}function E9(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12]*a,t[13]=e[13]*a,t[14]=e[14]*a,t[15]=e[15]*a,t}function D9(t,e,a,n){return t[0]=e[0]+a[0]*n,t[1]=e[1]+a[1]*n,t[2]=e[2]+a[2]*n,t[3]=e[3]+a[3]*n,t[4]=e[4]+a[4]*n,t[5]=e[5]+a[5]*n,t[6]=e[6]+a[6]*n,t[7]=e[7]+a[7]*n,t[8]=e[8]+a[8]*n,t[9]=e[9]+a[9]*n,t[10]=e[10]+a[10]*n,t[11]=e[11]+a[11]*n,t[12]=e[12]+a[12]*n,t[13]=e[13]+a[13]*n,t[14]=e[14]+a[14]*n,t[15]=e[15]+a[15]*n,t}function O9(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function b9(t,e){var a=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c=t[7],p=t[8],l=t[9],f=t[10],h=t[11],v=t[12],m=t[13],x=t[14],y=t[15],d=e[0],g=e[1],C=e[2],S=e[3],T=e[4],w=e[5],_=e[6],E=e[7],D=e[8],O=e[9],b=e[10],R=e[11],N=e[12],L=e[13],B=e[14],P=e[15];return Math.abs(a-d)<=Pe*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(n-g)<=Pe*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(r-C)<=Pe*Math.max(1,Math.abs(r),Math.abs(C))&&Math.abs(i-S)<=Pe*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(o-T)<=Pe*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-w)<=Pe*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-_)<=Pe*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(c-E)<=Pe*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(p-D)<=Pe*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(l-O)<=Pe*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-b)<=Pe*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(h-R)<=Pe*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(v-N)<=Pe*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(m-L)<=Pe*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(x-B)<=Pe*Math.max(1,Math.abs(x),Math.abs(B))&&Math.abs(y-P)<=Pe*Math.max(1,Math.abs(y),Math.abs(P))}var Vl=Ee,M9=Al;const Ra=Object.freeze(Object.defineProperty({__proto__:null,add:_9,adjoint:u9,clone:o9,copy:vt,create:qr,determinant:l9,equals:b9,exactEquals:O9,frob:w9,fromQuat:Yr,fromQuat2:g9,fromRotation:Ol,fromRotationTranslation:bl,fromRotationTranslationScale:Nl,fromRotationTranslationScaleOrigin:d9,fromScaling:Ii,fromTranslation:s0,fromValues:s9,fromXRotation:f9,fromYRotation:p9,fromZRotation:h9,frustum:v9,getRotation:zi,getScaling:Pi,getTranslation:Ml,identity:we,invert:Et,lookAt:kl,mul:Vl,multiply:Ee,multiplyScalar:E9,multiplyScalarAndAdd:D9,ortho:Fl,orthoNO:Ll,orthoZO:C9,perspective:y9,perspectiveFromFieldOfView:x9,perspectiveNO:Rl,perspectiveZO:m9,rotate:Tt,rotateX:Ui,rotateY:Na,rotateZ:Gi,scale:zn,set:c9,str:T9,sub:M9,subtract:Al,targetTo:S9,translate:Ye,transpose:We},Symbol.toStringTag,{value:"Module"}));function Wi(){var t=new St(3);return St!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function La(t){var e=t[0],a=t[1],n=t[2];return Math.hypot(e,a,n)}function ji(t,e,a){var n=new St(3);return n[0]=t,n[1]=e,n[2]=a,n}function $i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function un(t,e,a,n){return t[0]=e,t[1]=a,t[2]=n,t}function Hi(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t}function ln(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t}function Bl(t,e,a){return t[0]=e[0]*a[0],t[1]=e[1]*a[1],t[2]=e[2]*a[2],t}function Yt(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function N9(t,e){var a=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return Math.hypot(a,n,r)}function Ul(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Ki(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function fn(t,e){var a=e[0],n=e[1],r=e[2],i=a*a+n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Xi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Jr(t,e,a){var n=e[0],r=e[1],i=e[2],o=a[0],s=a[1],u=a[2];return t[0]=r*u-i*s,t[1]=i*o-n*u,t[2]=n*s-r*o,t}function _e(t,e,a){var n=e[0],r=e[1],i=e[2],o=a[3]*n+a[7]*r+a[11]*i+a[15];return o=o||1,t[0]=(a[0]*n+a[4]*r+a[8]*i+a[12])/o,t[1]=(a[1]*n+a[5]*r+a[9]*i+a[13])/o,t[2]=(a[2]*n+a[6]*r+a[10]*i+a[14])/o,t}function Zr(t,e,a){var n=e[0],r=e[1],i=e[2];return t[0]=n*a[0]+r*a[3]+i*a[6],t[1]=n*a[1]+r*a[4]+i*a[7],t[2]=n*a[2]+r*a[5]+i*a[8],t}function R9(t){return t[0]=0,t[1]=0,t[2]=0,t}function Fa(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Gl(t,e){var a=t[0],n=t[1],r=t[2],i=e[0],o=e[1],s=e[2];return Math.abs(a-i)<=Pe*Math.max(1,Math.abs(a),Math.abs(i))&&Math.abs(n-o)<=Pe*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=Pe*Math.max(1,Math.abs(r),Math.abs(s))}var Il=ln,L9=Bl,F9=N9,k9=La;(function(){var t=Wi();return function(e,a,n,r,i,o){var s,u;for(a||(a=3),n||(n=0),r?u=Math.min(r*a+n,e.length):u=e.length,s=n;s0&&(o=1/Math.sqrt(o)),t[0]=a*o,t[1]=n*o,t[2]=r*o,t[3]=i*o,t}function On(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3];return t[0]=a[0]*n+a[4]*r+a[8]*i+a[12]*o,t[1]=a[1]*n+a[5]*r+a[9]*i+a[13]*o,t[2]=a[2]*n+a[6]*r+a[10]*i+a[14]*o,t[3]=a[3]*n+a[7]*r+a[11]*i+a[15]*o,t}(function(){var t=A9();return function(e,a,n,r,i,o){var s,u;for(a||(a=4),n||(n=0),r?u=Math.min(r*a+n,e.length):u=e.length,s=n;sPe?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),a}function Yi(t,e,a){var n=e[0],r=e[1],i=e[2],o=e[3],s=a[0],u=a[1],c=a[2],p=a[3];return t[0]=n*p+o*s+r*c-i*u,t[1]=r*p+o*u+i*s-n*c,t[2]=i*p+o*c+n*u-r*s,t[3]=o*p-n*s-r*u-i*c,t}function Ji(t,e,a,n){var r=e[0],i=e[1],o=e[2],s=e[3],u=a[0],c=a[1],p=a[2],l=a[3],f,h,v,m,x;return h=r*u+i*c+o*p+s*l,h<0&&(h=-h,u=-u,c=-c,p=-p,l=-l),1-h>Pe?(f=Math.acos(h),v=Math.sin(f),m=Math.sin((1-n)*f)/v,x=Math.sin(n*f)/v):(m=1-n,x=n),t[0]=m*r+x*u,t[1]=m*i+x*c,t[2]=m*o+x*p,t[3]=m*s+x*l,t}function c0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function I9(t,e){var a=e[0]+e[4]+e[8],n;if(a>0)n=Math.sqrt(a+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[r*3+r]&&(r=2);var i=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[r*3+r]-e[i*3+i]-e[o*3+o]+1),t[r]=.5*n,n=.5/n,t[3]=(e[i*3+o]-e[o*3+i])*n,t[i]=(e[i*3+r]+e[r*3+i])*n,t[o]=(e[o*3+r]+e[r*3+o])*n}return t}var zl=V9,Zi=G9;(function(){var t=Wi(),e=ji(1,0,0),a=ji(0,1,0);return function(n,r,i){var o=Xi(r,i);return o<-.999999?(Jr(t,e,r),k9(t)<1e-6&&Jr(t,a,r),fn(t,t),qi(n,t,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Jr(t,r,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+o,Zi(n,n))}})(),function(){var t=Wn(),e=Wn();return function(a,n,r,i,o,s){return Ji(t,n,o,s),Ji(e,r,i,s),Ji(a,t,e,2*s*(1-s)),a}}(),function(){var t=sn();return function(e,a,n,r){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-a[0],t[5]=-a[1],t[8]=-a[2],Zi(e,I9(e,t))}}();function P9(t,e){e.classHierarchy.push("vtkOpenGLActor"),t.buildPass=a=>{if(a){e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNodes(e.renderable.getTextures()),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes(),e.ogltextures=null,e.activeTextures=null;for(let n=0;n{!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseOpaqueZBufferPass=a=>t.traverseOpaquePass(a),t.traverseOpaquePass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||!e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseTranslucentPass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.activateTextures=()=>{if(e.ogltextures){e.activeTextures=[];for(let a=0;a{if(a){if(!e.renderable||!e.renderable.getVisibility())return;e.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},t.zBufferPass=(a,n)=>t.opaquePass(a,n),t.opaqueZBufferPass=(a,n)=>t.opaquePass(a,n),t.opaquePass=(a,n)=>{if(a)e.context.depthMask(!0),t.activateTextures();else{if(e.activeTextures)for(let r=0;r{if(a)e.context.depthMask(e._openGLRenderer.getSelector()&&e.renderable.getNestedPickable()),t.activateTextures();else{if(e.activeTextures)for(let r=0;r(e.renderable.getMTime()>e.keyMatrixTime.getMTime()&&(e.renderable.computeMatrix(),vt(e.keyMatrices.mcwc,e.renderable.getMatrix()),We(e.keyMatrices.mcwc,e.keyMatrices.mcwc),e.renderable.getIsIdentity()?zt(e.keyMatrices.normalMatrix):(Pn(e.keyMatrices.normalMatrix,e.keyMatrices.mcwc),cn(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix),Xr(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix)),e.keyMatrixTime.modified()),e.keyMatrices)}var z9={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};function W9(t,e,a={}){Object.assign(e,z9,a),Ct.extend(t,e,a),e.keyMatrixTime={},lt(e.keyMatrixTime,{mtime:0}),e.keyMatrices={normalMatrix:zt(new Float64Array(9)),mcwc:we(new Float64Array(16))},ht(t,e,["context"]),Bt(t,e,["activeTextures"]),P9(t,e)}var j9=qe(W9);ct("vtkActor",j9);function $9(t,e){e.classHierarchy.push("vtkOpenGLActor2D"),t.buildPass=a=>{if(a){if(!e.renderable)return;e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNodes(e.renderable.getTextures()),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes(),e.ogltextures=null,e.activeTextures=null;for(let n=0;n{if(a){if(!e.renderable||!e.renderable.getVisibility())return;n.incrementOverlayActorCount()}},t.traverseOpaquePass=a=>{!e.oglmapper||!e.renderable||!e.renderable.getNestedVisibility()||!e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseTranslucentPass=a=>{!e.oglmapper||!e.renderable||!e.renderable.getNestedVisibility()||e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.traverseOverlayPass=a=>{!e.oglmapper||!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable||(t.apply(a,!0),e.oglmapper.traverse(a),t.apply(a,!1))},t.activateTextures=()=>{if(e.ogltextures){e.activeTextures=[];for(let a=0;a{if(a)e.context.depthMask(!0),t.activateTextures();else{if(e.activeTextures)for(let r=0;r{if(a)e.context.depthMask(!1),t.activateTextures();else{if(e.activeTextures)for(let r=0;r{if(a)e.context.depthMask(!0),t.activateTextures();else{if(e.activeTextures)for(let r=0;r{a&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.context=e._openGLRenderWindow.getContext())},t.opaquePass=a=>{if(a){const n=e._openGLRenderer.getTiledSizeAndOrigin();e.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),e.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},t.translucentPass=t.opaquePass,t.zBufferPass=t.opaquePass,t.opaqueZBufferPass=t.opaquePass,t.volumePass=t.opaquePass,t.getKeyMatrices=a=>{if(a!==e.lastRenderer||e._openGLRenderWindow.getMTime()>e.keyMatrixTime.getMTime()||t.getMTime()>e.keyMatrixTime.getMTime()||a.getMTime()>e.keyMatrixTime.getMTime()||e.renderable.getMTime()>e.keyMatrixTime.getMTime()){vt(e.keyMatrices.wcvc,e.renderable.getViewMatrix()),Pn(e.keyMatrices.normalMatrix,e.keyMatrices.wcvc),cn(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix),We(e.keyMatrices.wcvc,e.keyMatrices.wcvc);const n=e._openGLRenderer.getAspectRatio();vt(e.keyMatrices.vcpc,e.renderable.getProjectionMatrix(n,-1,1)),We(e.keyMatrices.vcpc,e.keyMatrices.vcpc),Ee(e.keyMatrices.wcpc,e.keyMatrices.vcpc,e.keyMatrices.wcvc),e.keyMatrixTime.modified(),e.lastRenderer=a}return e.keyMatrices}}var Y9={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function J9(t,e,a={}){Object.assign(e,Y9,a),Ct.extend(t,e,a),e.keyMatrixTime={},lt(e.keyMatrixTime),e.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},ht(t,e,["context","keyMatrixTime"]),q9(t,e)}var Z9=qe(J9);ct("vtkCamera",Z9);function Q9(t,e){e.classHierarchy.push("vtkImplicitFunction"),t.functionValue=a=>{if(!e.transform)return t.evaluateFunction(a);const n=[];return e.transform.transformPoint(a,n),t.evaluateFunction(n)},t.evaluateFunction=a=>{A.vtkErrorMacro("not implemented")}}var ey={};function Wl(t,e,a={}){Object.assign(e,ey,a),A.obj(t,e),A.setGet(t,e,["transform"]),Q9(t,e)}var ty=A.newInstance(Wl,"vtkImplicitFunction"),ny={newInstance:ty,extend:Wl},u0=1e-6,jl="coincide",$l="disjoint";function ry(t,e,a){return t[0]*(a[0]-e[0])+t[1]*(a[1]-e[1])+t[2]*(a[2]-e[2])}function Hl(t,e,a){const n=a[0]*(t[0]-e[0])+a[1]*(t[1]-e[1])+a[2]*(t[2]-e[2]);return Math.abs(n)}function Kl(t,e,a,n){const r=[];$e(t,e,r);const i=xe(a,r);n[0]=t[0]-i*a[0],n[1]=t[1]-i*a[1],n[2]=t[2]-i*a[2]}function Xl(t,e,a){const n=xe(t,e);let r=xe(e,e);return r===0&&(r=1),a[0]=t[0]-n*e[0]/r,a[1]=t[1]-n*e[1]/r,a[2]=t[2]-n*e[2]/r,a}function ql(t,e,a,n){const r=[];$e(t,e,r);const i=xe(a,r),o=xe(a,a);o!==0?(n[0]=t[0]-i*a[0]/o,n[1]=t[1]-i*a[1]/o,n[2]=t[2]-i*a[2]/o):(n[0]=t[0],n[1]=t[1],n[2]=t[2])}function Yl(t,e,a,n){const r={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},i=[],o=[];$e(e,t,i),$e(a,t,o);const s=xe(n,o),u=xe(n,i);let c,p;return u<0?c=-u:c=u,s<0?p=-s*u0:p=s*u0,c<=p||(r.t=s/u,r.x[0]=t[0]+r.t*i[0],r.x[1]=t[1]+r.t*i[1],r.x[2]=t[2]+r.t*i[2],r.intersection=!0,r.betweenPoints=r.t>=0&&r.t<=1),r}function Jl(t,e,a,n){const r={intersection:!1,l0:[],l1:[],error:null},i=[];tt(e,n,i);const o=i.map(l=>Math.abs(l));if(o[0]+o[1]+o[2]o[1]&&o[0]>o[2]?s="x":o[1]>o[2]?s="y":s="z";const u=[],c=-xe(e,t),p=-xe(n,a);switch(s){case"x":u[0]=0,u[1]=(p*e[2]-c*n[2])/i[0],u[2]=(c*n[1]-p*e[1])/i[0];break;case"y":u[0]=(c*n[2]-p*e[2])/i[1],u[1]=0,u[2]=(p*e[0]-c*n[0])/i[1];break;case"z":u[0]=(p*e[1]-c*n[1])/i[2],u[1]=(c*n[0]-p*e[0])/i[2],u[2]=0;break}return r.l0=u,sr(u,i,r.l1),r.intersection=!0,r}var ay={evaluate:ry,distanceToPlane:Hl,projectPoint:Kl,projectVector:Xl,generalizedProjectPoint:ql,intersectWithLine:Yl,intersectWithPlane:Jl,DISJOINT:$l,COINCIDE:jl};function iy(t,e){e.classHierarchy.push("vtkPlane"),t.distanceToPlane=a=>Hl(a,e.origin,e.normal),t.projectPoint=(a,n)=>{Kl(a,e.origin,e.normal,n)},t.projectVector=(a,n)=>Xl(a,e.normal,n),t.push=a=>{if(a!==0)for(let n=0;n<3;n++)e.origin[n]+=a*e.normal[n]},t.generalizedProjectPoint=(a,n)=>{ql(a,e.origin,e.normal,n)},t.evaluateFunction=(a,n,r)=>Array.isArray(a)?e.normal[0]*(a[0]-e.origin[0])+e.normal[1]*(a[1]-e.origin[1])+e.normal[2]*(a[2]-e.origin[2]):e.normal[0]*(a-e.origin[0])+e.normal[1]*(n-e.origin[1])+e.normal[2]*(r-e.origin[2]),t.evaluateGradient=a=>[e.normal[0],e.normal[1],e.normal[2]],t.intersectWithLine=(a,n)=>Yl(a,n,e.origin,e.normal),t.intersectWithPlane=(a,n)=>Jl(a,n,e.origin,e.normal)}var oy={normal:[0,0,1],origin:[0,0,0]};function Zl(t,e,a={}){Object.assign(e,oy,a),ny.extend(t,e,a),A.setGetArray(t,e,["normal","origin"],3),iy(t,e)}var sy=A.newInstance(Zl,"vtkPlane"),pn={newInstance:sy,extend:Zl,...ay},Qi=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];function Ql(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function bn(t){return(t==null?void 0:t.length)>=6&&t[0]<=t[1]&&t[2]<=t[3]&&t[4]<=t[5]}function l0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function f0(t){return l0(t,Qi)}function eo(t,e,a,n){const[r,i,o,s,u,c]=t;return typeof e=="number"?(t[0]=re?i:e,t[2]=oa?s:a,t[4]=un?c:n):(t[0]=re[0]?i:e[0],t[2]=oe[1]?s:e[1],t[4]=ue[2]?c:e[2]),t}function p0(t,e){if(e.length===0)return t;if(Array.isArray(e[0]))for(let a=0;ai?e:i,t[2]=a,t[3]=a>s?a:s,t[4]=n,t[5]=n>c?n:c,r!==e||o!==a||u!==n}function nf(t,e,a,n){const[r,i,o,s,u,c]=t;return t[0]=en&&(n=r,a=i),e[i]=r>0?1:0;if(a<0)return h0(t,.5);for(let i=0;i<3;++i)if(!e[i]){const o=.005*n;t[i*2]-=o,t[i*2+1]+=o}return t}function g0(t,e,a,n){return bn(t)?(e>=0?(t[0]*=e,t[1]*=e):(t[0]=e*t[1],t[1]=e*t[0]),a>=0?(t[2]*=a,t[3]*=a):(t[2]=a*t[3],t[3]=a*t[2]),n>=0?(t[4]*=n,t[5]*=n):(t[4]=n*t[5],t[5]=n*t[4]),!0):!1}function d0(t){return[.5*(t[0]+t[1]),.5*(t[2]+t[3]),.5*(t[4]+t[5])]}function uy(t,e,a,n){if(!bn(t))return!1;const r=d0(t);return t[0]-=r[0],t[1]-=r[0],t[2]-=r[1],t[3]-=r[1],t[4]-=r[2],t[5]-=r[2],g0(t,e,a,n),t[0]+=r[0],t[1]+=r[0],t[2]+=r[1],t[3]+=r[1],t[4]+=r[2],t[5]+=r[2],!0}function ka(t,e){return t[e*2+1]-t[e*2]}function Aa(t){return[ka(t,0),ka(t,1),ka(t,2)]}function rf(t){return t.slice(0,2)}function af(t){return t.slice(2,4)}function of(t){return t.slice(4,6)}function sf(t){const e=Aa(t);return e[0]>e[1]?e[0]>e[2]?e[0]:e[2]:e[1]>e[2]?e[1]:e[2]}function v0(t){if(bn(t)){const e=Aa(t);return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]}return null}function cf(t){const e=v0(t);return e!==null?Math.sqrt(e):null}function to(t){return[t[0],t[2],t[4]]}function no(t){return[t[1],t[3],t[5]]}function ro(t,e){return t<=0&&e>=0||t>=0&&e<=0}function y0(t,e){return e[0]=[t[0],t[2],t[4]],e[1]=[t[0],t[2],t[5]],e[2]=[t[0],t[3],t[4]],e[3]=[t[0],t[3],t[5]],e[4]=[t[1],t[2],t[4]],e[5]=[t[1],t[2],t[5]],e[6]=[t[1],t[3],t[4]],e[7]=[t[1],t[3],t[5]],e}function uf(t,e,a){return e[0]=t[0],e[1]=t[2],e[2]=t[4],a[0]=t[1],a[1]=t[3],a[2]=t[5],e}function lf(t,e,a=[]){const n=y0(t,[]);for(let r=0;rt[2*h+1]?(o[h]=p,c[h]=t[2*h+1],i=!1):o[h]=f;if(i)return n[0]=e[0],n[1]=e[1],n[2]=e[2],r[0]=0,1;for(let h=0;h<3;h++)o[h]!==f&&a[h]!==0?u[h]=(c[h]-e[h])/a[h]:u[h]=-1;for(let h=0;h<3;h++)u[s]1||u[s]<0)return 0;r[0]=u[s];for(let h=0;h<3;h++)if(s!==h){if(n[h]=e[h]+u[s]*a[h],n[h]t[2*h+1])return 0}else n[h]=c[h];return 1}function gf(t,e,a){const n=[];let r=0,i=1,o=1;for(let s=4;s<=5;++s){n[2]=t[s];for(let u=2;u<=3;++u){n[1]=t[u];for(let c=0;c<=1;++c)if(n[0]=t[c],r=pn.evaluate(a,e,n),o&&(i=r>=0?1:-1,o=0),r===0||i>0&&r<0||i<0&&r>0)return 1}}return 0}function df(t,e){if(!(bn(t)&&bn(e)))return!1;const a=[0,0,0,0,0,0];let n;for(let r=0;r<3;r++)if(n=!1,e[r*2]>=t[r*2]&&e[r*2]<=t[r*2+1]?(n=!0,a[r*2]=e[r*2]):t[r*2]>=e[r*2]&&t[r*2]<=e[r*2+1]&&(n=!0,a[r*2]=t[r*2]),e[r*2+1]>=t[r*2]&&e[r*2+1]<=t[r*2+1]?(n=!0,a[r*2+1]=e[2*r+1]):t[r*2+1]>=e[r*2]&&t[r*2+1]<=e[r*2+1]&&(n=!0,a[r*2+1]=t[r*2+1]),!n)return!1;return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],!0}function ao(t,e){if(!(bn(t)&&bn(e)))return!1;for(let a=0;a<3;a++)if(!(e[a*2]>=t[a*2]&&e[a*2]<=t[a*2+1])&&!(t[a*2]>=e[a*2]&&t[a*2]<=e[a*2+1])&&!(e[a*2+1]>=t[a*2]&&e[a*2+1]<=t[a*2+1])&&!(t[a*2+1]>=e[a*2]&&t[a*2+1]<=e[a*2+1]))return!1;return!0}function io(t,e,a,n){return!(et[1]||at[3]||nt[5])}function ly(t,e){return!(!ao(t,e)||!io(t,...to(e))||!io(t,...no(e)))}function vf(t,e,a){const n=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],r=[0,0,0,0,0,0,0,0];let i=0;for(let l=0;l<2;l++)for(let f=2;f<4;f++)for(let h=4;h<6;h++){const v=[t[l],t[f],t[h]];r[i++]=pn.evaluate(a,e,v)}let o=2;for(;o--&&!(ro(r[n[o][0]],r[n[o][4]])&&ro(r[n[o][1]],r[n[o][5]])&&ro(r[n[o][2]],r[n[o][6]])&&ro(r[n[o][3]],r[n[o][7]])););if(o<0)return!1;const s=Math.sign(a[o]),u=Math.abs((t[o*2+1]-t[o*2])*a[o]);let c=s>0?1:0;for(let l=0;l<4;l++){if(u===0)continue;const f=Math.abs(r[n[o][l]])/u;s>0&&fc&&(c=f)}const p=(1-c)*t[o*2]+c*t[o*2+1];return s>0?t[o*2]=p:t[o*2+1]=p,!0}function yf(t,e){for(let n=0;n<3;++n)e[n]=e[n]<1?1:e[n];let a=e[0]*e[1]*e[2];for(;a>t;){for(let n=0;n<3;++n)e[n]=e[n]>1?e[n]-1:1;a=e[0]*e[1]*e[2]}}function mf(t,e,a,n=[]){e=e<=0?1:e;let r=0;const i=[0,0,0];let o=-1,s=0;const u=Aa(t),c=u[0]+u[1]+u[2],p=c*(.001/3);for(let m=0;m<3;++m)u[m]>s&&(o=m,s=u[m]),u[m]>p?(i[m]=1,r++):i[m]=0;const l=to(t),f=no(t);if(r<1)return a[0]=1,a[1]=1,a[2]=1,n[0]=l[0]-.5,n[1]=f[0]+.5,n[2]=l[1]-.5,n[3]=f[1]+.5,n[4]=l[2]-.5,n[5]=f[2]+.5,1;let h=e;h/=i[0]?u[0]/c:1,h/=i[1]?u[1]/c:1,h/=i[2]?u[2]/c:1,h**=1/r;for(let m=0;m<3;++m)a[m]=i[m]?Math.floor(h*u[m]/c):1,a[m]=a[m]<1?1:a[m];yf(e,a);const v=.5*u[o]/a[o];for(let m=0;m<3;++m)i[m]?(n[2*m]=l[m],n[2*m+1]=f[m]):(n[2*m]=l[m]-v,n[2*m+1]=f[m]+v);return a[0]*a[1]*a[2]}function xf(t,e){if(t[0]>=e[0]&&t[0]<=e[1]&&t[1]>=e[2]&&t[1]<=e[3]&&t[2]>=e[4]&&t[2]<=e[5])return 0;const a=[0,0,0];return t[0]e[1]&&(a[0]=t[0]-e[1]),t[1]e[3]&&(a[1]=t[1]-e[3]),t[2]e[5]&&(a[2]=t[2]-e[5]),xe(a,a)}var fy=class{constructor(t){this.bounds=t,this.bounds||(this.bounds=new Float64Array(Qi))}getBounds(){return this.bounds}equals(t){return Ql(this.bounds,t)}isValid(){return bn(this.bounds)}setBounds(t){return l0(this.bounds,t)}reset(){return f0(this.bounds)}addPoint(...t){return eo(this.bounds,...t)}addPoints(t){return p0(this.bounds,t)}addBounds(t,e,a,n,r,i){return ef(this.bounds,t,e,a,n,r,i)}setMinPoint(t,e,a){return tf(this.bounds,t,e,a)}setMaxPoint(t,e,a){return nf(this.bounds,t,e,a)}inflate(t){return h0(this.bounds,t)}scale(t,e,a){return g0(this.bounds,t,e,a)}getCenter(){return d0(this.bounds)}getLength(t){return ka(this.bounds,t)}getLengths(){return Aa(this.bounds)}getMaxLength(){return sf(this.bounds)}getDiagonalLength(){return cf(this.bounds)}getDiagonalLength2(){return v0(this.bounds)}getMinPoint(){return to(this.bounds)}getMaxPoint(){return no(this.bounds)}getXRange(){return rf(this.bounds)}getYRange(){return af(this.bounds)}getZRange(){return of(this.bounds)}getCorners(t){return y0(this.bounds,t)}computeCornerPoints(t,e){return uf(this.bounds,t,e)}computeLocalBounds(t,e,a){return pf(this.bounds,t,e,a)}transformBounds(t,e=[]){return lf(this.bounds,t,e)}computeScale3(t){return ff(this.bounds,t)}cutWithPlane(t,e){return vf(this.bounds,t,e)}intersectBox(t,e,a,n){return hf(this.bounds,t,e,a,n)}intersectPlane(t,e){return gf(this.bounds,t,e)}intersect(t){return df(this.bounds,t)}intersects(t){return ao(this.bounds,t)}containsPoint(t,e,a){return io(this.bounds,t,e,a)}contains(t){return ao(this.bounds,t)}computeDivisions(t,e,a=[]){return mf(this.bounds,t,e,a)}distance2ToBounds(t){return xf(t,this.bounds)}};function py(t){return new fy(t&&t.bounds)}var hy={equals:Ql,isValid:bn,setBounds:l0,reset:f0,addPoint:eo,addPoints:p0,addBounds:ef,setMinPoint:tf,setMaxPoint:nf,inflate:h0,scale:g0,scaleAboutCenter:uy,getCenter:d0,getLength:ka,getLengths:Aa,getMaxLength:sf,getDiagonalLength:cf,getDiagonalLength2:v0,getMinPoint:to,getMaxPoint:no,getXRange:rf,getYRange:af,getZRange:of,getCorners:y0,computeCornerPoints:uf,computeLocalBounds:pf,transformBounds:lf,computeScale3:ff,cutWithPlane:vf,intersectBox:hf,intersectPlane:gf,intersect:df,intersects:ao,containsPoint:io,contains:ly,computeDivisions:mf,clampDivisions:yf,distance2ToBounds:xf,INIT_BOUNDS:Qi},de={newInstance:py,...hy},{isVtkObject:gy}=A;function Cf(t){const e=[];for(let a=0;a(e.numberOfCells!==void 0&&!n||(e.cellSizes?e.numberOfCells=e.cellSizes.length:e.numberOfCells=Sf(t.getData())),e.numberOfCells),t.getCellSizes=n=>(e.cellSizes!==void 0&&!n||(e.cellSizes=Cf(t.getData())),e.cellSizes),t.resize=n=>{const r=t.getNumberOfTuples();a.resize(n);const i=t.getNumberOfTuples();i{a.setData(n,1),e.numberOfCells=void 0,e.cellSizes=void 0},t.getCell=n=>{let r=n;const i=e.values[r++];return e.values.subarray(r,r+i)},t.insertNextCell=n=>{let r;gy(n)?r=n.getPointsIds():r=n;const i=t.getNumberOfCells();return t.insertNextTuples([r.length,...r]),++e.numberOfCells,e.cellSizes!=null&&e.cellSizes.push(r.length),i},t.getMaxCellSize=()=>t.getCellSizes().reduce((n,r)=>Math.max(n,r),0)}function yy(t){return{empty:!0,numberOfComponents:1,dataType:be.UNSIGNED_INT,...t}}function Tf(t,e,a={}){pe.extend(t,e,yy(a)),vy(t,e)}var my=A.newInstance(Tf,"vtkCellArray"),Mn={newInstance:my,extend:Tf,...dy},{vtkErrorMacro:xy}=A;function Cy(t,e){let a=0;e.classHierarchy.push("vtkPoints"),t.getNumberOfPoints=t.getNumberOfTuples,t.setNumberOfPoints=(i,o=3)=>{t.getNumberOfPoints()!==i&&(e.size=i*o,e.values=A.newTypedArray(e.dataType,e.size),t.setNumberOfComponents(o),t.modified())},t.setPoint=(i,...o)=>{t.setTuple(i,o)},t.getPoint=t.getTuple,t.findPoint=t.findTuple,t.insertNextPoint=(i,o,s)=>t.insertNextTuple([i,o,s]),t.insertPoint=(i,o)=>t.insertTuple(i,o);const n=t.getBounds;t.getBounds=()=>(a(a{if(t.getNumberOfComponents()===3){const i=t.getRange(0);e.bounds[0]=i[0],e.bounds[1]=i[1];const o=t.getRange(1);e.bounds[2]=o[0],e.bounds[3]=o[1];const s=t.getRange(2);e.bounds[4]=s[0],e.bounds[5]=s[1]}else if(t.getNumberOfComponents()===2){const i=t.getRange(0);e.bounds[0]=i[0],e.bounds[1]=i[1];const o=t.getRange(1);e.bounds[2]=o[0],e.bounds[3]=o[1],e.bounds[4]=0,e.bounds[5]=0}else xy(`getBounds called on an array with components of ${t.getNumberOfComponents()}`),Qs(e.bounds);a=A.getCurrentGlobalMTime()},t.setNumberOfComponents(e.numberOfComponents<2?3:e.numberOfComponents)}var Sy={empty:!0,numberOfComponents:3,dataType:be.FLOAT,bounds:[1,-1,1,-1,1,-1]};function wf(t,e,a={}){Object.assign(e,Sy,a),pe.extend(t,e,a),A.getArray(t,e,["bounds"],6),Cy(t,e)}var Ty=A.newInstance(wf,"vtkPoints"),kt={newInstance:Ty,extend:wf};function wy(t,e){e.classHierarchy.push("vtkCell"),t.initialize=(a,n=null)=>{if(n){e.pointsIds=n;let r=e.points.getData();r.length!==3*e.pointsIds.length&&(r=A.newTypedArray(a.getDataType(),3*e.pointsIds.length));const i=a.getData();e.pointsIds.forEach((o,s)=>{let u=3*o,c=3*s;r[c]=i[u],r[++c]=i[++u],r[++c]=i[++u]}),e.points.setData(r)}else{e.points=a,e.pointsIds=new Array(a.getNumberOfPoints());for(let r=a.getNumberOfPoints()-1;r>=0;--r)e.pointsIds[r]=r}},t.getBounds=()=>e.points.getBounds(),t.getLength2=()=>{const a=de.getLengths(t.getBounds());return a[0]*a[0]+a[1]*a[1]+a[2]*a[2]},t.getParametricDistance=a=>{let n,r=0;for(let i=0;i<3;i++)a[i]<0?n=-a[i]:a[i]>1?n=a[i]-1:n=0,n>r&&(r=n);return r},t.getNumberOfPoints=()=>e.points.getNumberOfPoints(),t.deepCopy=a=>{a.initialize(e.points,e.pointsIds)},t.getCellDimension=()=>{},t.intersectWithLine=(a,n,r,i,o,s,u)=>{},t.evaluatePosition=(a,n,r,i,o,s)=>{A.vtkErrorMacro("vtkCell.evaluatePosition is not implemented.")}}var _y={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function _f(t,e,a={}){Object.assign(e,_y,a),A.obj(t,e),e.points||(e.points=kt.newInstance()),A.get(t,e,["points","pointsIds"]),wy(t,e)}var Ey=A.newInstance(_f,"vtkCell"),pr={newInstance:Ey,extend:_f};function Dy(t,e){let a=e;for(e>=t.array.length&&(a+=t.array.length);a>t.array.length;)t.array.push({ncells:0,cells:null});t.array.length=a}function Oy(t,e){e.classHierarchy.push("vtkCellLinks"),t.buildLinks=a=>{const n=a.getPoints().getNumberOfPoints(),r=a.getNumberOfCells(),i=new Uint32Array(n);if(a.isA("vtkPolyData")){for(let o=0;o{t.incrementLinkCount(u)})}t.allocateLinks(n),e.maxId=n-1;for(let o=0;o{t.insertCellReference(u,i[u]++,o)})}}else{for(let o=0;o{t.incrementLinkCount(s)});t.allocateLinks(n),e.maxId=n-1;for(let o=0;o{t.insertCellReference(s,i[s]++,o)})}},t.allocate=(a,n=1e3)=>{e.array=Array(a).fill().map(()=>({ncells:0,cells:null})),e.extend=n,e.maxId=-1},t.initialize=()=>{e.array=null},t.getLink=a=>e.array[a],t.getNcells=a=>e.array[a].ncells,t.getCells=a=>e.array[a].cells,t.insertNextPoint=a=>{e.array.push({ncells:a,cells:Array(a)}),++e.maxId},t.insertNextCellReference=(a,n)=>{e.array[a].cells[e.array[a].ncells++]=n},t.deletePoint=a=>{e.array[a].ncells=0,e.array[a].cells=null},t.removeCellReference=(a,n)=>{e.array[n].cells=e.array[n].cells.filter(r=>r!==a),e.array[n].ncells=e.array[n].cells.length},t.addCellReference=(a,n)=>{e.array[n].cells[e.array[n].ncells++]=a},t.resizeCellList=(a,n)=>{e.array[a].cells.length=n},t.squeeze=()=>{Dy(e,e.maxId+1)},t.reset=()=>{e.maxId=-1},t.deepCopy=a=>{e.array=[...a.array],e.extend=a.extend,e.maxId=a.maxId},t.incrementLinkCount=a=>{++e.array[a].ncells},t.allocateLinks=a=>{for(let n=0;n{e.array[a].cells[n]=r}}var by={array:null,maxId:0,extend:0};function Ef(t,e,a={}){Object.assign(e,by,a),A.obj(t,e),Oy(t,e)}var My=A.newInstance(Ef,"vtkCellLinks"),Ny={newInstance:My,extend:Ef},je={VTK_EMPTY_CELL:0,VTK_VERTEX:1,VTK_POLY_VERTEX:2,VTK_LINE:3,VTK_POLY_LINE:4,VTK_TRIANGLE:5,VTK_TRIANGLE_STRIP:6,VTK_POLYGON:7,VTK_PIXEL:8,VTK_QUAD:9,VTK_TETRA:10,VTK_VOXEL:11,VTK_HEXAHEDRON:12,VTK_WEDGE:13,VTK_PYRAMID:14,VTK_PENTAGONAL_PRISM:15,VTK_HEXAGONAL_PRISM:16,VTK_QUADRATIC_EDGE:21,VTK_QUADRATIC_TRIANGLE:22,VTK_QUADRATIC_QUAD:23,VTK_QUADRATIC_POLYGON:36,VTK_QUADRATIC_TETRA:24,VTK_QUADRATIC_HEXAHEDRON:25,VTK_QUADRATIC_WEDGE:26,VTK_QUADRATIC_PYRAMID:27,VTK_BIQUADRATIC_QUAD:28,VTK_TRIQUADRATIC_HEXAHEDRON:29,VTK_QUADRATIC_LINEAR_QUAD:30,VTK_QUADRATIC_LINEAR_WEDGE:31,VTK_BIQUADRATIC_QUADRATIC_WEDGE:32,VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON:33,VTK_BIQUADRATIC_TRIANGLE:34,VTK_CUBIC_LINE:35,VTK_CONVEX_POINT_SET:41,VTK_POLYHEDRON:42,VTK_PARAMETRIC_CURVE:51,VTK_PARAMETRIC_SURFACE:52,VTK_PARAMETRIC_TRI_SURFACE:53,VTK_PARAMETRIC_QUAD_SURFACE:54,VTK_PARAMETRIC_TETRA_REGION:55,VTK_PARAMETRIC_HEX_REGION:56,VTK_HIGHER_ORDER_EDGE:60,VTK_HIGHER_ORDER_TRIANGLE:61,VTK_HIGHER_ORDER_QUAD:62,VTK_HIGHER_ORDER_POLYGON:63,VTK_HIGHER_ORDER_TETRAHEDRON:64,VTK_HIGHER_ORDER_WEDGE:65,VTK_HIGHER_ORDER_PYRAMID:66,VTK_HIGHER_ORDER_HEXAHEDRON:67,VTK_LAGRANGE_CURVE:68,VTK_LAGRANGE_TRIANGLE:69,VTK_LAGRANGE_QUADRILATERAL:70,VTK_LAGRANGE_TETRAHEDRON:71,VTK_LAGRANGE_HEXAHEDRON:72,VTK_LAGRANGE_WEDGE:73,VTK_LAGRANGE_PYRAMID:74,VTK_NUMBER_OF_CELL_TYPES:75},m0=["vtkEmptyCell","vtkVertex","vtkPolyVertex","vtkLine","vtkPolyLine","vtkTriangle","vtkTriangleStrip","vtkPolygon","vtkPixel","vtkQuad","vtkTetra","vtkVoxel","vtkHexahedron","vtkWedge","vtkPyramid","vtkPentagonalPrism","vtkHexagonalPrism","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkQuadraticEdge","vtkQuadraticTriangle","vtkQuadraticQuad","vtkQuadraticTetra","vtkQuadraticHexahedron","vtkQuadraticWedge","vtkQuadraticPyramid","vtkBiQuadraticQuad","vtkTriQuadraticHexahedron","vtkQuadraticLinearQuad","vtkQuadraticLinearWedge","vtkBiQuadraticQuadraticWedge","vtkBiQuadraticQuadraticHexahedron","vtkBiQuadraticTriangle","vtkCubicLine","vtkQuadraticPolygon","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkConvexPointSet","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkParametricCurve","vtkParametricSurface","vtkParametricTriSurface","vtkParametricQuadSurface","vtkParametricTetraRegion","vtkParametricHexRegion","UnknownClass","UnknownClass","UnknownClass","vtkHigherOrderEdge","vtkHigherOrderTriangle","vtkHigherOrderQuad","vtkHigherOrderPolygon","vtkHigherOrderTetrahedron","vtkHigherOrderWedge","vtkHigherOrderPyramid","vtkHigherOrderHexahedron"];function Ry(t){return t{e.size=a>0?a:1,e.extend=n>0?n:1,e.maxId=-1,e.typeArray=new Uint8Array(a),e.locationArray=new Uint32Array(a)},t.insertCell=(a,n,r)=>{e.typeArray[a]=n,e.locationArray[a]=r,a>e.maxId&&(e.maxId=a)},t.insertNextCell=(a,n)=>(t.insertCell(++e.maxId,a,n),e.maxId),t.setCellTypes=(a,n,r)=>{e.size=a,e.typeArray=n,e.locationArray=r,e.maxId=a-1},t.getCellLocation=a=>e.locationArray[a],t.deleteCell=a=>{e.typeArray[a]=je.VTK_EMPTY_CELL},t.getNumberOfTypes=()=>e.maxId+1,t.isType=a=>{const n=t.getNumberOfTypes();for(let r=0;rt.insertNextCell(a,-1),t.getCellType=a=>e.typeArray[a],t.reset=()=>{e.maxId=-1},t.deepCopy=a=>{t.allocate(a.getSize(),a.getExtend()),e.typeArray.set(a.getTypeArray()),e.locationArray.set(a.getLocationArray()),e.maxId=a.getMaxId()}}var By={size:0,maxId:-1,extend:1e3};function Df(t,e,a={}){Object.assign(e,By,a),A.obj(t,e),A.get(t,e,["size","maxId","extend"]),A.getArray(t,e,["typeArray","locationArray"]),Vy(t,e)}var Uy=A.newInstance(Df,"vtkCellTypes"),Gy={newInstance:Uy,extend:Df,...Ay},Of={NO_INTERSECTION:0,YES_INTERSECTION:1,ON_LINE:2},bf={IntersectionState:Of},{IntersectionState:oo}=bf;function Qr(t,e,a,n=null){const r={t:Number.MIN_VALUE,distance:0},i=[];let o;i[0]=a[0]-e[0],i[1]=a[1]-e[1],i[2]=a[2]-e[2];const s=i[0]*(t[0]-e[0])+i[1]*(t[1]-e[1])+i[2]*(t[2]-e[2]),u=xe(i,i);let c=1e-5*s;return u!==0&&(r.t=s/u),c<0&&(c=-c),-c1?o=a:(o=i,i[0]=e[0]+r.t*i[0],i[1]=e[1]+r.t*i[1],i[2]=e[2]+r.t*i[2]),n&&(n[0]=o[0],n[1]=o[1],n[2]=o[2]),r.distance=dt(o,t),r}function Mf(t,e,a,n,r,i){const o=[],s=[],u=[];r[0]=0,i[0]=0,$e(e,t,o),$e(n,a,s),$e(a,t,u);const c=[xe(o,o),-xe(o,s),-xe(o,s),xe(s,s)],p=[];if(p[0]=xe(o,u),p[1]=-xe(s,u),al(c,p,2)===0){let l=Number.MAX_VALUE;const f=[t,e,a,n],h=[a,a,t,t],v=[n,n,e,e];i[0],i[0],r[0],r[0],r[0],r[0],i[0],i[0];let m;for(let x=0;x<4;x++)m=Qr(f[x],h[x],v[x]),m.distance=0&&r[0]<=1&&i[0]>=0&&i[0]<=1?oo.YES_INTERSECTION:oo.NO_INTERSECTION}var Iy={distanceToLine:Qr,intersection:Mf};function Py(t,e){e.classHierarchy.push("vtkLine");function a(n){return n>=0&&n<=1}t.getCellDimension=()=>1,t.intersectWithLine=(n,r,i,o,s)=>{const u={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};s[1]=0,s[2]=0;const c=[],p=[],l=[];e.points.getPoint(0,p),e.points.getPoint(1,l);const f=[],h=[],v=Mf(n,r,p,l,f,h);if(u.t=f[0],u.betweenPoints=a(u.t),s[0]=h[0],v===oo.YES_INTERSECTION){for(let m=0;m<3;m++)o[m]=p[m]+s[0]*(l[m]-p[m]),c[m]=n[m]+u.t*(r[m]-n[m]);if(dt(o,c)<=i*i)return u.intersect=1,u}else{let m;if(u.t<0)return m=Qr(n,p,l,o),m.distance<=i*i&&(u.t=0,u.intersect=1,u.betweenPoints=!0),u;if(u.t>1)return m=Qr(r,p,l,o),m.distance<=i*i&&(u.t=1,u.intersect=1,u.betweenPoints=!0),u;if(s[0]<0)return s[0]=0,m=Qr(p,n,r,o),u.t=m.t,m.distance<=i*i&&(u.intersect=1),u;if(s[0]>1)return s[0]=1,m=Qr(l,n,r,o),u.t=m.t,m.distance<=i*i&&(u.intersect=1),u}return u},t.evaluateLocation=(n,r,i)=>{const o=[],s=[];e.points.getPoint(0,o),e.points.getPoint(1,s);for(let u=0;u<3;u++)r[u]=o[u]+n[0]*(s[u]-o[u]);i[0]=1-n[0],i[1]=n[0]},t.evaluateOrientation=(n,r,i)=>e.orientations?(Ji(r,e.orientations[0],e.orientations[1],n[0]),i[0]=1-n[0],i[1]=n[0],!0):!1}var zy={orientations:null};function Nf(t,e,a={}){Object.assign(e,zy,a),pr.extend(t,e,a),A.setGet(t,e,["orientations"]),Py(t,e)}var Wy=A.newInstance(Nf,"vtkLine"),Mt={newInstance:Wy,extend:Nf,...Iy,...bf},{vtkErrorMacro:Rf,vtkWarningMacro:jy}=A;function $y(t,e){e.classHierarchy.push("vtkFieldData");const a=t.getState;e.arrays&&(e.arrays=e.arrays.map(n=>({data:_t(n.data)}))),t.initialize=()=>{t.initializeFields(),t.copyAllOn(),t.clearFieldFlags()},t.initializeFields=()=>{e.arrays=[],e.copyFieldFlags={},t.modified()},t.copyStructure=n=>{t.initializeFields(),e.copyFieldFlags=n.getCopyFieldFlags().map(r=>r),e.arrays=n.getArrays().map(r=>({data:r}))},t.getNumberOfArrays=()=>e.arrays.length,t.getNumberOfActiveArrays=()=>e.arrays.length,t.addArray=n=>{const r=n.getName(),{array:i,index:o}=t.getArrayWithIndex(r);return i!=null?(e.arrays[o]={data:n},o):(e.arrays=[].concat(e.arrays,{data:n}),e.arrays.length-1)},t.removeAllArrays=()=>{e.arrays=[]},t.removeArray=n=>{const r=e.arrays.findIndex(i=>i.data.getName()===n);return t.removeArrayByIndex(r)},t.removeArrayByIndex=n=>n!==-1&&ne.arrays.map(n=>n.data),t.getArray=n=>typeof n=="number"?t.getArrayByIndex(n):t.getArrayByName(n),t.getArrayByName=n=>e.arrays.reduce((r,i,o)=>i.data.getName()===n?i.data:r,null),t.getArrayWithIndex=n=>{const r=e.arrays.findIndex(i=>i.data.getName()===n);return{array:r!==-1?e.arrays[r].data:null,index:r}},t.getArrayByIndex=n=>n>=0&&nt.getArrayWithIndex(n).index>=0,t.getArrayName=n=>{const r=e.arrays[n];return r?r.data.getName():""},t.getCopyFieldFlags=()=>e.copyFieldFlags,t.getFlag=n=>e.copyFieldFlags[n],t.passData=(n,r=-1,i=-1)=>{n.getArrays().forEach(o=>{const s=t.getFlag(o.getName());if(s!==!1&&!(e.doCopyAllOff&&s!==!0)&&o){let u=t.getArrayByName(o.getName());if(u)if(o.getNumberOfComponents()===u.getNumberOfComponents())if(r>-1&&r-1?i:r;u.insertTuple(c,o.getTuple(r))}else u.insertTuples(0,o.getTuples());else Rf("Unhandled case in passData");else if(r<0||r>o.getNumberOfTuples())t.addArray(o),n.getAttributes(o).forEach(c=>{t.setAttribute(o,c)});else{const c=o.getNumberOfComponents();let p=o.getNumberOfValues();const l=i>-1?i:r;p<=l*c&&(p=(l+1)*c),u=pe.newInstance({name:o.getName(),dataType:o.getDataType(),numberOfComponents:c,values:A.newTypedArray(o.getDataType(),p),size:0}),u.insertTuple(l,o.getTuple(r)),t.addArray(u),n.getAttributes(o).forEach(f=>{t.setAttribute(u,f)})}}})},t.interpolateData=(n,r=-1,i=-1,o=-1,s=.5)=>{n.getArrays().forEach(u=>{const c=t.getFlag(u.getName());if(c!==!1&&!(e.doCopyAllOff&&c!==!0)&&u){let p=t.getArrayByName(u.getName());if(p)if(u.getNumberOfComponents()===p.getNumberOfComponents())if(r>-1&&r-1?o:r;p.interpolateTuple(l,u,r,u,i,s),jy("Unexpected case in interpolateData")}else p.insertTuples(u.getTuples());else Rf("Unhandled case in interpolateData");else if(r<0||i<0||r>u.getNumberOfTuples())t.addArray(u),n.getAttributes(u).forEach(l=>{t.setAttribute(u,l)});else{const l=u.getNumberOfComponents();let f=u.getNumberOfValues();const h=o>-1?o:r;f<=h*l&&(f=(h+1)*l),p=pe.newInstance({name:u.getName(),dataType:u.getDataType(),numberOfComponents:l,values:A.newTypedArray(u.getDataType(),f),size:0}),p.interpolateTuple(h,u,r,u,i,s),t.addArray(p),n.getAttributes(u).forEach(v=>{t.setAttribute(p,v)})}}})},t.copyFieldOn=n=>{e.copyFieldFlags[n]=!0},t.copyFieldOff=n=>{e.copyFieldFlags[n]=!1},t.copyAllOn=()=>{(!e.doCopyAllOn||e.doCopyAllOff)&&(e.doCopyAllOn=!0,e.doCopyAllOff=!1,t.modified())},t.copyAllOff=()=>{(e.doCopyAllOn||!e.doCopyAllOff)&&(e.doCopyAllOn=!1,e.doCopyAllOff=!0,t.modified())},t.clearFieldFlags=()=>{e.copyFieldFlags={}},t.deepCopy=n=>{e.arrays=n.getArrays().map(r=>{const i=r.newClone();return i.deepCopy(r),{data:i}})},t.copyFlags=n=>n.getCopyFieldFlags().map(r=>r),t.reset=()=>e.arrays.forEach(n=>n.data.reset()),t.getMTime=()=>e.arrays.reduce((n,r)=>r.data.getMTime()>n?r.data.getMTime():n,e.mtime),t.getNumberOfComponents=()=>e.arrays.reduce((n,r)=>n+r.data.getNumberOfComponents(),0),t.getNumberOfTuples=()=>e.arrays.length>0?e.arrays[0].getNumberOfTuples():0,t.getState=n=>{const r=a(n);return r&&(r.arrays=e.arrays.map(i=>({data:i.data.getState(n)}))),r}}var Hy={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function Lf(t,e,a={}){Object.assign(e,Hy,a),A.obj(t,e),$y(t,e)}var Ky=A.newInstance(Lf,"vtkFieldData"),Xy={newInstance:Ky,extend:Lf},Ff={SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},qy={MAX:0,EXACT:1,NOLIMIT:2},Yy={DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},Jy={DUPLICATEPOINT:1,HIDDENPOINT:2},Zy={COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},Qy="vtkGhostType",hr={DEFAULT:0,SINGLE:1,DOUBLE:2},kf={AttributeCopyOperations:Zy,AttributeLimitTypes:qy,AttributeTypes:Ff,CellGhostTypes:Yy,DesiredOutputPrecision:hr,PointGhostTypes:Jy,ghostArrayName:Qy},{AttributeTypes:jn,AttributeCopyOperations:gr}=kf,{vtkWarningMacro:so}=A;function e5(t,e){const a=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(o){let s=a.find(u=>jn[u.toUpperCase()]===o||typeof o!="number"&&u.toLowerCase()===o.toLowerCase());return typeof s>"u"&&(s=null),s}e.classHierarchy.push("vtkDataSetAttributes");const r={...t};t.checkNumberOfComponents=o=>!0,t.setAttribute=(o,s)=>{const u=n(s);if(o&&u.toUpperCase()==="PEDIGREEIDS"&&!o.isA("vtkDataArray"))return so(`Cannot set attribute ${u}. The attribute must be a vtkDataArray.`),-1;if(o&&!t.checkNumberOfComponents(o,u))return so(`Cannot set attribute ${u}. Incorrect number of components.`),-1;if(o){const c=t.addArray(o);e[`active${u}`]=c}else e[`active${u}`]=-1;return t.modified(),e[`active${u}`]},t.getAttributes=o=>a.filter(s=>t[`get${s}`]()===o),t.setActiveAttributeByName=(o,s)=>t.setActiveAttributeByIndex(t.getArrayWithIndex(o).index,s),t.setActiveAttributeByIndex=(o,s)=>{const u=n(s);if(o>=0&&ot[`get${n(o)}`](),t.removeAllArrays=()=>{a.forEach(o=>{e[`active${o}`]=-1}),r.removeAllArrays()},t.removeArrayByIndex=o=>(o!==-1&&a.forEach(s=>{o===e[`active${s}`]?e[`active${s}`]=-1:o{const s=`active${o}`;t[`get${o}`]=()=>t.getArrayByIndex(e[s]),t[`set${o}`]=u=>t.setAttribute(u,o),t[`setActive${o}`]=u=>t.setActiveAttributeByIndex(t.getArrayWithIndex(u).index,o),t[`copy${o}Off`]=()=>{const u=o.toUpperCase();e.copyAttributeFlags[gr.PASSDATA][jn[u]]=!1},t[`copy${o}On`]=()=>{const u=o.toUpperCase();e.copyAttributeFlags[gr.PASSDATA][jn[u]]=!0}}),t.initializeAttributeCopyFlags=()=>{e.copyAttributeFlags=[],Object.keys(gr).filter(o=>o!=="ALLCOPY").forEach(o=>{e.copyAttributeFlags[gr[o]]=Object.keys(jn).filter(s=>s!=="NUM_ATTRIBUTES").reduce((s,u)=>(s[jn[u]]=!0,s),[])}),e.copyAttributeFlags[gr.COPYTUPLE][jn.GLOBALIDS]=!1,e.copyAttributeFlags[gr.INTERPOLATE][jn.GLOBALIDS]=!1,e.copyAttributeFlags[gr.COPYTUPLE][jn.PEDIGREEIDS]=!1},t.initialize=A.chain(t.initialize,t.initializeAttributeCopyFlags),e.dataArrays&&Object.keys(e.dataArrays).length&&Object.keys(e.dataArrays).forEach(o=>{!e.dataArrays[o].ref&&e.dataArrays[o].type==="vtkDataArray"&&t.addArray(pe.newInstance(e.dataArrays[o]))});const i=t.shallowCopy;t.shallowCopy=(o,s)=>{i(o,s),e.arrays=o.getArrays().map(u=>{const c=u.newClone();return c.shallowCopy(u,s),{data:c}})},t.initializeAttributeCopyFlags()}var t5={activeScalars:-1,activeVectors:-1,activeTensors:-1,activeNormals:-1,activeTCoords:-1,activeGlobalIds:-1,activePedigreeIds:-1};function Af(t,e,a={}){Object.assign(e,t5,a),Xy.extend(t,e,a),A.setGet(t,e,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),e.arrays||(e.arrays={}),e5(t,e)}var n5=A.newInstance(Af,"vtkDataSetAttributes"),Vf={newInstance:n5,extend:Af,...kf},ft={UNIFORM:0,DATA_OBJECT_FIELD:0,COORDINATE:1,POINT_DATA:1,POINT:2,POINT_FIELD_DATA:2,CELL:3,CELL_FIELD_DATA:3,VERTEX:4,VERTEX_FIELD_DATA:4,EDGE:5,EDGE_FIELD_DATA:5,ROW:6,ROW_DATA:6},x0={FIELD_ASSOCIATION_POINTS:0,FIELD_ASSOCIATION_CELLS:1,FIELD_ASSOCIATION_NONE:2,FIELD_ASSOCIATION_POINTS_THEN_CELLS:3,FIELD_ASSOCIATION_VERTICES:4,FIELD_ASSOCIATION_EDGES:5,FIELD_ASSOCIATION_ROWS:6,NUMBER_OF_ASSOCIATIONS:7},r5={FieldDataTypes:ft,FieldAssociations:x0},Va=["pointData","cellData","fieldData"];function a5(t,e){e.classHierarchy.push("vtkDataSet"),Va.forEach(r=>{e[r]?e[r]=_t(e[r]):e[r]=Vf.newInstance()}),t.computeBounds=()=>{if(e.modifiedTime&&e.computeTime&&e.modifiedTime>e.computeTime||!e.computeTime){const r=t.getPoints();r!=null&&r.getNumberOfPoints()?de.setBounds(e.bounds,r.getBoundsByReference()):e.bounds=Ze.createUninitializedBounds(),e.computeTime=A.getCurrentGlobalMTime()}},t.getLength2=()=>{const r=t.getBoundsByReference();return!r||r.length!==6?0:de.getDiagonalLength2(r)},t.getLength=()=>Math.sqrt(t.getLength2()),t.getCenter=()=>{const r=t.getBoundsByReference();return!r||r.length!==6?[0,0,0]:de.getCenter(r)},t.getCellBounds=r=>{const i=t.getCell(r);return i?i.getBounds():Ze.createUninitializedBounds()},t.getBounds=A.chain(()=>t.computeBounds,t.getBounds),t.getBoundsByReference=A.chain(()=>t.computeBounds,t.getBoundsByReference);const a=t.shallowCopy;t.shallowCopy=(r,i=!1)=>{a(r,i),Va.forEach(o=>{e[o]=Vf.newInstance(),e[o].shallowCopy(r.getReferenceByName(o))})};const n=t.getMTime;t.getMTime=()=>Va.reduce((r,i)=>{var o;return Math.max(r,((o=e[i])==null?void 0:o.getMTime())??r)},n()),t.initialize=()=>(Va.forEach(r=>{var i;return(i=e[r])==null?void 0:i.initialize()}),t)}var i5={};function Bf(t,e,a={}){Object.assign(e,i5,a),A.obj(t,e),A.setGet(t,e,Va),A.getArray(t,e,["bounds"],6),a5(t,e)}var o5=A.newInstance(Bf,"vtkDataSet"),dr={newInstance:o5,extend:Bf,...r5};function s5(t,e){e.classHierarchy.push("vtkPointSet"),e.points?e.points=_t(e.points):e.points=kt.newInstance(),t.getNumberOfPoints=()=>e.points.getNumberOfPoints(),t.getBounds=()=>{var i;return(i=e.points)==null?void 0:i.getBounds()},t.computeBounds=()=>{var i;(i=e.points)==null||i.computeBounds()};const a=t.shallowCopy;t.shallowCopy=(i,o=!1)=>{a(i,o),e.points=kt.newInstance(),e.points.shallowCopy(i.getPoints())};const n=t.getMTime;t.getMTime=()=>{var o;const i=n();return Math.max(i,((o=e.points)==null?void 0:o.getMTime())??i)};const r=t.initialize;t.initialize=()=>{var i;return(i=e.points)==null||i.initialize(),r()}}var c5={};function Uf(t,e,a={}){Object.assign(e,c5,a),dr.extend(t,e,a),A.setGet(t,e,["points"]),s5(t,e)}var u5=A.newInstance(Uf,"vtkPointSet"),l5={newInstance:u5,extend:Uf};function f5(t,e){e.classHierarchy.push("vtkPolyLine");const a=Mt.newInstance();a.getPoints().setNumberOfPoints(2),t.getCellDimension=()=>1,t.intersectWithLine=(n,r,i,o,s,u,c)=>{const p={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null},l=t.getNumberOfPoints()-1;let f=Number.MAX_VALUE;for(let h=0;h=n&&m.t<=r){p.intersect=1;const x=a.getParametricDistance(v);if(x(a.getPoints().getData().set(e.points.getData().subarray(3*n,3*(n+2))),a.evaluateLocation(r,i,o)),t.evaluateOrientation=(n,r,i,o)=>(e.orientations?a.setOrientations([e.orientations[n],e.orientations[n+1]]):a.setOrientations(null),a.evaluateOrientation(r,i,o)),t.getDistancesToFirstPoint=()=>{const n=e.distancesTime.getMTime();if(n0){const i=new Array(3),o=new Array(3);let s=0;e.distances[0]=s,e.points.getPoint(0,i);for(let u=1;u{const r=t.getDistancesToFirstPoint();if(r.length<2)return-1;let i=0,o=r.length-1;if(nr[o]||r[o]===0)return-1;for(;o-i>1;){const s=Math.floor((i+o)/2);r[s]<=n?i=s:o=s}return i}}var p5={orientations:null,distanceFunction:F9};function Gf(t,e,a={}){Object.assign(e,p5,a),pr.extend(t,e,a),A.setGet(t,e,["orientations","distanceFunction"]),e.distancesTime={},A.obj(e.distancesTime,{mtime:0}),f5(t,e)}var h5=A.newInstance(Gf,"vtkPolyLine"),g5={newInstance:h5,extend:Gf};function d5(t,e){e.classHierarchy.push("vtkPriorityQueue"),t.push=(a,n)=>{const r=e.elements.findIndex(i=>i.priority>a);e.elements.splice(r,0,{priority:a,element:n})},t.pop=()=>e.elements.length>0?e.elements.shift().element:null,t.deleteById=a=>{e.elements=e.elements.filter(({element:n})=>n.id!==a)},t.length=()=>e.elements.length}var v5={elements:[]};function If(t,e,a={}){Object.assign(e,v5,a),A.obj(t,e),d5(t,e)}var y5=A.newInstance(If,"vtkPriorityQueue"),m5={newInstance:y5,extend:If},x5=11920929e-14,C5=1e-8,vr={FAILURE:-1,OUTSIDE:0,INSIDE:1,INTERSECTION:2,ON_LINE:3};function Pf(t,e,a,n,r){return(n[t]-a[t])*(r[e]-a[e])-(r[t]-a[t])*(n[e]-a[e])}function S5(t,e,a,n){if(t[0]a[1]||t[1]a[3]||t[2]a[5])return vr.OUTSIDE;if(He(n)<=11920929e-14)return vr.FAILURE;let r=C5*((a[1]-a[0])*(a[1]-a[0])+(a[3]-a[2])*(a[3]-a[2])+(a[5]-a[4])*(a[5]-a[4]));r*=r,r=r===0?x5:r;const i=[],o=[];for(let p=0;p0&&f<1)return vr.INSIDE}let s,u;Math.abs(n[0])>Math.abs(n[1])?Math.abs(n[0])>Math.abs(n[2])?(s=1,u=2):(s=0,u=1):Math.abs(n[1])>Math.abs(n[2])?(s=0,u=2):(s=0,u=1);let c=0;for(let p=0;pt[u]&&Pf(s,u,i,o,t)>0&&++c:o[u]<=t[u]&&Pf(s,u,i,o,t)<0&&--c;return c===0?vr.OUTSIDE:vr.INSIDE}function T5(t,e,a){const n=t.length,r=[];e.getPoint(t[0],r),a[0]=r[0],a[1]=r[0],a[2]=r[1],a[3]=r[1],a[4]=r[2],a[5]=r[2];for(let o=1;o1e-6?1:f<-1e-6?-1:0,v=h<0?1:0;for(let m=c.next.next;m.id!==u.id;m=m.next){const x=m.previous;f=pn.evaluate(l,u.point,m.point);const y=f>1e-6?1:f<-1e-6?-1:0;if(y!==h){if(v||(v=y<=0?1:0),Mt.intersection(u.point,c.point,m.point,x.point,[0],[0])===Of.YES_INTERSECTION)return!1;h=y}}return v===1}function i(s,u){e.pointCount-=1;const c=s.previous,p=s.next;e.tris=e.tris.concat(s.point),e.tris=e.tris.concat(p.point),e.tris=e.tris.concat(c.point),c.next=p,p.previous=c,u.deleteById(c.id),u.deleteById(p.id);const l=n(c);l>0&&u.push(l,c);const f=n(p);f>0&&u.push(f,p),s.id===e.firstPoint.id&&(e.firstPoint=p)}function o(){a();const s=m5.newInstance();let u=e.firstPoint;for(let c=0;c0&&s.push(p,u),u=u.next}for(;e.pointCount>2&&s.length()>0;)if(e.pointCount===s.length())i(s.pop(),s);else{const c=s.pop();r(c)&&i(c,s)}return e.pointCount<=2}t.triangulate=()=>e.firstPoint?o():null,t.setPoints=s=>{e.pointCount=s.length,e.firstPoint={id:0,point:s[0],next:null,previous:null};let u=e.firstPoint;for(let c=1;ce.tris}var O5={firstPoint:null,pointCount:0,tris:[]};function zf(t,e,a={}){Object.assign(e,O5,a),A.obj(t,e),D5(t,e)}var b5=A.newInstance(zf,"vtkPolygon"),M5={newInstance:b5,extend:zf,...E5};function C0(t,e,a,n){const r=a[0]-e[0],i=a[1]-e[1],o=a[2]-e[2],s=t[0]-e[0],u=t[1]-e[1],c=t[2]-e[2];n[0]=i*c-o*u,n[1]=o*s-r*c,n[2]=r*u-i*s}function Ba(t,e,a,n){C0(t,e,a,n);const r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);r!==0&&(n[0]/=r,n[1]/=r,n[2]/=r)}function Wf(t){t[0]=-1,t[1]=1,t[2]=0,t[3]=-1,t[4]=0,t[5]=1}function N5(t,e,a,n,r,i,o=1e-6){let s=!1;const u=[],c=[],p=[],l=[],f=[];Ba(t,e,a,l),Ba(n,r,i,f);const h=-xe(l,t),v=-xe(f,n),m=[xe(f,t)+v,xe(f,e)+v,xe(f,a)+v];if(m[0]*m[1]>o&&m[0]*m[2]>o)return{intersect:!1,coplanar:s,pt1:u,pt2:c,surfaceId:p};const x=[xe(l,n)+h,xe(l,r)+h,xe(l,i)+h];if(x[0]*x[1]>o&&x[0]*x[2]>o)return{intersect:!1,coplanar:s,pt1:u,pt2:c,surfaceId:p};if(Math.abs(l[0]-f[0])<1e-9&&Math.abs(l[1]-f[1])<1e-9&&Math.abs(l[2]-f[2])<1e-9&&Math.abs(h-v)<1e-9)return s=!0,{intersect:!1,coplanar:s,pt1:u,pt2:c,surfaceId:p};const y=[t,e,a],d=[n,r,i],g=xe(l,f),C=(h-v*g)/(g*g-1),S=(v-h*g)/(g*g-1),T=[C*l[0]+S*f[0],C*l[1]+S*f[1],C*l[2]+S*f[2]],w=tt(l,f,[]);He(w);let _=0,E=0;const D=[],O=[];let b=50,R=50;for(let B=0;B<3;B++){const P=B,F=(B+1)%3,k=pn.intersectWithLine(y[P],y[F],n,f);k.intersection&&k.t>0-o&&k.t<1+o&&(k.t<1+o&&k.t>1-o&&(b=_),D[_++]=xe(k.x,w)-xe(T,w));const G=pn.intersectWithLine(d[P],d[F],t,l);G.intersection&&G.t>0-o&&G.t<1+o&&(G.t<1+o&&G.t>1-o&&(R=E),O[E++]=xe(G.x,w)-xe(T,w))}if(_>2){_--;const B=D[2];D[2]=D[b],D[b]=B}if(E>2){E--;const B=O[2];O[2]=O[R],O[R]=B}if(_!==2||E!==2)return{intersect:!1,coplanar:s,pt1:u,pt2:c,surfaceId:p};if(Number.isNaN(D[0])||Number.isNaN(D[1])||Number.isNaN(O[0])||Number.isNaN(O[1]))return{intersect:!1,coplanar:s,pt1:u,pt2:c,surfaceId:p};if(D[0]>D[1]){const B=D[1];D[1]=D[0],D[0]=B}if(O[0]>O[1]){const B=O[1];O[1]=O[0],O[0]=B}let N,L;return D[1]2,t.intersectWithLine=(a,n,r,i,o)=>{const s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};o[2]=0;const u=[],c=r*r,p=[],l=[],f=[];e.points.getPoint(0,p),e.points.getPoint(1,l),e.points.getPoint(2,f);const h=[],v=[];if(Ba(p,l,f,h),h[0]!==0||h[1]!==0||h[2]!==0){const g=pn.intersectWithLine(a,n,p,h);if(s.betweenPoints=g.betweenPoints,s.t=g.t,i[0]=g.x[0],i[1]=g.x[1],i[2]=g.x[2],!g.intersection)return o[0]=0,o[1]=0,s.intersect=0,s;const C=t.evaluatePosition(i,u,o,v);if(C.evaluation>=0)return C.dist2<=c?(s.intersect=1,s):(s.intersect=C.evaluation,s)}const m=dt(p,l),x=dt(l,f),y=dt(f,p);e.line||(e.line=Mt.newInstance()),m>x&&m>y?(e.line.getPoints().setPoint(0,p),e.line.getPoints().setPoint(1,l)):x>y&&x>m?(e.line.getPoints().setPoint(0,l),e.line.getPoints().setPoint(1,f)):(e.line.getPoints().setPoint(0,f),e.line.getPoints().setPoint(1,p));const d=e.line.intersectWithLine(a,n,r,i,o);if(s.betweenPoints=d.betweenPoints,s.t=d.t,d.intersect){const g=[],C=[],S=[];for(let T=0;T<3;T++)g[T]=p[T]-f[T],C[T]=l[T]-f[T],S[T]=i[T]-f[T];return o[0]=xe(S,g)/y,o[1]=xe(S,C)/x,s.intersect=1,s}return o[0]=0,o[1]=0,s.intersect=0,s},t.evaluatePosition=(a,n,r,i)=>{const o={subId:0,dist2:0,evaluation:-1};let s,u;const c=[],p=[],l=[],f=[];let h;const v=[],m=[],x=[];let y=0,d=0;const g=[];let C,S,T,w=[];const _=[],E=[],D=[];o.subId=0,r[2]=0,e.points.getPoint(1,c),e.points.getPoint(2,p),e.points.getPoint(0,l),C0(c,p,l,f),pn.generalizedProjectPoint(a,c,f,D);let O=0;for(s=0;s<3;s++)f[s]<0?h=-f[s]:h=f[s],h>O&&(O=h,d=s);for(u=0,s=0;s<3;s++)s!==d&&(g[u++]=s);for(s=0;s<2;s++)v[s]=D[g[s]]-l[g[s]],m[s]=c[g[s]]-l[g[s]],x[s]=p[g[s]]-l[g[s]];if(y=ot(m,x),y===0)return r[0]=0,r[1]=0,o.evaluation=-1,o;if(r[0]=ot(v,x)/y,r[1]=ot(m,v)/y,i[0]=1-(r[0]+r[1]),i[1]=r[0],i[2]=r[1],i[0]>=0&&i[0]<=1&&i[1]>=0&&i[1]<=1&&i[2]>=0&&i[2]<=1)n&&(o.dist2=dt(D,a),n[0]=D[0],n[1]=D[1],n[2]=D[2]),o.evaluation=1;else{let b;if(n)if(i[1]<0&&i[2]<0)for(C=dt(a,l),S=Mt.distanceToLine(a,c,l,b,_),T=Mt.distanceToLine(a,l,p,b,E),C{const i=[],o=[],s=[];e.points.getPoint(0,i),e.points.getPoint(1,o),e.points.getPoint(2,s);const u=1-a[0]-a[1];for(let c=0;c<3;c++)n[c]=i[c]*u+o[c]*a[0]+s[c]*a[1];r[0]=u,r[1]=a[0],r[2]=a[1]},t.getParametricDistance=a=>{let n,r=0;const i=[];i[0]=a[0],i[1]=a[1],i[2]=1-a[0]-a[1];for(let o=0;o<3;o++)i[o]<0?n=-i[o]:i[o]>1?n=i[o]-1:n=0,n>r&&(r=n);return r},t.derivatives=(a,n,r,i,o)=>{const s=e.points.getPoint(0),u=e.points.getPoint(1),c=e.points.getPoint(2),p=[],l=[],f=[],h=[];Ba(s,u,c,p),$e(u,s,l),$e(c,s,h),tt(p,l,f);const v=He(l);if(v<=0||He(f)<=0){for(let S=0;S{const i=n[0]-n[1],o=.5*(1-n[0])-n[1],s=2*n[0]+n[1]-1;return i>=0&&o>=0?(r[0]=e.pointsIds[0],r[1]=e.pointsIds[1]):o<0&&s>=0?(r[0]=e.pointsIds[1],r[1]=e.pointsIds[2]):(r[0]=e.pointsIds[2],r[1]=e.pointsIds[0]),!(n[0]<0||n[1]<0||n[0]>1||n[1]>1||1-n[0]-n[1]<0)},t.clip=(a,n,r,i,o,s,u,c,p,l)=>{let f=0;for(let d=0;d<3;d++){const g=n.getComponent(d,0);(l&&g<=a||!l&&g>a)&&(f+=L5[d])}const h=F5[f],v=[0,0,0],m=[0,0,0],x=[0,0,0],y=[0,0,0];for(let d=0;h[d]>-1;d+=3){y[0]=0,y[1]=0,y[2]=0;for(let g=0;g<3;g++){const C=h[d+g];if(C>=100){const S=C-100;e.points.getPoint(S,v);const{inserted:T,id:w}=r.insertUniquePoint(v);y[g]=w,T&&s.passData(o,e.pointsIds[S],w)}else{const S=R5[C];let T=S[0],w=S[1],_=n.getComponent(S[1],0)-n.getComponent(S[0],0);_<=0&&(T=S[1],w=S[0],_=-_);const E=_===0?0:(a-n.getComponent(T,0))/_;e.points.getPoint(T,m),e.points.getPoint(w,x);for(let b=0;b<3;b++)v[b]=m[b]+E*(x[b]-m[b]);const{inserted:D,id:O}=r.insertUniquePoint(v);y[g]=O,D&&s.interpolateData(o,e.pointsIds[T],e.pointsIds[w],O,E)}}if(!(y[0]===y[1]||y[0]===y[2]||y[1]===y[2])){const g=i.insertNextCell(y);p.passData(u,c,g)}}}}var V5={};function jf(t,e,a={}){Object.assign(e,V5,a),pr.extend(t,e,a),A5(t,e)}var B5=A.newInstance(jf,"vtkTriangle"),S0={newInstance:B5,extend:jf,...k5};function $f(){return{intersected:!1,subId:-1,x:[0,0,0],pCoords:[0,0,0],t:-1}}function U5(t,e){e.classHierarchy.push("vtkQuad"),t.getCellDimension=()=>2,t.getCellType=()=>je.VTK_QUAD,t.getNumberOfEdges=()=>4,t.getNumberOfFaces=()=>0,t.intersectWithLine=(a,n,r,i,o)=>{let s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1},u;const c=e.points.getPoint(0,[]),p=e.points.getPoint(1,[]),l=e.points.getPoint(2,[]),f=e.points.getPoint(3,[]),h=dt(c,l),v=dt(p,f);if(h===v){let T,w=0,_=0;for(let E=0;E<4;E++)T=e.pointsIds[E],T>w&&(w=T,_=E);_===0||_===2?u=0:u=1}else h{const r=1-a[0],i=1-a[1];n[0]=r*i,n[1]=a[0]*i,n[2]=a[0]*a[1],n[3]=r*a[1]},t.evaluateLocation=(a,n,r)=>{const i=[];t.interpolationFunctions(a,r),n[0]=0,n[1]=0,n[2]=0;for(let o=0;o<4;o++){e.points.getPoint(o,i);for(let s=0;s<3;s++)n[s]+=i[s]*r[o]}}}var G5={};function Hf(t,e,a={}){Object.assign(e,G5,a),pr.extend(t,e,a),U5(t,e)}var I5=A.newInstance(Hf,"vtkQuad"),P5={newInstance:I5,extend:Hf},{vtkErrorMacro:Kf}=A;function z5(t){return()=>Kf(`vtkTriangleStrip.${t} - NOT IMPLEMENTED`)}function W5(t,e){if(!Array.isArray(t)||t.length<3){Kf("decomposeStrip - Invalid points array");return}let a=t[0],n=t[1];for(let r=0;r{e.triangle.initialize(n,r),a(n,r)},t.getCellType=()=>je.VTK_TRIANGLE_STRIP,t.getCellDimension=()=>2,t.getNumberOfEdges=()=>e.pointsIds.length,t.getNumberOfFaces=()=>0,t.evaluatePosition=(n,r,i,o,s)=>{const u=[0,0,0];let c=Number.MAX_VALUE,p=0;const l=[],f=[],h=[];i[2]=0,f[0]=0,f[1]=0,f[2]=0;const v=e.triangle.getPoints();v.setNumberOfPoints(3);const m=e.triangle.getPointsIds().length;for(let x=0;x=0&&(S{const s=[[0,1,2],[1,0,2]],u=n%2,c=e.pointsIds.length;for(let h=0;h{const o=[[0,1,2],[1,0,2]],s=n%2,u=e.triangle.getPointsIds();return u[0]=e.pointsIds[o[s][0]],u[1]=e.pointsIds[o[s][1]],u[2]=e.pointsIds[o[s][2]],e.triangle.cellBoundary(0,r,i)},t.getEdge=n=>{let r,i;const o=e.pointsIds.length;return n===0?(r=0,i=1):n===o-1?(r=n-1,i=n):(r=n-1,i=n+1),e.line.getPointsIds()[0]=e.pointsIds[r],e.line.getPointsIds()[1]=e.pointsIds[i],e.line.getPoints().setPoint(0,e.points.getPoint(r)),e.line.getPoints().setPoint(1,e.points.getPoint(i)),e.line},t.intersectWithLine=(n,r,i,o,s)=>{const u=e.pointsIds.length-2,c=e.triangle.getPoints();c.setNumberOfPoints(3);for(let p=0;p{const n=e.points.getNumberOfPoints()-2;e.tris=new Array(3*n);const r=[[0,1,2],[1,0,2]];for(let i=0;ie.tris,t.derivatives=(n,r,i,o,s)=>{const u=[];e.points.getPoint(n,u);const c=[];e.points.getPoint(n+1,c);const p=[];e.points.getPoint(n+2,p);const l=e.triangle.getPoints();l.setPoint(0,...u),l.setPoint(1,...c),l.setPoint(2,...p),e.triangle.derivatives(0,r,i,o,s)},t.getParametricCenter=n=>(n[0]=.333333,n[1]=.333333,n[2]=0,Math.floor((e.pointsIds.length-2)/2)),t.contour=(n,r,i,o,s,u,c,p,l,f,h)=>z5("contour")(),t.clip=(n,r,i,o,s,u,c,p,l,f)=>{const h=e.points.getNumberOfPoints()-2,v=new Float32Array(3),m=r.newClone();m.setNumberOfComponents(r.getNumberOfComponents()),m.setData(v,r.getNumberOfComponents());const x=e.triangle.getPoints();x.setNumberOfPoints(3);const y=e.triangle.getPointsIds(),d=[0,0,0];for(let g=0;gu.toUpperCase()).replace(/\s+/g,"")}function n(){e.cells=void 0,e.links=void 0}ea.forEach(s=>{t[`getNumberOf${a(s)}`]=()=>e[s].getNumberOfCells(),e[s]?e[s]=_t(e[s]):e[s]=Mn.newInstance(),e[`_on${a(s)}Changed`]=n}),t.getNumberOfCells=()=>ea.reduce((s,u)=>s+e[u].getNumberOfCells(),0);const r=t.shallowCopy;t.shallowCopy=(s,u=!1)=>{r(s,u),ea.forEach(c=>{e[c]=Mn.newInstance(),e[c].shallowCopy(s.getReferenceByName(c))})};const i=t.getMTime;t.getMTime=()=>ea.reduce((s,u)=>{var c;return Math.max(s,((c=e[u])==null?void 0:c.getMTime())??s)},i());const o=t.initialize;t.initialize=()=>(ea.forEach(s=>{var u;return(u=e[s])==null?void 0:u.initialize()}),n(),o()),t.buildCells=()=>{const s=t.getNumberOfVerts(),u=t.getNumberOfLines(),c=t.getNumberOfPolys(),p=t.getNumberOfStrips(),l=s+u+c+p,f=new Uint8Array(l);let h=f;const v=new Uint32Array(l);let m=v;if(s){let x=0;e.verts.getCellSizes().forEach((y,d)=>{m[d]=x,h[d]=y>1?je.VTK_POLY_VERTEX:je.VTK_VERTEX,x+=y+1}),m=m.subarray(s),h=h.subarray(s)}if(u){let x=0;e.lines.getCellSizes().forEach((y,d)=>{m[d]=x,h[d]=y>2?je.VTK_POLY_LINE:je.VTK_LINE,y===1&&qf("Building VTK_LINE ",d," with only one point, but VTK_LINE needs at least two points. Check the input."),x+=y+1}),m=m.subarray(u),h=h.subarray(u)}if(c){let x=0;e.polys.getCellSizes().forEach((y,d)=>{switch(m[d]=x,y){case 3:h[d]=je.VTK_TRIANGLE;break;case 4:h[d]=je.VTK_QUAD;break;default:h[d]=je.VTK_POLYGON;break}y<3&&qf("Building VTK_TRIANGLE ",d," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),x+=y+1}),m+=m.subarray(c),h+=h.subarray(c)}if(p){let x=0;h.fill(je.VTK_TRIANGLE_STRIP,0,p),e.strips.getCellSizes().forEach((y,d)=>{m[d]=x,x+=y+1})}e.cells=Gy.newInstance(),e.cells.setCellTypes(l,f,v)},t.buildLinks=(s=0)=>{e.cells==null&&t.buildCells(),e.links=Ny.newInstance(),s>0?e.links.allocate(s):e.links.allocate(t.getPoints().getNumberOfPoints()),e.links.buildLinks(t)},t.getCellType=s=>e.cells.getCellType(s),t.getCellPoints=s=>{const u=t.getCellType(s);let c=null;switch(u){case je.VTK_VERTEX:case je.VTK_POLY_VERTEX:c=e.verts;break;case je.VTK_LINE:case je.VTK_POLY_LINE:c=e.lines;break;case je.VTK_TRIANGLE:case je.VTK_QUAD:case je.VTK_POLYGON:c=e.polys;break;case je.VTK_TRIANGLE_STRIP:c=e.strips;break;default:return c=null,{type:0,cellPointIds:null}}const p=e.cells.getCellLocation(s);return{cellType:u,cellPointIds:c.getCell(p)}},t.getPointCells=s=>e.links.getCells(s),t.getCellEdgeNeighbors=(s,u,c)=>{const p=e.links.getLink(u),l=e.links.getLink(c);return p.cells.filter(f=>f!==s&&l.cells.indexOf(f)!==-1)},t.getCell=(s,u=null)=>{const c=t.getCellPoints(s),p=u||q5[c.cellType].newInstance();return p.initialize(t.getPoints(),c.cellPointIds),p},t.getMaxCellSize=()=>ea.reduce((s,u)=>{var c,p;return Math.max(s,((p=(c=e[u])==null?void 0:c.getMaxCellSize)==null?void 0:p.call(c))??0)},0)}var J5={};function Yf(t,e,a={}){Object.assign(e,J5,a),l5.extend(t,e,a),A.get(t,e,["cells","links"]),A.setGet(t,e,["verts","lines","polys","strips"]),Y5(t,e)}var Z5=A.newInstance(Yf,"vtkPolyData"),Je={newInstance:Z5,extend:Yf},Q5={DISPLAY:0,WORLD:1},Jf={CoordinateSystem:Q5},{CoordinateSystem:T0}=Jf;function Zf(t){return()=>A.vtkErrorMacro(`vtkProp::${t} - NOT IMPLEMENTED`)}function e4(t,e){e.classHierarchy.push("vtkProp"),t.getMTime=()=>{let a=e.mtime;for(let n=0;na&&(a=r)}return a},t.processSelectorPixelBuffers=(a,n)=>{},t.getNestedProps=()=>null,t.getActors=()=>[],t.getActors2D=()=>[],t.getVolumes=()=>[],t.pick=Zf("pick"),t.hasKey=Zf("hasKey"),t.getNestedVisibility=()=>e.visibility&&(!e._parentProp||e._parentProp.getNestedVisibility()),t.getNestedPickable=()=>e.pickable&&(!e._parentProp||e._parentProp.getNestedPickable()),t.getNestedDragable=()=>e.dragable&&(!e._parentProp||e._parentProp.getNestedDragable()),t.getRedrawMTime=()=>e.mtime,t.setEstimatedRenderTime=a=>{e.estimatedRenderTime=a,e.savedEstimatedRenderTime=a},t.restoreEstimatedRenderTime=()=>{e.estimatedRenderTime=e.savedEstimatedRenderTime},t.addEstimatedRenderTime=a=>{e.estimatedRenderTime+=a},t.setAllocatedRenderTime=a=>{e.allocatedRenderTime=a,e.savedEstimatedRenderTime=e.estimatedRenderTime,e.estimatedRenderTime=0},t.getSupportsSelection=()=>!1,t.getTextures=()=>e.textures,t.hasTexture=a=>e.textures.indexOf(a)!==-1,t.addTexture=a=>{a&&!t.hasTexture(a)&&(e.textures=e.textures.concat(a),t.modified())},t.removeTexture=a=>{const n=e.textures.filter(r=>r!==a);e.textures.length!==n.length&&(e.textures=n,t.modified())},t.removeAllTextures=()=>{e.textures=[],t.modified()},t.setCoordinateSystemToWorld=()=>t.setCoordinateSystem(T0.WORLD),t.setCoordinateSystemToDisplay=()=>t.setCoordinateSystem(T0.DISPLAY)}var t4={allocatedRenderTime:10,coordinateSystem:T0.WORLD,dragable:!0,estimatedRenderTime:0,paths:null,pickable:!0,renderTimeMultiplier:1,savedEstimatedRenderTime:0,textures:[],useBounds:!0,visibility:!0};function Qf(t,e,a={}){Object.assign(e,t4,a),A.obj(t,e),A.get(t,e,["estimatedRenderTime","allocatedRenderTime"]),A.setGet(t,e,["_parentProp","coordinateSystem","dragable","pickable","renderTimeMultiplier","useBounds","visibility"]),A.moveToProtected(t,e,["parentProp"]),e4(t,e)}var n4=A.newInstance(Qf,"vtkProp"),ep={newInstance:n4,extend:Qf,...Jf},r4=1e-6;function a4(t,e){e.classHierarchy.push("vtkProp3D"),t.addPosition=i=>{e.position=e.position.map((o,s)=>o+i[s]),t.modified()},t.getOrientationWXYZ=()=>{const i=Wn();zi(i,e.rotation);const o=new Float64Array(3);return[_a(Pl(o,i)),o[0],o[1],o[2]]},t.getOrientationQuaternion=(i=[])=>zi(i,e.rotation),t.rotateX=i=>{i!==0&&(Ui(e.rotation,e.rotation,et(i)),t.modified())},t.rotateY=i=>{i!==0&&(Na(e.rotation,e.rotation,et(i)),t.modified())},t.rotateZ=i=>{i!==0&&(Gi(e.rotation,e.rotation,et(i)),t.modified())},t.rotateWXYZ=(i,o,s,u)=>{if(i===0||o===0&&s===0&&u===0)return;const c=et(i),p=Wn();qi(p,[o,s,u],c);const l=new Float64Array(16);Yr(l,p),Ee(e.rotation,e.rotation,l),t.modified()},t.rotateQuaternion=i=>{if(Math.abs(i[3])>=1-r4)return;const o=Yr(new Float64Array(16),i);Ee(e.rotation,e.rotation,o),t.modified()},t.setOrientation=(i,o,s)=>i===e.orientation[0]&&o===e.orientation[1]&&s===e.orientation[2]?!1:(e.orientation=[i,o,s],we(e.rotation),t.rotateZ(s),t.rotateX(i),t.rotateY(o),t.modified(),!0),t.setOrientationFromQuaternion=i=>{const o=qr();return Yr(o,i),Hr(o,e.rotation)?!1:(e.rotation=o,t.modified(),!0)},t.setUserMatrix=i=>Hr(e.userMatrix,i)?!1:(vt(e.userMatrix,i),t.modified(),!0),t.getMatrix=()=>(t.computeMatrix(),e.matrix),t.computeMatrix=()=>{if(t.getMTime()>e.matrixMTime.getMTime()){we(e.matrix),e.userMatrix&&Ee(e.matrix,e.matrix,e.userMatrix),Ye(e.matrix,e.matrix,e.origin),Ye(e.matrix,e.matrix,e.position),Ee(e.matrix,e.matrix,e.rotation),zn(e.matrix,e.matrix,e.scale),Ye(e.matrix,e.matrix,[-e.origin[0],-e.origin[1],-e.origin[2]]),We(e.matrix,e.matrix),e.isIdentity=!0;for(let i=0;i<4;++i)for(let o=0;o<4;++o)(i===o?1:0)!==e.matrix[i+o*4]&&(e.isIdentity=!1);e.matrixMTime.modified()}},t.computeBounds=()=>{if(e.mapper===null){de.reset(e.bounds);return}const i=e.mapper.getBounds();if(!i||i.length!==6||!de.isValid(i)){e.mapperBounds=i,de.reset(e.bounds),e.boundsMTime.modified();return}if(!e.mapperBounds||!i.every((o,s)=>i[s]===e.mapperBounds[s])||t.getMTime()>e.boundsMTime.getMTime()){A.vtkDebugMacro("Recomputing bounds..."),e.mapperBounds=i,t.computeMatrix();const o=new Float64Array(16);We(o,e.matrix),de.transformBounds(i,o,e.bounds),e.boundsMTime.modified()}};const a=t.getBounds;t.getBounds=()=>(t.computeBounds(),a());const n=t.getBoundsByReference;t.getBoundsByReference=()=>(t.computeBounds(),n()),t.getCenter=()=>de.getCenter(t.getBoundsByReference()),t.getLength=()=>de.getLength(t.getBoundsByReference()),t.getXRange=()=>de.getXRange(t.getBoundsByReference()),t.getYRange=()=>de.getYRange(t.getBoundsByReference()),t.getZRange=()=>de.getZRange(t.getBoundsByReference()),t.getUserMatrix=()=>e.userMatrix;function r(){t.computeMatrix()}t.onModified(r),t.getProperty=(i=0)=>{var o;return e.properties[i]==null&&(e.properties[i]=(o=t.makeProperty)==null?void 0:o.call(t)),e.properties[i]},t.getProperties=()=>{var i;return e.properties.length===0&&(e.properties[0]=(i=t.makeProperty)==null?void 0:i.call(t)),e.properties},t.setProperty=(i,o)=>{const[s,u]=Number.isInteger(i)?[i,o]:[0,i];return e.properties[s]===u?!1:(e.properties[s]=u,!0)},t.getMTime=()=>{let i=e.mtime;return e.properties.forEach(o=>{if(o!==null){const s=o.getMTime();i=s>i?s:i}}),i}}var i4={bounds:[...de.INIT_BOUNDS],origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],properties:[],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function tp(t,e,a={}){Object.assign(e,i4,a),ep.extend(t,e,a),e.matrixMTime={},A.obj(e.matrixMTime),A.get(t,e,["isIdentity"]),A.getArray(t,e,["orientation"]),A.setGetArray(t,e,["origin","position","scale"],3),A.setGet(t,e,["properties"]),A.getArray(t,e,["bounds"],6),e.matrix=we(new Float64Array(16)),e.rotation=we(new Float64Array(16)),e.userMatrix=we(new Float64Array(16)),e.transform=null,a4(t,e)}var o4=A.newInstance(tp,"vtkProp3D"),w0={newInstance:o4,extend:tp},np={FLAT:0,GOURAUD:1,PHONG:2},Jt={POINTS:0,WIREFRAME:1,SURFACE:2},s4=np,rp={Shading:np,Representation:Jt,Interpolation:s4},{Representation:Ua,Interpolation:Ga}=rp;function ap(t){return()=>A.vtkErrorMacro(`vtkProperty::${t} - NOT IMPLEMENTED`)}function c4(t,e){e.classHierarchy.push("vtkProperty"),t.setColor=(a,n,r)=>{Array.isArray(a)?(e.color[0]!==a[0]||e.color[1]!==a[1]||e.color[2]!==a[2])&&(e.color[0]=a[0],e.color[1]=a[1],e.color[2]=a[2],t.modified()):(e.color[0]!==a||e.color[1]!==n||e.color[2]!==r)&&(e.color[0]=a,e.color[1]=n,e.color[2]=r,t.modified()),t.setDiffuseColor(e.color),t.setAmbientColor(e.color),t.setSpecularColor(e.color)},t.computeCompositeColor=ap("ComputeCompositeColor"),t.getColor=()=>{let a=0;e.ambient+e.diffuse+e.specular>0&&(a=1/(e.ambient+e.diffuse+e.specular));for(let n=0;n<3;n++)e.color[n]=a*(e.ambient*e.ambientColor[n]+e.diffuse*e.diffuseColor[n]+e.specular*e.specularColor[n]);return[].concat(e.color)},t.addShaderVariable=ap("AddShaderVariable"),t.setInterpolationToFlat=()=>t.setInterpolation(Ga.FLAT),t.setInterpolationToGouraud=()=>t.setInterpolation(Ga.GOURAUD),t.setInterpolationToPhong=()=>t.setInterpolation(Ga.PHONG),t.getInterpolationAsString=()=>A.enumToString(Ga,e.interpolation),t.setRepresentationToWireframe=()=>t.setRepresentation(Ua.WIREFRAME),t.setRepresentationToSurface=()=>t.setRepresentation(Ua.SURFACE),t.setRepresentationToPoints=()=>t.setRepresentation(Ua.POINTS),t.getRepresentationAsString=()=>A.enumToString(Ua,e.representation)}var u4={color:[1,1,1],ambientColor:[1,1,1],diffuseColor:[1,1,1],specularColor:[1,1,1],edgeColor:[0,0,0],ambient:0,diffuse:1,metallic:0,roughness:.6,normalStrength:1,emission:1,baseIOR:1.45,specular:0,specularPower:1,opacity:1,edgeOpacity:1,interpolation:Ga.GOURAUD,representation:Ua.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null,ORMTexture:null,RMTexture:null};function ip(t,e,a={}){Object.assign(e,u4,a),A.obj(t,e),A.setGet(t,e,["lighting","interpolation","ambient","diffuse","metallic","roughness","normalStrength","emission","baseIOR","specular","specularPower","opacity","edgeOpacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation","diffuseTexture","metallicTexture","roughnessTexture","normalTexture","ambientOcclusionTexture","emissionTexture","ORMTexture","RMTexture"]),A.setGetArray(t,e,["ambientColor","specularColor","diffuseColor","edgeColor"],3),c4(t,e)}var l4=A.newInstance(ip,"vtkProperty"),yr={newInstance:l4,extend:ip,...rp};function f4(t,e){e.classHierarchy.push("vtkActor");const a={...t};t.getActors=()=>[t],t.getIsOpaque=()=>{if(e.forceOpaque)return!0;if(e.forceTranslucent)return!1;e.properties[0]||t.getProperty();let n=e.properties[0].getOpacity()>=1;return n=n&&(!e.texture||!e.texture.isTranslucent()),n=n&&(!e.mapper||e.mapper.getIsOpaque()),n},t.hasTranslucentPolygonalGeometry=()=>e.mapper===null?!1:(e.properties[0]||t.getProperty(),!t.getIsOpaque()),t.makeProperty=yr.newInstance,t.getMTime=()=>{let n=a.getMTime();if(e.backfaceProperty!==null){const r=e.backfaceProperty.getMTime();n=r>n?r:n}return n},t.getRedrawMTime=()=>{let n=e.mtime;if(e.mapper!==null){let r=e.mapper.getMTime();n=r>n?r:n,e.mapper.getInput()!==null&&(e.mapper.getInputAlgorithm().update(),r=e.mapper.getInput().getMTime(),n=r>n?r:n)}return n},t.getSupportsSelection=()=>e.mapper?e.mapper.getSupportsSelection():!1,t.processSelectorPixelBuffers=(n,r)=>{e.mapper&&e.mapper.processSelectorPixelBuffers&&e.mapper.processSelectorPixelBuffers(n,r)}}var p4={mapper:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1};function op(t,e,a={}){Object.assign(e,p4,a),w0.extend(t,e,a),e.boundsMTime={},A.obj(e.boundsMTime),A.setGet(t,e,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),f4(t,e)}var h4=A.newInstance(op,"vtkActor"),hn={newInstance:h4,extend:op},Wt={UNCHANGED:0,SINGLE_POINT:1,X_LINE:2,Y_LINE:3,Z_LINE:4,XY_PLANE:5,YZ_PLANE:6,XZ_PLANE:7,XYZ_GRID:8,EMPTY:9},sp={StructuredType:Wt},{StructuredType:Nn}=sp;function g4(t){let e=0;for(let a=0;a<3;++a)t[a*2]t[1]||t[2]>t[3]||t[4]>t[5]?Nn.EMPTY:e===3?Nn.XYZ_GRID:e===2?t[0]===t[1]?Nn.YZ_PLANE:t[2]===t[3]?Nn.XZ_PLANE:Nn.XY_PLANE:e===1?t[0]{if(e.deleted)return mr("instance deleted - cannot call any method"),!1;const r=n.length===1?n[0]:n;if(r.length!==6)return!1;const i=e.extent.some((o,s)=>o!==r[s]);return i&&(e.extent=r.slice(),e.dataDescription=d4.getDataDescriptionFromExtent(e.extent),t.modified()),i},t.setDimensions=(...n)=>{let r,i,o;if(e.deleted){mr("instance deleted - cannot call any method");return}if(n.length===1){const s=n[0];r=s[0],i=s[1],o=s[2]}else if(n.length===3)r=n[0],i=n[1],o=n[2];else{mr("Bad dimension specification");return}t.setExtent(0,r-1,0,i-1,0,o-1)},t.getDimensions=()=>[e.extent[1]-e.extent[0]+1,e.extent[3]-e.extent[2]+1,e.extent[5]-e.extent[4]+1],t.getNumberOfCells=()=>{const n=t.getDimensions();let r=1;for(let i=0;i<3;i++){if(n[i]===0)return 0;n[i]>1&&(r*=n[i]-1)}return r},t.getNumberOfPoints=()=>{const n=t.getDimensions();return n[0]*n[1]*n[2]},t.getPoint=n=>{const r=t.getDimensions();if(r[0]===0||r[1]===0||r[2]===0)return mr("Requesting a point from an empty image."),null;const i=new Float64Array(3);switch(e.dataDescription){case Wt.EMPTY:return null;case Wt.SINGLE_POINT:break;case Wt.X_LINE:i[0]=n;break;case Wt.Y_LINE:i[1]=n;break;case Wt.Z_LINE:i[2]=n;break;case Wt.XY_PLANE:i[0]=n%r[0],i[1]=n/r[0];break;case Wt.YZ_PLANE:i[1]=n%r[1],i[2]=n/r[1];break;case Wt.XZ_PLANE:i[0]=n%r[0],i[2]=n/r[0];break;case Wt.XYZ_GRID:i[0]=n%r[0],i[1]=n/r[0]%r[1],i[2]=n/(r[0]*r[1]);break;default:mr("Invalid dataDescription");break}const o=[0,0,0];return t.indexToWorld(i,o),o},t.getBounds=()=>t.extentToBounds(t.getSpatialExtent()),t.extentToBounds=n=>de.transformBounds(n,e.indexToWorld),t.getSpatialExtent=()=>de.inflate([...e.extent],.5),t.computeTransforms=()=>{s0(e.indexToWorld,e.origin),e.indexToWorld[0]=e.direction[0],e.indexToWorld[1]=e.direction[1],e.indexToWorld[2]=e.direction[2],e.indexToWorld[4]=e.direction[3],e.indexToWorld[5]=e.direction[4],e.indexToWorld[6]=e.direction[5],e.indexToWorld[8]=e.direction[6],e.indexToWorld[9]=e.direction[7],e.indexToWorld[10]=e.direction[8],zn(e.indexToWorld,e.indexToWorld,e.spacing),Et(e.worldToIndex,e.indexToWorld)},t.indexToWorld=(n,r=[])=>(_e(r,n,e.indexToWorld),r),t.indexToWorldVec3=t.indexToWorld,t.worldToIndex=(n,r=[])=>(_e(r,n,e.worldToIndex),r),t.worldToIndexVec3=t.worldToIndex,t.indexToWorldBounds=(n,r=[])=>de.transformBounds(n,e.indexToWorld,r),t.worldToIndexBounds=(n,r=[])=>de.transformBounds(n,e.worldToIndex,r),e._onOriginChanged=t.computeTransforms,e._onDirectionChanged=t.computeTransforms,e._onSpacingChanged=t.computeTransforms,t.computeTransforms(),t.getCenter=()=>de.getCenter(t.getBounds()),t.computeHistogram=(n,r=null)=>{const i=[0,0,0,0,0,0];t.worldToIndexBounds(n,i);const o=[0,0,0],s=[0,0,0];de.computeCornerPoints(i,o,s),Xs(o,o),Xs(s,s);const u=t.getDimensions();e0(o,[0,0,0],[u[0]-1,u[1]-1,u[2]-1],o),e0(s,[0,0,0],[u[0]-1,u[1]-1,u[2]-1],s);const c=u[0],p=u[0]*u[1],l=t.getPointData().getScalars().getData();let f=-1/0,h=1/0,v=0,m=0,x=0;for(let g=o[2];g<=s[2];g++)for(let C=o[1];C<=s[1];C++){let S=o[0]+C*c+g*p;for(let T=o[0];T<=s[0];T++){if(!r||r([T,C,g],i)){const w=l[S];w>f&&(f=w),w0?m/x:0,d=x?Math.abs(v/x-y*y):0;return{minimum:h,maximum:f,average:y,variance:d,sigma:Math.sqrt(d),count:x}},t.computeIncrements=(n,r=1)=>{const i=[];let o=r;for(let s=0;s<3;++s)i[s]=o,o*=n[s*2+1]-n[s*2]+1;return i},t.computeOffsetIndex=([n,r,i])=>{const o=t.getExtent(),s=t.getPointData().getScalars().getNumberOfComponents(),u=t.computeIncrements(o,s);return Math.floor((Math.round(n)-o[0])*u[0]+(Math.round(r)-o[2])*u[1]+(Math.round(i)-o[4])*u[2])},t.getOffsetIndexFromWorld=n=>{const r=t.getExtent(),i=t.worldToIndex(n);for(let o=0;o<3;++o)if(i[o]r[o*2+1])return mr(`GetScalarPointer: Pixel ${i} is not in memory. Current extent = ${r}`),NaN;return t.computeOffsetIndex(i)},t.getScalarValueFromWorld=(n,r=0)=>{const i=t.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=i)return mr(`GetScalarPointer: Scalar Component ${r} is not within bounds. Current Scalar numberOfComponents: ${i}`),NaN;const o=t.getOffsetIndexFromWorld(n);return Number.isNaN(o)?o:t.getPointData().getScalars().getComponent(o,r)};const a=t.initialize;t.initialize=()=>(t.set({direction:zt(e.direction),spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:Wt.EMPTY}),a())}var y4={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:Wt.EMPTY};function cp(t,e,a={}){Object.assign(e,y4,a),dr.extend(t,e,a),e.direction?Array.isArray(e.direction)&&(e.direction=new Float64Array(e.direction.slice(0,9))):e.direction=zt(new Float64Array(9)),e.indexToWorld=new Float64Array(16),e.worldToIndex=new Float64Array(16),A.get(t,e,["indexToWorld","worldToIndex"]),A.setGetArray(t,e,["origin","spacing"],3),A.setGetArray(t,e,["direction"],9),A.getArray(t,e,["extent"],6),v4(t,e)}var m4=A.newInstance(cp,"vtkImageData"),_0={newInstance:m4,extend:cp},x4={MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},E0={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},C4={LINEAR:0,LOG10:1},D0={VectorMode:x4,ScalarMappingTarget:E0,Scale:C4},S4={DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},T4={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},w4={BY_ID:0,BY_NAME:1},O0={ColorMode:S4,GetArray:w4,ScalarMode:T4},{ScalarMappingTarget:up,Scale:_4,VectorMode:gn}=D0,{VtkDataTypes:$n}=pe,{ColorMode:co}=O0,{vtkErrorMacro:lp}=A;function E4(t){return t}function fp(t){return Math.floor(t*255+.5)}function D4(t,e){e.classHierarchy.push("vtkScalarsToColors"),t.setVectorModeToMagnitude=()=>t.setVectorMode(gn.MAGNITUDE),t.setVectorModeToComponent=()=>t.setVectorMode(gn.COMPONENT),t.setVectorModeToRGBColors=()=>t.setVectorMode(gn.RGBCOLORS),t.build=()=>{},t.isOpaque=()=>!0,t.setAnnotations=(a,n)=>{if(!(a&&!n||!a&&n)){if(a&&n&&a.length!==n.length){lp("Values and annotations do not have the same number of tuples so ignoring");return}if(e.annotationArray=[],n&&a){const r=n.length;for(let i=0;i{let r=t.checkForAnnotatedValue(a),i=!1;return r>=0?e.annotationArray[r].annotation!==n&&(e.annotationArray[r].annotation=n,i=!0):(e.annotationArray.push({value:a,annotation:n}),r=e.annotationArray.length-1,i=!0),i&&(t.updateAnnotatedValueMap(),t.modified()),r},t.getNumberOfAnnotatedValues=()=>e.annotationArray.length,t.getAnnotatedValue=a=>a<0||a>=e.annotationArray.length?null:e.annotationArray[a].value,t.getAnnotation=a=>e.annotationArray[a]===void 0?null:e.annotationArray[a].annotation,t.getAnnotatedValueIndex=a=>e.annotationArray.length?t.checkForAnnotatedValue(a):-1,t.removeAnnotation=a=>{const n=t.checkForAnnotatedValue(a),r=n>=0;return r&&(e.annotationArray.splice(n,1),t.updateAnnotatedValueMap(),t.modified()),r},t.resetAnnotations=()=>{e.annotationArray=[],e.annotatedValueMap=[],t.modified()},t.getAnnotationColor=(a,n)=>{if(e.indexedLookup){const r=t.getAnnotatedValueIndex(a);t.getIndexedColor(r,n)}else t.getColor(parseFloat(a),n),n[3]=1},t.checkForAnnotatedValue=a=>t.getAnnotatedValueIndexInternal(a),t.getAnnotatedValueIndexInternal=a=>{if(e.annotatedValueMap[a]!==void 0){const n=e.annotationArray.length;return e.annotatedValueMap[a]%n}return-1},t.getIndexedColor=(a,n)=>{n[0]=0,n[1]=0,n[2]=0,n[3]=0},t.updateAnnotatedValueMap=()=>{e.annotatedValueMap=[];const a=e.annotationArray.length;for(let n=0;n{const i=a.getNumberOfComponents();let o=null;if(n===co.DEFAULT&&(a.getDataType()===$n.UNSIGNED_CHAR||a.getDataType()===$n.UNSIGNED_CHAR_CLAMPED)||n===co.DIRECT_SCALARS&&a)o=t.convertToRGBA(a,i,a.getNumberOfTuples());else{const s={type:"vtkDataArray",name:"temp",numberOfComponents:4,dataType:$n.UNSIGNED_CHAR},u=A.newTypedArray(s.dataType,4*a.getNumberOfTuples());s.values=u,s.size=u.length,o=pe.newInstance(s);let c=r;c<0&&i>1?t.mapVectorsThroughTable(a,o,up.RGBA,-1,-1):(c<0&&(c=0),c>=i&&(c=i-1),t.mapScalarsThroughTable(a,o,up.RGBA,c))}return o},t.mapVectorsToMagnitude=(a,n,r)=>{const i=a.getNumberOfTuples(),o=a.getNumberOfComponents(),s=n.getData(),u=a.getData();for(let c=0;c{let s=t.getVectorMode(),u=o,c=i;const p=a.getNumberOfComponents();s===gn.COMPONENT?(c===-1&&(c=t.getVectorComponent()),c<0&&(c=0),c>=p&&(c=p-1)):(u===-1&&(u=t.getVectorSize()),u<=0?(c=0,u=p):(c<0&&(c=0),c>=p&&(c=p-1),c+u>p&&(u=p-c)),s===gn.MAGNITUDE&&(p===1||u===1)&&(s=gn.COMPONENT));let l=0;switch(c>0&&(l=c),s){case gn.COMPONENT:t.mapScalarsThroughTable(a,n,r,l);break;case gn.RGBCOLORS:break;case gn.MAGNITUDE:default:{const f=pe.newInstance({numberOfComponents:1,values:new Float32Array(a.getNumberOfTuples())});t.mapVectorsToMagnitude(a,f,u),t.mapScalarsThroughTable(f,n,r,0);break}}},t.luminanceToRGBA=(a,n,r,i)=>{const o=i(r),s=n.getData(),u=a.getData(),c=s.length,p=0,l=1;let f=0;for(let h=p;h{const o=n.getData(),s=a.getData(),u=o.length,c=0,p=2;let l=0;for(let f=c;f{const o=fp(r),s=n.getData(),u=a.getData(),c=s.length,p=0,l=3;let f=0;for(let h=p;h{const o=n.getData(),s=a.getData(),u=o.length,c=0,p=4;let l=0;for(let f=c;f{let{alpha:i}=e;if(n===4&&i>=1&&a.getDataType()===$n.UNSIGNED_CHAR)return a;const o=pe.newInstance({numberOfComponents:4,empty:!0,size:4*r,dataType:$n.UNSIGNED_CHAR});if(r<=0)return o;i=i>0?i:0,i=i<1?i:1;let s=E4;switch((a.getDataType()===$n.FLOAT||a.getDataType()===$n.DOUBLE)&&(s=fp),n){case 1:t.luminanceToRGBA(o,a,i,s);break;case 2:t.luminanceAlphaToRGBA(o,a,s);break;case 3:t.rGBToRGBA(o,a,i,s);break;case 4:t.rGBAToRGBA(o,a,i,s);break;default:return lp("Cannot convert colors"),null}return o},t.usingLogScale=()=>!1,t.getNumberOfAvailableColors=()=>256*256*256,t.setRange=(a,n)=>t.setMappingRange(a,n),t.getRange=()=>t.getMappingRange(),t.areScalarsOpaque=(a,n,r)=>{if(!a)return t.isOpaque();const i=a.getNumberOfComponents();return n===co.DEFAULT&&a.getDataType()===$n.UNSIGNED_CHAR||n===co.DIRECT_SCALARS?i===3||i===1?e.alpha>=1:a.getRange(i-1)[0]===255:!0}}var O4={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:gn.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1,scale:_4.LINEAR};function pp(t,e,a={}){Object.assign(e,O4,a),A.obj(t,e),e.mappingRange=[0,255],e.annotationArray=[],e.annotatedValueMap=[],A.setGet(t,e,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),A.setArray(t,e,["mappingRange"],2),A.getArray(t,e,["mappingRange"]),D4(t,e)}var b4=A.newInstance(pp,"vtkScalarsToColors"),uo={newInstance:b4,extend:pp,...D0},{vtkErrorMacro:hp}=A,gp=0,dp=1,b0=2;function M4(t,e){e.classHierarchy.push("vtkLookupTable"),t.isOpaque=()=>{if(e.opaqueFlagBuildTime.getMTime()!1,t.getNumberOfAvailableColors=()=>e.table.length/4-3,t.linearIndexLookup=(a,n)=>{let r=0;const i=Number(a);return in.range[1]?r=n.maxIndex+dp+1.5:(r=(i+n.shift)*n.scale,r=r{let i=0;ki(a)?i=Math.floor(r.maxIndex+1.5+b0):i=t.linearIndexLookup(a,r);const o=4*i;return n.slice(o,o+4)},t.indexedLookupFunction=(a,n,r)=>{let i=t.getAnnotatedValueIndexInternal(a);i===-1&&(i=e.numberOfColors+b0);const o=4*i;return[n[o],n[o+1],n[o+2],n[o+3]]},t.lookupShiftAndScale=(a,n)=>{n.shift=-a[0],n.scale=Number.MAX_VALUE,a[1]>a[0]&&(n.scale=(n.maxIndex+1)/(a[1]-a[0]))},t.mapScalarsThroughTable=(a,n,r,i)=>{let o=t.linearLookup;e.indexedLookup&&(o=t.indexedLookupFunction);const s=t.getMappingRange(),u={maxIndex:t.getNumberOfColors()-1,range:s,shift:0,scale:0};t.lookupShiftAndScale(s,u);const c=t.getAlpha(),p=a.getNumberOfTuples(),l=a.getNumberOfComponents(),f=n.getData(),h=a.getData();if(c>=1){if(r===E0.RGBA)for(let v=0;v{let a=0,n=0,r=0,i=0;const o=e.numberOfColors-1;o&&(a=(e.hueRange[1]-e.hueRange[0])/o,n=(e.saturationRange[1]-e.saturationRange[0])/o,r=(e.valueRange[1]-e.valueRange[0])/o,i=(e.alphaRange[1]-e.alphaRange[0])/o),e.table.length=4*o+16;const s=[],u=[];for(let c=0;c<=o;c++)s[0]=e.hueRange[0]+c*a,s[1]=e.saturationRange[0]+c*n,s[2]=e.valueRange[0]+c*r,cr(s,u),u[3]=e.alphaRange[0]+c*i,e.table[c*4]=u[0]*255+.5,e.table[c*4+1]=u[1]*255+.5,e.table[c*4+2]=u[2]*255+.5,e.table[c*4+3]=u[3]*255+.5;t.buildSpecialColors(),e.buildTime.modified()},t.setTable=a=>{if(Array.isArray(a)){const r=a[0].length;e.numberOfColors=a.length;const i=4-r;let o=0;for(let s=0;s{const{numberOfColors:a}=e,n=e.table;let r=(a+gp)*4;e.useBelowRangeColor||a===0?(n[r]=e.belowRangeColor[0]*255+.5,n[r+1]=e.belowRangeColor[1]*255+.5,n[r+2]=e.belowRangeColor[2]*255+.5,n[r+3]=e.belowRangeColor[3]*255+.5):(n[r]=n[0],n[r+1]=n[1],n[r+2]=n[2],n[r+3]=n[3]),r=(a+dp)*4,e.useAboveRangeColor||a===0?(n[r]=e.aboveRangeColor[0]*255+.5,n[r+1]=e.aboveRangeColor[1]*255+.5,n[r+2]=e.aboveRangeColor[2]*255+.5,n[r+3]=e.aboveRangeColor[3]*255+.5):(n[r]=n[4*(a-1)+0],n[r+1]=n[4*(a-1)+1],n[r+2]=n[4*(a-1)+2],n[r+3]=n[4*(a-1)+3]),r=(a+b0)*4,n[r]=e.nanColor[0]*255+.5,n[r+1]=e.nanColor[1]*255+.5,n[r+2]=e.nanColor[2]*255+.5,n[r+3]=e.nanColor[3]*255+.5},t.build=()=>{(e.table.length<1||t.getMTime()>e.buildTime.getMTime()&&e.insertTime.getMTime()<=e.buildTime.getMTime())&&t.forceBuild()},e.table.length>0&&(t.buildSpecialColors(),e.insertTime.modified())}var N4={numberOfColors:256,hueRange:[0,.66667],saturationRange:[1,1],valueRange:[1,1],alphaRange:[1,1],nanColor:[.5,0,0,1],belowRangeColor:[0,0,0,1],aboveRangeColor:[1,1,1,1],useAboveRangeColor:!1,useBelowRangeColor:!1,alpha:1};function vp(t,e,a={}){Object.assign(e,N4,a),uo.extend(t,e,a),e.table||(e.table=[]),e.buildTime={},A.obj(e.buildTime),e.opaqueFlagBuildTime={},A.obj(e.opaqueFlagBuildTime,{mtime:0}),e.insertTime={},A.obj(e.insertTime,{mtime:0}),A.get(t,e,["buildTime"]),A.setGet(t,e,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),A.setArray(t,e,["alphaRange","hueRange","saturationRange","valueRange"],2),A.setArray(t,e,["nanColor","belowRangeColor","aboveRangeColor"],4),A.getArray(t,e,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),M4(t,e)}var R4=A.newInstance(vp,"vtkLookupTable"),yp={newInstance:R4,extend:vp},{vtkErrorMacro:mp}=A,lo=new Float64Array(16),fo=new Float64Array(4);function xp(t,e){const a=t.getNormalByReference(),n=t.getOriginByReference();return e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=-(a[0]*n[0]+a[1]*n[1]+a[2]*n[2]),e}function L4(t,e){e.classHierarchy.push("vtkAbstractMapper"),t.update=()=>{t.getInputData()},t.addClippingPlane=a=>a.isA("vtkPlane")?e.clippingPlanes.includes(a)?!1:(e.clippingPlanes.push(a),t.modified(),!0):!1,t.getNumberOfClippingPlanes=()=>e.clippingPlanes.length,t.removeAllClippingPlanes=()=>e.clippingPlanes.length===0?!1:(e.clippingPlanes.length=0,t.modified(),!0),t.removeClippingPlane=a=>{const n=e.clippingPlanes.indexOf(a);return n===-1?!1:(e.clippingPlanes.splice(n,1),t.modified(),!0)},t.getClippingPlanes=()=>e.clippingPlanes,t.getClippingPlanesMTime=()=>{let a=0;for(let n=0;n{if(a)if(!Array.isArray(a))t.addClippingPlane(a);else{const n=a.length;for(let r=0;r{var o;if(n<0||n>=((o=e.clippingPlanes)==null?void 0:o.length)){mp(`Clipping plane index ${n} is out of range.`);return}const i=r||new Float64Array(4);return xp(e.clippingPlanes[n],fo),Et(lo,a),We(lo,lo),On(i,fo,lo),i},t.getClippingPlaneInDataCoords=(a,n,r)=>{const i=e.clippingPlanes;if(i){const o=i.length;if(n>=0&&n{A.vtkErrorMacro("vtkAbstractMapper3D.computeBounds - NOT IMPLEMENTED")};const a=t.getBounds;t.getBounds=()=>(t.computeBounds(),a());const n=t.getBoundsByReference;t.getBoundsByReference=()=>(t.computeBounds(),n()),t.getCenter=()=>{var i;const r=t.getBoundsByReference();return e.center=de.isValid(r)?de.getCenter(r):null,(i=e.center)==null?void 0:i.slice()},t.getLength=()=>{const r=t.getBoundsByReference();return de.getDiagonalLength(r)}}var B4=t=>({bounds:[...de.INIT_BOUNDS],center:[0,0,0],viewSpecificProperties:{},...t});function U4(t,e,a={}){Object.assign(e,B4(a)),A4.extend(t,e,a),A.setGet(t,e,["viewSpecificProperties"]),A.getArray(t,e,["bounds"],6),V4(t,e)}var M0={extend:U4},Zt={Off:0,PolygonOffset:1},N0=Zt.PolygonOffset,po=Zt.Off,G4=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function I4(){return N0}function P4(t){const e=N0===t;return N0=t,e}function z4(){return po}function ho(t=0){const e=po===t;return po=t,e}function W4(){return ho(Zt.Off)}function j4(){return ho(Zt.Off)}function $4(){return ho(Zt.PolygonOffset)}function H4(){return G4[po]}var R0={Resolve:Zt,getResolveCoincidentTopologyAsString:H4,getResolveCoincidentTopologyPolygonOffsetFaces:I4,getResolveCoincidentTopology:z4,setResolveCoincidentTopology:ho,setResolveCoincidentTopologyPolygonOffsetFaces:P4,setResolveCoincidentTopologyToDefault:W4,setResolveCoincidentTopologyToOff:j4,setResolveCoincidentTopologyToPolygonOffset:$4};function Cp(t,e,a){a.forEach(n=>{t[`get${n.method}`]=()=>e[n.key],t[`set${n.method}`]=A.objectSetterMap.object(t,e,{name:n.key,params:["factor","offset"]})})}var L0=["Polygon","Line","Point"],K4={Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},X4=()=>{},xr={modified:X4};Cp(xr,K4,L0.map(t=>({key:t,method:`ResolveCoincidentTopology${t}OffsetParameters`})));function q4(t,e){e.resolveCoincidentTopology===void 0&&(e.resolveCoincidentTopology=!1),A.setGet(t,e,["resolveCoincidentTopology"]),e.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(R0).forEach(a=>{t[a]=R0[a]}),Object.keys(xr).filter(a=>a!=="modified").forEach(a=>{t[a]=xr[a]}),Cp(t,e.topologyOffset,L0.map(a=>({key:a,method:`RelativeCoincidentTopology${a}OffsetParameters`}))),t.getCoincidentTopologyPolygonOffsetParameters=()=>{const a=xr.getResolveCoincidentTopologyPolygonOffsetParameters(),n=t.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:a.factor+n.factor,offset:a.offset+n.offset}},t.getCoincidentTopologyLineOffsetParameters=()=>{const a=xr.getResolveCoincidentTopologyLineOffsetParameters(),n=t.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:a.factor+n.factor,offset:a.offset+n.offset}},t.getCoincidentTopologyPointOffsetParameter=()=>{const a=xr.getResolveCoincidentTopologyPointOffsetParameters(),n=t.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:a.factor+n.factor,offset:a.offset+n.offset}}}var go={implementCoincidentTopologyMethods:q4,staticOffsetAPI:xr,otherStaticMethods:R0,CATEGORIES:L0,Resolve:Zt},Nt={MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,ID_HIGH24:3,MAX_KNOWN_PASS:3},Sp={PassTypes:Nt},{FieldAssociations:Tp}=dr,{staticOffsetAPI:Y4,otherStaticMethods:J4}=go,{ColorMode:vo,ScalarMode:Cr,GetArray:F0}=O0,{VectorMode:Z4}=D0,{VtkDataTypes:Q4}=pe;function Ia(t){return()=>A.vtkErrorMacro(`vtkMapper::${t} - NOT IMPLEMENTED`)}function em(t,e){const a=t[1]%2===0?1:-1;if(t[0]+=a,t[0]>=e[0]||t[0]<0){const n=t[2]%2===0?1:-1;t[0]-=a,t[1]+=n,(t[1]>=e[1]||t[1]<0)&&(t[1]-=n,t[2]++)}}function tm(t,e){return t[0]+e[0]*(t[1]+e[1]*t[2])}function wp(t,e,a){const n=Math.floor(e),r=n%(2*a[0]);let i,o;r=g,S=i[2]<=1?2:3,T=pe.newInstance({numberOfComponents:S,values:new Float32Array(d*S)}),w=T.getData(),_=[0,0,0];wp(_,r+2,i);let E=0,D=0;const O=[.5,.5,.5];for(let R=0;Rr&&(L=r+1),wp(O,L,i)}else{O[1]=.49;const L=(N-h)*v;L>1e3?O[0]=1e3:L<-1e3?O[0]=-1e3:O[0]=L}for(let L=0;L{const a=t.getInputData();a?(e.static||t.update(),de.setBounds(e.bounds,a.getBounds())):de.reset(e.bounds)},t.setForceCompileOnly=a=>{e.forceCompileOnly=a},t.setSelectionWebGLIdsToVTKIds=a=>{e.selectionWebGLIdsToVTKIds=a},t.createDefaultLookupTable=()=>{e.lookupTable=yp.newInstance()},t.getColorModeAsString=()=>A.enumToString(vo,e.colorMode),t.setColorModeToDefault=()=>t.setColorMode(0),t.setColorModeToMapScalars=()=>t.setColorMode(1),t.setColorModeToDirectScalars=()=>t.setColorMode(2),t.getScalarModeAsString=()=>A.enumToString(Cr,e.scalarMode),t.setScalarModeToDefault=()=>t.setScalarMode(0),t.setScalarModeToUsePointData=()=>t.setScalarMode(1),t.setScalarModeToUseCellData=()=>t.setScalarMode(2),t.setScalarModeToUsePointFieldData=()=>t.setScalarMode(3),t.setScalarModeToUseCellFieldData=()=>t.setScalarMode(4),t.setScalarModeToUseFieldData=()=>t.setScalarMode(5),t.getAbstractScalars=(a,n,r,i,o)=>{if(!a||!e.scalarVisibility)return{scalars:null,cellFlag:!1};let s=null,u=!1;if(n===Cr.DEFAULT)s=a.getPointData().getScalars(),s||(s=a.getCellData().getScalars(),u=!0);else if(n===Cr.USE_POINT_DATA)s=a.getPointData().getScalars();else if(n===Cr.USE_CELL_DATA)s=a.getCellData().getScalars(),u=!0;else if(n===Cr.USE_POINT_FIELD_DATA){const c=a.getPointData();r===F0.BY_ID?s=c.getArrayByIndex(i):s=c.getArrayByName(o)}else if(n===Cr.USE_CELL_FIELD_DATA){const c=a.getCellData();u=!0,r===F0.BY_ID?s=c.getArrayByIndex(i):s=c.getArrayByName(o)}else if(n===Cr.USE_FIELD_DATA){const c=a.getFieldData();r===F0.BY_ID?s=c.getArrayByIndex(i):s=c.getArrayByName(o)}return{scalars:s,cellFlag:u}},t.mapScalars=(a,n)=>{const{scalars:r,cellFlag:i}=t.getAbstractScalars(a,e.scalarMode,e.arrayAccessMode,e.arrayId,e.colorByArrayName);if(e.areScalarsMappedFromCells=i,!r){e.colorCoordinates=null,e.colorTextureMap=null,e.colorMapColors=null;return}const o=`${t.getMTime()}${r.getMTime()}${n}`;if(e.colorBuildString!==o){if(e.useLookupTableScalarRange||t.getLookupTable().setRange(e.scalarRange[0],e.scalarRange[1]),t.canUseTextureMapForColoring(r,i))e.mapScalarsToTexture(r,i,n);else{e.colorCoordinates=null,e.colorTextureMap=null;const s=t.getLookupTable();s&&(s.build(),e.colorMapColors=s.mapScalars(r,e.colorMode,e.fieldDataTupleId))}e.colorBuildString=`${t.getMTime()}${r.getMTime()}${n}`}},e.mapScalarsToTexture=(a,n,r)=>{const i=e.lookupTable.getRange(),o=e.lookupTable.usingLogScale(),s=e.lookupTable.getAlpha(),u=o?[Math.log10(i[0]),Math.log10(i[1])]:i;if(e.colorMapColors=null,e.colorTextureMap==null||t.getMTime()>e.colorTextureMap.getMTime()||e.lookupTable.getMTime()>e.colorTextureMap.getMTime()||e.lookupTable.getAlpha()!==r){e.lookupTable.setAlpha(r),e.colorTextureMap=null,e.lookupTable.build();const c=e.lookupTable.getNumberOfAvailableColors(),p=2048,l=p**3-3;e.numberOfColorsInRange=Math.min(Math.max(c,2),n?l:4094);const f=e.numberOfColorsInRange+3,h=e.numberOfColorsInRange+2,v=n?[Math.min(Math.ceil(f/p**0),p),Math.min(Math.ceil(f/p**1),p),Math.min(Math.ceil(f/p**2),p)]:[h,2,1],m=v[0]*v[1]*v[2],x=new Float64Array(m);x.fill(NaN);const y=e.numberOfColorsInRange,d=y+2,g=[0,0,0],C=u[0],S=u[1]-u[0];for(let _=0;_1?-1:e.lookupTable.getVectorComponent(),u,o,e.numberOfColorsInRange,e.colorTextureMap.getDimensions(),n)},t.getIsOpaque=()=>{const a=t.getInputData(),n=t.getAbstractScalars(a,e.scalarMode,e.arrayAccessMode,e.arrayId,e.colorByArrayName).scalars;if(!e.scalarVisibility||n==null)return!0;const r=t.getLookupTable();return r?(r.build(),r.areScalarsOpaque(n,e.colorMode,-1)):!0},t.canUseTextureMapForColoring=(a,n)=>n&&e.colorMode!==vo.DIRECT_SCALARS?!0:!(!e.interpolateScalarsBeforeMapping||e.lookupTable&&e.lookupTable.getIndexedLookup()||!a||e.colorMode===vo.DEFAULT&&a.getDataType()===Q4.UNSIGNED_CHAR||e.colorMode===vo.DIRECT_SCALARS),t.clearColorArrays=()=>{e.colorMapColors=null,e.colorCoordinates=null,e.colorTextureMap=null},t.getLookupTable=()=>(e.lookupTable||t.createDefaultLookupTable(),e.lookupTable),t.getMTime=()=>{let a=e.mtime;if(e.lookupTable!==null){const n=e.lookupTable.getMTime();a=n>a?n:a}return a},t.getPrimitiveCount=()=>{const a=t.getInputData();return{points:a.getPoints().getNumberOfValues()/3,verts:a.getVerts().getNumberOfValues()-a.getVerts().getNumberOfCells(),lines:a.getLines().getNumberOfValues()-2*a.getLines().getNumberOfCells(),triangles:a.getPolys().getNumberOfValues()-3*a.getPolys().getNumberOfCells()}},t.acquireInvertibleLookupTable=Ia("AcquireInvertibleLookupTable"),t.valueToColor=Ia("ValueToColor"),t.colorToValue=Ia("ColorToValue"),t.useInvertibleColorFor=Ia("UseInvertibleColorFor"),t.clearInvertibleColor=Ia("ClearInvertibleColor"),t.processSelectorPixelBuffers=(a,n)=>{if(!a||!e.selectionWebGLIdsToVTKIds||!e.populateSelectionSettings)return;const r=a.getRawPixelBuffer(Nt.ID_LOW24),i=a.getRawPixelBuffer(Nt.ID_HIGH24),o=a.getCurrentPass(),s=a.getFieldAssociation();let u=null;s===Tp.FIELD_ASSOCIATION_POINTS?u=e.selectionWebGLIdsToVTKIds.points:s===Tp.FIELD_ASSOCIATION_CELLS&&(u=e.selectionWebGLIdsToVTKIds.cells),u&&n.forEach(c=>{if(o===Nt.ID_LOW24){let p=0;i&&(p+=i[c],p*=256),p+=r[c+2],p*=256,p+=r[c+1],p*=256,p+=r[c];const l=u[p],f=a.getPixelBuffer(Nt.ID_LOW24);f[c]=l&255,f[c+1]=(l&65280)>>8,f[c+2]=(l&16711680)>>16}else if(o===Nt.ID_HIGH24&&i){let p=0;p+=i[c],p*=256,p+=r[c+2],p*=256,p+=r[c+1],p*=256,p+=r[c];const l=u[p],f=a.getPixelBuffer(Nt.ID_HIGH24);f[c]=(l&4278190080)>>24}})}}var am={colorMapColors:null,areScalarsMappedFromCells:!1,static:!1,lookupTable:null,scalarVisibility:!0,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,fieldDataTupleId:-1,populateSelectionSettings:!0,selectionWebGLIdsToVTKIds:null,interpolateScalarsBeforeMapping:!1,colorCoordinates:null,colorTextureMap:null,numberOfColorsInRange:0,forceCompileOnly:0,useInvertibleColors:!1,invertibleScalars:null,customShaderAttributes:[]};function Ep(t,e,a={}){Object.assign(e,am,a),M0.extend(t,e,a),A.get(t,e,["areScalarsMappedFromCells","colorCoordinates","colorMapColors","colorTextureMap","numberOfColorsInRange","selectionWebGLIdsToVTKIds"]),A.setGet(t,e,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","populateSelectionSettings","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","customShaderAttributes"]),A.setGetArray(t,e,["scalarRange"],2),go.implementCoincidentTopologyMethods(t,e),rm(t,e)}var im=A.newInstance(Ep,"vtkMapper"),dn={newInstance:im,extend:Ep,...Y4,...J4,...O0};function om(t,e){e.classHierarchy.push("vtkTexture"),t.imageLoaded=()=>{e.image.removeEventListener("load",t.imageLoaded),e.imageLoaded=!0,t.modified()},t.setJsImageData=a=>{e.jsImageData!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.image=null,e.canvas=null,e.imageBitmap=null),e.jsImageData=a,e.imageLoaded=!0,t.modified())},t.setImageBitmap=a=>{e.imageBitmap!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.image=null,e.canvas=null,e.jsImageData=null),e.imageBitmap=a,e.imageLoaded=!0,t.modified())},t.setCanvas=a=>{e.canvas!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.image=null,e.imageBitmap=null,e.jsImageData=null),e.canvas=a,t.modified())},t.setImage=a=>{e.image!==a&&(a!==null&&(t.setInputData(null),t.setInputConnection(null),e.canvas=null,e.jsImageData=null,e.imageBitmap=null),e.image=a,e.imageLoaded=!1,a.complete?t.imageLoaded():a.addEventListener("load",t.imageLoaded),t.modified())},t.getDimensionality=()=>{let a=0,n=0,r=1;if(t.getInputData()){const i=t.getInputData();a=i.getDimensions()[0],n=i.getDimensions()[1],r=i.getDimensions()[2]}return e.jsImageData&&(a=e.jsImageData.width,n=e.jsImageData.height),e.canvas&&(a=e.canvas.width,n=e.canvas.height),e.image&&(a=e.image.width,n=e.image.height),e.imageBitmap&&(a=e.imageBitmap.width,n=e.imageBitmap.height),(a>1)+(n>1)+(r>1)},t.getInputAsJsImageData=()=>{if(!e.imageLoaded||t.getInputData())return null;if(e.jsImageData)return e.jsImageData;if(e.imageBitmap)return e.imageBitmap;if(e.canvas)return e.canvas.getContext("2d").getImageData(0,0,e.canvas.width,e.canvas.height);if(e.image){const a=e.image.width,n=e.image.height,r=new OffscreenCanvas(a,n).getContext("2d");return r.translate(0,n),r.scale(1,-1),r.drawImage(e.image,0,0,a,n),r.getImageData(0,0,a,n)}return null}}var sm=(t,e,a)=>{const n=t.createShaderModule({code:` @group(0) @binding(0) var inputTexture: texture_2d; @group(0) @binding(1) var outputTexture: texture_storage_2d; @@ -42,30 +60,12 @@ textureStore(outputTexture, texelCoord, color); } - `,r=t.createShaderModule({code:n}),i=t.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,texture:{sampleType:"float"}},{binding:1,visibility:GPUShaderStage.COMPUTE,storageTexture:{format:"rgba8unorm",access:"write-only"}},{binding:2,visibility:GPUShaderStage.COMPUTE,sampler:{type:"filtering"}}]}),o=t.createPipelineLayout({bindGroupLayouts:[i]}),s=t.createComputePipeline({label:"ComputeMipmapPipeline",layout:o,compute:{module:r,entryPoint:"main"}}),c=t.createSampler({magFilter:"linear",minFilter:"linear"});for(let l=1;l>l),m=Math.max(1,e.height>>l),x=Math.ceil(v/8),y=Math.ceil(m/8);d.dispatchWorkgroups(x,y),d.end(),t.queue.submit([h.finish()])}},r9={image:null,canvas:null,jsImageData:null,imageBitmap:null,imageLoaded:!1,repeat:!1,interpolate:!1,edgeClamp:!1,mipLevel:0,resizable:!1};function Bp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,r9,a),V.obj(t,e),V.algo(t,e,6,0),V.get(t,e,["canvas","image","jsImageData","imageBitmap","imageLoaded","resizable"]),V.setGet(t,e,["repeat","edgeClamp","interpolate","mipLevel"]),t9(t,e)}var A0={newInstance:V.newInstance(Bp,"vtkTexture"),extend:Bp,...{generateMipmaps:n9}};const a9=[[-1,0,0],[1,0,0],[0,-1,0],[0,1,0],[0,0,-1],[0,0,1]],Up=[[8,7,11,3],[9,1,10,5],[4,9,0,8],[2,11,6,10],[0,3,2,1],[4,5,6,7]],So=[[0,1],[1,3],[2,3],[0,2],[4,5],[5,7],[6,7],[4,6],[0,4],[1,5],[3,7],[2,6]],Gp=[0,1,0,1,0,1,0,1,2,2,2,2],rt=[[1,2],[1,2],[0,2],[0,2],[0,1],[0,1]],be=new Float64Array(3),To=new Float64Array(3),qe=new Float64Array(3),Sr=new Float64Array(3),Tr=new Float64Array(3),wo=new Float64Array(3),B0=new Float64Array(16);function U0(t,e){t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeSize,t.fillStyle=e.fontColor,t.font=`${e.fontStyle} ${e.fontSize}px ${e.fontFamily}`}function Ip(t){const e=[],a=[];for(let n=0;n<3;n++){const r=Gs().domain([t[n*2],t[n*2+1]]);e[n]=r.ticks(5);const i=r.tickFormat(5);a[n]=e[n].map(i)}return{ticks:e,tickStrings:a}}function i9(t,e){e.classHierarchy.push("vtkCubeAxesActorHelper"),t.setRenderable=a=>{e.renderable!==a&&(e.renderable=a,e.tmActor.addTexture(e.renderable.getTmTexture()),e.tmActor.setProperty(a.getProperty()),e.tmActor.setParentProp(a),t.modified())},t.createPolyDataForOneLabel=(a,n,r,i,o,s,c)=>{const l=e.renderable.get_tmAtlas().get(a);if(!l)return;const p=e.renderable.getTextPolyData().getPoints().getData(),u=e.lastSize;be[0]=p[n*3],be[1]=p[n*3+1],be[2]=p[n*3+2],_e(qe,be,r),qe[0]+=.1,_e(To,qe,i),sn(Tr,To,be),qe[0]-=.1,qe[1]+=.1,_e(To,qe,i),sn(wo,To,be);for(let d=0;d<3;d++)Tr[d]/=.5*.1*u[0],wo[d]/=.5*.1*u[1];let f=c.ptIdx,h=c.cellIdx;be[0]=p[n*3],be[1]=p[n*3+1],be[2]=p[n*3+2],o[0]<-.5?Kt(qe,Tr,o[0]*s-l.width):o[0]>.5?Kt(qe,Tr,o[0]*s):Kt(qe,Tr,o[0]*s-l.width/2),Ti(be,be,qe),Kt(qe,wo,o[1]*s-l.height/2),Ti(be,be,qe),c.points[f*3]=be[0],c.points[f*3+1]=be[1],c.points[f*3+2]=be[2],c.tcoords[f*2]=l.tcoords[0],c.tcoords[f*2+1]=l.tcoords[1],f++,Kt(qe,Tr,l.width),Ti(be,be,qe),c.points[f*3]=be[0],c.points[f*3+1]=be[1],c.points[f*3+2]=be[2],c.tcoords[f*2]=l.tcoords[2],c.tcoords[f*2+1]=l.tcoords[3],f++,Kt(qe,wo,l.height),Ti(be,be,qe),c.points[f*3]=be[0],c.points[f*3+1]=be[1],c.points[f*3+2]=be[2],c.tcoords[f*2]=l.tcoords[4],c.tcoords[f*2+1]=l.tcoords[5],f++,Kt(qe,Tr,l.width),sn(be,be,qe),c.points[f*3]=be[0],c.points[f*3+1]=be[1],c.points[f*3+2]=be[2],c.tcoords[f*2]=l.tcoords[6],c.tcoords[f*2+1]=l.tcoords[7],f++,c.polys[h*4]=3,c.polys[h*4+1]=f-4,c.polys[h*4+2]=f-3,c.polys[h*4+3]=f-2,h++,c.polys[h*4]=3,c.polys[h*4+1]=f-4,c.polys[h*4+2]=f-2,c.polys[h*4+3]=f-1,c.ptIdx+=4,c.cellIdx+=2},t.updateTexturePolyData=()=>{const a=e.camera.getCompositeProjectionMatrix(e.lastAspectRatio,-1,1);We(a,a);const n=e.renderable.getTextValues().length,r=n*4,i=n*2,o=new Float64Array(r*3),s=new Uint16Array(i*4),c=new Float32Array(r*2);Et(B0,a);const l={ptIdx:0,cellIdx:0,polys:s,points:o,tcoords:c};let p=0,u=0,f=0;const h=e.renderable.getTextPolyData().getPoints().getData(),d=e.renderable.getTextValues();for(;p{(e.lastSize[0]!==a[0]||e.lastSize[1]!==a[1])&&(e.lastSize[0]=a[0],e.lastSize[1]=a[1],e.lastAspectRatio=a[0]/a[1],e.forceUpdate=!0),e.camera=n,t.updateTexturePolyData()}}const o9=V.newInstance(function(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{renderable:null};Object.assign(e,{},a),V.obj(t,e),e.tmPolyData=Xe.newInstance(),e.tmMapper=gn.newInstance(),e.tmMapper.setInputData(e.tmPolyData),e.tmActor=pn.newInstance({parentProp:t}),e.tmActor.setMapper(e.tmMapper),V.setGet(t,e,["renderable"]),V.get(t,e,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),e.forceUpdate=!1,e.lastRedrawTime={},V.obj(e.lastRedrawTime,{mtime:0}),e.lastRebuildTime={},V.obj(e.lastRebuildTime,{mtime:0}),e.lastSize=[-1,-1],e.lastTickBounds=[],i9(t,e)},"vtkCubeAxesActorHelper");function s9(t,e){e.classHierarchy.push("vtkCubeAxesActor"),t.setCamera=n=>{e.camera!==n&&(e.cameraModifiedSub&&(e.cameraModifiedSub.unsubscribe(),e.cameraModifiedSub=null),e.camera=n,n&&(e.cameraModifiedSub=n.onModified(t.update)),t.update(),t.modified())},t.computeFacesToDraw=()=>{const n=e.camera.getViewMatrix();We(n,n);let r=!1;const i=we.getDiagonalLength(e.dataBounds),o=Math.sin(e.faceVisibilityAngle*Math.PI/180);for(let s=0;s<6;s++){let c=!1;const l=Math.floor(s/2),p=(l+1)%3,u=(l+2)%3;e.dataBounds[p*2]!==e.dataBounds[p*2+1]&&e.dataBounds[u*2]!==e.dataBounds[u*2+1]&&(be[l]=e.dataBounds[s]-.1*i*a9[s][l],be[p]=.5*(e.dataBounds[p*2]+e.dataBounds[p*2+1]),be[u]=.5*(e.dataBounds[u*2]+e.dataBounds[u*2+1]),_e(qe,be,n),be[l]=e.dataBounds[s],_e(Sr,be,n),sn(qe,Sr,qe),cn(qe,qe),c=qe[2]>o,e.camera.getParallelProjection()||(cn(Sr,Sr),c=_i(Sr,qe)>o)),c!==e.lastFacesToDraw[s]&&(e.lastFacesToDraw[s]=c,r=!0)}return r},t.updatePolyData=(n,r,i)=>{let o=0,s=0;o+=8;let c=0;for(let h=0;h<12;h++)r[h]>0&&c++;if(s+=c,e.gridLines)for(let h=0;h<6;h++)n[h]&&(o+=i[rt[h][0]].length*2+i[rt[h][1]].length*2,s+=i[rt[h][0]].length+i[rt[h][1]].length);const l=new Float64Array(o*3),p=new Uint32Array(s*3);let u=0,f=0;for(let h=0;h<2;h++)for(let d=0;d<2;d++)for(let v=0;v<2;v++)l[u*3]=e.dataBounds[v],l[u*3+1]=e.dataBounds[2+d],l[u*3+2]=e.dataBounds[4+h],u++;for(let h=0;h<12;h++)r[h]>0&&(p[f*3]=2,p[f*3+1]=So[h][0],p[f*3+2]=So[h][1],f++);if(e.gridLines){for(let h=0;h<6;h++)if(n[h]){const d=Math.floor(h/2);let v=i[rt[h][0]];for(let m=0;m{let s=0;for(let h=0;h<12;h++)r[h]===1&&(s+=2,s+=i[Gp[h]].length);const c=e.polyData.getPoints().getData(),l=new Float64Array(s*3);let p=0,u=0,f=0;for(let h=0;h<6;h++)if(n[h])for(let d=0;d<4;d++){const v=Up[h][d];if(r[v]===1){const m=Gp[v],x=So[v][0]*3,y=So[v][1]*3;l[p*3]=.5*(c[x]+c[y]),l[p*3+1]=.5*(c[x+1]+c[y+1]),l[p*3+2]=.5*(c[x+2]+c[y+2]),p++;const g=Math.floor(h/2);l[p*3+g]=e.dataBounds[h],l[p*3+rt[h][0]]=.5*(e.dataBounds[rt[h][0]*2]+e.dataBounds[rt[h][0]*2+1]),l[p*3+rt[h][1]]=.5*(e.dataBounds[rt[h][1]*2]+e.dataBounds[rt[h][1]*2+1]),p++,e.textValues[u]=e.axisLabels[m],u++;const C=(m+1)%3,S=(m+2)%3,T=i[m],w=o[m];e.tickCounts[f]=T.length;for(let _=0;_{if(!e.camera)return;const n=t.computeFacesToDraw(),r=e.lastFacesToDraw;let i=!1;for(let o=0;o<6;o++)e.dataBounds[o]!==e.lastTickBounds[o]&&(i=!0,e.lastTickBounds[o]=e.dataBounds[o]);if(n||i||e.forceUpdate){const o=new Array(12).fill(0);for(let c=0;c<6;c++)if(r[c])for(let l=0;l<4;l++)o[Up[c][l]]++;const s=e.generateTicks(e.dataBounds);t.updatePolyData(r,o,s.ticks),t.updateTextData(r,o,s.ticks,s.tickStrings),(i||e.forceUpdate)&&t.updateTextureAtlas(s.tickStrings)}e.forceUpdate=!1},t.updateTextureAtlas=n=>{e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left",e._tmAtlas.clear();let r=0,i=1;for(let o=0;o<3;o++){if(!e._tmAtlas.has(e.axisLabels[o])){U0(e.tmContext,e.axisTextStyle);const s=e.tmContext.measureText(e.axisLabels[o]),c={height:s.actualBoundingBoxAscent+2,startingHeight:i,width:s.width+2,textStyle:e.axisTextStyle};e._tmAtlas.set(e.axisLabels[o],c),i+=c.height,r{o.tcoords=[0,(i-o.startingHeight-o.height)/i,o.width/r,(i-o.startingHeight-o.height)/i,o.width/r,(i-o.startingHeight)/i,0,(i-o.startingHeight)/i]}),e.tmCanvas.width=r,e.tmCanvas.height=i,e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left",e.tmContext.clearRect(0,0,r,i),e._tmAtlas.forEach((o,s)=>{U0(e.tmContext,o.textStyle),e.tmContext.fillText(s,1,o.startingHeight+o.height-1)}),e.tmTexture.setCanvas(e.tmCanvas),e.tmTexture.modified()},t.onModified(()=>{e.forceUpdate=!0,t.update()}),t.setTickTextStyle=n=>{e.tickTextStyle={...e.tickTextStyle,...n},t.modified()},t.setAxisTextStyle=n=>{e.axisTextStyle={...e.axisTextStyle,...n},t.modified()},t.get_tmAtlas=()=>e._tmAtlas,t.getBounds=()=>(t.update(),we.setBounds(e.bounds,e.gridActor.getBounds()),we.scaleAboutCenter(e.bounds,e.boundsScaleFactor,e.boundsScaleFactor,e.boundsScaleFactor),e.bounds);const a=V.chain(t.setProperty,e.gridActor.setProperty);t.setProperty=n=>a(n)[0]}function c9(t,e,a){return{boundsScaleFactor:1.3,camera:null,dataBounds:[...we.INIT_BOUNDS],faceVisibilityAngle:8,gridLines:!0,axisLabels:null,axisTitlePixelOffset:35,tickLabelPixelOffset:12,generateTicks:Ip,...a,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif",...a==null?void 0:a.axisTextStyle},tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif",...a==null?void 0:a.tickTextStyle}}}function Pp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};pn.extend(t,e,c9(t,e,a)),e.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],e.axisLabels=["X-Axis","Y-Axis","Z-Axis"],e.tickCounts=[],e.textValues=[],e.lastTickBounds=[],e.tmCanvas=document.createElement("canvas"),e.tmContext=e.tmCanvas.getContext("2d"),e._tmAtlas=new Map,e.tmTexture=A0.newInstance({resizable:!0}),e.tmTexture.setInterpolate(!1),t.getProperty().setDiffuse(0),t.getProperty().setAmbient(1),e.gridMapper=gn.newInstance(),e.polyData=Xe.newInstance(),e.gridMapper.setInputData(e.polyData),e.gridActor=pn.newInstance(),e.gridActor.setMapper(e.gridMapper),e.gridActor.setProperty(t.getProperty()),e.gridActor.setParentProp(t),e.textPolyData=Xe.newInstance(),V.setGet(t,e,["axisTitlePixelOffset","boundsScaleFactor","faceVisibilityAngle","gridLines","tickLabelPixelOffset","generateTicks"]),V.setGetArray(t,e,["dataBounds"],6),V.setGetArray(t,e,["axisLabels"],3),V.get(t,e,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","tickCounts","gridActor"]),s9(t,e)}var G0={newInstance:V.newInstance(Pp,"vtkCubeAxesActor"),extend:Pp,newCubeAxesActorHelper:o9,defaultGenerateTicks:Ip};function u9(t,e){e.classHierarchy.push("vtkOpenGLCubeAxesActor"),t.buildPass=a=>{a&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.CubeAxesActorHelper.getRenderable()||e.CubeAxesActorHelper.setRenderable(e.renderable),t.prepareNodes(),t.addMissingNode(e.CubeAxesActorHelper.getTmActor()),t.addMissingNode(e.renderable.getGridActor()),t.removeUnusedNodes())},t.opaquePass=(a,n)=>{if(a){const r=e._openGLRenderer?e._openGLRenderer.getRenderable().getActiveCamera():null,i=e._openGLRenderer.getTiledSizeAndOrigin();e.CubeAxesActorHelper.updateAPISpecificData([i.usize,i.vsize],r,e._openGLRenderWindow.getRenderable())}}}const l9={};function f9(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,l9,a),Ct.extend(t,e,a),e.CubeAxesActorHelper=G0.newCubeAxesActorHelper(),u9(t,e)}const p9=Je(f9,"vtkOpenGLCubeAxesActor");st("vtkCubeAxesActor",p9);const Dn={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2};var zp={ObjectType:Dn};const{ObjectType:_o}=zp,h9={};function g9(t,e){e.classHierarchy.push("vtkOpenGLBufferObject");function a(s){switch(s){case _o.ELEMENT_ARRAY_BUFFER:return e.context.ELEMENT_ARRAY_BUFFER;case _o.TEXTURE_BUFFER:if("TEXTURE_BUFFER"in e.context)return e.context.TEXTURE_BUFFER;case _o.ARRAY_BUFFER:default:return e.context.ARRAY_BUFFER}}let n=null,r=null,i=!0,o="";t.getType=()=>n,t.setType=s=>{n=s},t.getHandle=()=>r,t.isReady=()=>i===!1,t.generateBuffer=s=>{const c=a(s);return r===null&&(r=e.context.createBuffer(),n=s),a(n)===c},t.upload=(s,c)=>t.generateBuffer(c)?(e.context.bindBuffer(a(n),r),e.context.bufferData(a(n),s,e.context.STATIC_DRAW),e.allocatedGPUMemoryInBytes=s.length*s.BYTES_PER_ELEMENT,i=!1,!0):(o="Trying to upload array buffer to incompatible buffer.",!1),t.bind=()=>r?(e.context.bindBuffer(a(n),r),!0):!1,t.release=()=>r?(e.context.bindBuffer(a(n),null),!0):!1,t.releaseGraphicsResources=()=>{r!==null&&(e.context.bindBuffer(a(n),null),e.context.deleteBuffer(r),r=null,e.allocatedGPUMemoryInBytes=0)},t.setOpenGLRenderWindow=s=>{e._openGLRenderWindow!==s&&(t.releaseGraphicsResources(),e._openGLRenderWindow=s,e.context=null,s&&(e.context=e._openGLRenderWindow.getContext()))},t.getError=()=>o}const d9={objectType:_o.ARRAY_BUFFER,context:null,allocatedGPUMemoryInBytes:0};function jp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,d9,a),V.obj(t,e),V.get(t,e,["_openGLRenderWindow","allocatedGPUMemoryInBytes"]),V.moveToProtected(t,e,["openGLRenderWindow"]),g9(t,e)}var On={newInstance:V.newInstance(jp),extend:jp,...h9,...zp};function I0(t){let e=0,a=0;for(let r=0;r<3;++r){const i=t.getRange(r),o=i[1]-i[0];e+=o*o;const s=.5*(i[1]+i[0]);a+=s*s}const n=e>0&&(Math.abs(a)/e>1e6||Math.abs(Math.log10(e))>3||e===0&&a>1e6);if(n){const r=new Float64Array(3),i=new Float64Array(3);for(let o=0;o<3;++o){const s=t.getRange(o),c=s[1]-s[0];r[o]=.5*(s[1]+s[0]),i[o]=c>0?1/c:1}return{useShiftAndScale:n,coordShift:r,coordScale:i}}return{useShiftAndScale:n,coordShift:new Float32Array([0,0,0]),coordScale:new Float32Array([1,1,1])}}function Wp(t,e){const a=new Float64Array(3);wi(a,e);const n=new Float64Array(16);return Qc(n,Bn(),t,a),n}const{vtkErrorMacro:$p}=V;function v9(t,e){return t===null||e===null?!1:!(ma(t,[0,0,0])&&ma(e,[1,1,1]))}function y9(t,e){e.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),t.setType(Dn.ARRAY_BUFFER),t.createVBO=function(a,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;if(!a.getData()||!a.getData().length)return e.elementCount=0,0;e.blockSize=3,e.vertexOffset=0,e.normalOffset=0,e.tCoordOffset=0,e.tCoordComponents=0,e.colorComponents=0,e.colorOffset=0,e.customData=[];const s=i.points.getData();let c=null,l=null,p=null;const u=i.colors?i.colors.getNumberOfComponents():0,f=i.tcoords?i.tcoords.getNumberOfComponents():0;i.normals&&(e.normalOffset=4*e.blockSize,e.blockSize+=3,c=i.normals.getData()),i.customAttributes&&i.customAttributes.forEach(k=>{k&&(e.customData.push({data:k.getData(),offset:4*e.blockSize,components:k.getNumberOfComponents(),name:k.getName()}),e.blockSize+=k.getNumberOfComponents())}),i.tcoords&&(e.tCoordOffset=4*e.blockSize,e.tCoordComponents=f,e.blockSize+=f,l=i.tcoords.getData()),i.colors?(e.colorComponents=i.colors.getNumberOfComponents(),e.colorOffset=0,p=i.colors.getData(),e.colorBO||(e.colorBO=On.newInstance()),e.colorBO.setOpenGLRenderWindow(e._openGLRenderWindow)):e.colorBO=null,e.stride=4*e.blockSize;let h=0,d=0,v=0,m=0,x=0,y=0,g;const C={anythingToPoints(k,A,j,H){for(let K=0;K2)for(let K=0;K2){for(let K=0;K1?(k-1)*2:0},polysToWireframe(k,A){return k>2?k*2:0},stripsToWireframe(k,A){return k>2?k*4-6:0},polysToSurface(k,A){return k>2?(k-2)*3:0},stripsToSurface(k,A,j){return k>2?(k-2)*3:0}};let T=null,w=null;r===Jt.POINTS||n==="verts"?(T=C.anythingToPoints,w=S.anythingToPoints):r===Jt.WIREFRAME||n==="lines"?(T=C[`${n}ToWireframe`],w=S[`${n}ToWireframe`]):(T=C[`${n}ToSurface`],w=S[`${n}ToSurface`]);const _=a.getData(),E=_.length;let D=0;for(let k=0;k{x=A*H.components;for(let K=0;K{if(a!==null&&(a.constructor!==Float64Array||a.length!==3)){$p("Wrong type for coordShift, expected vec3 or null");return}if(n!==null&&(n.constructor!==Float64Array||n.length!==3)){$p("Wrong type for coordScale, expected vec3 or null");return}(e.coordShift===null||a===null||!uu(a,e.coordShift))&&(e.coordShift=a),(e.coordScale===null||n===null||!uu(n,e.coordScale))&&(e.coordScale=n),e.coordShiftAndScaleEnabled=v9(e.coordShift,e.coordScale),e.coordShiftAndScaleEnabled?e.inverseShiftAndScaleMatrix=Wp(e.coordShift,e.coordScale):e.inverseShiftAndScaleMatrix=null}}const m9={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};function Hp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,m9,a),On.extend(t,e,a),V.setGet(t,e,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),V.get(t,e,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),y9(t,e)}var x9={newInstance:V.newInstance(Hp),extend:Hp};const{vtkErrorMacro:C9}=V;function S9(t,e){e.classHierarchy.push("vtkShader"),t.compile=()=>{let a=e.context.VERTEX_SHADER;if(!e.source||!e.source.length||e.shaderType==="Unknown")return!1;switch(e.handle!==0&&(e.context.deleteShader(e.handle),e.handle=0),e.shaderType){case"Fragment":a=e.context.FRAGMENT_SHADER;break;case"Vertex":default:a=e.context.VERTEX_SHADER;break}if(e.handle=e.context.createShader(a),e.context.shaderSource(e.handle,e.source),e.context.compileShader(e.handle),!e.context.getShaderParameter(e.handle,e.context.COMPILE_STATUS)){const r=e.context.getShaderInfoLog(e.handle);return C9(`Error compiling shader '${e.source}': ${r}`),e.context.deleteShader(e.handle),e.handle=0,!1}return!0},t.cleanup=()=>{e.shaderType==="Unknown"||e.handle===0||(e.context.deleteShader(e.handle),e.handle=0,e.dirty=!0)}}const T9={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function Kp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,T9,a),V.obj(t,e),V.setGet(t,e,["shaderType","source","error","handle","context"]),S9(t,e)}var P0={newInstance:V.newInstance(Kp,"vtkShader"),extend:Kp};const{vtkErrorMacro:vn}=V;function w9(t,e,a,n){const r=typeof a=="string"?a:a.join(` -`),i=n===!1?e:new RegExp(e,"g"),o=t.replace(i,r);return{replace:o!==r,result:o}}function _9(t,e){e.classHierarchy.push("vtkShaderProgram"),t.compileShader=()=>e.vertexShader.compile()?e.fragmentShader.compile()?!t.attachShader(e.vertexShader)||!t.attachShader(e.fragmentShader)?(vn(e.error),0):t.link()?(t.setCompiled(!0),1):(vn(`Links failed: ${e.error}`),0):(vn(e.fragmentShader.getSource().split(` + `}),r=t.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,texture:{sampleType:"float"}},{binding:1,visibility:GPUShaderStage.COMPUTE,storageTexture:{format:"rgba8unorm",access:"write-only"}},{binding:2,visibility:GPUShaderStage.COMPUTE,sampler:{type:"filtering"}}]}),i=t.createPipelineLayout({bindGroupLayouts:[r]}),o=t.createComputePipeline({label:"ComputeMipmapPipeline",layout:i,compute:{module:n,entryPoint:"main"}}),s=t.createSampler({magFilter:"linear",minFilter:"linear"});for(let u=1;u>u),m=Math.max(1,e.height>>u),x=Math.ceil(v/8),y=Math.ceil(m/8);h.dispatchWorkgroups(x,y),h.end(),t.queue.submit([f.finish()])}},cm={image:null,canvas:null,jsImageData:null,imageBitmap:null,imageLoaded:!1,repeat:!1,interpolate:!1,edgeClamp:!1,mipLevel:0,resizable:!1};function Dp(t,e,a={}){Object.assign(e,cm,a),A.obj(t,e),A.algo(t,e,6,0),A.get(t,e,["canvas","image","jsImageData","imageBitmap","imageLoaded","resizable"]),A.setGet(t,e,["repeat","edgeClamp","interpolate","mipLevel"]),om(t,e)}var um=A.newInstance(Dp,"vtkTexture"),lm={generateMipmaps:sm},k0={newInstance:um,extend:Dp,...lm};function yo(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function fm(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Op(t){let e,a,n;t.length!==2?(e=yo,a=(s,u)=>yo(t(s),u),n=(s,u)=>t(s)-u):(e=t===yo||t===fm?t:pm,a=t,n=t);function r(s,u,c=0,p=s.length){if(c>>1;a(s[l],u)<0?c=l+1:p=l}while(c>>1;a(s[l],u)<=0?c=l+1:p=l}while(cc&&n(s[l-1],u)>-n(s[l],u)?l-1:l}return{left:r,center:o,right:i}}function pm(){return 0}function hm(t){return t===null?NaN:+t}const gm=Op(yo).right;Op(hm).center;const dm=gm,vm=Math.sqrt(50),ym=Math.sqrt(10),mm=Math.sqrt(2);function mo(t,e,a){const n=(e-t)/Math.max(0,a),r=Math.floor(Math.log10(n)),i=n/Math.pow(10,r),o=i>=vm?10:i>=ym?5:i>=mm?2:1;let s,u,c;return r<0?(c=Math.pow(10,-r)/o,s=Math.round(t*c),u=Math.round(e*c),s/ce&&--u,c=-c):(c=Math.pow(10,r)*o,s=Math.round(t/c),u=Math.round(e/c),s*ce&&--u),u0))return[];if(t===e)return[t];const n=e=r))return[];const s=i-r+1,u=new Array(s);if(n)if(o<0)for(let c=0;c>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):a===8?Co(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):a===4?Co(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=wm.exec(t))?new At(e[1],e[2],e[3],1):(e=_m.exec(t))?new At(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Em.exec(t))?Co(e[1],e[2],e[3],e[4]):(e=Dm.exec(t))?Co(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Om.exec(t))?Ap(e[1],e[2]/100,e[3]/100,1):(e=bm.exec(t))?Ap(e[1],e[2]/100,e[3]/100,e[4]):Mp.hasOwnProperty(t)?Lp(Mp[t]):t==="transparent"?new At(NaN,NaN,NaN,0):null}function Lp(t){return new At(t>>16&255,t>>8&255,t&255,1)}function Co(t,e,a,n){return n<=0&&(t=e=a=NaN),new At(t,e,a,n)}function Rm(t){return t instanceof Pa||(t=ja(t)),t?(t=t.rgb(),new At(t.r,t.g,t.b,t.opacity)):new At}function B0(t,e,a,n){return arguments.length===1?Rm(t):new At(t,e,a,n??1)}function At(t,e,a,n){this.r=+t,this.g=+e,this.b=+a,this.opacity=+n}V0(At,B0,bp(Pa,{brighter(t){return t=t==null?xo:Math.pow(xo,t),new At(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?za:Math.pow(za,t),new At(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new At(Sr(this.r),Sr(this.g),Sr(this.b),So(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fp,formatHex:Fp,formatHex8:Lm,formatRgb:kp,toString:kp}));function Fp(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}`}function Lm(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}${Tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function kp(){const t=So(this.opacity);return`${t===1?"rgb(":"rgba("}${Sr(this.r)}, ${Sr(this.g)}, ${Sr(this.b)}${t===1?")":`, ${t})`}`}function So(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Sr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Tr(t){return t=Sr(t),(t<16?"0":"")+t.toString(16)}function Ap(t,e,a,n){return n<=0?t=e=a=NaN:a<=0||a>=1?t=e=NaN:e<=0&&(t=NaN),new Qt(t,e,a,n)}function Vp(t){if(t instanceof Qt)return new Qt(t.h,t.s,t.l,t.opacity);if(t instanceof Pa||(t=ja(t)),!t)return new Qt;if(t instanceof Qt)return t;t=t.rgb();var e=t.r/255,a=t.g/255,n=t.b/255,r=Math.min(e,a,n),i=Math.max(e,a,n),o=NaN,s=i-r,u=(i+r)/2;return s?(e===i?o=(a-n)/s+(a0&&u<1?0:o,new Qt(o,s,u,t.opacity)}function Fm(t,e,a,n){return arguments.length===1?Vp(t):new Qt(t,e,a,n??1)}function Qt(t,e,a,n){this.h=+t,this.s=+e,this.l=+a,this.opacity=+n}V0(Qt,Fm,bp(Pa,{brighter(t){return t=t==null?xo:Math.pow(xo,t),new Qt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?za:Math.pow(za,t),new Qt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,a=this.l,n=a+(a<.5?a:1-a)*e,r=2*a-n;return new At(U0(t>=240?t-240:t+120,r,n),U0(t,r,n),U0(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new Qt(Bp(this.h),To(this.s),To(this.l),So(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=So(this.opacity);return`${t===1?"hsl(":"hsla("}${Bp(this.h)}, ${To(this.s)*100}%, ${To(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Bp(t){return t=(t||0)%360,t<0?t+360:t}function To(t){return Math.max(0,Math.min(1,t||0))}function U0(t,e,a){return(t<60?e+(a-e)*t/60:t<180?a:t<240?e+(a-e)*(240-t)/60:e)*255}const G0=t=>()=>t;function km(t,e){return function(a){return t+a*e}}function Am(t,e,a){return t=Math.pow(t,a),e=Math.pow(e,a)-t,a=1/a,function(n){return Math.pow(t+n*e,a)}}function Vm(t){return(t=+t)==1?Up:function(e,a){return a-e?Am(e,a,t):G0(isNaN(e)?a:e)}}function Up(t,e){var a=e-t;return a?km(t,a):G0(isNaN(t)?e:t)}const Gp=function t(e){var a=Vm(e);function n(r,i){var o=a((r=B0(r)).r,(i=B0(i)).r),s=a(r.g,i.g),u=a(r.b,i.b),c=Up(r.opacity,i.opacity);return function(p){return r.r=o(p),r.g=s(p),r.b=u(p),r.opacity=c(p),r+""}}return n.gamma=t,n}(1);function Bm(t,e){e||(e=[]);var a=t?Math.min(e.length,t.length):0,n=e.slice(),r;return function(i){for(r=0;ra&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:wo(n,r)})),a=P0.lastIndex;return ae&&(a=t,t=e,e=a),function(n){return Math.max(t,Math.min(e,n))}}function qm(t,e,a){var n=t[0],r=t[1],i=e[0],o=e[1];return r2?Ym:qm,u=c=null,l}function l(f){return f==null||isNaN(f=+f)?i:(u||(u=s(t.map(n),e,a)))(n(o(f)))}return l.invert=function(f){return o(r((c||(c=s(e,t.map(n),wo)))(f)))},l.domain=function(f){return arguments.length?(t=Array.from(f,Km),p()):t.slice()},l.range=function(f){return arguments.length?(e=Array.from(f),p()):e.slice()},l.rangeRound=function(f){return e=Array.from(f),a=$m,p()},l.clamp=function(f){return arguments.length?(o=f?!0:na,p()):o!==na},l.interpolate=function(f){return arguments.length?(a=f,p()):a},l.unknown=function(f){return arguments.length?(i=f,l):i},function(f,h){return n=f,r=h,p()}}function Qm(){return Zm()(na,na)}function e6(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function _o(t,e){if((a=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var a,n=t.slice(0,a);return[n.length>1?n[0]+n.slice(2):n,+t.slice(a+1)]}function ra(t){return t=_o(Math.abs(t)),t?t[1]:NaN}function t6(t,e){return function(a,n){for(var r=a.length,i=[],o=0,s=t[0],u=0;r>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),i.push(a.substring(r-=s,r+s)),!((u+=s+1)>n));)s=t[o=(o+1)%t.length];return i.reverse().join(e)}}function n6(t){return function(e){return e.replace(/[0-9]/g,function(a){return t[+a]})}}var r6=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Eo(t){if(!(e=r6.exec(t)))throw new Error("invalid format: "+t);var e;return new j0({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Eo.prototype=j0.prototype;function j0(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}j0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function a6(t){e:for(var e=t.length,a=1,n=-1,r;a0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(r+1):t}var Pp;function i6(t,e){var a=_o(t,e);if(!a)return t+"";var n=a[0],r=a[1],i=r-(Pp=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+_o(t,Math.max(0,e+i-1))[0]}function zp(t,e){var a=_o(t,e);if(!a)return t+"";var n=a[0],r=a[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}const Wp={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:e6,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>zp(t*100,e),r:zp,s:i6,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function jp(t){return t}var $p=Array.prototype.map,Hp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function o6(t){var e=t.grouping===void 0||t.thousands===void 0?jp:t6($p.call(t.grouping,Number),t.thousands+""),a=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?jp:n6($p.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function c(l){l=Eo(l);var f=l.fill,h=l.align,v=l.sign,m=l.symbol,x=l.zero,y=l.width,d=l.comma,g=l.precision,C=l.trim,S=l.type;S==="n"?(d=!0,S="g"):Wp[S]||(g===void 0&&(g=12),C=!0,S="g"),(x||f==="0"&&h==="=")&&(x=!0,f="0",h="=");var T=m==="$"?a:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",w=m==="$"?n:/[%p]/.test(S)?o:"",_=Wp[S],E=/[defgprs%]/.test(S);g=g===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function D(O){var b=T,R=w,N,L,B;if(S==="c")R=_(O)+R,O="";else{O=+O;var P=O<0||1/O<0;if(O=isNaN(O)?u:_(Math.abs(O),g),C&&(O=a6(O)),P&&+O==0&&v!=="+"&&(P=!1),b=(P?v==="("?v:s:v==="-"||v==="("?"":v)+b,R=(S==="s"?Hp[8+Pp/3]:"")+R+(P&&v==="("?")":""),E){for(N=-1,L=O.length;++NB||B>57){R=(B===46?r+O.slice(N+1):O.slice(N))+R,O=O.slice(0,N);break}}}d&&!x&&(O=e(O,1/0));var F=b.length+O.length+R.length,k=F>1)+b+O+R+k.slice(F);break;default:O=k+b+O+R;break}return i(O)}return D.toString=function(){return l+""},D}function p(l,f){var h=c((l=Eo(l),l.type="f",l)),v=Math.max(-8,Math.min(8,Math.floor(ra(f)/3)))*3,m=Math.pow(10,-v),x=Hp[8+v/3];return function(y){return h(m*y)+x}}return{format:c,formatPrefix:p}}var Do,Kp,Xp;s6({thousands:",",grouping:[3],currency:["$",""]});function s6(t){return Do=o6(t),Kp=Do.format,Xp=Do.formatPrefix,Do}function c6(t){return Math.max(0,-ra(Math.abs(t)))}function u6(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ra(e)/3)))*3-ra(Math.abs(t)))}function l6(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ra(e)-ra(t))+1}function f6(t,e,a,n){var r=Cm(t,e,a),i;switch(n=Eo(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(i=u6(r,o))&&(n.precision=i),Xp(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=l6(r,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=c6(r))&&(n.precision=i-(n.type==="%")*2);break}}return Kp(n)}function p6(t){var e=t.domain;return t.ticks=function(a){var n=e();return xm(n[0],n[n.length-1],a??10)},t.tickFormat=function(a,n){var r=e();return f6(r[0],r[r.length-1],a??10,n)},t.nice=function(a){a==null&&(a=10);var n=e(),r=0,i=n.length-1,o=n[r],s=n[i],u,c,p=10;for(s0;){if(c=A0(o,s,a),c===u)return n[r]=o,n[i]=s,e(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;u=c}return t},t}function $0(){var t=Qm();return t.copy=function(){return Jm(t,$0())},Sm.apply(t,arguments),p6(t)}var h6=[[-1,0,0],[1,0,0],[0,-1,0],[0,1,0],[0,0,-1],[0,0,1]],qp=[[8,7,11,3],[9,1,10,5],[4,9,0,8],[2,11,6,10],[0,3,2,1],[4,5,6,7]],Oo=[[0,1],[1,3],[2,3],[0,2],[4,5],[5,7],[6,7],[4,6],[0,4],[1,5],[3,7],[2,6]],Yp=[0,1,0,1,0,1,0,1,2,2,2,2],at=[[1,2],[1,2],[0,2],[0,2],[0,1],[0,1]],Me=new Float64Array(3),bo=new Float64Array(3),Ke=new Float64Array(3),wr=new Float64Array(3),_r=new Float64Array(3),Mo=new Float64Array(3),H0=new Float64Array(16);function K0(t,e){t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeSize,t.fillStyle=e.fontColor,t.font=`${e.fontStyle} ${e.fontSize}px ${e.fontFamily}`}function Jp(t){const e=[],a=[];for(let n=0;n<3;n++){const r=$0().domain([t[n*2],t[n*2+1]]);e[n]=r.ticks(5);const i=r.tickFormat(5);a[n]=e[n].map(i)}return{ticks:e,tickStrings:a}}function g6(t,e){e.classHierarchy.push("vtkCubeAxesActorHelper"),t.setRenderable=a=>{e.renderable!==a&&(e.renderable=a,e.tmActor.addTexture(e.renderable.getTmTexture()),e.tmActor.setProperty(a.getProperty()),e.tmActor.setParentProp(a),t.modified())},t.createPolyDataForOneLabel=(a,n,r,i,o,s,u)=>{const c=e.renderable.get_tmAtlas().get(a);if(!c)return;const p=e.renderable.getTextPolyData().getPoints().getData(),l=e.lastSize;Me[0]=p[n*3],Me[1]=p[n*3+1],Me[2]=p[n*3+2],_e(Ke,Me,r),Ke[0]+=.1,_e(bo,Ke,i),ln(_r,bo,Me),Ke[0]-=.1,Ke[1]+=.1,_e(bo,Ke,i),ln(Mo,bo,Me);for(let v=0;v<3;v++)_r[v]/=.5*.1*l[0],Mo[v]/=.5*.1*l[1];let f=u.ptIdx,h=u.cellIdx;Me[0]=p[n*3],Me[1]=p[n*3+1],Me[2]=p[n*3+2],o[0]<-.5?Yt(Ke,_r,o[0]*s-c.width):o[0]>.5?Yt(Ke,_r,o[0]*s):Yt(Ke,_r,o[0]*s-c.width/2),Hi(Me,Me,Ke),Yt(Ke,Mo,o[1]*s-c.height/2),Hi(Me,Me,Ke),u.points[f*3]=Me[0],u.points[f*3+1]=Me[1],u.points[f*3+2]=Me[2],u.tcoords[f*2]=c.tcoords[0],u.tcoords[f*2+1]=c.tcoords[1],f++,Yt(Ke,_r,c.width),Hi(Me,Me,Ke),u.points[f*3]=Me[0],u.points[f*3+1]=Me[1],u.points[f*3+2]=Me[2],u.tcoords[f*2]=c.tcoords[2],u.tcoords[f*2+1]=c.tcoords[3],f++,Yt(Ke,Mo,c.height),Hi(Me,Me,Ke),u.points[f*3]=Me[0],u.points[f*3+1]=Me[1],u.points[f*3+2]=Me[2],u.tcoords[f*2]=c.tcoords[4],u.tcoords[f*2+1]=c.tcoords[5],f++,Yt(Ke,_r,c.width),ln(Me,Me,Ke),u.points[f*3]=Me[0],u.points[f*3+1]=Me[1],u.points[f*3+2]=Me[2],u.tcoords[f*2]=c.tcoords[6],u.tcoords[f*2+1]=c.tcoords[7],f++,u.polys[h*4]=3,u.polys[h*4+1]=f-4,u.polys[h*4+2]=f-3,u.polys[h*4+3]=f-2,h++,u.polys[h*4]=3,u.polys[h*4+1]=f-4,u.polys[h*4+2]=f-2,u.polys[h*4+3]=f-1,u.ptIdx+=4,u.cellIdx+=2},t.updateTexturePolyData=()=>{const a=e.camera.getCompositeProjectionMatrix(e.lastAspectRatio,-1,1);We(a,a);const n=e.renderable.getTextValues().length,r=n*4,i=n*2,o=new Float64Array(r*3),s=new Uint16Array(i*4),u=new Float32Array(r*2);Et(H0,a);const c={ptIdx:0,cellIdx:0,polys:s,points:o,tcoords:u};let p=0,l=0,f=0;const h=e.renderable.getTextPolyData().getPoints().getData(),v=e.renderable.getTextValues();for(;p{(e.lastSize[0]!==a[0]||e.lastSize[1]!==a[1])&&(e.lastSize[0]=a[0],e.lastSize[1]=a[1],e.lastAspectRatio=a[0]/a[1],e.forceUpdate=!0),e.camera=n,t.updateTexturePolyData()}}var d6=A.newInstance((t,e,a={renderable:null})=>{Object.assign(e,{},a),A.obj(t,e),e.tmPolyData=Je.newInstance(),e.tmMapper=dn.newInstance(),e.tmMapper.setInputData(e.tmPolyData),e.tmActor=hn.newInstance({parentProp:t}),e.tmActor.setMapper(e.tmMapper),A.setGet(t,e,["renderable"]),A.get(t,e,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),e.forceUpdate=!1,e.lastRedrawTime={},A.obj(e.lastRedrawTime,{mtime:0}),e.lastRebuildTime={},A.obj(e.lastRebuildTime,{mtime:0}),e.lastSize=[-1,-1],e.lastTickBounds=[],g6(t,e)},"vtkCubeAxesActorHelper");function v6(t,e){e.classHierarchy.push("vtkCubeAxesActor"),t.setCamera=n=>{e.camera!==n&&(e.cameraModifiedSub&&(e.cameraModifiedSub.unsubscribe(),e.cameraModifiedSub=null),e.camera=n,n&&(e.cameraModifiedSub=n.onModified(t.update)),t.update(),t.modified())},t.computeFacesToDraw=()=>{const n=e.camera.getViewMatrix();We(n,n);let r=!1;const i=de.getDiagonalLength(e.dataBounds),o=Math.sin(e.faceVisibilityAngle*Math.PI/180);for(let s=0;s<6;s++){let u=!1;const c=Math.floor(s/2),p=(c+1)%3,l=(c+2)%3;e.dataBounds[p*2]!==e.dataBounds[p*2+1]&&e.dataBounds[l*2]!==e.dataBounds[l*2+1]&&(Me[c]=e.dataBounds[s]-.1*i*h6[s][c],Me[p]=.5*(e.dataBounds[p*2]+e.dataBounds[p*2+1]),Me[l]=.5*(e.dataBounds[l*2]+e.dataBounds[l*2+1]),_e(Ke,Me,n),Me[c]=e.dataBounds[s],_e(wr,Me,n),ln(Ke,wr,Ke),fn(Ke,Ke),u=Ke[2]>o,e.camera.getParallelProjection()||(fn(wr,wr),u=Xi(wr,Ke)>o)),u!==e.lastFacesToDraw[s]&&(e.lastFacesToDraw[s]=u,r=!0)}return r},t.updatePolyData=(n,r,i)=>{let o=0,s=0;o+=8;let u=0;for(let h=0;h<12;h++)r[h]>0&&u++;if(s+=u,e.gridLines)for(let h=0;h<6;h++)n[h]&&(o+=i[at[h][0]].length*2+i[at[h][1]].length*2,s+=i[at[h][0]].length+i[at[h][1]].length);const c=new Float64Array(o*3),p=new Uint32Array(s*3);let l=0,f=0;for(let h=0;h<2;h++)for(let v=0;v<2;v++)for(let m=0;m<2;m++)c[l*3]=e.dataBounds[m],c[l*3+1]=e.dataBounds[2+v],c[l*3+2]=e.dataBounds[4+h],l++;for(let h=0;h<12;h++)r[h]>0&&(p[f*3]=2,p[f*3+1]=Oo[h][0],p[f*3+2]=Oo[h][1],f++);if(e.gridLines){for(let h=0;h<6;h++)if(n[h]){const v=Math.floor(h/2);let m=i[at[h][0]];for(let x=0;x{let s=0;for(let h=0;h<12;h++)r[h]===1&&(s+=2,s+=i[Yp[h]].length);const u=e.polyData.getPoints().getData(),c=new Float64Array(s*3);let p=0,l=0,f=0;for(let h=0;h<6;h++)if(n[h])for(let v=0;v<4;v++){const m=qp[h][v];if(r[m]===1){const x=Yp[m],y=Oo[m][0]*3,d=Oo[m][1]*3;c[p*3]=.5*(u[y]+u[d]),c[p*3+1]=.5*(u[y+1]+u[d+1]),c[p*3+2]=.5*(u[y+2]+u[d+2]),p++;const g=Math.floor(h/2);c[p*3+g]=e.dataBounds[h],c[p*3+at[h][0]]=.5*(e.dataBounds[at[h][0]*2]+e.dataBounds[at[h][0]*2+1]),c[p*3+at[h][1]]=.5*(e.dataBounds[at[h][1]*2]+e.dataBounds[at[h][1]*2+1]),p++,e.textValues[l]=e.axisLabels[x],l++;const C=(x+1)%3,S=(x+2)%3,T=i[x],w=o[x];e.tickCounts[f]=T.length;for(let _=0;_{if(!e.camera)return;const n=t.computeFacesToDraw(),r=e.lastFacesToDraw;let i=!1;for(let o=0;o<6;o++)e.dataBounds[o]!==e.lastTickBounds[o]&&(i=!0,e.lastTickBounds[o]=e.dataBounds[o]);if(n||i||e.forceUpdate){const o=new Array(12).fill(0);for(let u=0;u<6;u++)if(r[u])for(let c=0;c<4;c++)o[qp[u][c]]++;const s=e.generateTicks(e.dataBounds);t.updatePolyData(r,o,s.ticks),t.updateTextData(r,o,s.ticks,s.tickStrings),(i||e.forceUpdate)&&t.updateTextureAtlas(s.tickStrings)}e.forceUpdate=!1},t.updateTextureAtlas=n=>{e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left",e._tmAtlas.clear();let r=0,i=1;for(let o=0;o<3;o++){if(!e._tmAtlas.has(e.axisLabels[o])){K0(e.tmContext,e.axisTextStyle);const s=e.tmContext.measureText(e.axisLabels[o]),u={height:s.actualBoundingBoxAscent+2,startingHeight:i,width:s.width+2,textStyle:e.axisTextStyle};e._tmAtlas.set(e.axisLabels[o],u),i+=u.height,r{o.tcoords=[0,(i-o.startingHeight-o.height)/i,o.width/r,(i-o.startingHeight-o.height)/i,o.width/r,(i-o.startingHeight)/i,0,(i-o.startingHeight)/i]}),e.tmCanvas.width=r,e.tmCanvas.height=i,e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left",e.tmContext.clearRect(0,0,r,i),e._tmAtlas.forEach((o,s)=>{K0(e.tmContext,o.textStyle),e.tmContext.fillText(s,1,o.startingHeight+o.height-1)}),e.tmTexture.setCanvas(e.tmCanvas),e.tmTexture.modified()},t.onModified(()=>{e.forceUpdate=!0,t.update()}),t.setTickTextStyle=n=>{e.tickTextStyle={...e.tickTextStyle,...n},t.modified()},t.setAxisTextStyle=n=>{e.axisTextStyle={...e.axisTextStyle,...n},t.modified()},t.get_tmAtlas=()=>e._tmAtlas,t.computeBounds=()=>{t.update(),de.setBounds(e.bounds,e.gridActor.getBounds()),de.scaleAboutCenter(e.bounds,e.boundsScaleFactor,e.boundsScaleFactor,e.boundsScaleFactor)};const a=t.setProperty;t.setProperty=n=>{const r=a(n);return e.gridActor.setProperty(n),r}}function y6(t,e,a){return{boundsScaleFactor:1.3,camera:null,dataBounds:[...de.INIT_BOUNDS],faceVisibilityAngle:8,gridLines:!0,axisLabels:null,axisTitlePixelOffset:35,tickLabelPixelOffset:12,generateTicks:Jp,...a,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif",...a==null?void 0:a.axisTextStyle},tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif",...a==null?void 0:a.tickTextStyle}}}function Zp(t,e,a={}){hn.extend(t,e,y6(t,e,a)),e.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],e.axisLabels=["X-Axis","Y-Axis","Z-Axis"],e.tickCounts=[],e.textValues=[],e.lastTickBounds=[],e.tmCanvas=document.createElement("canvas"),e.tmContext=e.tmCanvas.getContext("2d"),e._tmAtlas=new Map,e.tmTexture=k0.newInstance({resizable:!0}),e.tmTexture.setInterpolate(!1),t.getProperty().setDiffuse(0),t.getProperty().setAmbient(1),e.gridMapper=dn.newInstance(),e.polyData=Je.newInstance(),e.gridMapper.setInputData(e.polyData),e.gridActor=hn.newInstance(),e.gridActor.setMapper(e.gridMapper),e.gridActor.setProperty(t.getProperty()),e.gridActor.setParentProp(t),e.textPolyData=Je.newInstance(),A.setGet(t,e,["axisTitlePixelOffset","boundsScaleFactor","faceVisibilityAngle","gridLines","tickLabelPixelOffset","generateTicks"]),A.setGetArray(t,e,["dataBounds"],6),A.setGetArray(t,e,["axisLabels"],3),A.get(t,e,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","tickCounts","gridActor"]),v6(t,e)}var m6=A.newInstance(Zp,"vtkCubeAxesActor"),X0={newInstance:m6,extend:Zp,newCubeAxesActorHelper:d6,defaultGenerateTicks:Jp};function x6(t,e){e.classHierarchy.push("vtkOpenGLCubeAxesActor"),t.buildPass=a=>{a&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.CubeAxesActorHelper.getRenderable()||e.CubeAxesActorHelper.setRenderable(e.renderable),t.prepareNodes(),t.addMissingNode(e.CubeAxesActorHelper.getTmActor()),t.addMissingNode(e.renderable.getGridActor()),t.removeUnusedNodes())},t.opaquePass=(a,n)=>{if(a){const r=e._openGLRenderer?e._openGLRenderer.getRenderable().getActiveCamera():null,i=e._openGLRenderer.getTiledSizeAndOrigin();e.CubeAxesActorHelper.updateAPISpecificData([i.usize,i.vsize],r,e._openGLRenderWindow.getRenderable())}}}var C6={};function S6(t,e,a={}){Object.assign(e,C6,a),Ct.extend(t,e,a),e.CubeAxesActorHelper=X0.newCubeAxesActorHelper(),x6(t,e)}var T6=qe(S6,"vtkOpenGLCubeAxesActor");ct("vtkCubeAxesActor",T6);var{vtkErrorMacro:w6}=A;function _6(t,e){e.classHierarchy.push("vtkShader"),t.compile=()=>{let a=e.context.VERTEX_SHADER;if(!e.source||!e.source.length||e.shaderType==="Unknown")return!1;switch(e.handle!==0&&(e.context.deleteShader(e.handle),e.handle=0),e.shaderType){case"Fragment":a=e.context.FRAGMENT_SHADER;break;default:a=e.context.VERTEX_SHADER;break}if(e.handle=e.context.createShader(a),e.context.shaderSource(e.handle,e.source),e.context.compileShader(e.handle),!e.context.getShaderParameter(e.handle,e.context.COMPILE_STATUS)){const n=e.context.getShaderInfoLog(e.handle);return w6(`Error compiling shader '${e.source}': ${n}`),e.context.deleteShader(e.handle),e.handle=0,!1}return!0},t.cleanup=()=>{e.shaderType==="Unknown"||e.handle===0||(e.context.deleteShader(e.handle),e.handle=0,e.dirty=!0)}}var E6={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function Qp(t,e,a={}){Object.assign(e,E6,a),A.obj(t,e),A.setGet(t,e,["shaderType","source","error","handle","context"]),_6(t,e)}var D6=A.newInstance(Qp,"vtkShader"),q0={newInstance:D6,extend:Qp},{vtkErrorMacro:yn}=A;function O6(t,e,a,n){const r=typeof a=="string"?a:a.join(` +`),i=n===!1?e:new RegExp(e,"g"),o=t.replace(i,r);return{replace:o!==r,result:o}}function b6(t,e){e.classHierarchy.push("vtkShaderProgram"),t.compileShader=()=>e.vertexShader.compile()?e.fragmentShader.compile()?!t.attachShader(e.vertexShader)||!t.attachShader(e.fragmentShader)?(yn(e.error),0):t.link()?(t.setCompiled(!0),1):(yn(`Links failed: ${e.error}`),0):(yn(e.fragmentShader.getSource().split(` `).map((a,n)=>`${n}: ${a}`).join(` -`)),vn(e.fragmentShader.getError()),0):(vn(e.vertexShader.getSource().split(` +`)),yn(e.fragmentShader.getError()),0):(yn(e.vertexShader.getSource().split(` `).map((a,n)=>`${n}: ${a}`).join(` -`)),vn(e.vertexShader.getError()),0),t.cleanup=()=>{e.shaderType==="Unknown"||e.handle===0||(t.release(),e.vertexShaderHandle!==0&&(e.context.detachShader(e.handle,e.vertexShaderHandle),e.vertexShaderHandle=0),e.fragmentShaderHandle!==0&&(e.context.detachShader(e.handle,e.fragmentShaderHandle),e.fragmentShaderHandle=0),e.context.deleteProgram(e.handle),e.handle=0,t.setCompiled(!1))},t.bind=()=>!e.linked&&!t.link()?!1:(e.context.useProgram(e.handle),t.setBound(!0),!0),t.isBound=()=>!!e.bound,t.release=()=>{e.context.useProgram(null),t.setBound(!1)},t.setContext=a=>{e.vertexShader.setContext(a),e.fragmentShader.setContext(a),e.geometryShader.setContext(a)},t.link=()=>{if(e.linked)return!0;if(e.handle===0)return e.error="Program has not been initialized, and/or does not have shaders.",!1;if(e.uniformLocs={},e.context.linkProgram(e.handle),!e.context.getProgramParameter(e.handle,e.context.LINK_STATUS)){const n=e.context.getProgramInfoLog(e.handle);return vn(`Error linking shader ${n}`),e.handle=0,!1}return t.setLinked(!0),e.attributeLocs={},!0},t.setUniformMatrix=(a,n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;const i=new Float32Array(n);return e.context.uniformMatrix4fv(r,!1,i),!0},t.setUniformMatrix3x3=(a,n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;const i=new Float32Array(n);return e.context.uniformMatrix3fv(r,!1,i),!0},t.setUniformf=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1f(r,n),!0)},t.setUniformfv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1fv(r,n),!0)},t.setUniformi=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1i(r,n),!0)},t.setUniformiv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1iv(r,n),!0)},t.setUniform2f=(a,n,r)=>{const i=t.findUniform(a);if(i===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(r===void 0)throw new RangeError("Invalid number of values for array");return e.context.uniform2f(i,n,r),!0},t.setUniform2fv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform2fv(r,n),!0)},t.setUniform2i=(a,n,r)=>{const i=t.findUniform(a);if(i===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(r===void 0)throw new RangeError("Invalid number of values for array");return e.context.uniform2i(i,n,r),!0},t.setUniform2iv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform2iv(r,n),!0)},t.setUniform3f=(a,n,r,i)=>{const o=t.findUniform(a);if(o===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(i===void 0)throw new RangeError("Invalid number of values for array");return e.context.uniform3f(o,n,r,i),!0},t.setUniform3fArray=(a,n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(!Array.isArray(n)||n.length!==3)throw new RangeError("Invalid number of values for array");return e.context.uniform3f(r,n[0],n[1],n[2]),!0},t.setUniform3fv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform3fv(r,n),!0)},t.setUniform3i=function(a){const n=t.findUniform(a);if(n===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform3iv(r,n),!0)},t.setUniform4f=function(a){const n=t.findUniform(a);if(n===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform4fv(r,n),!0)},t.setUniform4i=function(a){const n=t.findUniform(a);if(n===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform4iv(r,n),!0)},t.findUniform=a=>{if(!a||!e.linked)return-1;let n=e.uniformLocs[a];return n!==void 0?n:(n=e.context.getUniformLocation(e.handle,a),n===null?(e.error=`Uniform ${a} not found in current shader program.`,e.uniformLocs[a]=-1,-1):(e.uniformLocs[a]=n,n))},t.isUniformUsed=a=>{if(!a)return!1;let n=e.uniformLocs[a];return n!==void 0?n!==null:e.linked?(n=e.context.getUniformLocation(e.handle,a),e.uniformLocs[a]=n,n!==null):(vn("attempt to find uniform when the shader program is not linked"),!1)},t.isAttributeUsed=a=>{if(!a)return!1;if(a in e.attributeLocs)return!0;if(!e.linked)return vn("attempt to find uniform when the shader program is not linked"),!1;const n=e.context.getAttribLocation(e.handle,a);return n===-1?!1:(e.attributeLocs[a]=n,!0)},t.attachShader=a=>{if(a.getHandle()===0)return e.error="Shader object was not initialized, cannot attach it.",!1;if(a.getShaderType()==="Unknown")return e.error="Shader object is of type Unknown and cannot be used.",!1;if(e.handle===0){const n=e.context.createProgram();if(n===0)return e.error="Could not create shader program.",!1;e.handle=n,e.linked=!1}return a.getShaderType()==="Vertex"&&(e.vertexShaderHandle!==0&&e.context.detachShader(e.handle,e.vertexShaderHandle),e.vertexShaderHandle=a.getHandle()),a.getShaderType()==="Fragment"&&(e.fragmentShaderHandle!==0&&e.context.detachShader(e.handle,e.fragmentShaderHandle),e.fragmentShaderHandle=a.getHandle()),e.context.attachShader(e.handle,a.getHandle()),t.setLinked(!1),!0},t.detachShader=a=>{if(a.getHandle()===0)return e.error="shader object was not initialized, cannot attach it.",!1;if(a.getShaderType()==="Unknown")return e.error="Shader object is of type Unknown and cannot be used.",!1;switch(e.handle===0&&(e.error="This shader program has not been initialized yet."),a.getShaderType()){case"Vertex":return e.vertexShaderHandle!==a.getHandle()?(e.error="The supplied shader was not attached to this program.",!1):(e.context.detachShader(e.handle,a.getHandle()),e.vertexShaderHandle=0,e.linked=!1,!0);case"Fragment":return e.fragmentShaderHandle!==a.getHandle()?(e.error="The supplied shader was not attached to this program.",!1):(e.context.detachShader(e.handle,a.getHandle()),e.fragmentShaderHandle=0,e.linked=!1,!0);default:return!1}},t.setContext=a=>{e.context=a,e.vertexShader.setContext(a),e.fragmentShader.setContext(a),e.geometryShader.setContext(a)},t.setLastCameraMTime=a=>{e.lastCameraMTime=a}}const E9={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 Xp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,E9,a),e.attributesLocs={},e.uniformLocs={},e.vertexShader=P0.newInstance(),e.vertexShader.setShaderType("Vertex"),e.fragmentShader=P0.newInstance(),e.fragmentShader.setShaderType("Fragment"),e.geometryShader=P0.newInstance(),e.geometryShader.setShaderType("Geometry"),V.obj(t,e),V.get(t,e,["lastCameraMTime"]),V.setGet(t,e,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),_9(t,e)}var Q={newInstance:V.newInstance(Xp,"vtkShaderProgram"),extend:Xp,substitute:w9};function D9(t,e){e.classHierarchy.push("vtkOpenGLVertexArrayObject"),t.exposedMethod=()=>{},t.initialize=()=>{e.instancingExtension=null,e._openGLRenderWindow.getWebgl2()||(e.instancingExtension=e.context.getExtension("ANGLE_instanced_arrays")),!e.forceEmulation&&e._openGLRenderWindow&&e._openGLRenderWindow.getWebgl2()?(e.extension=null,e.supported=!0,e.handleVAO=e.context.createVertexArray()):(e.extension=e.context.getExtension("OES_vertex_array_object"),!e.forceEmulation&&e.extension?(e.supported=!0,e.handleVAO=e.extension.createVertexArrayOES()):e.supported=!1)},t.isReady=()=>e.handleVAO!==0||e.supported===!1,t.bind=()=>{if(t.isReady()||t.initialize(),t.isReady()&&e.supported)e.extension?e.extension.bindVertexArrayOES(e.handleVAO):e.context.bindVertexArray(e.handleVAO);else if(t.isReady()){const a=e.context;for(let n=0;n0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(o.index+c,1):a.vertexAttribDivisor(o.index+c,1))}}}},t.release=()=>{if(t.isReady()&&e.supported)e.extension?e.extension.bindVertexArrayOES(null):e.context.bindVertexArray(null);else if(t.isReady()){const a=e.context;for(let n=0;n0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(o.index+c,0):a.vertexAttribDivisor(o.index+c,0)),a.disableVertexAttribArray(o.index+c)}}}},t.shaderProgramChanged=()=>{t.release(),e.handleVAO&&(e.extension?e.extension.deleteVertexArrayOES(e.handleVAO):e.context.deleteVertexArray(e.handleVAO)),e.handleVAO=0,e.handleProgram=0},t.releaseGraphicsResources=()=>{t.shaderProgramChanged(),e.handleVAO&&(e.extension?e.extension.deleteVertexArrayOES(e.handleVAO):e.context.deleteVertexArray(e.handleVAO)),e.handleVAO=0,e.supported=!0,e.handleProgram=0},t.addAttributeArray=(a,n,r,i,o,s,c,l)=>t.addAttributeArrayWithDivisor(a,n,r,i,o,s,c,l,0,!1),t.addAttributeArrayWithDivisor=(a,n,r,i,o,s,c,l,p,u)=>{if(!a||!a.isBound()||n.getHandle()===0||n.getType()!==Dn.ARRAY_BUFFER||(e.handleProgram===0&&(e.handleProgram=a.getHandle()),t.isReady()||t.initialize(),!t.isReady()||e.handleProgram!==a.getHandle()))return!1;const f=e.context,h={};if(h.name=r,h.index=f.getAttribLocation(e.handleProgram,r),h.offset=i,h.stride=o,h.type=s,h.size=c,h.normalize=l,h.isMatrix=u,h.divisor=p,h.Index===-1)return!1;if(n.bind(),f.enableVertexAttribArray(h.index),f.vertexAttribPointer(h.index,h.size,h.type,h.normalize,h.stride,h.offset),p>0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(h.index,1):f.vertexAttribDivisor(h.index,1)),h.buffer=n.getHandle(),!e.supported){let d=!1;for(let v=0;v{const u=t.addAttributeArrayWithDivisor(a,n,r,i,o,s,c,l,p,!0);if(!u)return u;const f=e.context,h=f.getAttribLocation(e.handleProgram,r);for(let d=1;d0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(h+d,1):f.vertexAttribDivisor(h+d,1));return!0},t.removeAttributeArray=a=>{if(!t.isReady()||e.handleProgram===0)return!1;if(!e.supported)for(let n=0;n{e._openGLRenderWindow!==a&&(t.releaseGraphicsResources(),e._openGLRenderWindow=a,e.context=null,a&&(e.context=e._openGLRenderWindow.getContext()))}}const O9={forceEmulation:!1,handleVAO:0,handleProgram:0,supported:!0,buffers:null,context:null};function qp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,O9,a),e.buffers=[],V.obj(t,e),V.get(t,e,["supported"]),V.setGet(t,e,["forceEmulation"]),D9(t,e)}var ja={newInstance:V.newInstance(qp,"vtkOpenGLVertexArrayObject"),extend:qp};const yn={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6};function b9(t,e){e.classHierarchy.push("vtkOpenGLHelper"),t.setOpenGLRenderWindow=a=>{e.context=a.getContext(),e.program.setContext(e.context),e.VAO.setOpenGLRenderWindow(a),e.CABO.setOpenGLRenderWindow(a)},t.releaseGraphicsResources=a=>{e.VAO.releaseGraphicsResources(),e.CABO.releaseGraphicsResources(),e.CABO.setElementCount(0)},t.drawArrays=(a,n,r,i)=>{if(e.CABO.getElementCount()){const o=t.getOpenGLMode(r),s=t.haveWideLines(a,n),c=e.context,l=c.getParameter(c.DEPTH_WRITEMASK);e.pointPicking&&c.depthMask(!1),o===c.LINES&&s?(t.updateShaders(a,n,i),c.drawArraysInstanced(o,0,e.CABO.getElementCount(),2*Math.ceil(n.getProperty().getLineWidth()))):(c.lineWidth(n.getProperty().getLineWidth()),t.updateShaders(a,n,i),c.drawArrays(o,0,e.CABO.getElementCount()),c.lineWidth(1));const u=(o===c.POINTS?1:0)||(o===c.LINES?2:3);return e.pointPicking&&c.depthMask(l),e.CABO.getElementCount()/u}return 0},t.getOpenGLMode=a=>{if(e.pointPicking)return e.context.POINTS;const n=e.primitiveType;return a===Jt.POINTS||n===yn.Points?e.context.POINTS:a===Jt.WIREFRAME||n===yn.Lines||n===yn.TrisEdges||n===yn.TriStripsEdges?e.context.LINES:e.context.TRIANGLES},t.haveWideLines=(a,n)=>n.getProperty().getLineWidth()>1?!(e.CABO.getOpenGLRenderWindow()&&e.CABO.getOpenGLRenderWindow().getHardwareMaximumLineWidth()>=n.getProperty().getLineWidth()):!1,t.getNeedToRebuildShaders=(a,n,r)=>!!(r.getNeedToRebuildShaders(t,a,n)||t.getProgram()===0||t.getShaderSourceTime().getMTime(){if(t.getNeedToRebuildShaders(a,n,r)){const i={Vertex:null,Fragment:null,Geometry:null};r.buildShaders(i,a,n);const o=e.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgramArray(i.Vertex,i.Fragment,i.Geometry);o!==t.getProgram()&&(t.setProgram(o),t.getVAO().releaseGraphicsResources()),t.getShaderSourceTime().modified()}else e.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgram(t.getProgram());t.getVAO().bind(),r.setMapperShaderParameters(t,a,n),r.setPropertyShaderParameters(t,a,n),r.setCameraShaderParameters(t,a,n),r.setLightingShaderParameters(t,a,n),r.invokeShaderCallbacks(t,a,n)},t.setMapperShaderParameters=(a,n,r)=>{if(t.haveWideLines(a,n)){t.getProgram().setUniform2f("viewportSize",r.usize,r.vsize);const i=parseFloat(n.getProperty().getLineWidth()),o=i/2;t.getProgram().setUniformf("lineWidthStepSize",i/Math.ceil(i)),t.getProgram().setUniformf("halfLineWidth",o)}e.primitiveType===yn.Points||n.getProperty().getRepresentation()===Jt.POINTS?t.getProgram().setUniformf("pointSize",n.getProperty().getPointSize()):e.pointPicking&&t.getProgram().setUniformf("pointSize",t.getPointPickingPrimitiveSize())},t.replaceShaderPositionVC=(a,n,r)=>{let i=a.Vertex;i=Q.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform float pointSize;"]).result,i=Q.substitute(i,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = pointSize;"],!1).result,t.getOpenGLMode(r.getProperty().getRepresentation())===e.context.LINES&&t.haveWideLines(n,r)&&(i=Q.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform vec2 viewportSize;","uniform float lineWidthStepSize;","uniform float halfLineWidth;"]).result,i=Q.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),a.Vertex=i},t.getPointPickingPrimitiveSize=()=>e.primitiveType===yn.Points?2:e.primitiveType===yn.Lines?4:6,t.getAllocatedGPUMemoryInBytes=()=>t.getCABO().getAllocatedGPUMemoryInBytes()}const M9={context:null,program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0,pointPicking:!1};function Yp(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,M9,a),V.obj(t,e),e.shaderSourceTime={},V.obj(e.shaderSourceTime),e.attributeUpdateTime={},V.obj(e.attributeUpdateTime),V.setGet(t,e,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType","pointPicking"]),e.program=Q.newInstance(),e.VAO=ja.newInstance(),e.CABO=x9.newInstance(),b9(t,e)}var jt={newInstance:V.newInstance(Yp),extend:Yp,primTypes:yn};const Wa={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},me={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5};var Jp={Wrap:Wa,Filter:me};const Zp=new Float32Array(1),N9=new Int32Array(Zp.buffer);function R9(t){Zp[0]=t;const e=N9[0];let a=e>>16&32768,n=e>>12&2047;const r=e>>23&255;return r<103?a:r>142?(a|=31744,a|=(r===255?0:1)&&e&8388607,a):r<113?(n|=2048,a|=(n>>114-r)+(n>>113-r&1),a):(a|=r-112<<10|n>>1,a+=n&1,a)}function L9(t){const e=(t&32768)>>15,a=(t&31744)>>10,n=t&1023;return a===0?(e?-1:1)*2**-14*(n/2**10):a===31?n?NaN:(e?-1:1)*(1/0):(e?-1:1)*2**(a-15)*(1+n/2**10)}var ea={fromHalf:L9,toHalf:R9};function F9(){try{const n=new Int16Array([0,32767]),r=[1,1],i=document.createElement("canvas");i.width=4,i.height=4;const o=i.getContext("webgl2");if(!o)return!1;const s=o.getExtension("EXT_texture_norm16");if(!s)return!1;const c=`#version 300 es - void main() { - gl_PointSize = ${4 .toFixed(1)}; - gl_Position = vec4(0, 0, 0, 1); - } - `,l=`#version 300 es - precision highp float; - precision highp int; - precision highp sampler2D; - - uniform sampler2D u_image; - - out vec4 color; - - void main() { - vec4 intColor = texture(u_image, gl_PointCoord.xy); - color = vec4(vec3(intColor.rrr), 1); - } - `,p=o.createShader(o.VERTEX_SHADER);if(o.shaderSource(p,c),o.compileShader(p),!o.getShaderParameter(p,o.COMPILE_STATUS))return!1;const u=o.createShader(o.FRAGMENT_SHADER);if(o.shaderSource(u,l),o.compileShader(u),!o.getShaderParameter(u,o.COMPILE_STATUS))return!1;const f=o.createProgram();if(o.attachShader(f,p),o.attachShader(f,u),o.linkProgram(f),!o.getProgramParameter(f,o.LINK_STATUS))return!1;const h=o.createTexture();o.bindTexture(o.TEXTURE_2D,h),o.texImage2D(o.TEXTURE_2D,0,s.R16_SNORM_EXT,2,1,0,o.RED,o.SHORT,n),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.useProgram(f),o.drawArrays(o.POINTS,0,1);const d=new Uint8Array(4);o.readPixels(r[0],r[1],1,1,o.RGBA,o.UNSIGNED_BYTE,d);const[v,m,x]=d,y=o.getExtension("WEBGL_lose_context");return y&&y.loseContext(),v===m&&m===x&&v!==0}catch{return!1}}let z0;function k9(){return z0===void 0&&(z0=F9()),z0}const{Wrap:bn,Filter:ht}=Jp,{VtkDataTypes:ke}=pe,{vtkDebugMacro:j0,vtkErrorMacro:wr,vtkWarningMacro:Qp,requiredParam:Ve}=Dt,{toHalf:V9}=ea;function A9(t,e){e.classHierarchy.push("vtkOpenGLTexture");function a(){return{internalFormat:e.internalFormat,format:e.format,openGLDataType:e.openGLDataType,width:e.width,height:e.height}}t.render=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(d?e._openGLRenderWindow=d:(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow")),e.context=e._openGLRenderWindow.getContext(),e.renderable.getInterpolate()?(e.generateMipmap?t.setMinificationFilter(ht.LINEAR_MIPMAP_LINEAR):t.setMinificationFilter(ht.LINEAR),t.setMagnificationFilter(ht.LINEAR)):(t.setMinificationFilter(ht.NEAREST),t.setMagnificationFilter(ht.NEAREST)),e.renderable.getRepeat()&&(t.setWrapR(bn.REPEAT),t.setWrapS(bn.REPEAT),t.setWrapT(bn.REPEAT)),e.renderable.getInputData()&&e.renderable.setImage(null),!e.handle||e.renderable.getMTime()>e.textureBuildTime.getMTime()){if(e.renderable.getImageBitmap()!==null&&(e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(ht.LINEAR_MIPMAP_LINEAR)),e.renderable.getImageBitmap()&&e.renderable.getImageLoaded()&&(t.create2DFromImageBitmap(e.renderable.getImageBitmap()),t.activate(),t.sendParameters(),e.textureBuildTime.modified())),e.renderable.getImage()!==null&&(e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(ht.LINEAR_MIPMAP_LINEAR)),e.renderable.getImage()&&e.renderable.getImageLoaded()&&(t.create2DFromImage(e.renderable.getImage()),t.activate(),t.sendParameters(),e.textureBuildTime.modified())),e.renderable.getCanvas()!==null){e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(ht.LINEAR_MIPMAP_LINEAR));const m=e.renderable.getCanvas();t.create2DFromRaw({width:m.width,height:m.height,numComps:4,dataType:ke.UNSIGNED_CHAR,data:m,flip:!0}),t.activate(),t.sendParameters(),e.textureBuildTime.modified()}if(e.renderable.getJsImageData()!==null){const m=e.renderable.getJsImageData();e.renderable.getInterpolate()&&(e.generateMipmap=!0,t.setMinificationFilter(ht.LINEAR_MIPMAP_LINEAR)),t.create2DFromRaw({width:m.width,height:m.height,numComps:4,dataType:ke.UNSIGNED_CHAR,data:m.data,flip:!0}),t.activate(),t.sendParameters(),e.textureBuildTime.modified()}const v=e.renderable.getInputData(0);if(v&&v.getPointData().getScalars()){const m=v.getExtent(),x=v.getPointData().getScalars(),y=[];for(let g=0;g{if(!((e.minificationFilter===ht.LINEAR||e.magnificationFilter===ht.LINEAR)&&!k9()))return e.oglNorm16Ext};t.destroyTexture=()=>{t.deactivate(),e.context&&e.handle&&e.context.deleteTexture(e.handle),e._prevTexParams=null,e.handle=0,e.numberOfDimensions=0,e.target=0,e.components=0,e.width=0,e.height=0,e.depth=0,t.resetFormatAndType()},t.createTexture=()=>{e.handle||(e.handle=e.context.createTexture(),e.target&&(e.context.bindTexture(e.target,e.handle),e.context.texParameteri(e.target,e.context.TEXTURE_MIN_FILTER,t.getOpenGLFilterMode(e.minificationFilter)),e.context.texParameteri(e.target,e.context.TEXTURE_MAG_FILTER,t.getOpenGLFilterMode(e.magnificationFilter)),e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_S,t.getOpenGLWrapMode(e.wrapS)),e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_T,t.getOpenGLWrapMode(e.wrapT)),e._openGLRenderWindow.getWebgl2()&&e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_R,t.getOpenGLWrapMode(e.wrapR)),e.context.bindTexture(e.target,null)))},t.getTextureUnit=()=>e._openGLRenderWindow?e._openGLRenderWindow.getTextureUnitForTexture(t):-1,t.activate=()=>{e._openGLRenderWindow.activateTexture(t),t.bind()},t.deactivate=()=>{e._openGLRenderWindow&&e._openGLRenderWindow.deactivateTexture(t)},t.releaseGraphicsResources=d=>{d&&e.handle&&(d.activateTexture(t),d.deactivateTexture(t),e.context.deleteTexture(e.handle),e._prevTexParams=null,e.handle=0,e.numberOfDimensions=0,e.target=0,e.internalFormat=0,e.format=0,e.openGLDataType=0,e.components=0,e.width=0,e.height=0,e.depth=0,e.allocatedGPUMemoryInBytes=0),e.shaderProgram&&(e.shaderProgram.releaseGraphicsResources(d),e.shaderProgram=null)},t.bind=()=>{e.context.bindTexture(e.target,e.handle),e.autoParameters&&t.getMTime()>e.sendParametersTime.getMTime()&&t.sendParameters()},t.isBound=()=>{let d=!1;if(e.context&&e.handle){let v=0;switch(e.target){case e.context.TEXTURE_2D:v=e.context.TEXTURE_BINDING_2D;break;default:Qp("impossible case");break}d=e.context.getIntegerv(v)===e.handle}return d},t.sendParameters=()=>{e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_S,t.getOpenGLWrapMode(e.wrapS)),e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_T,t.getOpenGLWrapMode(e.wrapT)),e._openGLRenderWindow.getWebgl2()&&e.context.texParameteri(e.target,e.context.TEXTURE_WRAP_R,t.getOpenGLWrapMode(e.wrapR)),e.context.texParameteri(e.target,e.context.TEXTURE_MIN_FILTER,t.getOpenGLFilterMode(e.minificationFilter)),e.context.texParameteri(e.target,e.context.TEXTURE_MAG_FILTER,t.getOpenGLFilterMode(e.magnificationFilter)),e._openGLRenderWindow.getWebgl2()&&(e.context.texParameteri(e.target,e.context.TEXTURE_BASE_LEVEL,e.baseLevel),e.context.texParameteri(e.target,e.context.TEXTURE_MAX_LEVEL,e.maxLevel)),e.sendParametersTime.modified()},t.getInternalFormat=(d,v)=>(e._forceInternalFormat||(e.internalFormat=t.getDefaultInternalFormat(d,v)),e.internalFormat||j0(`Unable to find suitable internal format for T=${d} NC= ${v}`),[e.context.R32F,e.context.RG32F,e.context.RGB32F,e.context.RGBA32F].includes(e.internalFormat)&&!e.context.getExtension("OES_texture_float_linear")&&Qp("Failed to load OES_texture_float_linear. Texture filtering is not available for *32F internal formats."),e.internalFormat),t.getDefaultInternalFormat=(d,v)=>{let m=0;return m=e._openGLRenderWindow.getDefaultTextureInternalFormat(d,v,n(),t.useHalfFloat()),m||(m||(j0("Unsupported internal texture type!"),j0(`Unable to find suitable internal format for T=${d} NC= ${v}`)),m)},t.useHalfFloat=()=>e.enableUseHalfFloat&&e.canUseHalfFloat,t.setInternalFormat=d=>{e._forceInternalFormat=!0,d!==e.internalFormat&&(e.internalFormat=d,t.modified())},t.getFormat=(d,v)=>(e.format=t.getDefaultFormat(d,v),e.format),t.getDefaultFormat=(d,v)=>{if(e._openGLRenderWindow.getWebgl2())switch(v){case 1:return e.context.RED;case 2:return e.context.RG;case 3:return e.context.RGB;case 4:return e.context.RGBA;default:return e.context.RGB}else switch(v){case 1:return e.context.LUMINANCE;case 2:return e.context.LUMINANCE_ALPHA;case 3:return e.context.RGB;case 4:return e.context.RGBA;default:return e.context.RGB}},t.resetFormatAndType=()=>{e._prevTexParams=null,e.format=0,e.internalFormat=0,e._forceInternalFormat=!1,e.openGLDataType=0},t.getDefaultDataType=d=>{const v=t.useHalfFloat();if(e._openGLRenderWindow.getWebgl2())switch(d){case ke.UNSIGNED_CHAR:return e.context.UNSIGNED_BYTE;case(n()&&!v&&ke.SHORT):return e.context.SHORT;case(n()&&!v&&ke.UNSIGNED_SHORT):return e.context.UNSIGNED_SHORT;case(v&&ke.SHORT):return e.context.HALF_FLOAT;case(v&&ke.UNSIGNED_SHORT):return e.context.HALF_FLOAT;case ke.FLOAT:case ke.VOID:default:return e.context.FLOAT}switch(d){case ke.UNSIGNED_CHAR:return e.context.UNSIGNED_BYTE;case ke.FLOAT:case ke.VOID:default:if(e.context.getExtension("OES_texture_float")&&e.context.getExtension("OES_texture_float_linear"))return e.context.FLOAT;{const m=e.context.getExtension("OES_texture_half_float");if(m&&e.context.getExtension("OES_texture_half_float_linear"))return m.HALF_FLOAT_OES}return e.context.UNSIGNED_BYTE}},t.getOpenGLDataType=function(d){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(!e.openGLDataType||v)&&(e.openGLDataType=t.getDefaultDataType(d)),e.openGLDataType},t.getShiftAndScale=()=>{let d=0,v=1;switch(e.openGLDataType){case e.context.BYTE:v=127.5,d=v-128;break;case e.context.UNSIGNED_BYTE:v=255,d=0;break;case e.context.SHORT:v=32767.5,d=v-32768;break;case e.context.UNSIGNED_SHORT:v=65536,d=0;break;case e.context.INT:v=21474836475e-1,d=v-2147483648;break;case e.context.UNSIGNED_INT:v=4294967295,d=0;break;case e.context.FLOAT:}return{shift:d,scale:v}},t.getOpenGLFilterMode=d=>{switch(d){case ht.NEAREST:return e.context.NEAREST;case ht.LINEAR:return e.context.LINEAR;case ht.NEAREST_MIPMAP_NEAREST:return e.context.NEAREST_MIPMAP_NEAREST;case ht.NEAREST_MIPMAP_LINEAR:return e.context.NEAREST_MIPMAP_LINEAR;case ht.LINEAR_MIPMAP_NEAREST:return e.context.LINEAR_MIPMAP_NEAREST;case ht.LINEAR_MIPMAP_LINEAR:return e.context.LINEAR_MIPMAP_LINEAR;default:return e.context.NEAREST}},t.getOpenGLWrapMode=d=>{switch(d){case bn.CLAMP_TO_EDGE:return e.context.CLAMP_TO_EDGE;case bn.REPEAT:return e.context.REPEAT;case bn.MIRRORED_REPEAT:return e.context.MIRRORED_REPEAT;default:return e.context.CLAMP_TO_EDGE}};function r(d){const[v,m,x,y,g,C]=d;return[m-v+1,y-x+1,C-g+1]}function i(d){const[v,m,x]=r(d);return v*m*x}function o(d,v,m,x,y){const[g,C,S,T,w,_]=m,[E,D]=v,O=E*D;let M=y;for(let N=w;N<=_;N++){const R=N*O;for(let B=S;B<=T;B++){const I=R+B*E;for(let P=I+g,L=I+C;P<=L;P++,M++)x[M]=d[P]}}}function s(d,v){const x=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:null)||d.constructor,y=v.reduce((T,w)=>T+i(w),0),g=new x(y),C=[e.width,e.height,e.depth];let S=0;return v.forEach(T=>{o(d,C,T,g,S),S+=i(T)}),g}t.updateArrayDataTypeForGL=function(d,v){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];const y=[];let g=e.width*e.height*e.components;m&&(g*=e.depth);const C=!!x.length;if(d!==ke.FLOAT&&e.openGLDataType===e.context.FLOAT)for(let T=0;Tg?v[T].subarray(0,g):v[T];y.push(new Float32Array(w))}else y.push(null);if(d!==ke.UNSIGNED_CHAR&&e.openGLDataType===e.context.UNSIGNED_BYTE)for(let T=0;Tg?v[T].subarray(0,g):v[T];y.push(new Uint8Array(w))}else y.push(null);let S=!1;if(e._openGLRenderWindow.getWebgl2())S=e.openGLDataType===e.context.HALF_FLOAT;else{const T=e.context.getExtension("OES_texture_half_float");S=T&&e.openGLDataType===T.HALF_FLOAT_OES}if(S)for(let T=0;T=x&&(I=x-1);const P=R-B,L=1-P;B=B*m*y,I=I*m*y;for(let k=0;k=m&&(K=m-1);const Y=j-H;H*=y,K*=y;for(let q=0;q0&&arguments[0]!==void 0?arguments[0]:{};if(t.getOpenGLDataType(x,!0),t.getInternalFormat(x,m),t.getFormat(x,m),!e.internalFormat||!e.format||!e.openGLDataType)return wr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_2D,e.components=m,e.width=d,e.height=v,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind();const C=[y],S=t.updateArrayDataTypeForGL(x,C),T=c(S);return e.context.pixelStorei(e.context.UNPACK_FLIP_Y_WEBGL,g),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),l(x)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),T[0]!=null&&e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,T[0])):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,T[0]),e.generateMipmap&&e.context.generateMipmap(e.target),g&&e.context.pixelStorei(e.context.UNPACK_FLIP_Y_WEBGL,!1),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*m*e._openGLRenderWindow.getDefaultTextureByteSize(x,n(),t.useHalfFloat()),t.deactivate(),!0},t.createCubeFromRaw=function(){let{width:d=Ve("width"),height:v=Ve("height"),numComps:m=Ve("numComps"),dataType:x=Ve("dataType"),data:y=Ve("data")}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(t.getOpenGLDataType(x),t.getInternalFormat(x,m),t.getFormat(x,m),!e.internalFormat||!e.format||!e.openGLDataType)return wr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_CUBE_MAP,e.components=m,e.width=d,e.height=v,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),e.maxLevel=y.length/6-1,t.createTexture(),t.bind();const g=t.updateArrayDataTypeForGL(x,y),C=c(g),S=[];let T=e.width,w=e.height;for(let _=0;_=1&&O>=1;){let M=null;E<=e.maxLevel&&(M=S[6*E+_]),l(x)?M!=null&&e.context.texSubImage2D(e.context.TEXTURE_CUBE_MAP_POSITIVE_X+_,E,0,0,D,O,e.format,e.openGLDataType,M):e.context.texImage2D(e.context.TEXTURE_CUBE_MAP_POSITIVE_X+_,E,e.internalFormat,D,O,0,e.format,e.openGLDataType,M),E++,D/=2,O/=2}}return e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*m*e._openGLRenderWindow.getDefaultTextureByteSize(x,n(),t.useHalfFloat()),t.deactivate(),!0},t.createDepthFromRaw=function(){let{width:d=Ve("width"),height:v=Ve("height"),dataType:m=Ve("dataType"),data:x=Ve("data")}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t.getOpenGLDataType(m),e.format=e.context.DEPTH_COMPONENT,e._openGLRenderWindow.getWebgl2()?m===ke.FLOAT?e.internalFormat=e.context.DEPTH_COMPONENT32F:e.internalFormat=e.context.DEPTH_COMPONENT16:e.internalFormat=e.context.DEPTH_COMPONENT,!e.internalFormat||!e.format||!e.openGLDataType?(wr("Failed to determine texture parameters."),!1):(e.target=e.context.TEXTURE_2D,e.components=1,e.width=d,e.height=v,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind(),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),l(m)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),x!=null&&e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,x)):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,x),e.generateMipmap&&e.context.generateMipmap(e.target),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*e.components*e._openGLRenderWindow.getDefaultTextureByteSize(m,n(),t.useHalfFloat()),t.deactivate(),!0)},t.create2DFromImage=d=>{if(t.getOpenGLDataType(ke.UNSIGNED_CHAR),t.getInternalFormat(ke.UNSIGNED_CHAR,4),t.getFormat(ke.UNSIGNED_CHAR,4),!e.internalFormat||!e.format||!e.openGLDataType)return wr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_2D,e.components=4,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind();const v=!e._openGLRenderWindow.getWebgl2()&&(!Fa(d.width)||!Fa(d.height));let m=d,x=d.width,y=d.height,g=!0;const C=window.chrome;if(v||C){const S=new OffscreenCanvas(Pt(d.width),Pt(d.height));x=S.width,y=S.height;const T=S.getContext("2d");T.translate(0,S.height),T.scale(1,-1),T.drawImage(d,0,0,d.width,d.height,0,0,S.width,S.height),m=S,g=!1}return e.width=x,e.height=y,e.context.pixelStorei(e.context.UNPACK_FLIP_Y_WEBGL,g),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),l(ke.UNSIGNED_CHAR)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,m)):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,m),e.generateMipmap&&e.context.generateMipmap(e.target),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*e.components*e._openGLRenderWindow.getDefaultTextureByteSize(ke.UNSIGNED_CHAR,n(),t.useHalfFloat()),t.deactivate(),!0},t.create2DFromImageBitmap=d=>(t.getOpenGLDataType(ke.UNSIGNED_CHAR),t.getInternalFormat(ke.UNSIGNED_CHAR,4),t.getFormat(ke.UNSIGNED_CHAR,4),!e.internalFormat||!e.format||!e.openGLDataType?(wr("Failed to determine texture parameters."),!1):(e.target=e.context.TEXTURE_2D,e.components=4,e.depth=1,e.numberOfDimensions=2,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind(),e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),e.width=d.width,e.height=d.height,l(ke.UNSIGNED_CHAR)?(e.context.texStorage2D(e.target,1,e.internalFormat,e.width,e.height),e.context.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.openGLDataType,d)):e.context.texImage2D(e.target,0,e.internalFormat,e.width,e.height,0,e.format,e.openGLDataType,d),e.generateMipmap&&e.context.generateMipmap(e.target),e.allocatedGPUMemoryInBytes=e.width*e.height*e.depth*e.components*e._openGLRenderWindow.getDefaultTextureByteSize(ke.UNSIGNED_CHAR,n(),t.useHalfFloat()),t.deactivate(),!0));function p(d,v,m){const x=new Array(m),y=new Array(m);for(let g=0;g2048||y<-2048||y>2048)return!1}return!0}function f(d,v,m,x){t.getOpenGLDataType(d);const y=u(v,m)||x;let g=!1;if(e._openGLRenderWindow.getWebgl2())g=e.openGLDataType===e.context.FLOAT&&e.context.getExtension("OES_texture_float_linear")===null&&y||e.openGLDataType===e.context.HALF_FLOAT;else{const C=e.context.getExtension("OES_texture_half_float");g=C&&e.openGLDataType===C.HALF_FLOAT_OES}e.canUseHalfFloat=g&&y}function h(d,v){const m=d.getNumberOfComponents(),x=d.getDataType(),y=d.getData(),g=new Array(m),C=new Array(m);for(let T=0;T0&&arguments[0]!==void 0?arguments[0]:{};return t.create2DFilterableFromDataArray({width:d,height:v,dataArray:pe.newInstance({numberOfComponents:m,dataType:x,values:y,ranges:C}),preferSizeOverAccuracy:g})},t.create2DFilterableFromDataArray=function(){let{width:d=Ve("width"),height:v=Ve("height"),dataArray:m=Ve("dataArray"),preferSizeOverAccuracy:x=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{numComps:y,dataType:g,data:C}=h(m,x);t.create2DFromRaw({width:d,height:v,numComps:y,dataType:g,data:C})},t.updateVolumeInfoForGL=(d,v)=>{var y,g;let m=!1;const x=t.useHalfFloat();(!((y=e.volumeInfo)!=null&&y.scale)||!((g=e.volumeInfo)!=null&&g.offset))&&(e.volumeInfo={scale:new Array(v),offset:new Array(v)});for(let C=0;C0&&arguments[0]!==void 0?arguments[0]:{},S=y,T=g;if(!t.updateVolumeInfoForGL(S,x)&&T){const N=d*v*m,R=structuredClone(e.volumeInfo),B=new Float32Array(N*x);e.volumeInfo.offset=R.offset,e.volumeInfo.scale=R.scale;let I=0;const P=R.scale.map(L=>1/L);for(let L=0;L0,_=!w||!hs(e._prevTexParams,a()),E=[T],D=!0,O=t.updateArrayDataTypeForGL(S,E,D,_?[]:C),M=c(O);if(e.context.pixelStorei(e.context.UNPACK_ALIGNMENT,1),_)l(S)?(e.context.texStorage3D(e.target,1,e.internalFormat,e.width,e.height,e.depth),M[0]!=null&&e.context.texSubImage3D(e.target,0,0,0,0,e.width,e.height,e.depth,e.format,e.openGLDataType,M[0])):e.context.texImage3D(e.target,0,e.internalFormat,e.width,e.height,e.depth,0,e.format,e.openGLDataType,M[0]),e._prevTexParams=a();else if(w){const N=M[0];let R=0;for(let B=0;B0&&arguments[0]!==void 0?arguments[0]:{};return t.create3DFilterableFromDataArray({width:d,height:v,depth:m,dataArray:pe.newInstance({numberOfComponents:x,dataType:y,values:g,ranges:S}),preferSizeOverAccuracy:C,updatedExtents:T})},t.create3DFilterableFromDataArray=function(){let{width:d=Ve("width"),height:v=Ve("height"),depth:m=Ve("depth"),dataArray:x=Ve("dataArray"),preferSizeOverAccuracy:y=!1,updatedExtents:g=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{numComps:C,dataType:S,data:T,scaleOffsets:w}=h(x,y),_=[],E=[];for(let Z=0;Z{Z[re]=ae},N=ke.UNSIGNED_CHAR;if(S===ke.UNSIGNED_CHAR)for(let Z=0;Z{Z[re]=(ae-ee)/F}):(N=ke.UNSIGNED_CHAR,M=(Z,re,ae,ee,F)=>{Z[re]=255*(ae-ee)/F});if(t.getOpenGLDataType(N),t.getInternalFormat(N,C),t.getFormat(N,C),!e.internalFormat||!e.format||!e.openGLDataType)return wr("Failed to determine texture parameters."),!1;e.target=e.context.TEXTURE_2D,e.components=C,e.depth=1,e.numberOfDimensions=2;let R=e.context.getParameter(e.context.MAX_TEXTURE_SIZE);R>4096&&(N===ke.FLOAT||C>=3)&&(R=4096);let B=1,I=1;D>R*R&&(B=Math.ceil(Math.sqrt(D/(R*R))),I=B);let P=Math.sqrt(D)/B;P=Pt(P);const L=Math.floor(P*B/d),k=Math.ceil(m/L),A=Pt(v*k/I);e.width=P,e.height=A,e._openGLRenderWindow.activateTexture(t),t.createTexture(),t.bind(),e.volumeInfo.xreps=L,e.volumeInfo.yreps=k,e.volumeInfo.xstride=B,e.volumeInfo.ystride=I,e.volumeInfo.offset=O.offset,e.volumeInfo.scale=O.scale;let j;const H=P*A*C;N===ke.FLOAT?j=new Float32Array(H):j=new Uint8Array(H);let K=0;const Y=Math.floor(d/B),q=Math.floor(v/I);for(let Z=0;Z{e._openGLRenderWindow!==d&&(t.releaseGraphicsResources(),e._openGLRenderWindow=d,e.context=null,d&&(e.context=e._openGLRenderWindow.getContext()))},t.getMaximumTextureSize=d=>d&&d.isCurrent()?d.getIntegerv(d.MAX_TEXTURE_SIZE):-1,t.enableUseHalfFloat=d=>{e.enableUseHalfFloat=d}}const B9={_openGLRenderWindow:null,_forceInternalFormat:!1,_prevTexParams:null,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:bn.CLAMP_TO_EDGE,wrapT:bn.CLAMP_TO_EDGE,wrapR:bn.CLAMP_TO_EDGE,minificationFilter:ht.NEAREST,magnificationFilter:ht.NEAREST,minLOD:-1e3,maxLOD:1e3,baseLevel:0,maxLevel:1e3,generateMipmap:!1,oglNorm16Ext:null,allocatedGPUMemoryInBytes:0,enableUseHalfFloat:!0,canUseHalfFloat:!1};function eh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,B9,a),Ct.extend(t,e,a),e.sendParametersTime={},ut(e.sendParametersTime,{mtime:0}),e.textureBuildTime={},ut(e.textureBuildTime,{mtime:0}),Ca(t,e,["format","openGLDataType"]),pt(t,e,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap","oglNorm16Ext"]),At(t,e,["width","height","volumeInfo","components","handle","target","allocatedGPUMemoryInBytes"]),Ta(t,e,["openGLRenderWindow"]),A9(t,e)}const th=Je(eh,"vtkOpenGLTexture");var Re={newInstance:th,extend:eh,...Jp};st("vtkTexture",th);var W0=`//VTK::System::Dec +`)),yn(e.vertexShader.getError()),0),t.cleanup=()=>{e.shaderType==="Unknown"||e.handle===0||(t.release(),e.vertexShaderHandle!==0&&(e.context.detachShader(e.handle,e.vertexShaderHandle),e.vertexShaderHandle=0),e.fragmentShaderHandle!==0&&(e.context.detachShader(e.handle,e.fragmentShaderHandle),e.fragmentShaderHandle=0),e.context.deleteProgram(e.handle),e.handle=0,t.setCompiled(!1))},t.bind=()=>!e.linked&&!t.link()?!1:(e.context.useProgram(e.handle),t.setBound(!0),!0),t.isBound=()=>!!e.bound,t.release=()=>{e.context.useProgram(null),t.setBound(!1)},t.setContext=a=>{e.vertexShader.setContext(a),e.fragmentShader.setContext(a),e.geometryShader.setContext(a)},t.link=()=>e.linked?!0:e.handle===0?(e.error="Program has not been initialized, and/or does not have shaders.",!1):(e.uniformLocs={},e.context.linkProgram(e.handle),e.context.getProgramParameter(e.handle,e.context.LINK_STATUS)?(t.setLinked(!0),e.attributeLocs={},!0):(yn(`Error linking shader ${e.context.getProgramInfoLog(e.handle)}`),e.handle=0,!1)),t.setUniformMatrix=(a,n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;const i=new Float32Array(n);return e.context.uniformMatrix4fv(r,!1,i),!0},t.setUniformMatrix3x3=(a,n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;const i=new Float32Array(n);return e.context.uniformMatrix3fv(r,!1,i),!0},t.setUniformf=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1f(r,n),!0)},t.setUniformfv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1fv(r,n),!0)},t.setUniformi=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1i(r,n),!0)},t.setUniformiv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform1iv(r,n),!0)},t.setUniform2f=(a,n,r)=>{const i=t.findUniform(a);if(i===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(r===void 0)throw new RangeError("Invalid number of values for array");return e.context.uniform2f(i,n,r),!0},t.setUniform2fv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform2fv(r,n),!0)},t.setUniform2i=(a,n,r)=>{const i=t.findUniform(a);if(i===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(r===void 0)throw new RangeError("Invalid number of values for array");return e.context.uniform2i(i,n,r),!0},t.setUniform2iv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform2iv(r,n),!0)},t.setUniform3f=(a,n,r,i)=>{const o=t.findUniform(a);if(o===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(i===void 0)throw new RangeError("Invalid number of values for array");return e.context.uniform3f(o,n,r,i),!0},t.setUniform3fArray=(a,n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;if(!Array.isArray(n)||n.length!==3)throw new RangeError("Invalid number of values for array");return e.context.uniform3f(r,n[0],n[1],n[2]),!0},t.setUniform3fv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform3fv(r,n),!0)},t.setUniform3i=(a,...n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;let i=n;if(i.length===1&&Array.isArray(i[0])&&(i=i[0]),i.length!==3)throw new RangeError("Invalid number of values for array");return e.context.uniform3i(r,i[0],i[1],i[2]),!0},t.setUniform3iv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform3iv(r,n),!0)},t.setUniform4f=(a,...n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;let i=n;if(i.length===1&&Array.isArray(i[0])&&(i=i[0]),i.length!==4)throw new RangeError("Invalid number of values for array");return e.context.uniform4f(r,i[0],i[1],i[2],i[3]),!0},t.setUniform4fv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform4fv(r,n),!0)},t.setUniform4i=(a,...n)=>{const r=t.findUniform(a);if(r===-1)return e.error=`Could not set uniform ${a} . No such uniform.`,!1;let i=n;if(i.length===1&&Array.isArray(i[0])&&(i=i[0]),i.length!==4)throw new RangeError("Invalid number of values for array");return e.context.uniform4i(r,i[0],i[1],i[2],i[3]),!0},t.setUniform4iv=(a,n)=>{const r=t.findUniform(a);return r===-1?(e.error=`Could not set uniform ${a} . No such uniform.`,!1):(e.context.uniform4iv(r,n),!0)},t.findUniform=a=>{if(!a||!e.linked)return-1;let n=e.uniformLocs[a];return n!==void 0?n:(n=e.context.getUniformLocation(e.handle,a),n===null?(e.error=`Uniform ${a} not found in current shader program.`,e.uniformLocs[a]=-1,-1):(e.uniformLocs[a]=n,n))},t.isUniformUsed=a=>{if(!a)return!1;let n=e.uniformLocs[a];return n!==void 0?n!==null:e.linked?(n=e.context.getUniformLocation(e.handle,a),e.uniformLocs[a]=n,n!==null):(yn("attempt to find uniform when the shader program is not linked"),!1)},t.isAttributeUsed=a=>{if(!a)return!1;if(a in e.attributeLocs)return!0;if(!e.linked)return yn("attempt to find uniform when the shader program is not linked"),!1;const n=e.context.getAttribLocation(e.handle,a);return n===-1?!1:(e.attributeLocs[a]=n,!0)},t.attachShader=a=>{if(a.getHandle()===0)return e.error="Shader object was not initialized, cannot attach it.",!1;if(a.getShaderType()==="Unknown")return e.error="Shader object is of type Unknown and cannot be used.",!1;if(e.handle===0){const n=e.context.createProgram();if(n===0)return e.error="Could not create shader program.",!1;e.handle=n,e.linked=!1}return a.getShaderType()==="Vertex"&&(e.vertexShaderHandle!==0&&e.context.detachShader(e.handle,e.vertexShaderHandle),e.vertexShaderHandle=a.getHandle()),a.getShaderType()==="Fragment"&&(e.fragmentShaderHandle!==0&&e.context.detachShader(e.handle,e.fragmentShaderHandle),e.fragmentShaderHandle=a.getHandle()),e.context.attachShader(e.handle,a.getHandle()),t.setLinked(!1),!0},t.detachShader=a=>{if(a.getHandle()===0)return e.error="shader object was not initialized, cannot attach it.",!1;if(a.getShaderType()==="Unknown")return e.error="Shader object is of type Unknown and cannot be used.",!1;switch(e.handle===0&&(e.error="This shader program has not been initialized yet."),a.getShaderType()){case"Vertex":return e.vertexShaderHandle!==a.getHandle()?(e.error="The supplied shader was not attached to this program.",!1):(e.context.detachShader(e.handle,a.getHandle()),e.vertexShaderHandle=0,e.linked=!1,!0);case"Fragment":return e.fragmentShaderHandle!==a.getHandle()?(e.error="The supplied shader was not attached to this program.",!1):(e.context.detachShader(e.handle,a.getHandle()),e.fragmentShaderHandle=0,e.linked=!1,!0);default:return!1}},t.setContext=a=>{e.context=a,e.vertexShader.setContext(a),e.fragmentShader.setContext(a),e.geometryShader.setContext(a)},t.setLastCameraMTime=a=>{e.lastCameraMTime=a}}var M6={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 e1(t,e,a={}){Object.assign(e,M6,a),e.attributesLocs={},e.uniformLocs={},e.vertexShader=q0.newInstance(),e.vertexShader.setShaderType("Vertex"),e.fragmentShader=q0.newInstance(),e.fragmentShader.setShaderType("Fragment"),e.geometryShader=q0.newInstance(),e.geometryShader.setShaderType("Geometry"),A.obj(t,e),A.get(t,e,["lastCameraMTime"]),A.setGet(t,e,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),b6(t,e)}var Z={newInstance:A.newInstance(e1,"vtkShaderProgram"),extend:e1,substitute:O6},Rn={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},t1={ObjectType:Rn},{ObjectType:No}=t1,N6={};function R6(t,e){e.classHierarchy.push("vtkOpenGLBufferObject");function a(s){switch(s){case No.ELEMENT_ARRAY_BUFFER:return e.context.ELEMENT_ARRAY_BUFFER;case No.TEXTURE_BUFFER:if("TEXTURE_BUFFER"in e.context)return e.context.TEXTURE_BUFFER;case No.ARRAY_BUFFER:default:return e.context.ARRAY_BUFFER}}let n=null,r=null,i=!0,o="";t.getType=()=>n,t.setType=s=>{n=s},t.getHandle=()=>r,t.isReady=()=>i===!1,t.generateBuffer=s=>{const u=a(s);return r===null&&(r=e.context.createBuffer(),n=s),a(n)===u},t.upload=(s,u)=>t.generateBuffer(u)?(e.context.bindBuffer(a(n),r),e.context.bufferData(a(n),s,e.context.STATIC_DRAW),e.allocatedGPUMemoryInBytes=s.length*s.BYTES_PER_ELEMENT,i=!1,!0):(o="Trying to upload array buffer to incompatible buffer.",!1),t.bind=()=>r?(e.context.bindBuffer(a(n),r),!0):!1,t.release=()=>r?(e.context.bindBuffer(a(n),null),!0):!1,t.releaseGraphicsResources=()=>{r!==null&&(e.context.bindBuffer(a(n),null),e.context.deleteBuffer(r),r=null,e.allocatedGPUMemoryInBytes=0)},t.setOpenGLRenderWindow=s=>{e._openGLRenderWindow!==s&&(t.releaseGraphicsResources(),e._openGLRenderWindow=s,e.context=null,s&&(e.context=e._openGLRenderWindow.getContext()))},t.getError=()=>o}var L6={objectType:No.ARRAY_BUFFER,context:null,allocatedGPUMemoryInBytes:0};function n1(t,e,a={}){Object.assign(e,L6,a),A.obj(t,e),A.get(t,e,["_openGLRenderWindow","allocatedGPUMemoryInBytes"]),A.moveToProtected(t,e,["openGLRenderWindow"]),R6(t,e)}var F6=A.newInstance(n1),Ln={newInstance:F6,extend:n1,...N6,...t1};function Y0(t){let e=0,a=0;for(let r=0;r<3;++r){const i=t.getRange(r),o=i[1]-i[0];e+=o*o;const s=.5*(i[1]+i[0]);a+=s*s}const n=e>0&&(Math.abs(a)/e>1e6||Math.abs(Math.log10(e))>3||e===0&&a>1e6);if(n){const r=new Float64Array(3),i=new Float64Array(3);for(let o=0;o<3;++o){const s=t.getRange(o),u=s[1]-s[0];r[o]=.5*(s[1]+s[0]),i[o]=u>0?1/u:1}return{useShiftAndScale:n,coordShift:r,coordScale:i}}return{useShiftAndScale:n,coordShift:new Float32Array([0,0,0]),coordScale:new Float32Array([1,1,1])}}function r1(t,e){const a=new Float64Array(3);Ki(a,e);const n=new Float64Array(16);return Nl(n,Wn(),t,a),n}var{vtkErrorMacro:a1}=A;function k6(t,e){return t===null||e===null?!1:!(Fa(t,[0,0,0])&&Fa(e,[1,1,1]))}function A6(t,e){e.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),t.setType(Rn.ARRAY_BUFFER),t.createVBO=(a,n,r,i,o=null)=>{if(!a.getData()||!a.getData().length)return e.elementCount=0,0;e.blockSize=3,e.vertexOffset=0,e.normalOffset=0,e.tCoordOffset=0,e.tCoordComponents=0,e.colorComponents=0,e.colorOffset=0,e.customData=[];const s=i.points.getData();let u=null,c=null,p=null;const l=i.colors?i.colors.getNumberOfComponents():0,f=i.tcoords?i.tcoords.getNumberOfComponents():0;i.normals&&(e.normalOffset=4*e.blockSize,e.blockSize+=3,u=i.normals.getData()),i.customAttributes&&i.customAttributes.forEach(k=>{k&&(e.customData.push({data:k.getData(),offset:4*e.blockSize,components:k.getNumberOfComponents(),name:k.getName()}),e.blockSize+=k.getNumberOfComponents())}),i.tcoords&&(e.tCoordOffset=4*e.blockSize,e.tCoordComponents=f,e.blockSize+=f,c=i.tcoords.getData()),i.colors?(e.colorComponents=i.colors.getNumberOfComponents(),e.colorOffset=0,p=i.colors.getData(),e.colorBO||(e.colorBO=Ln.newInstance()),e.colorBO.setOpenGLRenderWindow(e._openGLRenderWindow)):e.colorBO=null,e.stride=4*e.blockSize;let h=0,v=0,m=0,x=0,y=0,d=0,g;const C={anythingToPoints(k,G,W,H){for(let X=0;X2)for(let X=0;X2){for(let X=0;X1?(k-1)*2:0},polysToWireframe(k,G){return k>2?k*2:0},stripsToWireframe(k,G){return k>2?k*4-6:0},polysToSurface(k,G){return k>2?(k-2)*3:0},stripsToSurface(k,G,W){return k>2?(k-2)*3:0}};let T=null,w=null;r===Jt.POINTS||n==="verts"?(T=C.anythingToPoints,w=S.anythingToPoints):r===Jt.WIREFRAME||n==="lines"?(T=C[`${n}ToWireframe`],w=S[`${n}ToWireframe`]):(T=C[`${n}ToSurface`],w=S[`${n}ToSurface`]);const _=a.getData(),E=_.length;let D=0;for(let k=0;k{y=G*H.components;for(let X=0;X{if(a!==null&&(a.constructor!==Float64Array||a.length!==3)){a1("Wrong type for coordShift, expected vec3 or null");return}if(n!==null&&(n.constructor!==Float64Array||n.length!==3)){a1("Wrong type for coordScale, expected vec3 or null");return}(e.coordShift===null||a===null||!Gl(a,e.coordShift))&&(e.coordShift=a),(e.coordScale===null||n===null||!Gl(n,e.coordScale))&&(e.coordScale=n),e.coordShiftAndScaleEnabled=k6(e.coordShift,e.coordScale),e.coordShiftAndScaleEnabled?e.inverseShiftAndScaleMatrix=r1(e.coordShift,e.coordScale):e.inverseShiftAndScaleMatrix=null}}var V6={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};function i1(t,e,a={}){Object.assign(e,V6,a),Ln.extend(t,e,a),A.setGet(t,e,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),A.get(t,e,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),A6(t,e)}var B6=A.newInstance(i1),U6={newInstance:B6,extend:i1};function G6(t,e){e.classHierarchy.push("vtkOpenGLVertexArrayObject"),t.exposedMethod=()=>{},t.initialize=()=>{e.instancingExtension=null,e._openGLRenderWindow.getWebgl2()||(e.instancingExtension=e.context.getExtension("ANGLE_instanced_arrays")),!e.forceEmulation&&e._openGLRenderWindow&&e._openGLRenderWindow.getWebgl2()?(e.extension=null,e.supported=!0,e.handleVAO=e.context.createVertexArray()):(e.extension=e.context.getExtension("OES_vertex_array_object"),!e.forceEmulation&&e.extension?(e.supported=!0,e.handleVAO=e.extension.createVertexArrayOES()):e.supported=!1)},t.isReady=()=>e.handleVAO!==0||e.supported===!1,t.bind=()=>{if(t.isReady()||t.initialize(),t.isReady()&&e.supported)e.extension?e.extension.bindVertexArrayOES(e.handleVAO):e.context.bindVertexArray(e.handleVAO);else if(t.isReady()){const a=e.context;for(let n=0;n0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(o.index+u,1):a.vertexAttribDivisor(o.index+u,1))}}}},t.release=()=>{if(t.isReady()&&e.supported)e.extension?e.extension.bindVertexArrayOES(null):e.context.bindVertexArray(null);else if(t.isReady()){const a=e.context;for(let n=0;n0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(o.index+u,0):a.vertexAttribDivisor(o.index+u,0)),a.disableVertexAttribArray(o.index+u)}}}},t.shaderProgramChanged=()=>{t.release(),e.handleVAO&&(e.extension?e.extension.deleteVertexArrayOES(e.handleVAO):e.context.deleteVertexArray(e.handleVAO)),e.handleVAO=0,e.handleProgram=0},t.releaseGraphicsResources=()=>{t.shaderProgramChanged(),e.handleVAO&&(e.extension?e.extension.deleteVertexArrayOES(e.handleVAO):e.context.deleteVertexArray(e.handleVAO)),e.handleVAO=0,e.supported=!0,e.handleProgram=0},t.addAttributeArray=(a,n,r,i,o,s,u,c)=>t.addAttributeArrayWithDivisor(a,n,r,i,o,s,u,c,0,!1),t.addAttributeArrayWithDivisor=(a,n,r,i,o,s,u,c,p,l)=>{if(!a||!a.isBound()||n.getHandle()===0||n.getType()!==Rn.ARRAY_BUFFER||(e.handleProgram===0&&(e.handleProgram=a.getHandle()),t.isReady()||t.initialize(),!t.isReady()||e.handleProgram!==a.getHandle()))return!1;const f=e.context,h={};if(h.name=r,h.index=f.getAttribLocation(e.handleProgram,r),h.offset=i,h.stride=o,h.type=s,h.size=u,h.normalize=c,h.isMatrix=l,h.divisor=p,h.Index===-1)return!1;if(n.bind(),f.enableVertexAttribArray(h.index),f.vertexAttribPointer(h.index,h.size,h.type,h.normalize,h.stride,h.offset),p>0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(h.index,1):f.vertexAttribDivisor(h.index,1)),h.buffer=n.getHandle(),!e.supported){let v=!1;for(let m=0;m{const l=t.addAttributeArrayWithDivisor(a,n,r,i,o,s,u,c,p,!0);if(!l)return l;const f=e.context,h=f.getAttribLocation(e.handleProgram,r);for(let v=1;v0&&(e.instancingExtension?e.instancingExtension.vertexAttribDivisorANGLE(h+v,1):f.vertexAttribDivisor(h+v,1));return!0},t.removeAttributeArray=a=>{if(!t.isReady()||e.handleProgram===0)return!1;if(!e.supported)for(let n=0;n{e._openGLRenderWindow!==a&&(t.releaseGraphicsResources(),e._openGLRenderWindow=a,e.context=null,a&&(e.context=e._openGLRenderWindow.getContext()))}}var I6={forceEmulation:!1,handleVAO:0,handleProgram:0,supported:!0,buffers:null,context:null};function o1(t,e,a={}){Object.assign(e,I6,a),e.buffers=[],A.obj(t,e),A.get(t,e,["supported"]),A.setGet(t,e,["forceEmulation"]),G6(t,e)}var P6=A.newInstance(o1,"vtkOpenGLVertexArrayObject"),$a={newInstance:P6,extend:o1},mn={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6};function z6(t,e){e.classHierarchy.push("vtkOpenGLHelper"),t.setOpenGLRenderWindow=a=>{e.context=a.getContext(),e.program.setContext(e.context),e.VAO.setOpenGLRenderWindow(a),e.CABO.setOpenGLRenderWindow(a)},t.releaseGraphicsResources=a=>{e.VAO.releaseGraphicsResources(),e.CABO.releaseGraphicsResources(),e.CABO.setElementCount(0)},t.drawArrays=(a,n,r,i)=>{if(e.CABO.getElementCount()){const o=t.getOpenGLMode(r),s=t.haveWideLines(a,n),u=e.context,c=u.getParameter(u.DEPTH_WRITEMASK);e.pointPicking&&u.depthMask(!1),o===u.LINES&&s?(t.updateShaders(a,n,i),u.drawArraysInstanced(o,0,e.CABO.getElementCount(),2*Math.ceil(n.getProperty().getLineWidth()))):(u.lineWidth(n.getProperty().getLineWidth()),t.updateShaders(a,n,i),u.drawArrays(o,0,e.CABO.getElementCount()),u.lineWidth(1));const p=(o===u.POINTS?1:0)||(o===u.LINES?2:3);return e.pointPicking&&u.depthMask(c),e.CABO.getElementCount()/p}return 0},t.getOpenGLMode=a=>{if(e.pointPicking)return e.context.POINTS;const n=e.primitiveType;return a===Jt.POINTS||n===mn.Points?e.context.POINTS:a===Jt.WIREFRAME||n===mn.Lines||n===mn.TrisEdges||n===mn.TriStripsEdges?e.context.LINES:e.context.TRIANGLES},t.haveWideLines=(a,n)=>n.getProperty().getLineWidth()>1?!(e.CABO.getOpenGLRenderWindow()&&e.CABO.getOpenGLRenderWindow().getHardwareMaximumLineWidth()>=n.getProperty().getLineWidth()):!1,t.getNeedToRebuildShaders=(a,n,r)=>!!(r.getNeedToRebuildShaders(t,a,n)||t.getProgram()===0||t.getShaderSourceTime().getMTime(){if(t.getNeedToRebuildShaders(a,n,r)){const i={Vertex:null,Fragment:null,Geometry:null};r.buildShaders(i,a,n);const o=e.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgramArray(i.Vertex,i.Fragment,i.Geometry);o!==t.getProgram()&&(t.setProgram(o),t.getVAO().releaseGraphicsResources()),t.getShaderSourceTime().modified()}else e.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgram(t.getProgram());t.getVAO().bind(),r.setMapperShaderParameters(t,a,n),r.setPropertyShaderParameters(t,a,n),r.setCameraShaderParameters(t,a,n),r.setLightingShaderParameters(t,a,n),r.invokeShaderCallbacks(t,a,n)},t.setMapperShaderParameters=(a,n,r)=>{if(t.haveWideLines(a,n)){t.getProgram().setUniform2f("viewportSize",r.usize,r.vsize);const i=parseFloat(n.getProperty().getLineWidth()),o=i/2;t.getProgram().setUniformf("lineWidthStepSize",i/Math.ceil(i)),t.getProgram().setUniformf("halfLineWidth",o)}e.primitiveType===mn.Points||n.getProperty().getRepresentation()===Jt.POINTS?t.getProgram().setUniformf("pointSize",n.getProperty().getPointSize()):e.pointPicking&&t.getProgram().setUniformf("pointSize",t.getPointPickingPrimitiveSize())},t.replaceShaderPositionVC=(a,n,r)=>{let i=a.Vertex;i=Z.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform float pointSize;"]).result,i=Z.substitute(i,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = pointSize;"],!1).result,t.getOpenGLMode(r.getProperty().getRepresentation())===e.context.LINES&&t.haveWideLines(n,r)&&(i=Z.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform vec2 viewportSize;","uniform float lineWidthStepSize;","uniform float halfLineWidth;"]).result,i=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),a.Vertex=i},t.getPointPickingPrimitiveSize=()=>e.primitiveType===mn.Points?2:e.primitiveType===mn.Lines?4:6,t.getAllocatedGPUMemoryInBytes=()=>t.getCABO().getAllocatedGPUMemoryInBytes()}var W6={context:null,program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0,pointPicking:!1};function s1(t,e,a={}){Object.assign(e,W6,a),A.obj(t,e),e.shaderSourceTime={},A.obj(e.shaderSourceTime),e.attributeUpdateTime={},A.obj(e.attributeUpdateTime),A.setGet(t,e,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType","pointPicking"]),e.program=Z.newInstance(),e.VAO=$a.newInstance(),e.CABO=U6.newInstance(),z6(t,e)}var j6=A.newInstance(s1),jt={newInstance:j6,extend:s1,primTypes:mn},J0=`//VTK::System::Dec /*========================================================================= @@ -129,7 +129,7 @@ void main() //VTK::Picking::Impl } -`,$a=`//VTK::System::Dec +`,Ha=`//VTK::System::Dec /*========================================================================= @@ -236,18 +236,69 @@ void main() //VTK::RenderPassFragmentShader::Impl } -`;function U9(t,e){t.replaceShaderCoincidentOffset=(a,n,r)=>{const i=t.getCoincidentParameters(n,r);if(i&&(i.factor!==0||i.offset!==0)){let o=a.Fragment;o=Q.substitute(o,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,e.context.getExtension("EXT_frag_depth")&&(i.factor!==0?(o=Q.substitute(o,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,o=Q.substitute(o,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):o=Q.substitute(o,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),e._openGLRenderWindow.getWebgl2()&&(i.factor!==0?(o=Q.substitute(o,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,o=Q.substitute(o,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):o=Q.substitute(o,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),a.Fragment=o}}}function G9(t,e){t.applyShaderReplacements=(a,n,r)=>{let i=null;if(n&&(i=n.ShaderReplacements),i)for(let o=0;o{t.getReplacedShaderTemplate(a,n,r),e.lastRenderPassShaderReplacement=e.currentRenderPass?e.currentRenderPass.getShaderReplacement():null,e.lastRenderPassShaderReplacement&&e.lastRenderPassShaderReplacement(a);const i=e.renderable.getViewSpecificProperties().OpenGL;t.applyShaderReplacements(a,i,!0),t.replaceShaderValues(a,n,r),t.applyShaderReplacements(a,i)},t.getReplacedShaderTemplate=(a,n,r)=>{const i=e.renderable.getViewSpecificProperties().OpenGL;t.getShaderTemplate(a,n,r);let o=a.Vertex;if(i){const l=i.VertexShaderCode;l!==void 0&&l!==""&&(o=l)}a.Vertex=o;let s=a.Fragment;if(i){const l=i.FragmentShaderCode;l!==void 0&&l!==""&&(s=l)}a.Fragment=s;let c=a.Geometry;if(i){const l=i.GeometryShaderCode;l!==void 0&&(c=l)}a.Geometry=c}}var mn={implementReplaceShaderCoincidentOffset:U9,implementBuildShadersWithReplacements:G9};const{FieldAssociations:$0}=dr,{primTypes:vt}=jt,{Representation:ta,Shading:nh}=pr,{ScalarMode:Eo}=gn,{Filter:rh,Wrap:ah}=Re,{vtkErrorMacro:_r}=Dt,I9={type:"StartEvent"},P9={type:"EndEvent"},{CoordinateSystem:z9}=Mf;function j9(t){const e=t.getSelector();return e?e.getCurrentPass():Nt.MIN_KNOWN_PASS-1}function W9(t,e){e.classHierarchy.push("vtkOpenGLPolyDataMapper"),t.buildPass=n=>{n&&(e.currentRenderPass=null,e.openGLActor=t.getFirstAncestorOfType("vtkOpenGLActor"),e._openGLRenderer=e.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),e.openGLCamera=e._openGLRenderer.getViewNodeFor(e._openGLRenderer.getRenderable().getActiveCamera(),e.openGLCamera))},t.translucentPass=(n,r)=>{n&&(e.currentRenderPass=r,t.render())},t.zBufferPass=n=>{n&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.opaqueZBufferPass=n=>t.zBufferPass(n),t.opaquePass=n=>{n&&t.render()},t.render=()=>{const n=e._openGLRenderWindow.getContext();if(e.context!==n){e.context=n;for(let o=vt.Start;o{n.Vertex=W0,n.Fragment=$a,n.Geometry=""},t.replaceShaderColor=(n,r,i)=>{let o=n.Vertex,s=n.Geometry,c=n.Fragment;const l=e.lastBoundBO.getReferenceByName("lastLightComplexity");let p=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity","uniform vec3 ambientColorUniform;","uniform vec3 diffuseColorUniform;"];l&&(p=p.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));let u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" ambientColor = ambientColorUniform;"," diffuseColor = diffuseColorUniform;"," opacity = opacityUniform;"]),l&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),e.lastBoundBO.getCABO().getColorComponents()!==0&&!e.drawingEdges&&(p=p.concat(["varying vec4 vertexColorVSOutput;"]),o=Q.substitute(o,"//VTK::Color::Dec",["attribute vec4 scalarColor;","varying vec4 vertexColorVSOutput;"]).result,o=Q.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = scalarColor;"]).result,s=Q.substitute(s,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,s=Q.substitute(s,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result),e.lastBoundBO.getCABO().getColorComponents()!==0&&!e.drawingEdges?c=Q.substitute(c,"//VTK::Color::Impl",u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])).result:(e.renderable.getAreScalarsMappedFromCells()||e.renderable.getInterpolateScalarsBeforeMapping())&&e.renderable.getColorCoordinates()&&!e.drawingEdges?c=Q.substitute(c,"//VTK::Color::Impl",u.concat([" vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);"," diffuseColor = texColor.rgb;"," ambientColor = texColor.rgb;"," opacity = opacity*texColor.a;"])).result:(i.getBackfaceProperty()&&!e.drawingEdges&&(p=p.concat(["uniform float opacityUniformBF; // the fragment opacity","uniform float ambientIntensityBF; // the material ambient","uniform float diffuseIntensityBF; // the material diffuse","uniform vec3 ambientColorUniformBF; // ambient material color","uniform vec3 diffuseColorUniformBF; // diffuse material color"]),l?(p=p.concat(["uniform float specularIntensityBF; // the material specular intensity","uniform vec3 specularColorUniformBF; // intensity weighted color","uniform float specularPowerUniformBF;"]),u=u.concat(["if (gl_FrontFacing == false) {"," ambientColor = ambientIntensityBF * ambientColorUniformBF;"," diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;"," specularColor = specularIntensityBF * specularColorUniformBF;"," specularPower = specularPowerUniformBF;"," opacity = opacityUniformBF; }"])):u=u.concat(["if (gl_FrontFacing == false) {"," ambientColor = ambientIntensityBF * ambientColorUniformBF;"," diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;"," opacity = opacityUniformBF; }"])),e.haveCellScalars&&!e.drawingEdges&&(p=p.concat(["uniform samplerBuffer texture1;"])),c=Q.substitute(c,"//VTK::Color::Impl",u).result),c=Q.substitute(c,"//VTK::Color::Dec",p).result,n.Vertex=o,n.Geometry=s,n.Fragment=c},t.replaceShaderLight=(n,r,i)=>{let o=n.Fragment;const s="",c=e.lastBoundBO.getReferenceByName("lastLightComplexity"),l=e.lastBoundBO.getReferenceByName("lastLightCount");let p=[];switch(c){case 0:o=Q.substitute(o,"//VTK::Light::Impl",[" gl_FragData[0] = vec4(ambientColor * ambient + diffuseColor * diffuse, opacity);"," //VTK::Light::Impl"],!1).result;break;case 1:o=Q.substitute(o,"//VTK::Light::Impl",[" float df = max(0.0, normalVCVSOutput.z);"," float sf = pow(df, specularPower);"," vec3 diffuseL = df * diffuseColor;"," vec3 specularL = sf * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"],!1).result;break;case 2:for(let u=0;u{const o=t.getCoincidentParameters(r,i);if(o&&(o.factor!==0||o.offset!==0)){let s=n.Fragment;s=Z.substitute(s,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,e.context.getExtension("EXT_frag_depth")&&(o.factor!==0?(s=Z.substitute(s,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,s=Z.substitute(s,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):s=Z.substitute(s,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),e._openGLRenderWindow.getWebgl2()&&(o.factor!==0?(s=Z.substitute(s,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,s=Z.substitute(s,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):s=Z.substitute(s,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),n.Fragment=s}}}function H6(t,e,a={}){t.applyShaderReplacements=(n,r,i)=>{let o=null;if(r&&(o=r.ShaderReplacements),o)for(let s=0;s{t.getReplacedShaderTemplate(n,r,i),e.lastRenderPassShaderReplacement=e.currentRenderPass?e.currentRenderPass.getShaderReplacement():null,e.lastRenderPassShaderReplacement&&e.lastRenderPassShaderReplacement(n);const o=e.renderable.getViewSpecificProperties().OpenGL;t.applyShaderReplacements(n,o,!0),t.replaceShaderValues(n,r,i),t.applyShaderReplacements(n,o)},t.getReplacedShaderTemplate=(n,r,i)=>{const o=e.renderable.getViewSpecificProperties().OpenGL;t.getShaderTemplate(n,r,i);let s=n.Vertex;if(o){const p=o.VertexShaderCode;p!==void 0&&p!==""&&(s=p)}n.Vertex=s;let u=n.Fragment;if(o){const p=o.FragmentShaderCode;p!==void 0&&p!==""&&(u=p)}n.Fragment=u;let c=n.Geometry;if(o){const p=o.GeometryShaderCode;p!==void 0&&(c=p)}n.Geometry=c}}var xn={implementReplaceShaderCoincidentOffset:$6,implementBuildShadersWithReplacements:H6},{FieldAssociations:Z0}=dr,{primTypes:yt}=jt,{Representation:Er,Shading:c1}=yr,{ScalarMode:Ro}=dn,{Filter:u1,Wrap:l1}=Ne,{vtkErrorMacro:Dr}=bt,K6={type:"StartEvent"},X6={type:"EndEvent"},{CoordinateSystem:q6}=ep;function Y6(t){const e=t.getSelector();return e?e.getCurrentPass():Nt.MIN_KNOWN_PASS-1}function J6(t,e){e.classHierarchy.push("vtkOpenGLPolyDataMapper"),t.buildPass=n=>{n&&(e.currentRenderPass=null,e.openGLActor=t.getFirstAncestorOfType("vtkOpenGLActor"),e._openGLRenderer=e.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),e.openGLCamera=e._openGLRenderer.getViewNodeFor(e._openGLRenderer.getRenderable().getActiveCamera(),e.openGLCamera))},t.translucentPass=(n,r)=>{n&&(e.currentRenderPass=r,t.render())},t.zBufferPass=n=>{n&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.opaqueZBufferPass=n=>t.zBufferPass(n),t.opaquePass=n=>{n&&t.render()},t.render=()=>{const n=e._openGLRenderWindow.getContext();if(e.context!==n){e.context=n;for(let o=yt.Start;o{n.Vertex=J0,n.Fragment=Ha,n.Geometry=""},t.replaceShaderColor=(n,r,i)=>{let o=n.Vertex,s=n.Geometry,u=n.Fragment;const c=e.lastBoundBO.getReferenceByName("lastLightComplexity");let p=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity","uniform vec3 ambientColorUniform;","uniform vec3 diffuseColorUniform;"];c&&(p=p.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));let l=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];c&&(l=l.concat([" vec3 specularColor;"," float specularPower;"])),l=l.concat([" ambientColor = ambientColorUniform;"," diffuseColor = diffuseColorUniform;"," opacity = opacityUniform;"]),c&&(l=l.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),e.lastBoundBO.getCABO().getColorComponents()!==0&&!e.drawingEdges&&(p=p.concat(["varying vec4 vertexColorVSOutput;"]),o=Z.substitute(o,"//VTK::Color::Dec",["attribute vec4 scalarColor;","varying vec4 vertexColorVSOutput;"]).result,o=Z.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = scalarColor;"]).result,s=Z.substitute(s,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,s=Z.substitute(s,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result),e.lastBoundBO.getCABO().getColorComponents()!==0&&!e.drawingEdges?u=Z.substitute(u,"//VTK::Color::Impl",l.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])).result:(e.renderable.getAreScalarsMappedFromCells()||e.renderable.getInterpolateScalarsBeforeMapping())&&e.renderable.getColorCoordinates()&&!e.drawingEdges?u=Z.substitute(u,"//VTK::Color::Impl",l.concat([" vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);"," diffuseColor = texColor.rgb;"," ambientColor = texColor.rgb;"," opacity = opacity*texColor.a;"])).result:(i.getBackfaceProperty()&&!e.drawingEdges&&(p=p.concat(["uniform float opacityUniformBF; // the fragment opacity","uniform float ambientIntensityBF; // the material ambient","uniform float diffuseIntensityBF; // the material diffuse","uniform vec3 ambientColorUniformBF; // ambient material color","uniform vec3 diffuseColorUniformBF; // diffuse material color"]),c?(p=p.concat(["uniform float specularIntensityBF; // the material specular intensity","uniform vec3 specularColorUniformBF; // intensity weighted color","uniform float specularPowerUniformBF;"]),l=l.concat(["if (gl_FrontFacing == false) {"," ambientColor = ambientIntensityBF * ambientColorUniformBF;"," diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;"," specularColor = specularIntensityBF * specularColorUniformBF;"," specularPower = specularPowerUniformBF;"," opacity = opacityUniformBF; }"])):l=l.concat(["if (gl_FrontFacing == false) {"," ambientColor = ambientIntensityBF * ambientColorUniformBF;"," diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;"," opacity = opacityUniformBF; }"])),e.haveCellScalars&&!e.drawingEdges&&(p=p.concat(["uniform samplerBuffer texture1;"])),u=Z.substitute(u,"//VTK::Color::Impl",l).result),u=Z.substitute(u,"//VTK::Color::Dec",p).result,n.Vertex=o,n.Geometry=s,n.Fragment=u},t.replaceShaderLight=(n,r,i)=>{let o=n.Fragment;const s="",u=e.lastBoundBO.getReferenceByName("lastLightComplexity"),c=e.lastBoundBO.getReferenceByName("lastLightCount");let p=[];switch(u){case 0:o=Z.substitute(o,"//VTK::Light::Impl",[" gl_FragData[0] = vec4(ambientColor * ambient + diffuseColor * diffuse, opacity);"," //VTK::Light::Impl"],!1).result;break;case 1:o=Z.substitute(o,"//VTK::Light::Impl",[" float df = max(0.0, normalVCVSOutput.z);"," float sf = pow(df, specularPower);"," vec3 diffuseL = df * diffuseColor;"," vec3 specularL = sf * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"],!1).result;break;case 2:for(let l=0;l= cos(radians(lightConeAngle${u})))`," {",` attenuation = attenuation * pow(coneDot, lightExponent${u});`," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));",` diffuseL += ((df${s}) * lightColor${u});`," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {",` float sf = sign(df)*attenuation*pow(max(1e-5, - dot(reflect(lightDirectionVC${u}, + specularPower);`,` specularL += (sf${s} * lightColor${l});`," }"]);p=p.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),o=Z.substitute(o,"//VTK::Light::Impl",p,!1).result;break;case 3:for(let l=0;l= cos(radians(lightConeAngle${l})))`," {",` attenuation = attenuation * pow(coneDot, lightExponent${l});`," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));",` diffuseL += ((df${s}) * lightColor${l});`," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {",` float sf = sign(df)*attenuation*pow(max(1e-5, + dot(reflect(lightDirectionVC${l}, normalVCVSOutput), normalize(-vertexVC.xyz))), - specularPower);`,` specularL += ((sf${s}) * lightColor${u});`," }"]);p=p.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),o=Q.substitute(o,"//VTK::Light::Impl",p,!1).result;break;default:_r("bad light complexity")}n.Fragment=o},t.replaceShaderNormal=(n,r,i)=>{if(e.lastBoundBO.getReferenceByName("lastLightComplexity")>0){let s=n.Vertex,c=n.Geometry,l=n.Fragment;e.lastBoundBO.getCABO().getNormalOffset()?(s=Q.substitute(s,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,s=Q.substitute(s,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,c=Q.substitute(c,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,c=Q.substitute(c,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,l=Q.substitute(l,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,l=Q.substitute(l,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.haveCellNormals?(l=Q.substitute(l,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,l=Q.substitute(l,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.lastBoundBO.getOpenGLMode(i.getProperty().getRepresentation())===e.context.LINES?(l=Q.substitute(l,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,l=Q.substitute(l,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(l=Q.substitute(l,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,l=Q.substitute(l,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,l=Q.substitute(l,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),n.Vertex=s,n.Geometry=c,n.Fragment=l}},t.replaceShaderPositionVC=(n,r,i)=>{e.lastBoundBO.replaceShaderPositionVC(n,r,i);let o=n.Vertex,s=n.Geometry,c=n.Fragment;e.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=Q.substitute(o,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,o=Q.substitute(o,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,o=Q.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,s=Q.substitute(s,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,s=Q.substitute(s,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,c=Q.substitute(c,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,c=Q.substitute(c,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(o=Q.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Q.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),n.Vertex=o,n.Geometry=s,n.Fragment=c},t.replaceShaderTCoord=(n,r,i)=>{if(e.lastBoundBO.getCABO().getTCoordOffset()){let o=n.Vertex,s=n.Geometry,c=n.Fragment;if(e.drawingEdges)return;o=Q.substitute(o,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;const l=e.openGLActor.getActiveTextures();let p=2,u=2;if(l&&l.length>0&&(p=l[0].getComponents(),l[0].getTarget()===e.context.TEXTURE_CUBE_MAP&&(u=3)),e.renderable.getColorTextureMap()&&(p=e.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),u=2),u===2){if(o=Q.substitute(o,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,s=Q.substitute(s,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,s=Q.substitute(s,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,c=Q.substitute(c,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,l&&l.length>=1)switch(p){case 1:c=Q.substitute(c,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:c=Q.substitute(c,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:c=Q.substitute(c,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(o=Q.substitute(o,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,s=Q.substitute(s,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,s=Q.substitute(s,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,c=Q.substitute(c,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,p){case 1:c=Q.substitute(c,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:c=Q.substitute(c,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:c=Q.substitute(c,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}n.Vertex=o,n.Geometry=s,n.Fragment=c}},t.replaceShaderClip=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){const c=e.renderable.getNumberOfClippingPlanes();o=Q.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`uniform vec4 clipPlanes[${c}];`,`varying float clipDistancesVSOutput[${c}];`]).result,o=Q.substitute(o,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${c}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=Q.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`varying float clipDistancesVSOutput[${c}];`]).result,s=Q.substitute(s,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${c}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s},t.getCoincidentParameters=(n,r)=>{let i={factor:0,offset:0};const o=r.getProperty();if(e.renderable.getResolveCoincidentTopology()==Zt.PolygonOffset||o.getEdgeVisibility()&&o.getRepresentation()===ta.SURFACE){const c=e.lastBoundBO.getPrimitiveType();c===vt.Points||o.getRepresentation()===ta.POINTS?i=e.renderable.getCoincidentTopologyPointOffsetParameter():c===vt.Lines||o.getRepresentation()===ta.WIREFRAME?i=e.renderable.getCoincidentTopologyLineOffsetParameters():(c===vt.Tris||c===vt.TriStrips)&&(i=e.renderable.getCoincidentTopologyPolygonOffsetParameters()),(c===vt.TrisEdges||c===vt.TriStripsEdges)&&(i=e.renderable.getCoincidentTopologyPolygonOffsetParameters(),i.factor/=2,i.offset/=2)}const s=e._openGLRenderer.getSelector();return s&&s.getFieldAssociation()===$0.FIELD_ASSOCIATION_POINTS&&(i.offset-=2),i},t.replaceShaderPicking=(n,r,i)=>{let o=n.Fragment,s=n.Vertex;if(o=Q.substitute(o,"//VTK::Picking::Dec",["uniform int picking;","//VTK::Picking::Dec"]).result,!!e._openGLRenderer.getSelector()){switch((e.lastSelectionState===Nt.ID_LOW24||e.lastSelectionState===Nt.ID_HIGH24)&&(s=Q.substitute(s,"//VTK::Picking::Dec",[`flat out int vertexIDVSOutput; + specularPower);`,` specularL += ((sf${s}) * lightColor${l});`," }"]);p=p.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),o=Z.substitute(o,"//VTK::Light::Impl",p,!1).result;break;default:Dr("bad light complexity")}n.Fragment=o},t.replaceShaderNormal=(n,r,i)=>{if(e.lastBoundBO.getReferenceByName("lastLightComplexity")>0){let o=n.Vertex,s=n.Geometry,u=n.Fragment;e.lastBoundBO.getCABO().getNormalOffset()?(o=Z.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=Z.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,s=Z.substitute(s,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,s=Z.substitute(s,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,u=Z.substitute(u,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,u=Z.substitute(u,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.haveCellNormals?(u=Z.substitute(u,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,u=Z.substitute(u,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.lastBoundBO.getOpenGLMode(i.getProperty().getRepresentation())===e.context.LINES?(u=Z.substitute(u,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,u=Z.substitute(u,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(u=Z.substitute(u,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,u=Z.substitute(u,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,u=Z.substitute(u,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),n.Vertex=o,n.Geometry=s,n.Fragment=u}},t.replaceShaderPositionVC=(n,r,i)=>{e.lastBoundBO.replaceShaderPositionVC(n,r,i);let o=n.Vertex,s=n.Geometry,u=n.Fragment;e.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=Z.substitute(o,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,o=Z.substitute(o,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,o=Z.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,s=Z.substitute(s,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,s=Z.substitute(s,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,u=Z.substitute(u,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,u=Z.substitute(u,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(o=Z.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Z.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),n.Vertex=o,n.Geometry=s,n.Fragment=u},t.replaceShaderTCoord=(n,r,i)=>{if(e.lastBoundBO.getCABO().getTCoordOffset()){let o=n.Vertex,s=n.Geometry,u=n.Fragment;if(e.drawingEdges)return;o=Z.substitute(o,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;const c=e.openGLActor.getActiveTextures();let p=2,l=2;if(c&&c.length>0&&(p=c[0].getComponents(),c[0].getTarget()===e.context.TEXTURE_CUBE_MAP&&(l=3)),e.renderable.getColorTextureMap()&&(p=e.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),l=2),l===2){if(o=Z.substitute(o,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,s=Z.substitute(s,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,s=Z.substitute(s,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,u=Z.substitute(u,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,c&&c.length>=1)switch(p){case 1:u=Z.substitute(u,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:u=Z.substitute(u,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:u=Z.substitute(u,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(o=Z.substitute(o,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,s=Z.substitute(s,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,s=Z.substitute(s,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,u=Z.substitute(u,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,p){case 1:u=Z.substitute(u,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:u=Z.substitute(u,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:u=Z.substitute(u,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}n.Vertex=o,n.Geometry=s,n.Fragment=u}},t.replaceShaderClip=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){const u=e.renderable.getNumberOfClippingPlanes();o=Z.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`uniform vec4 clipPlanes[${u}];`,`varying float clipDistancesVSOutput[${u}];`]).result,o=Z.substitute(o,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${u}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=Z.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`varying float clipDistancesVSOutput[${u}];`]).result,s=Z.substitute(s,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${u}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s},t.getCoincidentParameters=(n,r)=>{let i={factor:0,offset:0};const o=r.getProperty();if(e.renderable.getResolveCoincidentTopology()==Zt.PolygonOffset||o.getEdgeVisibility()&&o.getRepresentation()===Er.SURFACE){const u=e.lastBoundBO.getPrimitiveType();u===yt.Points||o.getRepresentation()===Er.POINTS?i=e.renderable.getCoincidentTopologyPointOffsetParameter():u===yt.Lines||o.getRepresentation()===Er.WIREFRAME?i=e.renderable.getCoincidentTopologyLineOffsetParameters():(u===yt.Tris||u===yt.TriStrips)&&(i=e.renderable.getCoincidentTopologyPolygonOffsetParameters()),(u===yt.TrisEdges||u===yt.TriStripsEdges)&&(i=e.renderable.getCoincidentTopologyPolygonOffsetParameters(),i.factor/=2,i.offset/=2)}const s=e._openGLRenderer.getSelector();return s&&s.getFieldAssociation()===Z0.FIELD_ASSOCIATION_POINTS&&(i.offset-=2),i},t.replaceShaderPicking=(n,r,i)=>{let o=n.Fragment,s=n.Vertex;if(o=Z.substitute(o,"//VTK::Picking::Dec",["uniform int picking;","//VTK::Picking::Dec"]).result,!!e._openGLRenderer.getSelector()){switch((e.lastSelectionState===Nt.ID_LOW24||e.lastSelectionState===Nt.ID_HIGH24)&&(s=Z.substitute(s,"//VTK::Picking::Dec",[`flat out int vertexIDVSOutput; `,`uniform int VertexIDOffset; -`]).result,s=Q.substitute(s,"//VTK::Picking::Impl",` vertexIDVSOutput = gl_VertexID + VertexIDOffset; -`).result,o=Q.substitute(o,"//VTK::Picking::Dec",`flat in int vertexIDVSOutput; -`).result,o=Q.substitute(o,"//VTK::Picking::Impl",[" int idx = vertexIDVSOutput;","//VTK::Picking::Impl"]).result),e.lastSelectionState){case Nt.ID_LOW24:o=Q.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = vec4(float(idx%256)/255.0, float((idx/256)%256)/255.0, float((idx/65536)%256)/255.0, 1.0);").result;break;case Nt.ID_HIGH24:o=Q.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = vec4(float((idx/16777216)%256)/255.0, 0.0, 0.0, 1.0);").result;break;default:o=Q.substitute(o,"//VTK::Picking::Dec","uniform vec3 mapperIndex;").result,o=Q.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result}n.Fragment=o,n.Vertex=s}},t.replaceShaderValues=(n,r,i)=>{if(t.replaceShaderColor(n,r,i),t.replaceShaderNormal(n,r,i),t.replaceShaderLight(n,r,i),t.replaceShaderTCoord(n,r,i),t.replaceShaderPicking(n,r,i),t.replaceShaderClip(n,r,i),t.replaceShaderCoincidentOffset(n,r,i),t.replaceShaderPositionVC(n,r,i),e.haveSeenDepthRequest){let o=n.Fragment;o=Q.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=Q.substitute(o,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,n.Fragment=o}},t.getNeedToRebuildShaders=(n,r,i)=>{let o=0,s=0;const c=n.getPrimitiveType(),l=e.currentInput;let p=!1;const u=l.getPointData().getNormals(),f=l.getCellData().getNormals(),h=i.getProperty().getInterpolation()===nh.FLAT,d=i.getProperty().getRepresentation(),v=n.getOpenGLMode(d,c);if((v===e.context.TRIANGLES||f&&!u||!h&&u||!h&&v===e.context.LINES)&&(p=!0),i.getProperty().getLighting()&&p){o=0;const g=r.getLightsByReference();for(let C=0;C0&&(s++,o===0&&(o=1)),o===1&&(s>1||S.getIntensity()!==1||!S.lightTypeIsHeadLight())&&(o=2),o<3&&S.getPositional()&&(o=3)}}let m=!1;const x=e.lastBoundBO.getReferenceByName("lastLightComplexity"),y=e.lastBoundBO.getReferenceByName("lastLightCount");return(x!==o||y!==s)&&(e.lastBoundBO.set({lastLightComplexity:o},!0),e.lastBoundBO.set({lastLightCount:s},!0),m=!0),(!e.currentRenderPass&&e.lastRenderPassShaderReplacement||e.currentRenderPass&&e.currentRenderPass.getShaderReplacement()!==e.lastRenderPassShaderReplacement)&&(m=!0),e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||n.getShaderSourceTime().getMTime(){const o=e.renderable.getViewSpecificProperties().ShadersCallbacks;o&&o.forEach(s=>{s.callback(s.userData,n,r,i)})},t.setMapperShaderParameters=(n,r,i)=>{if(n.getProgram().isUniformUsed("PrimitiveIDOffset")&&n.getProgram().setUniformi("PrimitiveIDOffset",e.primitiveIDOffset),n.getProgram().isUniformUsed("VertexIDOffset")&&n.getProgram().setUniformi("VertexIDOffset",e.vertexIDOffset),n.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){const c=e.lastBoundBO.getReferenceByName("lastLightComplexity");n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),e.context.FLOAT,3,!1)||_r("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("normalMC")&&n.getCABO().getNormalOffset()&&c>0?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"normalMC",n.getCABO().getNormalOffset(),n.getCABO().getStride(),e.context.FLOAT,3,!1)||_r("Error setting normalMC in shader VAO."):n.getVAO().removeAttributeArray("normalMC"),e.renderable.getCustomShaderAttributes().forEach((l,p)=>{n.getProgram().isAttributeUsed(`${l}MC`)&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),`${l}MC`,n.getCABO().getCustomData()[p].offset,n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getCustomData()[p].components,!1)||_r(`Error setting ${l}MC in shader VAO.`))}),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||_r("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),e.context.UNSIGNED_BYTE,4,!0)||_r("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),n.getAttributeUpdateTime().modified()}if(e.renderable.getNumberOfClippingPlanes()){const c=e.renderable.getNumberOfClippingPlanes(),l=[],u=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,f=u?gt(e.tmpMat4,i.getMatrix()):i.getMatrix();u&&(We(f,f),Ee(f,f,u),We(f,f));for(let h=0;h{const o=e.lastBoundBO.getReferenceByName("lastLightComplexity");if(o<2)return;const s=n.getProgram();let c=0;const l=r.getLightsByReference();for(let f=0;f0){const v=h.getColorByReference(),m=h.getIntensity();e.lightColor[0]=v[0]*m,e.lightColor[1]=v[1]*m,e.lightColor[2]=v[2]*m;const x=h.getDirection(),y=r.getActiveCamera().getViewMatrix(),g=[...x];h.lightTypeIsSceneLight()&&(g[0]=y[0]*x[0]+y[1]*x[1]+y[2]*x[2],g[1]=y[4]*x[0]+y[5]*x[1]+y[6]*x[2],g[2]=y[8]*x[0]+y[9]*x[1]+y[10]*x[2],Ke(g)),e.lightDirection[0]=g[0],e.lightDirection[1]=g[1],e.lightDirection[2]=g[2],Ke(e.lightDirection),s.setUniform3fArray(`lightColor${c}`,e.lightColor),s.setUniform3fArray(`lightDirectionVC${c}`,e.lightDirection),c++}}if(o<3)return;const u=r.getActiveCamera().getViewMatrix();We(u,u),c=0;for(let f=0;f0){const v=h.getTransformedPosition(),m=new Float64Array(3);_e(m,v,u),s.setUniform3fArray(`lightAttenuation${c}`,h.getAttenuationValuesByReference()),s.setUniformi(`lightPositional${c}`,h.getPositional()),s.setUniformf(`lightExponent${c}`,h.getExponent()),s.setUniformf(`lightConeAngle${c}`,h.getConeAngle()),s.setUniform3fArray(`lightPositionVC${c}`,[m[0],m[1],m[2]]),c++}}};function a(n,r,i){return r.identity(i),n.reduce((o,s,c)=>c===0?s?r.copy(o,s):r.identity(o):s?r.multiply(o,o,s):o,i)}t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=e.openGLCamera.getKeyMatrices(r),c=r.getActiveCamera(),l=e.openGLCamera.getKeyMatrixTime().getMTime(),p=o.getLastCameraMTime(),f=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,h=i.getIsIdentity(),d=h?{mcwc:null,normalMatrix:null}:e.openGLActor.getKeyMatrices();if(i.getCoordinateSystem()===z9.DISPLAY){const v=e._openGLRenderer.getTiledSizeAndOrigin();Te(e.tmpMat4),e.tmpMat4[0]=2/v.usize,e.tmpMat4[12]=-1,e.tmpMat4[5]=2/v.vsize,e.tmpMat4[13]=-1,Ee(e.tmpMat4,e.tmpMat4,f),o.setUniformMatrix("MCPCMatrix",e.tmpMat4)}else o.setUniformMatrix("MCPCMatrix",a([s.wcpc,d.mcwc,f],va,e.tmpMat4));o.isUniformUsed("MCVCMatrix")&&o.setUniformMatrix("MCVCMatrix",a([s.wcvc,d.mcwc,f],va,e.tmpMat4)),o.isUniformUsed("normalMatrix")&&o.setUniformMatrix3x3("normalMatrix",a([s.normalMatrix,d.normalMatrix],r2,e.tmpMat3)),p!==l&&(o.isUniformUsed("cameraParallel")&&o.setUniformi("cameraParallel",c.getParallelProjection()),o.setLastCameraMTime(l)),h||o.setLastCameraMTime(0)},t.setPropertyShaderParameters=(n,r,i)=>{const o=n.getProgram();let s=i.getProperty(),c=s.getOpacity(),l=e.drawingEdges?s.getEdgeColorByReference():s.getAmbientColorByReference(),p=e.drawingEdges?s.getEdgeColorByReference():s.getDiffuseColorByReference(),u=e.drawingEdges?1:s.getAmbient(),f=e.drawingEdges?0:s.getDiffuse(),h=e.drawingEdges?0:s.getSpecular();const d=s.getSpecularPower();o.setUniformf("opacityUniform",c),o.setUniform3fArray("ambientColorUniform",l),o.setUniform3fArray("diffuseColorUniform",p),o.setUniformf("ambient",u),o.setUniformf("diffuse",f);const v=e.lastBoundBO.getReferenceByName("lastLightComplexity");if(v<1)return;let m=s.getSpecularColorByReference();if(o.setUniform3fArray("specularColorUniform",m),o.setUniformf("specularPowerUniform",d),o.setUniformf("specular",h),o.isUniformUsed("ambientIntensityBF")){if(s=i.getBackfaceProperty(),c=s.getOpacity(),l=s.getAmbientColor(),u=s.getAmbient(),p=s.getDiffuseColor(),f=s.getDiffuse(),m=s.getSpecularColor(),h=s.getSpecular(),o.setUniformf("ambientIntensityBF",u),o.setUniformf("diffuseIntensityBF",f),o.setUniformf("opacityUniformBF",c),o.setUniform3fArray("ambientColorUniformBF",l),o.setUniform3fArray("diffuseColorUniformBF",p),v<1)return;o.setUniformf("specularIntensityBF",h),o.setUniform3fArray("specularColorUniformBF",m),o.setUniformf("specularPowerUniformBF",d)}},t.updateMaximumPointCellIds=(n,r)=>{var s,c,l,p;const i=e._openGLRenderer.getSelector();if(!i)return;if((c=(s=e.selectionWebGLIdsToVTKIds)==null?void 0:s.points)!=null&&c.length){const u=e.selectionWebGLIdsToVTKIds.points.length;i.setMaximumPointId(u-1)}if((p=(l=e.selectionWebGLIdsToVTKIds)==null?void 0:l.cells)!=null&&p.length){const u=e.selectionWebGLIdsToVTKIds.cells.length;i.setMaximumCellId(u-1)}i.getFieldAssociation()===$0.FIELD_ASSOCIATION_POINTS&&(e.pointPicking=!0)},t.renderPieceStart=(n,r)=>{e.primitiveIDOffset=0,e.vertexIDOffset=0;const i=j9(e._openGLRenderer);if(e.lastSelectionState!==i&&(e.selectionStateChanged.modified(),e.lastSelectionState=i),e._openGLRenderer.getSelector())switch(i){default:e._openGLRenderer.getSelector().renderProp(r)}t.updateBufferObjects(n,r),e.renderable.getColorTextureMap()&&e.internalColorTexture.activate(),e.lastBoundBO=null},t.renderPieceDraw=(n,r)=>{const i=r.getProperty().getRepresentation(),o=r.getProperty().getEdgeVisibility()&&i===ta.SURFACE,s=e._openGLRenderer.getSelector(),c=s&&s.getFieldAssociation()===$0.FIELD_ASSOCIATION_POINTS&&(e.lastSelectionState===Nt.ID_LOW24||e.lastSelectionState===Nt.ID_HIGH24);for(let l=vt.Start;l=0))&&(e.lastBoundBO=e.primitives[l],e.primitiveIDOffset+=e.primitives[l].drawArrays(n,r,i,t),e.vertexIDOffset+=e.primitives[l].getCABO().getElementCount()))},t.renderPieceFinish=(n,r)=>{e.LastBoundBO&&e.LastBoundBO.getVAO().release(),e.renderable.getColorTextureMap()&&e.internalColorTexture.deactivate()},t.renderPiece=(n,r)=>{if(t.invokeEvent(I9),e.renderable.getStatic()||e.renderable.update(),e.currentInput=e.renderable.getInputData(),t.invokeEvent(P9),!e.currentInput){_r("No input!");return}if(!e.currentInput.getPoints||!e.currentInput.getPoints().getNumberOfValues())return;const i=e.context,o=r.getProperty().getBackfaceCulling(),s=r.getProperty().getFrontfaceCulling();!o&&!s?e._openGLRenderWindow.disableCullFace():s?(e._openGLRenderWindow.enableCullFace(),i.cullFace(i.FRONT)):(e._openGLRenderWindow.enableCullFace(),i.cullFace(i.BACK)),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.updateBufferObjects=(n,r)=>{t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r),t.updateMaximumPointCellIds()},t.getNeedToRebuildBufferObjects=(n,r)=>{const i=e.VBOBuildTime.getMTime();return i{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,1);const o=e.renderable.getColorMapColors();e.haveCellScalars=!1;const s=e.renderable.getScalarMode();e.renderable.getScalarVisibility()&&(s===Eo.USE_CELL_DATA||s===Eo.USE_CELL_FIELD_DATA||s===Eo.USE_FIELD_DATA||!i.getPointData().getScalars())&&s!==Eo.USE_POINT_FIELD_DATA&&o&&(e.haveCellScalars=!0);let c=r.getProperty().getInterpolation()!==nh.FLAT?i.getPointData().getNormals():null;c===null&&i.getCellData().getNormals()&&(e.haveCellNormals=!0,c=i.getCellData().getNormals());const l=r.getProperty().getRepresentation();let p=i.getPointData().getTCoords();e.openGLActor.getActiveTextures()||(p=null);let u=!1;if(e.renderable.getColorCoordinates()){p=e.renderable.getColorCoordinates(),u=e.renderable.getAreScalarsMappedFromCells(),e.internalColorTexture||(e.internalColorTexture=Re.newInstance({resizable:!0}));const h=e.internalColorTexture;h.setMinificationFilter(rh.NEAREST),h.setMagnificationFilter(rh.NEAREST),h.setWrapS(ah.CLAMP_TO_EDGE),h.setWrapT(ah.CLAMP_TO_EDGE),h.setOpenGLRenderWindow(e._openGLRenderWindow);const d=e.renderable.getColorTextureMap(),v=d.getExtent(),m=d.getPointData().getScalars();h.create2DFromRaw({width:v[1]-v[0]+1,height:v[3]-v[2]+1,numComps:m.getNumberOfComponents(),dataType:m.getDataType(),data:m.getData()}),h.activate(),h.sendParameters(),h.deactivate()}const f=`${i.getMTime()}A${l}B${i.getMTime()}C${c?c.getMTime():1}D${o?o.getMTime():1}E${r.getProperty().getEdgeVisibility()}F${p?p.getMTime():1}`;if(e.VBOBuildString!==f){const d={points:i.getPoints(),normals:c,tcoords:p,colors:o,cellOffset:0,vertexOffset:0,useTCoordsPerCell:u,haveCellScalars:e.haveCellScalars,haveCellNormals:e.haveCellNormals,customAttributes:e.renderable.getCustomShaderAttributes().map(x=>i.getPointData().getArrayByName(x))};e.renderable.getPopulateSelectionSettings()&&(e.selectionWebGLIdsToVTKIds={points:null,cells:null});const v=[{inRep:"verts",cells:i.getVerts()},{inRep:"lines",cells:i.getLines()},{inRep:"polys",cells:i.getPolys()},{inRep:"strips",cells:i.getStrips()},{inRep:"polys",cells:i.getPolys()},{inRep:"strips",cells:i.getStrips()}],m=r.getProperty().getEdgeVisibility()&&l===ta.SURFACE;for(let x=vt.Start;x{let n=0;return e.primitives.forEach(r=>{n+=r.getAllocatedGPUMemoryInBytes()}),n}}const $9={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null,tmpMat4:null,ambientColor:[],diffuseColor:[],specularColor:[],lightColor:[],lightDirection:[],lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastSelectionState:Nt.MIN_KNOWN_PASS-1,selectionStateChanged:null,selectionWebGLIdsToVTKIds:null,pointPicking:!1};function ih(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,$9,a),Ct.extend(t,e,a),mn.implementReplaceShaderCoincidentOffset(t,e,a),mn.implementBuildShadersWithReplacements(t,e,a),e.primitives=[],e.primTypes=vt,e.tmpMat3=It(new Float64Array(9)),e.tmpMat4=Te(new Float64Array(16));for(let n=vt.Start;n{if(t.replaceShaderColor(n,r,i),t.replaceShaderNormal(n,r,i),t.replaceShaderLight(n,r,i),t.replaceShaderTCoord(n,r,i),t.replaceShaderPicking(n,r,i),t.replaceShaderClip(n,r,i),t.replaceShaderCoincidentOffset(n,r,i),t.replaceShaderPositionVC(n,r,i),e.haveSeenDepthRequest){let o=n.Fragment;o=Z.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=Z.substitute(o,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,n.Fragment=o}},t.getNeedToRebuildShaders=(n,r,i)=>{let o=0,s=0;const u=n.getPrimitiveType(),c=e.currentInput;let p=!1;const l=c.getPointData().getNormals(),f=c.getCellData().getNormals(),h=i.getProperty().getInterpolation()===c1.FLAT,v=i.getProperty().getRepresentation(),m=n.getOpenGLMode(v,u);if((m===e.context.TRIANGLES||f&&!l||!h&&l||!h&&m===e.context.LINES)&&(p=!0),i.getProperty().getLighting()&&p){o=0;const g=r.getLightsByReference();for(let C=0;C0&&(s++,o===0&&(o=1)),o===1&&(s>1||S.getIntensity()!==1||!S.lightTypeIsHeadLight())&&(o=2),o<3&&S.getPositional()&&(o=3)}}let x=!1;const y=e.lastBoundBO.getReferenceByName("lastLightComplexity"),d=e.lastBoundBO.getReferenceByName("lastLightCount");return(y!==o||d!==s)&&(e.lastBoundBO.set({lastLightComplexity:o},!0),e.lastBoundBO.set({lastLightCount:s},!0),x=!0),(!e.currentRenderPass&&e.lastRenderPassShaderReplacement||e.currentRenderPass&&e.currentRenderPass.getShaderReplacement()!==e.lastRenderPassShaderReplacement)&&(x=!0),e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||n.getShaderSourceTime().getMTime(){const o=e.renderable.getViewSpecificProperties().ShadersCallbacks;o&&o.forEach(s=>{s.callback(s.userData,n,r,i)})},t.setMapperShaderParameters=(n,r,i)=>{if(n.getProgram().isUniformUsed("PrimitiveIDOffset")&&n.getProgram().setUniformi("PrimitiveIDOffset",e.primitiveIDOffset),n.getProgram().isUniformUsed("VertexIDOffset")&&n.getProgram().setUniformi("VertexIDOffset",e.vertexIDOffset),n.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){const u=e.lastBoundBO.getReferenceByName("lastLightComplexity");n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),e.context.FLOAT,3,!1)||Dr("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("normalMC")&&n.getCABO().getNormalOffset()&&u>0?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"normalMC",n.getCABO().getNormalOffset(),n.getCABO().getStride(),e.context.FLOAT,3,!1)||Dr("Error setting normalMC in shader VAO."):n.getVAO().removeAttributeArray("normalMC"),e.renderable.getCustomShaderAttributes().forEach((c,p)=>{n.getProgram().isAttributeUsed(`${c}MC`)&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),`${c}MC`,n.getCABO().getCustomData()[p].offset,n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getCustomData()[p].components,!1)||Dr(`Error setting ${c}MC in shader VAO.`))}),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||Dr("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),e.context.UNSIGNED_BYTE,4,!0)||Dr("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),n.getAttributeUpdateTime().modified()}if(e.renderable.getNumberOfClippingPlanes()){const u=e.renderable.getNumberOfClippingPlanes(),c=[],p=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,l=p?vt(e.tmpMat4,i.getMatrix()):i.getMatrix();p&&(We(l,l),Ee(l,l,p),We(l,l));for(let f=0;f{const o=e.lastBoundBO.getReferenceByName("lastLightComplexity");if(o<2)return;const s=n.getProgram();let u=0;const c=r.getLightsByReference();for(let l=0;l0){const h=f.getColorByReference(),v=f.getIntensity();e.lightColor[0]=h[0]*v,e.lightColor[1]=h[1]*v,e.lightColor[2]=h[2]*v;const m=f.getDirection(),x=r.getActiveCamera().getViewMatrix(),y=[...m];f.lightTypeIsSceneLight()&&(y[0]=x[0]*m[0]+x[1]*m[1]+x[2]*m[2],y[1]=x[4]*m[0]+x[5]*m[1]+x[6]*m[2],y[2]=x[8]*m[0]+x[9]*m[1]+x[10]*m[2],He(y)),e.lightDirection[0]=y[0],e.lightDirection[1]=y[1],e.lightDirection[2]=y[2],He(e.lightDirection),s.setUniform3fArray(`lightColor${u}`,e.lightColor),s.setUniform3fArray(`lightDirectionVC${u}`,e.lightDirection),u++}}if(o<3)return;const p=r.getActiveCamera().getViewMatrix();We(p,p),u=0;for(let l=0;l0){const h=f.getTransformedPosition(),v=new Float64Array(3);_e(v,h,p),s.setUniform3fArray(`lightAttenuation${u}`,f.getAttenuationValuesByReference()),s.setUniformi(`lightPositional${u}`,f.getPositional()),s.setUniformf(`lightExponent${u}`,f.getExponent()),s.setUniformf(`lightConeAngle${u}`,f.getConeAngle()),s.setUniform3fArray(`lightPositionVC${u}`,[v[0],v[1],v[2]]),u++}}};function a(n,r,i){return r.identity(i),n.reduce((o,s,u)=>u===0?s?r.copy(o,s):r.identity(o):s?r.multiply(o,o,s):o,i)}t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=e.openGLCamera.getKeyMatrices(r),u=r.getActiveCamera(),c=e.openGLCamera.getKeyMatrixTime().getMTime(),p=o.getLastCameraMTime(),l=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,f=i.getIsIdentity(),h=f?{mcwc:null,normalMatrix:null}:e.openGLActor.getKeyMatrices();if(i.getCoordinateSystem()===q6.DISPLAY){const v=e._openGLRenderer.getTiledSizeAndOrigin();we(e.tmpMat4),e.tmpMat4[0]=2/v.usize,e.tmpMat4[12]=-1,e.tmpMat4[5]=2/v.vsize,e.tmpMat4[13]=-1,Ee(e.tmpMat4,e.tmpMat4,l),o.setUniformMatrix("MCPCMatrix",e.tmpMat4)}else o.setUniformMatrix("MCPCMatrix",a([s.wcpc,h.mcwc,l],Ra,e.tmpMat4));o.isUniformUsed("MCVCMatrix")&&o.setUniformMatrix("MCVCMatrix",a([s.wcvc,h.mcwc,l],Ra,e.tmpMat4)),o.isUniformUsed("normalMatrix")&&o.setUniformMatrix3x3("normalMatrix",a([s.normalMatrix,h.normalMatrix],i9,e.tmpMat3)),p!==c&&(o.isUniformUsed("cameraParallel")&&o.setUniformi("cameraParallel",u.getParallelProjection()),o.setLastCameraMTime(c)),f||o.setLastCameraMTime(0)},t.setPropertyShaderParameters=(n,r,i)=>{const o=n.getProgram();let s=i.getProperty(),u=e.drawingEdges||s.getRepresentation()===Er.WIREFRAME?s.getEdgeOpacity():s.getOpacity(),c=e.drawingEdges?s.getEdgeColorByReference():s.getAmbientColorByReference(),p=e.drawingEdges?s.getEdgeColorByReference():s.getDiffuseColorByReference(),l=e.drawingEdges?1:s.getAmbient(),f=e.drawingEdges?0:s.getDiffuse(),h=e.drawingEdges?0:s.getSpecular();const v=s.getSpecularPower();o.setUniformf("opacityUniform",u),o.setUniform3fArray("ambientColorUniform",c),o.setUniform3fArray("diffuseColorUniform",p),o.setUniformf("ambient",l),o.setUniformf("diffuse",f);const m=e.lastBoundBO.getReferenceByName("lastLightComplexity");if(m<1)return;let x=s.getSpecularColorByReference();if(o.setUniform3fArray("specularColorUniform",x),o.setUniformf("specularPowerUniform",v),o.setUniformf("specular",h),o.isUniformUsed("ambientIntensityBF")){if(s=i.getBackfaceProperty(),u=s.getOpacity(),c=s.getAmbientColor(),l=s.getAmbient(),p=s.getDiffuseColor(),f=s.getDiffuse(),x=s.getSpecularColor(),h=s.getSpecular(),o.setUniformf("ambientIntensityBF",l),o.setUniformf("diffuseIntensityBF",f),o.setUniformf("opacityUniformBF",u),o.setUniform3fArray("ambientColorUniformBF",c),o.setUniform3fArray("diffuseColorUniformBF",p),m<1)return;o.setUniformf("specularIntensityBF",h),o.setUniform3fArray("specularColorUniformBF",x),o.setUniformf("specularPowerUniformBF",v)}},t.updateMaximumPointCellIds=(n,r)=>{var o,s,u,c;const i=e._openGLRenderer.getSelector();if(i){if((s=(o=e.selectionWebGLIdsToVTKIds)==null?void 0:o.points)!=null&&s.length){const p=e.selectionWebGLIdsToVTKIds.points.length;i.setMaximumPointId(p-1)}if((c=(u=e.selectionWebGLIdsToVTKIds)==null?void 0:u.cells)!=null&&c.length){const p=e.selectionWebGLIdsToVTKIds.cells.length;i.setMaximumCellId(p-1)}i.getFieldAssociation()===Z0.FIELD_ASSOCIATION_POINTS&&(e.pointPicking=!0)}},t.renderPieceStart=(n,r)=>{e.primitiveIDOffset=0,e.vertexIDOffset=0;const i=Y6(e._openGLRenderer);if(e.lastSelectionState!==i&&(e.selectionStateChanged.modified(),e.lastSelectionState=i),e._openGLRenderer.getSelector())switch(i){default:e._openGLRenderer.getSelector().renderProp(r)}t.updateBufferObjects(n,r),e.renderable.getColorTextureMap()&&e.internalColorTexture.activate(),e.lastBoundBO=null},t.renderPieceDraw=(n,r)=>{const i=r.getProperty().getRepresentation(),o=r.getProperty().getEdgeVisibility()&&i===Er.SURFACE,s=e._openGLRenderer.getSelector(),u=s&&s.getFieldAssociation()===Z0.FIELD_ASSOCIATION_POINTS&&(e.lastSelectionState===Nt.ID_LOW24||e.lastSelectionState===Nt.ID_HIGH24);for(let c=yt.Start;c=0))&&(e.lastBoundBO=e.primitives[c],e.primitiveIDOffset+=e.primitives[c].drawArrays(n,r,i,t),e.vertexIDOffset+=e.primitives[c].getCABO().getElementCount()))},t.renderPieceFinish=(n,r)=>{e.LastBoundBO&&e.LastBoundBO.getVAO().release(),e.renderable.getColorTextureMap()&&e.internalColorTexture.deactivate()},t.renderPiece=(n,r)=>{if(t.invokeEvent(K6),e.renderable.getStatic()||e.renderable.update(),e.currentInput=e.renderable.getInputData(),t.invokeEvent(X6),!e.currentInput){Dr("No input!");return}if(!e.currentInput.getPoints||!e.currentInput.getPoints().getNumberOfValues())return;const i=e.context,o=r.getProperty().getBackfaceCulling(),s=r.getProperty().getFrontfaceCulling();!o&&!s?e._openGLRenderWindow.disableCullFace():s?(e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(i.FRONT)):(e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(i.BACK)),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.updateBufferObjects=(n,r)=>{t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r),t.updateMaximumPointCellIds()},t.getNeedToRebuildBufferObjects=(n,r)=>{const i=e.VBOBuildTime.getMTime();return i{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,1);const o=e.renderable.getColorMapColors();e.haveCellScalars=!1;const s=e.renderable.getScalarMode();e.renderable.getScalarVisibility()&&(s===Ro.USE_CELL_DATA||s===Ro.USE_CELL_FIELD_DATA||s===Ro.USE_FIELD_DATA||!i.getPointData().getScalars())&&s!==Ro.USE_POINT_FIELD_DATA&&o&&(e.haveCellScalars=!0);let u=r.getProperty().getInterpolation()!==c1.FLAT?i.getPointData().getNormals():null;u===null&&i.getCellData().getNormals()&&(e.haveCellNormals=!0,u=i.getCellData().getNormals());const c=r.getProperty().getRepresentation();let p=i.getPointData().getTCoords();e.openGLActor.getActiveTextures()||(p=null);let l=!1;if(e.renderable.getColorCoordinates()){p=e.renderable.getColorCoordinates(),l=e.renderable.getAreScalarsMappedFromCells(),e.internalColorTexture||(e.internalColorTexture=Ne.newInstance({resizable:!0}));const v=e.internalColorTexture;v.setMinificationFilter(u1.NEAREST),v.setMagnificationFilter(u1.NEAREST),v.setWrapS(l1.CLAMP_TO_EDGE),v.setWrapT(l1.CLAMP_TO_EDGE),v.setOpenGLRenderWindow(e._openGLRenderWindow);const m=e.renderable.getColorTextureMap(),x=m.getExtent(),y=m.getPointData().getScalars();v.create2DFromRaw({width:x[1]-x[0]+1,height:x[3]-x[2]+1,numComps:y.getNumberOfComponents(),dataType:y.getDataType(),data:y.getData()}),v.activate(),v.sendParameters(),v.deactivate()}const f=e.renderable.getCustomShaderAttributes().map(v=>i.getPointData().getArrayByName(v)),h=`${i.getMTime()}A${c}B${i.getMTime()}C${u?u.getMTime():1}D${o?o.getMTime():1}E${r.getProperty().getEdgeVisibility()}F${p?p.getMTime():1}G${f.map(v=>v.getMTime()).join(",")}`;if(e.VBOBuildString!==h){const v={points:i.getPoints(),normals:u,tcoords:p,colors:o,cellOffset:0,vertexOffset:0,useTCoordsPerCell:l,haveCellScalars:e.haveCellScalars,haveCellNormals:e.haveCellNormals,customAttributes:f};e.renderable.getPopulateSelectionSettings()&&(e.selectionWebGLIdsToVTKIds={points:null,cells:null});const m=[{inRep:"verts",cells:i.getVerts()},{inRep:"lines",cells:i.getLines()},{inRep:"polys",cells:i.getPolys()},{inRep:"strips",cells:i.getStrips()},{inRep:"polys",cells:i.getPolys()},{inRep:"strips",cells:i.getStrips()}],x=r.getProperty().getEdgeVisibility()&&c===Er.SURFACE;for(let y=yt.Start;y{let n=0;return e.primitives.forEach(r=>{n+=r.getAllocatedGPUMemoryInBytes()}),n}}var Z6={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null,tmpMat4:null,ambientColor:[],diffuseColor:[],specularColor:[],lightColor:[],lightDirection:[],lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastSelectionState:Nt.MIN_KNOWN_PASS-1,selectionStateChanged:null,selectionWebGLIdsToVTKIds:null,pointPicking:!1};function f1(t,e,a={}){Object.assign(e,Z6,a),Ct.extend(t,e,a),xn.implementReplaceShaderCoincidentOffset(t,e,a),xn.implementBuildShadersWithReplacements(t,e,a),e.primitives=[],e.primTypes=yt,e.tmpMat3=zt(new Float64Array(9)),e.tmpMat4=we(new Float64Array(16));for(let n=yt.Start;ne.points.getBounds()}var r8={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function h1(t,e,a={}){Object.assign(e,r8,a),A.obj(t,e),e.properties={},A.setGet(t,e,["contentType","fieldType","properties","selectionList"]),n8(t,e)}var a8=A.newInstance(h1,"vtkSelectionNode"),g1={newInstance:a8,extend:h1,...t8},{FieldAssociations:i8}=dr;function o8(t,e){e.classHierarchy.push("vtkHardwareSelector"),t.getSourceDataAsync=async(a,n,r,i,o)=>{},t.selectAsync=async(a,n,r,i,o)=>{const s=await t.getSourceDataAsync(a,n,r,i,o);return s?s.generateSelection(n,r,i,o):[]}}var s8={fieldAssociation:i8.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function d1(t,e,a={}){Object.assign(e,s8,a),A.obj(t,e),A.setGet(t,e,["fieldAssociation","captureZValues"]),o8(t,e)}var c8=A.newInstance(d1,"vtkHardwareSelector"),u8={newInstance:c8,extend:d1};function l8(t,e){e.classHierarchy.push("vtkFramebuffer"),t.getBothMode=()=>e.context.FRAMEBUFFER,t.saveCurrentBindingsAndBuffers=a=>{const n=typeof a<"u"?a:t.getBothMode();t.saveCurrentBindings(n),t.saveCurrentBuffers(n)},t.saveCurrentBindings=a=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling saveCurrentBindings");return}e.previousDrawBinding=e.context.getParameter(e.context.FRAMEBUFFER_BINDING),e.previousActiveFramebuffer=e._openGLRenderWindow.getActiveFramebuffer()},t.saveCurrentBuffers=a=>{},t.restorePreviousBindingsAndBuffers=a=>{const n=typeof a<"u"?a:t.getBothMode();t.restorePreviousBindings(n),t.restorePreviousBuffers(n)},t.restorePreviousBindings=a=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling restorePreviousBindings");return}const n=e.context;n.bindFramebuffer(n.FRAMEBUFFER,e.previousDrawBinding),e._openGLRenderWindow.setActiveFramebuffer(e.previousActiveFramebuffer)},t.restorePreviousBuffers=a=>{},t.bind=(a=null)=>{let n=a;n===null&&(n=e.context.FRAMEBUFFER),e.context.bindFramebuffer(n,e.glFramebuffer);for(let r=0;r{if(!e.context){ze("you must set the OpenGLRenderWindow before calling create");return}e.glFramebuffer=e.context.createFramebuffer(),e.glFramebuffer.width=a,e.glFramebuffer.height=n},t.setColorBuffer=(a,n=0)=>{const r=e.context;if(!r){ze("you must set the OpenGLRenderWindow before calling setColorBuffer");return}let i=r.COLOR_ATTACHMENT0;if(n>0)if(e._openGLRenderWindow.getWebgl2())i+=n;else{ze("Using multiple framebuffer attachments requires WebGL 2");return}e.colorBuffers[n]=a,r.framebufferTexture2D(r.FRAMEBUFFER,i,r.TEXTURE_2D,a.getHandle(),0)},t.removeColorBuffer=(a=0)=>{const n=e.context;if(!n){ze("you must set the OpenGLRenderWindow before calling removeColorBuffer");return}let r=n.COLOR_ATTACHMENT0;if(a>0)if(e._openGLRenderWindow.getWebgl2())r+=a;else{ze("Using multiple framebuffer attachments requires WebGL 2");return}n.framebufferTexture2D(n.FRAMEBUFFER,r,n.TEXTURE_2D,null,0),e.colorBuffers=e.colorBuffers.splice(a,1)},t.setDepthBuffer=a=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling setDepthBuffer");return}if(e._openGLRenderWindow.getWebgl2()){const n=e.context;n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,a.getHandle(),0)}else ze("Attaching depth buffer textures to fbo requires WebGL 2")},t.removeDepthBuffer=()=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling removeDepthBuffer");return}if(e._openGLRenderWindow.getWebgl2()){const a=e.context;a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,null,0)}else ze("Attaching depth buffer textures to framebuffers requires WebGL 2")},t.getGLFramebuffer=()=>e.glFramebuffer,t.setOpenGLRenderWindow=a=>{e._openGLRenderWindow!==a&&(t.releaseGraphicsResources(),e._openGLRenderWindow=a,e.context=null,a&&(e.context=e._openGLRenderWindow.getContext()))},t.releaseGraphicsResources=()=>{e.glFramebuffer&&e.context.deleteFramebuffer(e.glFramebuffer)},t.getSize=()=>e.glFramebuffer==null?null:[e.glFramebuffer.width,e.glFramebuffer.height],t.populateFramebuffer=()=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling populateFrameBuffer");return}t.bind();const a=e.context,n=Ne.newInstance();n.setOpenGLRenderWindow(e._openGLRenderWindow),n.setMinificationFilter(me.LINEAR),n.setMagnificationFilter(me.LINEAR),n.create2DFromRaw({width:e.glFramebuffer.width,height:e.glFramebuffer.height,numComps:4,dataType:be.UNSIGNED_CHAR,data:null}),t.setColorBuffer(n),e.depthTexture=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,e.depthTexture),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,e.glFramebuffer.width,e.glFramebuffer.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,e.depthTexture)},t.getColorTexture=()=>e.colorBuffers[0]}var f8={glFramebuffer:null,colorBuffers:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function v1(t,e,a={}){Object.assign(e,f8,a),lt(t,e),e.colorBuffers&&ze("you cannot initialize colorBuffers through the constructor. You should call setColorBuffer() instead."),e.colorBuffers=[],ma(t,e,["colorBuffers"]),l8(t,e)}var p8=qe(v1,"vtkFramebuffer"),Or={newInstance:p8,extend:v1},{PassTypes:pt}=Sp,{SelectionContent:h8,SelectionField:y1}=g1,{FieldAssociations:Ka}=dr,{vtkErrorMacro:m1,vtkDebugMacro:Xa}=A,Hn=1;function x1(t){return`${t.propID} ${t.compositeID}`}function C1(t,e,a,n){return a?a[(e*(n[2]-n[0]+1)+t)*4+3]:0}function Fn(t,e,a,n,r=null){if(!a)return 0;const i=(e*(n[2]-n[0]+1)+t)*4,o=a[i],s=a[i+1];return(a[i+2]*256+s)*256+o}function S1(t,e){let a=e;return a<<=24,a|=t,a}function aa(t,e,a,n){const r=a<0?0:a;if(r===0){if(n[0]=e[0],n[1]=e[1],e[0]t.area[2]||e[1]t.area[3])return null;const u=[e[0]-t.area[0],e[1]-t.area[1]],c=Fn(u[0],u[1],t.pixBuffer[pt.ACTOR_PASS],t.area,"getPixelInformationWithData1");if(c<=0||c-Hn>=t.props.length)return null;const p={};p.valid=!0,p.propID=c-Hn,p.prop=t.props[p.propID];let l=Fn(u[0],u[1],t.pixBuffer[pt.COMPOSITE_INDEX_PASS],t.area,"getPixelInformationWithData2");if((l<0||l>16777215)&&(l=0),p.compositeID=l-Hn,t.captureZValues){const f=(u[1]*(t.area[2]-t.area[0]+1)+u[0])*4;p.zValue=(256*t.zBuffer[f]+t.zBuffer[f+1])/65535,p.displayPosition=e}return t.pixBuffer[pt.ID_LOW24]&&C1(u[0],u[1],t.pixBuffer[pt.ID_LOW24],t.area)===0||(p.attributeID=S1(Fn(u[0],u[1],t.pixBuffer[pt.ID_LOW24],t.area,"getPixelInformationWithData3"),Fn(u[0],u[1],t.pixBuffer[pt.ID_HIGH24],t.area,"getPixelInformationWithData4"))),p}const i=[e[0],e[1]],o=[0,0];let s=aa(t,e,0,n);if(s&&s.valid)return s;for(let u=1;uu?i[1]-u:0;c<=i[1]+u;++c)if(o[1]=c,i[0]>=u&&(o[0]=i[0]-u,s=aa(t,o,0,n),s&&s.valid)||(o[0]=i[0]+u,s=aa(t,o,0,n),s&&s.valid))return s;for(let c=i[0]>=u?i[0]-(u-1):0;c<=i[0]+(u-1);++c)if(o[0]=c,i[1]>=u&&(o[1]=i[1]-u,s=aa(t,o,0,n),s&&s.valid)||(o[1]=i[1]+u,s=aa(t,o,0,n),s&&s.valid))return s}return n[0]=e[0],n[1]=e[1],null}function T1(t,e,a,n,r){const i=[];let o=0;return e.forEach((s,u)=>{const c=g1.newInstance();switch(c.setContentType(h8.INDICES),t){case Ka.FIELD_ASSOCIATION_CELLS:c.setFieldType(y1.CELL);break;case Ka.FIELD_ASSOCIATION_POINTS:c.setFieldType(y1.POINT);break;default:m1("Unknown field association")}c.getProperties().propID=s.info.propID,c.getProperties().prop=s.info.prop,c.getProperties().compositeID=s.info.compositeID,c.getProperties().attributeID=s.info.attributeID,c.getProperties().pixelCount=s.pixelCount,a&&(c.getProperties().displayPosition=[s.info.displayPosition[0],s.info.displayPosition[1],s.info.zValue],c.getProperties().worldPosition=r.displayToWorld(s.info.displayPosition[0],s.info.displayPosition[1],s.info.zValue,n)),c.setSelectionList(s.attributeIDs),i[o]=c,o++}),i}function g8(t,e,a,n,r){const i=Math.floor(e),o=Math.floor(a),s=Math.floor(n),u=Math.floor(r),c=new Map,p=[0,0];for(let l=o;l<=u;l++)for(let f=i;f<=s;f++){const h=aa(t,[f,l],0,p);if(h&&h.valid){const v=x1(h);if(!c.has(v))c.set(v,{info:h,pixelCount:1,attributeIDs:[h.attributeID]});else{const m=c.get(v);m.pixelCount++,t.captureZValues&&h.zValue{e.rawPixBuffer=[],e.pixBuffer=[],e.zBuffer=null},t.beginSelection=()=>{e._openGLRenderer=e._openGLRenderWindow.getViewNodeFor(e._renderer,e._openGLRenderer),e.maxAttributeId=0;const n=e._openGLRenderWindow.getSize();if(!e.framebuffer)e.framebuffer=Or.newInstance(),e.framebuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.create(n[0],n[1]),e.framebuffer.populateFramebuffer();else{e.framebuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.framebuffer.saveCurrentBindingsAndBuffers();const r=e.framebuffer.getSize();!r||r[0]!==n[0]||r[1]!==n[1]?(e.framebuffer.create(n[0],n[1]),e.framebuffer.populateFramebuffer()):e.framebuffer.bind()}if(e._openGLRenderer.clear(),e._openGLRenderer.setSelector(t),e.hitProps={},e.propPixels={},e.props=[],t.releasePixBuffers(),e.fieldAssociation===Ka.FIELD_ASSOCIATION_POINTS){const r=e._openGLRenderWindow.getContext(),i=r.isEnabled(r.BLEND);r.disable(r.BLEND),e._openGLRenderWindow.traverseAllPasses(),i&&r.enable(r.BLEND)}},t.endSelection=()=>{e.hitProps={},e._openGLRenderer.setSelector(null),e.framebuffer.restorePreviousBindingsAndBuffers()},t.preCapturePass=()=>{const n=e._openGLRenderWindow.getContext();e.originalBlending=n.isEnabled(n.BLEND),n.disable(n.BLEND)},t.postCapturePass=()=>{const n=e._openGLRenderWindow.getContext();e.originalBlending&&n.enable(n.BLEND)},t.select=()=>{let n=null;return t.captureBuffers()&&(n=t.generateSelection(e.area[0],e.area[1],e.area[2],e.area[3]),t.releasePixBuffers()),n},t.getSourceDataAsync=async(n,r,i,o,s)=>{if(e._renderer=n,r===void 0){const c=e._openGLRenderWindow.getSize();t.setArea(0,0,c[0]-1,c[1]-1)}else t.setArea(r,i,o,s);if(!t.captureBuffers())return!1;const u={area:[...e.area],pixBuffer:[...e.pixBuffer],captureZValues:e.captureZValues,zBuffer:e.zBuffer,props:[...e.props],fieldAssociation:e.fieldAssociation,renderer:n,openGLRenderWindow:e._openGLRenderWindow};return u.generateSelection=(...c)=>g8(u,...c),u},t.captureBuffers=()=>{if(!e._renderer||!e._openGLRenderWindow)return m1("Renderer and view must be set before calling Select."),!1;e._openGLRenderer=e._openGLRenderWindow.getViewNodeFor(e._renderer,e._openGLRenderer),e._openGLRenderWindow.getRenderable().preRender(),t.invokeEvent({type:"StartEvent"}),e.originalBackground=e._renderer.getBackgroundByReference(),e._renderer.setBackground(0,0,0,0);const n=e._openGLRenderWindow.getRenderPasses();t.beginSelection();const r=[];for(e.currentPass=pt.MIN_KNOWN_PASS;e.currentPass<=pt.MAX_KNOWN_PASS;e.currentPass++)t.passRequired(e.currentPass)&&(t.preCapturePass(e.currentPass),e.captureZValues&&e.currentPass===pt.ACTOR_PASS&&typeof n[0].requestDepth=="function"&&typeof n[0].getFramebuffer=="function"&&n[0].requestDepth(),e._openGLRenderWindow.traverseAllPasses(),t.postCapturePass(e.currentPass),t.savePixelBuffer(e.currentPass),r.push(e.currentPass));return r.forEach(i=>{e.currentPass=i,t.processPixelBuffers()}),e.currentPass=pt.MAX_KNOWN_PASS,t.endSelection(),e._renderer.setBackground(e.originalBackground),t.invokeEvent({type:"EndEvent"}),!0},t.processPixelBuffers=()=>{e.props.forEach((n,r)=>{t.isPropHit(r)&&n.processSelectorPixelBuffers(t,e.propPixels[r])})},t.passRequired=n=>{if(n===pt.ID_HIGH24){if(e.fieldAssociation===Ka.FIELD_ASSOCIATION_POINTS)return e.maximumPointId>16777215;if(e.fieldAssociation===Ka.FIELD_ASSOCIATION_CELLS)return e.maximumCellId>16777215}return!0},t.savePixelBuffer=n=>{if(e.pixBuffer[n]=e._openGLRenderWindow.getPixelData(e.area[0],e.area[1],e.area[2],e.area[3]),!e.rawPixBuffer[n]){const r=(e.area[2]-e.area[0]+1)*(e.area[3]-e.area[1]+1)*4;e.rawPixBuffer[n]=new Uint8Array(r),e.rawPixBuffer[n].set(e.pixBuffer[n])}if(n===pt.ACTOR_PASS){if(e.captureZValues){const r=e._openGLRenderWindow.getRenderPasses();if(typeof r[0].requestDepth=="function"&&typeof r[0].getFramebuffer=="function"){const i=r[0].getFramebuffer();i.saveCurrentBindingsAndBuffers(),i.bind(),e.zBuffer=e._openGLRenderWindow.getPixelData(e.area[0],e.area[1],e.area[2],e.area[3]),i.restorePreviousBindingsAndBuffers()}}t.buildPropHitList(e.rawPixBuffer[n])}},t.buildPropHitList=n=>{let r=0;for(let i=0;i<=e.area[3]-e.area[1];i++)for(let o=0;o<=e.area[2]-e.area[0];o++){let s=Fn(o,i,n,e.area,"buildPropHitList");s>0&&(s--,s in e.hitProps||(e.hitProps[s]=!0,e.propPixels[s]=[]),e.propPixels[s].push(r*4)),++r}},t.renderProp=n=>{e.currentPass===pt.ACTOR_PASS&&(t.setPropColorValueFromInt(e.props.length+Hn),e.props.push(n))},t.renderCompositeIndex=n=>{e.currentPass===pt.COMPOSITE_INDEX_PASS&&t.setPropColorValueFromInt(n+Hn)},t.renderAttributeId=n=>{n<0||(e.maxAttributeId=n>e.maxAttributeId?n:e.maxAttributeId)},t.passTypeToString=n=>A.enumToString(pt,n),t.isPropHit=n=>Boolean(e.hitProps[n]),t.setPropColorValueFromInt=n=>{e.propColorValue[0]=n%256/255,e.propColorValue[1]=Math.floor(n/256)%256/255,e.propColorValue[2]=Math.floor(n/65536)%256/255},t.getPixelInformation=(n,r,i)=>{const o=r<0?0:r;if(Xa("getPixelInformation called",o),o===0){if(i[0]=n[0],i[1]=n[1],n[0]e.area[2]||n[1]e.area[3])return null;Xa(n),Xa(e.area);const p=[n[0]-e.area[0],n[1]-e.area[1]];Xa("adjusted displayPosition",p);const l=Fn(p[0],p[1],e.pixBuffer[pt.ACTOR_PASS],e.area,"getPixelInformation");if(Xa("actorid",l),l<=0||l-Hn>=e.props.length)return null;const f={};f.valid=!0,f.propID=l-Hn,f.prop=e.props[f.propID];let h=Fn(p[0],p[1],e.pixBuffer[pt.COMPOSITE_INDEX_PASS],e.area,"getPixelInformation2");if((h<0||h>16777215)&&(h=0),f.compositeID=h-Hn,e.captureZValues){const v=(p[1]*(e.area[2]-e.area[0]+1)+p[0])*4;f.zValue=(256*e.zBuffer[v]+e.zBuffer[v+1])/65535,f.displayPosition=n}return e.pixBuffer[pt.ID_LOW24]&&C1(p[0],p[1],e.pixBuffer[pt.ID_LOW24],e.area)===0||(f.attributeID=S1(Fn(p[0],p[1],e.pixBuffer[pt.ID_LOW24],e.area,"getPixelInformation3"),Fn(p[0],p[1],e.pixBuffer[pt.ID_HIGH24],e.area,"getPixelInformation4"))),f}const s=[n[0],n[1]],u=[0,0];let c=t.getPixelInformation(n,0,i);if(c&&c.valid)return c;for(let p=1;pp?s[1]-p:0;l<=s[1]+p;++l)if(u[1]=l,s[0]>=p&&(u[0]=s[0]-p,c=t.getPixelInformation(u,0,i),c&&c.valid)||(u[0]=s[0]+p,c=t.getPixelInformation(u,0,i),c&&c.valid))return c;for(let l=s[0]>=p?s[0]-(p-1):0;l<=s[0]+(p-1);++l)if(u[0]=l,s[1]>=p&&(u[1]=s[1]-p,c=t.getPixelInformation(u,0,i),c&&c.valid)||(u[1]=s[1]+p,c=t.getPixelInformation(u,0,i),c&&c.valid))return c}return i[0]=n[0],i[1]=n[1],null},t.generateSelection=(n,r,i,o)=>{const s=Math.floor(n),u=Math.floor(r),c=Math.floor(i),p=Math.floor(o),l=new Map,f=[0,0];for(let h=u;h<=p;h++)for(let v=s;v<=c;v++){const m=[v,h],x=t.getPixelInformation(m,0,f);if(x&&x.valid){const y=x1(x);if(!l.has(y))l.set(y,{info:x,pixelCount:1,attributeIDs:[x.attributeID]});else{const d=l.get(y);d.pixelCount++,e.captureZValues&&x.zValuee.rawPixBuffer[n],t.getPixelBuffer=n=>e.pixBuffer[n],t.attach=(n,r)=>{e._openGLRenderWindow=n,e._renderer=r};const a=t.setArea;t.setArea=(...n)=>a(...n)?(e.area[0]=Math.floor(e.area[0]),e.area[1]=Math.floor(e.area[1]),e.area[2]=Math.floor(e.area[2]),e.area[3]=Math.floor(e.area[3]),!0):!1}var v8={area:void 0,currentPass:-1,propColorValue:null,props:null,maximumPointId:0,maximumCellId:0,idOffset:1};function w1(t,e,a={}){Object.assign(e,v8,a),u8.extend(t,e,a),e.propColorValue=[0,0,0],e.props=[],e.area||(e.area=[0,0,0,0]),A.setGetArray(t,e,["area"],4),A.setGet(t,e,["_renderer","currentPass","_openGLRenderWindow","maximumPointId","maximumCellId"]),A.setGetArray(t,e,["propColorValue"],3),A.moveToProtected(t,e,["renderer","openGLRenderWindow"]),A.event(t,e,"event"),d8(t,e)}var y8=A.newInstance(w1,"vtkOpenGLHardwareSelector"),qa={newInstance:y8,extend:w1,...Sp},{vtkErrorMacro:Ya}=bt,{Representation:m8}=yr,{ObjectType:Fo}=Ln,{PassTypes:x8}=qa,C8={type:"StartEvent"},S8={type:"EndEvent"},T8=64,w8=16;function _8(t,e){e.classHierarchy.push("vtkOpenGLGlyph3DMapper");const a={...t};t.renderPiece=(n,r)=>{if(t.invokeEvent(C8),e.renderable.getStatic()||e.renderable.update(),e.currentInput=e.renderable.getInputData(1),t.invokeEvent(S8),!e.currentInput){Ya("No input!");return}if(!e.currentInput.getPoints||!e.currentInput.getPoints().getNumberOfValues())return;const i=e.context;e._openGLRenderWindow.getWebgl2()?(e.hardwareSupport=!0,e.extension=null):e.extension||(e.extension=e.context.getExtension("ANGLE_instanced_arrays"),e.hardwareSupport=!!e.extension);const o=r.getProperty().getBackfaceCulling(),s=r.getProperty().getFrontfaceCulling();!o&&!s?e._openGLRenderWindow.disableCullFace():s?(e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(i.FRONT)):(e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(i.BACK)),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.multiply4x4WithOffset=(n,r,i,o)=>{const s=r[0],u=r[1],c=r[2],p=r[3],l=r[4],f=r[5],h=r[6],v=r[7],m=r[8],x=r[9],y=r[10],d=r[11],g=r[12],C=r[13],S=r[14],T=r[15];let w=i[o],_=i[o+1],E=i[o+2],D=i[o+3];n[0]=w*s+_*l+E*m+D*g,n[1]=w*u+_*f+E*x+D*C,n[2]=w*c+_*h+E*y+D*S,n[3]=w*p+_*v+E*d+D*T,w=i[o+4],_=i[o+5],E=i[o+6],D=i[o+7],n[4]=w*s+_*l+E*m+D*g,n[5]=w*u+_*f+E*x+D*C,n[6]=w*c+_*h+E*y+D*S,n[7]=w*p+_*v+E*d+D*T,w=i[o+8],_=i[o+9],E=i[o+10],D=i[o+11],n[8]=w*s+_*l+E*m+D*g,n[9]=w*u+_*f+E*x+D*C,n[10]=w*c+_*h+E*y+D*S,n[11]=w*p+_*v+E*d+D*T,w=i[o+12],_=i[o+13],E=i[o+14],D=i[o+15],n[12]=w*s+_*l+E*m+D*g,n[13]=w*u+_*f+E*x+D*C,n[14]=w*c+_*h+E*y+D*S,n[15]=w*p+_*v+E*d+D*T},t.replaceShaderNormal=(n,r,i)=>{if(e.hardwareSupport&&e.lastBoundBO.getReferenceByName("lastLightComplexity")>0){let o=n.Vertex;e.lastBoundBO.getCABO().getNormalOffset()&&(o=Z.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=Z.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),n.Vertex=o}a.replaceShaderNormal(n,r,i)},t.replaceShaderClip=(n,r,i)=>{if(e.hardwareSupport){let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){const u=e.renderable.getNumberOfClippingPlanes();o=Z.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`uniform vec4 clipPlanes[${u}];`,`varying float clipDistancesVSOutput[${u}];`]).result,o=Z.substitute(o,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${u}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," vec4 gVertex = gMatrix * vertexMC;"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], gVertex);"," }"]).result,s=Z.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`varying float clipDistancesVSOutput[${u}];`]).result,s=Z.substitute(s,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${u}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s}a.replaceShaderClip(n,r,i)},t.replaceShaderColor=(n,r,i)=>{if(e.hardwareSupport&&e.renderable.getColorArray()){let o=n.Vertex,s=n.Geometry,u=n.Fragment;const c=e.lastBoundBO.getReferenceByName("lastLightComplexity");let p=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];c&&(p=p.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));let l=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];c&&(l=l.concat([" vec3 specularColor;"," float specularPower;"])),l=l.concat([" opacity = opacityUniform;"]),c&&(l=l.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),e.drawingEdges||(p=p.concat(["varying vec4 vertexColorVSOutput;"]),o=Z.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=Z.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,s=Z.substitute(s,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,s=Z.substitute(s,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,l=l.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),u=Z.substitute(u,"//VTK::Color::Impl",l).result,u=Z.substitute(u,"//VTK::Color::Dec",p).result,n.Vertex=o,n.Geometry=s,n.Fragment=u}a.replaceShaderColor(n,r,i)},t.replaceShaderPositionVC=(n,r,i)=>{if(e.hardwareSupport){let o=n.Vertex;e.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=Z.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=Z.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=Z.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=Z.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),n.Vertex=o}a.replaceShaderPositionVC(n,r,i)},t.replaceShaderPicking=(n,r,i)=>{if(e.hardwareSupport){let o=n.Fragment,s=n.Vertex;s=Z.substitute(s,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,s=Z.substitute(s,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,n.Vertex=s,o=Z.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=Z.substitute(o,"//VTK::Picking::Impl",[" vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);"," gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];"]).result,n.Fragment=o}else a.replaceShaderPicking(n,r,i)},t.updateGlyphShaderParameters=(n,r,i,o,s,u,c,p)=>{const l=i.getProgram();if(n){const f=e.normalMatrix,h=u,v=c*9,m=e.tmpMat3,x=f[0],y=f[1],d=f[2],g=f[3],C=f[4],S=f[5],T=f[6],w=f[7],_=f[8],E=h[v],D=h[v+1],O=h[v+2],b=h[v+3],R=h[v+4],N=h[v+5],L=h[v+6],B=h[v+7],P=h[v+8];m[0]=E*x+D*g+O*T,m[1]=E*y+D*C+O*w,m[2]=E*d+D*S+O*_,m[3]=b*x+R*g+N*T,m[4]=b*y+R*C+N*w,m[5]=b*d+R*S+N*_,m[6]=L*x+B*g+P*T,m[7]=L*y+B*C+P*w,m[8]=L*d+B*S+P*_,l.setUniformMatrix3x3("normalMatrix",e.tmpMat3)}if(t.multiply4x4WithOffset(e.tmpMat4,e.mcpcMatrix,s,c*16),l.setUniformMatrix("MCPCMatrix",e.tmpMat4),r&&(t.multiply4x4WithOffset(e.tmpMat4,e.mcvcMatrix,s,c*16),l.setUniformMatrix("MCVCMatrix",e.tmpMat4)),o){const f=o.getData();e.tmpColor[0]=f[c*4]/255,e.tmpColor[1]=f[c*4+1]/255,e.tmpColor[2]=f[c*4+2]/255,l.setUniform3fArray("ambientColorUniform",e.tmpColor),l.setUniform3fArray("diffuseColorUniform",e.tmpColor)}p&&l.setUniform3fArray("mapperIndex",p.getPropColorValue())},t.renderPieceDraw=(n,r)=>{const i=r.getProperty().getRepresentation(),o=e.context,s=r.getProperty().getEdgeVisibility()&&i===m8.SURFACE,u=e.openGLCamera.getKeyMatrices(n),c=e.openGLActor.getKeyMatrices();fr(e.normalMatrix,u.normalMatrix,c.normalMatrix),Ee(e.mcpcMatrix,u.wcpc,c.mcwc),Ee(e.mcvcMatrix,u.wcvc,c.mcwc);const p=e.renderable.getMatrixArray(),l=e.renderable.getNormalArray(),f=e.renderable.getColorArray(),h=p.length/16;let v=!1;e._openGLRenderer.getSelector()&&e._openGLRenderer.getSelector().getCurrentPass()===x8.COMPOSITE_INDEX_PASS&&(v=!0);for(let m=e.primTypes.Start;m{if(n.getCABO().getElementCount()&&(e.glyphBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){n.getProgram().isAttributeUsed("gMatrix")?n.getVAO().addAttributeMatrixWithDivisor(n.getProgram(),e.matrixBuffer,"gMatrix",0,64,e.context.FLOAT,4,!1,1)||Ya("Error setting gMatrix in shader VAO."):n.getVAO().removeAttributeArray("gMatrix"),n.getProgram().isAttributeUsed("gNormal")?n.getVAO().addAttributeMatrixWithDivisor(n.getProgram(),e.normalBuffer,"gNormal",0,36,e.context.FLOAT,3,!1,1)||Ya("Error setting gNormal in shader VAO."):n.getVAO().removeAttributeArray("gNormal"),n.getProgram().isAttributeUsed("gColor")?n.getVAO().addAttributeArrayWithDivisor(n.getProgram(),e.colorBuffer,"gColor",0,4,e.context.UNSIGNED_BYTE,4,!0,1,!1)||Ya("Error setting gColor in shader VAO."):n.getVAO().removeAttributeArray("gColor"),n.getProgram().isAttributeUsed("mapperIndexVS")?n.getVAO().addAttributeArrayWithDivisor(n.getProgram(),e.pickBuffer,"mapperIndexVS",0,4,e.context.UNSIGNED_BYTE,4,!0,1,!1)||Ya("Error setting mapperIndexVS in shader VAO."):n.getVAO().removeAttributeArray("mapperIndexVS"),a.setMapperShaderParameters(n,r,i),n.getAttributeUpdateTime().modified();return}a.setMapperShaderParameters(n,r,i)},t.getNeedToRebuildBufferObjects=(n,r)=>(e.renderable.buildArrays(),e.VBOBuildTime.getMTime()!!(a.getNeedToRebuildShaders(n,r,i)||n.getShaderSourceTime().getMTime(){const i=e.renderable.getMatrixArray(),{useShiftAndScale:o,coordShift:s,coordScale:u}=Y0(e.renderable.getInputData(0).getPoints());if(e.hardwareSupport){const c=e.renderable.getNormalArray(),p=e.renderable.getColorArray();if(e.matrixBuffer||(e.matrixBuffer=Ln.newInstance(),e.matrixBuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.normalBuffer=Ln.newInstance(),e.normalBuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.colorBuffer=Ln.newInstance(),e.colorBuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.pickBuffer=Ln.newInstance(),e.pickBuffer.setOpenGLRenderWindow(e._openGLRenderWindow)),o){const l=i.buffer,f=r1(s,u);Et(f,f);for(let h=0;he.glyphBOBuildTime.getMTime()){e.matrixBuffer.upload(i,Fo.ARRAY_BUFFER),e.normalBuffer.upload(c,Fo.ARRAY_BUFFER),p?e.colorBuffer.upload(p.getData(),Fo.ARRAY_BUFFER):e.colorBuffer.releaseGraphicsResources();const l=i.length/16,f=new Uint8Array(4*l);for(let h=0;h0?`${t.map(n=>(n==null?void 0:n.getMTime())??"x").join("/")}-${e}-${a}`:"0"}function ec(t,e){return`${e.getMTime()}`}var{vtkErrorMacro:ia}=bt,{SlicingMode:Ut}=Q0;function N8(t){const e=t.split(` +`),a=[];for(let n=0;n0&&a.push(r)}return a}function R8(t,e){e.classHierarchy.push("vtkOpenGLImageMapper");function a(n){e.openGLTexture.releaseGraphicsResources(n),[e._colorTransferFunc,e._pwFunc,e._labelOutlineThicknessArray,e._labelOutlineOpacity].forEach(r=>n.unregisterGraphicsResourceUser(r,t))}t.buildPass=n=>{if(n){e.currentRenderPass=null,e.openGLImageSlice=t.getFirstAncestorOfType("vtkOpenGLImageSlice"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const r=e._openGLRenderWindow;e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),r&&!r.isDeleted()&&r!==e._openGLRenderWindow&&a(r),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow);const i=e._openGLRenderer.getRenderable();e.openGLCamera=e._openGLRenderer.getViewNodeFor(i.getActiveCamera(),e.openGLCamera),e.renderable.isA("vtkImageMapper")&&e.renderable.getSliceAtFocalPoint()&&e.renderable.setSliceFromCamera(i.getActiveCamera())}},t.translucentPass=(n,r)=>{n&&(e.currentRenderPass=r,t.render())},t.zBufferPass=n=>{n&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.opaqueZBufferPass=n=>t.zBufferPass(n),t.opaquePass=n=>{n&&t.render()},t.getCoincidentParameters=(n,r)=>e.renderable.getResolveCoincidentTopology()==Zt.PolygonOffset?e.renderable.getCoincidentTopologyPolygonOffsetParameters():null,t.render=()=>{const n=e.openGLImageSlice.getRenderable(),r=e._openGLRenderer.getRenderable();t.renderPiece(r,n)},t.getShaderTemplate=(n,r,i)=>{n.Vertex=J0,n.Fragment=Ha,n.Geometry=""},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;o=Z.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Z.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result,o=Z.substitute(o,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result,o=Z.substitute(o,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result;const u=e.openGLTexture.getComponents(),c=i.getProperty().getIndependentComponents();let p=["varying vec2 tcoordVCVSOutput;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D texture1;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;"];if(i.getProperty().getUseLabelOutline()&&(p=p.concat(["uniform sampler2D labelOutlineTexture1;","uniform sampler2D labelOutlineOpacityTexture1;"])),c){for(let l=1;l{let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){let u=e.renderable.getNumberOfClippingPlanes();u>6&&(ze("OpenGL has a limit of 6 clipping planes"),u=6),o=Z.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,o=Z.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=Z.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,s=Z.substitute(s,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s},t.getNeedToRebuildShaders=(n,r,i)=>{var c;const o=e.openGLTexture.getComponents(),s=i.getProperty().getIndependentComponents();let u=!1;return(!e.currentRenderPass&&e.lastRenderPassShaderReplacement||e.currentRenderPass&&e.currentRenderPass.getShaderReplacement()!==e.lastRenderPassShaderReplacement)&&(u=!0),u||e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||((c=n.getProgram())==null?void 0:c.getHandle())===0||n.getShaderSourceTime().getMTime(){if(e.lastBoundBO=n,t.getNeedToRebuildShaders(n,r,i)){const o={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(o,r,i);const s=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);s!==n.getProgram()&&(n.setProgram(s),n.getVAO().releaseGraphicsResources()),n.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(n.getProgram());n.getVAO().bind(),t.setMapperShaderParameters(n,r,i),t.setCameraShaderParameters(n,r,i),t.setPropertyShaderParameters(n,r,i)},t.setMapperShaderParameters=(n,r,i)=>{n.getCABO().getElementCount()&&(e.VBOBuildTime>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||ia("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getTCoordComponents(),e.context.FALSE)||ia("Error setting tcoordMC in shader VAO.")),n.getAttributeUpdateTime().modified());const o=e.openGLTexture.getTextureUnit();n.getProgram().setUniformi("texture1",o);const s=e.openGLTexture.getComponents(),u=i.getProperty().getIndependentComponents();if(u)for(let f=0;f6&&(ze("OpenGL has a limit of 6 clipping planes"),f=6);const h=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,v=h?vt(e.imagematinv,i.getMatrix()):i.getMatrix();h&&(We(v,v),Ee(v,v,h),We(v,v)),We(e.imagemat,e.currentInput.getIndexToWorld()),Ee(e.imagematinv,v,e.imagemat);const m=[];for(let x=0;x{const o=n.getProgram(),s=e.openGLImageSlice.getKeyMatrices(),u=e.currentInput,c=u.getIndexToWorld();Ee(e.imagemat,s.mcwc,c);const p=e.openGLCamera.getKeyMatrices(r);if(Ee(e.imagemat,p.wcpc,e.imagemat),n.getCABO().getCoordShiftAndScaleEnabled()){const l=n.getCABO().getInverseShiftAndScaleMatrix();Ee(e.imagemat,e.imagemat,l)}if(o.setUniformMatrix("MCPCMatrix",e.imagemat),i.getProperty().getUseLabelOutline()===!0){const l=u.getWorldToIndex(),f=u.getDimensions();let h=e.renderable.getClosestIJKAxis().ijkMode;h===Ut.NONE&&(h=Ut.K),o.setUniform3i("imageDimensions",f[0],f[1],f[2]),o.setUniformi("sliceAxis",h),o.setUniformMatrix("vWCtoIDX",l);const v=e.openGLCamera.getKeyMatrices(r);Et(e.projectionToWorld,v.wcpc),e.openGLCamera.getKeyMatrices(r),o.setUniformMatrix("PCWCMatrix",e.projectionToWorld);const m=t.getRenderTargetSize();o.setUniformf("vpWidth",m[0]),o.setUniformf("vpHeight",m[1]);const x=t.getRenderTargetOffset();o.setUniformf("vpOffsetX",x[0]/m[0]),o.setUniformf("vpOffsetY",x[1]/m[1])}},t.setPropertyShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=i.getProperty().getOpacity();o.setUniformf("opacity",s)},t.renderPieceStart=(n,r)=>{t.updateBufferObjects(n,r),e.lastBoundBO=null},t.renderPieceDraw=(n,r)=>{const i=e.context;e.openGLTexture.activate(),e.colorTexture.activate(),r.getProperty().getUseLabelOutline()&&(e.labelOutlineThicknessTexture.activate(),e.labelOutlineOpacityTexture.activate()),e.pwfTexture.activate(),e.tris.getCABO().getElementCount()&&(t.updateShaders(e.tris,n,r),i.drawArrays(i.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release()),e.openGLTexture.deactivate(),e.colorTexture.deactivate(),r.getProperty().getUseLabelOutline()&&(e.labelOutlineThicknessTexture.deactivate(),e.labelOutlineOpacityTexture.deactivate()),e.pwfTexture.deactivate()},t.renderPieceFinish=(n,r)=>{},t.renderPiece=(n,r)=>{if(t.invokeEvent({type:"StartEvent"}),e.renderable.update(),e.currentInput=e.renderable.getCurrentImage(),t.invokeEvent({type:"EndEvent"}),!e.currentInput){ia("No input!");return}t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.updateBufferObjects=(n,r)=>{t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r)},t.getNeedToRebuildBufferObjects=(n,r)=>{var i,o,s,u,c;return e.VBOBuildTime.getMTime(){var b,R,N,L;const i=e.currentInput;if(!i)return;const o=i.getPointData()&&i.getPointData().getScalars();if(!o)return;const s=o.getDataType(),u=o.getNumberOfComponents(),c=r.getProperty(),p=c.getInterpolationType(),l=c.getIndependentComponents(),f=l?u:1,h=l?2*f:1,v=[];for(let B=0;B1?1:0;const G=[Ut.X,Ut.Y,Ut.Z].includes(e.renderable.getSlicingMode())?w:_,W=i.getSpatialExtent(),H=o.getData();let X=null;if(T===Ut.I){X=new H.constructor(B[2]*B[1]*u);let ee=0;for(let V=0;V{var s,u;let r=n.getProperty().getLabelOutlineOpacity();typeof r=="number"&&(((s=e._cachedLabelOutlineOpacityObj)==null?void 0:s[0])===r?r=e._cachedLabelOutlineOpacityObj:r=[r],e._cachedLabelOutlineOpacityObj=r);const i=e._openGLRenderWindow.getGraphicsResourceForObject(r),o=`${r.join("-")}`;if(!((u=i==null?void 0:i.oglObject)!=null&&u.getHandle())||(i==null?void 0:i.hash)!==o){let c=e.renderable.getLabelOutlineTextureWidth();c<=0&&(c=e.context.getParameter(e.context.MAX_TEXTURE_SIZE));const p=1,l=c*p,f=new Float32Array(l);for(let h=0;h{var s;const r=n.getProperty().getLabelOutlineThicknessByReference(),i=e._openGLRenderWindow.getGraphicsResourceForObject(r),o=`${r.join("-")}`;if(!((s=i==null?void 0:i.oglObject)!=null&&s.getHandle())||(i==null?void 0:i.hash)!==o){let u=e.renderable.getLabelOutlineTextureWidth();u<=0&&(u=e.context.getParameter(e.context.MAX_TEXTURE_SIZE));const c=1,p=u*c,l=new Uint8Array(p);for(let f=0;f{if(e._useSmallViewport)return[e._smallViewportWidth,e._smallViewportHeight];const{usize:n,vsize:r}=e._openGLRenderer.getTiledSizeAndOrigin();return[n,r]},t.getRenderTargetOffset=()=>{const{lowerLeftU:n,lowerLeftV:r}=e._openGLRenderer.getTiledSizeAndOrigin();return[n,r]},t.delete=In(()=>{e._openGLRenderWindow&&a(e._openGLRenderWindow)},t.delete)}var L8={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,imagematinv:null,colorTexture:null,pwfTexture:null,labelOutlineThicknessTexture:null,labelOutlineOpacityTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};function F8(t,e,a={}){Object.assign(e,L8,a),Ct.extend(t,e,a),xn.implementReplaceShaderCoincidentOffset(t,e,a),xn.implementBuildShadersWithReplacements(t,e,a),e.tris=jt.newInstance(),e.imagemat=we(new Float64Array(16)),e.imagematinv=we(new Float64Array(16)),e.projectionToWorld=we(new Float64Array(16)),e.idxToView=we(new Float64Array(16)),e.idxNormalMatrix=zt(new Float64Array(9)),e.modelToView=we(new Float64Array(16)),e.projectionToView=we(new Float64Array(16)),ht(t,e,[]),e.VBOBuildTime={},lt(e.VBOBuildTime),R8(t,e)}var k8=qe(F8,"vtkOpenGLImageMapper");ct("vtkAbstractImageMapper",k8);function A8(t,e){e.classHierarchy.push("vtkOpenGLImageSlice"),t.buildPass=a=>{if(!(!e.renderable||!e.renderable.getVisibility())&&a){if(!e.renderable)return;e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes()}},t.traverseZBufferPass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children.forEach(n=>{n.traverse(a)}),t.apply(a,!1))},t.traverseOpaqueZBufferPass=a=>t.traverseOpaquePass(a),t.traverseOpaquePass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||!e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children.forEach(n=>{n.traverse(a)}),t.apply(a,!1))},t.traverseTranslucentPass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children.forEach(n=>{n.traverse(a)}),t.apply(a,!1))},t.queryPass=(a,n)=>{if(a){if(!e.renderable||!e.renderable.getVisibility())return;e.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},t.zBufferPass=(a,n)=>t.opaquePass(a,n),t.opaqueZBufferPass=(a,n)=>t.opaquePass(a,n),t.opaquePass=(a,n)=>{a&&e.context.depthMask(!0)},t.translucentPass=(a,n)=>{e.context.depthMask(!a)},t.getKeyMatrices=()=>(e.renderable.getMTime()>e.keyMatrixTime.getMTime()&&(vt(e.keyMatrices.mcwc,e.renderable.getMatrix()),We(e.keyMatrices.mcwc,e.keyMatrices.mcwc),e.keyMatrixTime.modified()),e.keyMatrices)}var V8={context:null,keyMatrixTime:null,keyMatrices:null};function B8(t,e,a={}){Object.assign(e,V8,a),Ct.extend(t,e,a),e.keyMatrixTime={},lt(e.keyMatrixTime,{mtime:0}),e.keyMatrices={mcwc:we(new Float64Array(16))},ht(t,e,["context"]),A8(t,e)}var U8=qe(B8,"vtkOpenGLImageSlice");ct("vtkImageSlice",U8);var{vtkDebugMacro:G8}=bt;function I8(t,e){e.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),t.opaquePass=(a,n)=>{e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow");const r=e._openGLRenderer.getAspectRatio(),i=e._openGLRenderer?e._openGLRenderer.getRenderable().getActiveCamera():null,o=e._openGLRenderer.getTiledSizeAndOrigin();let s=null;if(e.renderable.getUseZValues()){const u=n.getZBufferTexture(),c=Math.floor(u.getWidth()),p=Math.floor(u.getHeight()),l=e._openGLRenderWindow.getContext();u.bind();const f=n.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():G8("No framebuffer to save/restore");const h=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,h),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,u.getHandle(),0),l.checkFramebufferStatus(l.FRAMEBUFFER)===l.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(c*p*4),l.viewport(0,0,c,p),l.readPixels(0,0,c,p,l.RGBA,l.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),l.deleteFramebuffer(h)}e.renderable.invokeCallback(e.renderable.getInputData(),i,r,o,s)},t.queryPass=(a,n)=>{a&&e.renderable.getUseZValues()&&n.requestDepth()}}var P8={};function z8(t,e,a={}){Object.assign(e,P8,a),Ct.extend(t,e,a),I8(t,e)}var W8=qe(z8,"vtkOpenGLPixelSpaceCallbackMapper");ct("vtkPixelSpaceCallbackMapper",W8);var j8={BACKGROUND:0,FOREGROUND:1},$8=`//VTK::System::Dec /*========================================================================= @@ -300,7 +351,7 @@ void main() discard; } } -`,K9=`//VTK::System::Dec +`,H8=`//VTK::System::Dec /*========================================================================= @@ -353,51 +404,9 @@ void main() //VTK::PositionVC::Impl } -`;const X9={BACKGROUND:0,FOREGROUND:1},{primTypes:Qt}=jt,{Filter:sh,Wrap:ch}=Re,{vtkErrorMacro:Ha}=Dt,q9={type:"StartEvent"},Y9={type:"EndEvent"};function J9(t,e){e.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),t.buildPass=n=>{n&&(e.openGLActor2D=t.getFirstAncestorOfType("vtkOpenGLActor2D"),e._openGLRenderer=e.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),e.openGLCamera=e._openGLRenderer.getViewNodeFor(e._openGLRenderer.getRenderable().getActiveCamera(),e.openGLCamera))},t.overlayPass=n=>{n&&t.render()},t.getShaderTemplate=(n,r,i)=>{n.Vertex=K9,n.Fragment=H9,n.Geometry=""},t.render=()=>{const n=e._openGLRenderWindow.getContext();if(e.context!==n){e.context=n;for(let o=Qt.Start;o{if(t.invokeEvent(q9),e.renderable.getStatic()||e.renderable.update(),e.currentInput=e.renderable.getInputData(),t.invokeEvent(Y9),!e.currentInput){Ha("No input!");return}if(!e.currentInput.getPoints||!e.currentInput.getPoints().getNumberOfValues())return;const i=e.context;e._openGLRenderWindow.enableCullFace(),i.cullFace(i.BACK),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.renderPieceStart=(n,r)=>{if(e.primitiveIDOffset=0,e._openGLRenderer.getSelector())switch(e._openGLRenderer.getSelector().getCurrentPass()){default:e._openGLRenderer.getSelector().renderProp(r)}e.renderable.getColorTextureMap()&&e.internalColorTexture.activate(),t.updateBufferObjects(n,r),e.lastBoundBO=null},t.getNeedToRebuildShaders=(n,r,i)=>n.getShaderSourceTime().getMTime(){t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r)},t.getNeedToRebuildBufferObjects=(n,r)=>{const i=e.VBOBuildTime.getMTime();return!!(i{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,r.getProperty().getOpacity());const o=e.renderable.getColorMapColors(),s=r.getProperty().getRepresentation();let c=i.getPointData().getTCoords();e.openGLActor2D.getActiveTextures()||(c=null);let l=!1;if(e.renderable.getColorCoordinates()){c=e.renderable.getColorCoordinates(),l=e.renderable.getAreScalarsMappedFromCells(),e.internalColorTexture||(e.internalColorTexture=Re.newInstance({resizable:!0}));const d=e.internalColorTexture;d.setMinificationFilter(sh.NEAREST),d.setMagnificationFilter(sh.NEAREST),d.setWrapS(ch.CLAMP_TO_EDGE),d.setWrapT(ch.CLAMP_TO_EDGE),d.setOpenGLRenderWindow(e._openGLRenderWindow);const v=e.renderable.getColorTextureMap(),m=v.getExtent(),x=v.getPointData().getScalars();d.create2DFromRaw({width:m[1]-m[0]+1,height:m[3]-m[2]+1,numComps:x.getNumberOfComponents(),dataType:x.getDataType(),data:x.getData()}),d.activate(),d.sendParameters(),d.deactivate()}const p=e.renderable.getTransformCoordinate(),f=n.getRenderWindow().getViews()[0].getViewportSize(n),h=`${i.getMTime()}A${s}B${i.getMTime()}C${o?o.getMTime():1}D${c?c.getMTime():1}E${p?n.getMTime():1}F${f}`;if(e.VBOBuildString!==h){let d=i.getPoints();if(p){const m=dn.newInstance(),x=d.getNumberOfPoints();m.setNumberOfPoints(x);const y=[];for(let g=0;gi.getPointData().getArrayByName(m))};v.cellOffset+=e.primitives[Qt.Points].getCABO().createVBO(i.getVerts(),"verts",s,v),v.cellOffset+=e.primitives[Qt.Lines].getCABO().createVBO(i.getLines(),"lines",s,v),v.cellOffset+=e.primitives[Qt.Tris].getCABO().createVBO(i.getPolys(),"polys",s,v),v.cellOffset+=e.primitives[Qt.TriStrips].getCABO().createVBO(i.getStrips(),"strips",s,v),e.VBOBuildTime.modified(),e.VBOBuildString=h}},t.renderPieceDraw=(n,r)=>{const i=r.getProperty().getRepresentation();e.context.depthMask(!0);for(let s=Qt.Start;s{e.lastBoundBO&&e.lastBoundBO.getVAO().release(),e.renderable.getColorTextureMap()&&e.internalColorTexture.deactivate()},t.replaceShaderValues=(n,r,i)=>{t.replaceShaderColor(n,r,i),t.replaceShaderTCoord(n,r,i),t.replaceShaderPicking(n,r,i),t.replaceShaderPositionVC(n,r,i)},t.replaceShaderColor=(n,r,i)=>{let o=n.Vertex,s=n.Geometry,c=n.Fragment,l=["uniform vec3 diffuseColorUniform;","uniform float opacityUniform;"],p=["vec3 diffuseColor = diffuseColorUniform;","float opacity = opacityUniform;"];e.lastBoundBO.getCABO().getColorComponents()!==0?(l=l.concat(["varying vec4 vertexColorVSOutput;"]),o=Q.substitute(o,"//VTK::Color::Dec",["attribute vec4 scalarColor;","varying vec4 vertexColorVSOutput;"]).result,o=Q.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = scalarColor;"]).result,s=Q.substitute(s,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,s=Q.substitute(s,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,c=Q.substitute(c,"//VTK::Color::Impl",p.concat([" diffuseColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])).result):e.renderable.getAreScalarsMappedFromCells()&&(p=p.concat([" vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);"," diffuseColor = texColor.rgb;"," opacity = opacity*texColor.a;"])),p=p.concat(["gl_FragData[0] = vec4(diffuseColor, opacity);"]),c=Q.substitute(c,"//VTK::Color::Dec",l).result,c=Q.substitute(c,"//VTK::Color::Impl",p).result,n.Vertex=o,n.Geometry=s,n.Fragment=c},t.replaceShaderTCoord=(n,r,i)=>{if(e.lastBoundBO.getCABO().getTCoordOffset()){let o=n.Vertex,s=n.Geometry,c=n.Fragment;const l=e.lastBoundBO.getCABO().getTCoordComponents();l===1?(o=Q.substitute(o,"//VTK::TCoord::Dec",["in float tcoordMC;","out float tcoordVCVSOutput;"]).result,o=Q.substitute(o,"//VTK::TCoord::Impl",["tcoordVCVSOutput = tcoordMC;"]).result,s=Q.substitute(s,"//VTK::TCoord::Dec",[`in float tcoordVCVSOutput[]; -`,"out float tcoordVCGSOutput;"]).result,s=Q.substitute(s,["//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];"]).result,c=Q.substitute(c,"//VTK::TCoord::Dec",["in float tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,c=Q.substitute(c,"//VTK::TCoord::Impl",["gl_FragData[0] = gl_FragData[0]*texture2D(texture1, vec2(tcoordVCVSOutput,0));"]).result):l===2&&(o=Q.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordMC;","out vec2 tcoordVCVSOutput;"]).result,o=Q.substitute(o,"//VTK::TCoord::Impl",["tcoordVCVSOutput = tcoordMC;"]).result,s=Q.substitute(s,"//VTK::TCoord::Dec",[`in vec2 tcoordVCVSOutput[]; -`,"out vec2 tcoordVCGSOutput;"]).result,s=Q.substitute(s,"//VTK::TCoord::Impl",["tcoordVCGSOutput = tcoordVCVSOutput[i];"]).result,c=Q.substitute(c,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,c=Q.substitute(c,"//VTK::TCoord::Impl",["gl_FragData[0] = gl_FragData[0]*texture2D(texture1, tcoordVCVSOutput.st);"]).result),e.renderable.getAreScalarsMappedFromCells()&&(s=Q.substitute(s,"//VTK::PrimID::Impl",["gl_PrimitiveID = gl_PrimitiveIDIn;"]).result),n.Vertex=o,n.Geometry=s,n.Fragment=c}},t.replaceShaderPicking=(n,r,i)=>{let o=n.Fragment;o=Q.substitute(o,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,o=Q.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,n.Fragment=o},t.replaceShaderPositionVC=(n,r,i)=>{e.lastBoundBO.replaceShaderPositionVC(n,r,i)},t.invokeShaderCallbacks=(n,r,i)=>{const o=e.renderable.getViewSpecificProperties().ShadersCallbacks;o&&o.forEach(s=>{s.callback(s.userData,n,r,i)})},t.setMapperShaderParameters=(n,r,i)=>{if(n.getProgram().isUniformUsed("PrimitiveIDOffset")&&n.getProgram().setUniformi("PrimitiveIDOffset",e.primitiveIDOffset),n.getProgram().isAttributeUsed("vertexWC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexWC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),e.context.FLOAT,3,!1)||Ha("Error setting vertexWC in shader VAO.")),n.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){e.renderable.getCustomShaderAttributes().forEach((c,l)=>{n.getProgram().isAttributeUsed(`${c}MC`)&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),`${c}MC`,n.getCABO().getCustomData()[l].offset,n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getCustomData()[l].components,!1)||Ha(`Error setting ${c}MC in shader VAO.`))}),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||Ha("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),e.context.UNSIGNED_BYTE,4,!0)||Ha("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),e.internalColorTexture&&n.getProgram().isUniformUsed("texture1")&&e.internalColorTexture.getTextureUnit()>-1&&n.getProgram().setUniformi("texture1",e.internalColorTexture.getTextureUnit());const o=e.openGLActor2D.getActiveTextures();if(o)for(let c=0;c{const o=e.renderable.getColorMapColors();if(!o||o.getNumberOfComponents()===0){const s=n.getProgram(),c=i.getProperty(),l=c.getOpacity();s.setUniformf("opacityUniform",l);const p=c.getColor();s.setUniform3fArray("diffuseColorUniform",p)}},t.setLightingShaderParameters=(n,r,i)=>{};function a(n,r,i){return r.identity(i),n.reduce((o,s,c)=>c===0?s?r.copy(o,s):r.identity(o):s?r.multiply(o,o,s):o,i)}t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),c=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,p=r.getRenderWindow().getViews()[0].getViewportSize(r),u=r.getViewport(),f=i.getActualPositionCoordinate().getComputedDoubleViewportValue(r),h=[0,0,1,1],d=[0,0,1,1];if(d[0]=u[0]>=h[0]?u[0]:h[0],d[1]=u[1]>=h[1]?u[1]:h[1],d[2]=u[2]<=h[2]?u[2]:h[2],d[3]=u[3]<=h[3]?u[3]:h[3],d[0]>=d[2]||d[1]>=d[3])return;p[0]=La(p[0]*(d[2]-d[0])/(u[2]-u[0])),p[1]=La(p[1]*(d[3]-d[1])/(u[3]-u[1]));const v=e._openGLRenderer.getParent().getSize(),m=La(f[0]-(d[0]-u[0])*v[0]),x=La(f[1]-(d[1]-u[1])*v[1]),y=-m;let g=-m+p[0];const C=-x;let S=-x+p[1];y===g&&(g=y+1),C===S&&(S=C+1);const T=Te(new Float64Array(16));T[0]=2/(g-y),T[1*4+1]=2/(S-C),T[0*4+3]=-1*(g+y)/(g-y),T[1*4+3]=-1*(S+C)/(S-C),T[2*4+2]=0,T[2*4+3]=i.getProperty().getDisplayLocation()===X9.FOREGROUND?-1:1,T[3*4+3]=1,We(T,T),o.setUniformMatrix("WCVCMatrix",a([T,c],va,e.tmpMat4))},t.getAllocatedGPUMemoryInBytes=()=>{let n=0;return e.primitives.forEach(r=>{n+=r.getAllocatedGPUMemoryInBytes()}),n}}const Z9={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};function Q9(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Z9,a),Ct.extend(t,e,a),mn.implementReplaceShaderCoincidentOffset(t,e,a),mn.implementBuildShadersWithReplacements(t,e,a),e.primitives=[],e.primTypes=Qt,e.tmpMat4=Te(new Float64Array(16));for(let n=Qt.Start;n{const n=a.getLastSize(),r=(n[0]/700)**.8,i=(n[1]/700)**.8,o=Math.min(r,i),s=a.getAxisTextStyle(),c=a.getTickTextStyle();Object.assign(s,e.axisTextStyle),Object.assign(c,e.tickTextStyle),s.fontSize===void 0&&(s.fontSize=Math.max(24*o,12)),c.fontSize===void 0&&(a.getLastAspectRatio()>1?c.fontSize=Math.max(20*o,10):c.fontSize=Math.max(16*o,10));const l=a.updateTextureAtlas();a.setTopTitle(!1);const p=a.getBoxSizeByReference();let u=!1;if(e.orientation===Oo.VERTICAL?u=!0:e.orientation===Oo.HORIZONTAL?u=!1:u=a.getLastAspectRatio()>1,u)a.setTickLabelPixelOffset(.3*c.fontSize),l.titleWidth<=l.tickWidth+a.getTickLabelPixelOffset()+.8*c.fontSize?(a.setTopTitle(!0),a.setAxisTitlePixelOffset(.2*c.fontSize),p[0]=2*(l.tickWidth+a.getTickLabelPixelOffset()+.8*c.fontSize)/n[0],a.setBoxPosition([.98-p[0],-.92])):(a.setAxisTitlePixelOffset(.2*c.fontSize),p[0]=2*(l.titleHeight+a.getAxisTitlePixelOffset()+l.tickWidth+a.getTickLabelPixelOffset()+.8*c.fontSize)/n[0],a.setBoxPosition([.99-p[0],-.92])),p[1]=Math.max(1.2,Math.min(1.84/i,1.84));else{a.setAxisTitlePixelOffset(1.2*c.fontSize),a.setTickLabelPixelOffset(.1*c.fontSize);const f=2*(.8*c.fontSize+l.titleHeight+a.getAxisTitlePixelOffset())/n[1],h=2*l.tickWidth/n[0];p[0]=Math.min(1.9,Math.max(1.4,1.4*h*(a.getTicks().length+3))),p[1]=f,a.setBoxPosition([-.5*p[0],-.97])}a.recomputeBarSegments(l)}}function fh(t,e){return a=>{const n=a.getLastTickBounds(),r=Gs().domain([n[0],n[1]]),i=r.ticks(5),o=r.tickFormat(5);a.setTicks(i),a.setTickStrings(i.map(o))}}function n6(t,e){e.classHierarchy.push("vtkScalarBarActorHelper"),t.setRenderable=r=>{e.renderable!==r&&(e.renderable=r,e.barActor.setProperty(r.getProperty()),e.barActor.setParentProp(r),e.barActor.setCoordinateSystemToDisplay(),e.tmActor.setProperty(r.getProperty()),e.tmActor.setParentProp(r),e.tmActor.setCoordinateSystemToDisplay(),e.generateTicks=r.generateTicks,e.axisTextStyle={...r.getAxisTextStyle()},e.tickTextStyle={...r.getTickTextStyle()},t.modified())},t.updateAPISpecificData=(r,i,o)=>{(e.lastSize[0]!==r[0]||e.lastSize[1]!==r[1])&&(e.lastSize[0]=r[0],e.lastSize[1]=r[1],e.lastAspectRatio=r[0]/r[1],e.forceUpdate=!0);const s=e.renderable.getScalarsToColors();if(!(!s||!e.renderable.getVisibility())&&(e.barMapper.setLookupTable(s),e.camera=i,e.renderWindow=o,e.forceUpdate||Math.max(s.getMTime(),t.getMTime(),e.renderable.getMTime())>e.lastRebuildTime.getMTime())){const c=s.getMappingRange();if(e.lastTickBounds=[...c],e.renderable.getGenerateTicks()(t),e.renderable.getAutomated())e.renderable.getAutoLayout()(t);else{e.axisTextStyle={...e.renderable.getAxisTextStyle()},e.tickTextStyle={...e.renderable.getTickTextStyle()},e.barPosition=[...e.renderable.getBarPosition()],e.barSize=[...e.renderable.getBarSize()],e.boxPosition=[...e.renderable.getBoxPosition()],e.boxSize=[...e.renderable.getBoxSize()],e.axisTitlePixelOffset=e.renderable.getAxisTitlePixelOffset(),e.tickLabelPixelOffset=e.renderable.getTickLabelPixelOffset();const l=t.updateTextureAtlas();t.recomputeBarSegments(l)}t.updatePolyDataForLabels(),t.updatePolyDataForBarSegments(),e.lastRebuildTime.modified(),e.forceUpdate=!1}},t.updateTextureAtlas=()=>{e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left";const r={},i=new Map;let o=0,s=1;H0(e.tmContext,e.axisTextStyle,18);let c=e.tmContext.measureText(e.renderable.getAxisLabel()),l={height:c.actualBoundingBoxAscent+2,startingHeight:s,width:c.width+2,textStyle:e.axisTextStyle};i.set(e.renderable.getAxisLabel(),l),s+=l.height,o=l.width,r.titleWidth=l.width,r.titleHeight=l.height,r.tickWidth=0,r.tickHeight=0,H0(e.tmContext,e.tickTextStyle,14);const p=[...t.getTickStrings(),"NaN","Below","Above"];for(let u=0;u{u.tcoords=[0,(s-u.startingHeight-u.height)/s,u.width/o,(s-u.startingHeight-u.height)/s,u.width/o,(s-u.startingHeight)/s,0,(s-u.startingHeight)/s]}),e.tmCanvas.width=o,e.tmCanvas.height=s,e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left",e.tmContext.clearRect(0,0,o,s),i.forEach((u,f)=>{const h=u.textStyle===e.axisTextStyle?18:14;H0(e.tmContext,u.textStyle,h),e.tmContext.fillText(f,1,u.startingHeight+u.height-1)}),e.tmTexture.setCanvas(e.tmCanvas),e.tmTexture.modified(),e._tmAtlas=i,r},t.computeBarSize=r=>{e.vertical=e.boxSize[1]>e.boxSize[0];const i=2*r.tickHeight/e.lastSize[1],o=[1,1];if(e.vertical){const s=2*(r.tickWidth+e.tickLabelPixelOffset)/e.lastSize[0];if(e.topTitle){const c=2*(r.titleHeight+e.axisTitlePixelOffset)/e.lastSize[1];e.barSize[0]=e.boxSize[0]-s,e.barSize[1]=e.boxSize[1]-c}else{const c=2*(r.titleHeight+e.axisTitlePixelOffset)/e.lastSize[0];e.barSize[0]=e.boxSize[0]-c-s,e.barSize[1]=e.boxSize[1]}e.barPosition[0]=e.boxPosition[0]+s,e.barPosition[1]=e.boxPosition[1],o[1]=i}else{const s=(2*r.tickWidth-8)/e.lastSize[0],c=2*(r.titleHeight+e.axisTitlePixelOffset)/e.lastSize[1];e.barSize[0]=e.boxSize[0],e.barPosition[0]=e.boxPosition[0],e.barSize[1]=e.boxSize[1]-c,e.barPosition[1]=e.boxPosition[1],o[0]=s}return o},t.recomputeBarSegments=r=>{var f,h,d,v;const i=t.computeBarSize(r);e.barSegments=[];const o=[0,0],s=e.vertical?1:0,c=e.vertical?.01:.02;function l(m,x){e.barSegments.push({corners:[[...o],[o[0]+i[0],o[1]],[o[0]+i[0],o[1]+i[1]],[o[0],o[1]+i[1]]],scalars:x,title:m}),o[s]+=i[s]+c}e.renderable.getDrawNanAnnotation()&&e.renderable.getScalarsToColors().getNanColor()&&l("NaN",[NaN,NaN,NaN,NaN]),e.renderable.getDrawBelowRangeSwatch()&&((h=(f=e.renderable.getScalarsToColors()).getUseBelowRangeColor)!=null&&h.call(f))&&l("Below",[-.1,-.1,-.1,-.1]);const p=(v=(d=e.renderable.getScalarsToColors()).getUseAboveRangeColor)==null?void 0:v.call(d);o[s]+=c;const u=i[s];i[s]=p?1-2*c-i[s]-o[s]:1-c-o[s],l("ticks",e.vertical?[0,0,.995,.995]:[0,.995,.995,0]),e.renderable.getDrawAboveRangeSwatch()&&p&&(i[s]=u,o[s]+=c,l("Above",[1.1,1.1,1.1,1.1]))};const a=new Float64Array(3);t.createPolyDataForOneLabel=(r,i,o,s,c,l)=>{const p=e._tmAtlas.get(r);if(!p)return;let u=l.ptIdx,f=l.cellIdx;a[0]=(.5*i[0]+.5)*e.lastSize[0],a[1]=(.5*i[1]+.5)*e.lastSize[1],a[2]=i[2],a[0]+=c[0],a[1]+=c[1];const h=[],d=s==="vertical"?[1,0]:[0,1];s==="vertical"?(h[0]=p.width,h[1]=-p.height,o[0]==="middle"?a[1]-=p.width/2:o[0]==="right"&&(a[1]-=p.width),o[1]==="middle"?a[0]+=p.height/2:o[1]==="top"&&(a[0]+=p.height)):(h[0]=p.width,h[1]=p.height,o[0]==="middle"?a[0]-=p.width/2:o[0]==="right"&&(a[0]-=p.width),o[1]==="middle"?a[1]-=p.height/2:o[1]==="top"&&(a[1]-=p.height)),l.points[u*3]=a[0],l.points[u*3+1]=a[1],l.points[u*3+2]=a[2],l.tcoords[u*2]=p.tcoords[0],l.tcoords[u*2+1]=p.tcoords[1],u++,a[d[0]]+=h[0],l.points[u*3]=a[0],l.points[u*3+1]=a[1],l.points[u*3+2]=a[2],l.tcoords[u*2]=p.tcoords[2],l.tcoords[u*2+1]=p.tcoords[3],u++,a[d[1]]+=h[1],l.points[u*3]=a[0],l.points[u*3+1]=a[1],l.points[u*3+2]=a[2],l.tcoords[u*2]=p.tcoords[4],l.tcoords[u*2+1]=p.tcoords[5],u++,a[d[0]]-=h[0],l.points[u*3]=a[0],l.points[u*3+1]=a[1],l.points[u*3+2]=a[2],l.tcoords[u*2]=p.tcoords[6],l.tcoords[u*2+1]=p.tcoords[7],u++,l.polys[f*4]=3,l.polys[f*4+1]=u-4,l.polys[f*4+2]=u-3,l.polys[f*4+3]=u-2,f++,l.polys[f*4]=3,l.polys[f*4+1]=u-4,l.polys[f*4+2]=u-2,l.polys[f*4+3]=u-1,l.ptIdx+=4,l.cellIdx+=2};const n=new Float64Array(3);t.updatePolyDataForLabels=()=>{const r=t.getTickStrings().length+e.barSegments.length,i=r*4,o=r*2,s=new Float64Array(i*3),c=new Uint16Array(o*4),l=new Float32Array(i*2),p={ptIdx:0,cellIdx:0,polys:c,points:s,tcoords:l},u=e.vertical?0:1,f=e.vertical?1:0;n[2]=-.99;const h=e.vertical?["right","middle"]:["middle","bottom"];let d=[0,1];const v=[0,0];e.vertical?(v[0]=-e.tickLabelPixelOffset,e.topTitle?(n[0]=e.boxPosition[0]+.5*e.boxSize[0],n[1]=e.barPosition[1]+e.barSize[1],t.createPolyDataForOneLabel(e.renderable.getAxisLabel(),n,["middle","bottom"],"horizontal",[0,e.axisTitlePixelOffset],p)):(n[0]=e.barPosition[0]+e.barSize[0],n[1]=e.barPosition[1]+.5*e.barSize[1],t.createPolyDataForOneLabel(e.renderable.getAxisLabel(),n,["middle","top"],"vertical",[e.axisTitlePixelOffset,0],p)),d=[-1,0]):(v[1]=e.tickLabelPixelOffset,n[0]=e.barPosition[0]+.5*e.barSize[0],n[1]=e.barPosition[1]+e.barSize[1],t.createPolyDataForOneLabel(e.renderable.getAxisLabel(),n,["middle","bottom"],"horizontal",[0,e.axisTitlePixelOffset],p)),n[u]=e.barPosition[u]+(.5*d[u]+.5)*e.barSize[u],n[f]=e.barPosition[f]+e.barSize[f]*.5;let m=null;for(let w=0;w{var v,m;const r=e.renderable.getScalarsToColors();let i=0;e.renderable.getDrawNanAnnotation()&&r.getNanColor()&&(i+=1),e.renderable.getDrawBelowRangeSwatch()&&((v=r.getUseBelowRangeColor)!=null&&v.call(r))&&(i+=1),e.renderable.getDrawAboveRangeSwatch()&&((m=r.getUseAboveRangeColor)!=null&&m.call(r))&&(i+=1);const o=4*(1+i),s=o;let c=1;r.getVectorMode()===t6.COMPONENT&&(c=r.getVectorComponent()+1);const l=new Float64Array(o*3),p=new Uint16Array(s*5),u=new Float32Array(o*c);let f=0,h=0;for(let x=0;x2&&arguments[2]!==void 0?arguments[2]:{renderable:null};Object.assign(e,{},a),V.obj(t,e),V.setGet(t,e,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle","ticks","tickStrings","tickPositions"]),V.get(t,e,["lastSize","lastAspectRatio","lastTickBounds","axisTextStyle","tickTextStyle","barActor","tmActor"]),V.getArray(t,e,["boxPosition","boxSize"]),V.setArray(t,e,["boxPosition","boxSize"],2),e.forceUpdate=!1,e.lastRebuildTime={},V.obj(e.lastRebuildTime,{mtime:0}),e.lastSize=[-1,-1],e.tmCanvas=document.createElement("canvas"),e.tmContext=e.tmCanvas.getContext("2d"),e._tmAtlas=new Map,e.barMapper=gn.newInstance(),e.barMapper.setInterpolateScalarsBeforeMapping(!0),e.barMapper.setUseLookupTableScalarRange(!0),e.polyData=Xe.newInstance(),e.barMapper.setInputData(e.polyData),e.barActor=pn.newInstance(),e.barActor.setMapper(e.barMapper),e.tmPolyData=Xe.newInstance(),e.tmMapper=gn.newInstance(),e.tmMapper.setInputData(e.tmPolyData),e.tmTexture=A0.newInstance({resizable:!0}),e.tmTexture.setInterpolate(!1),e.tmActor=pn.newInstance({parentProp:t}),e.tmActor.setMapper(e.tmMapper),e.tmActor.addTexture(e.tmTexture),e.barPosition=[0,0],e.barSize=[0,0],e.boxPosition=[.88,-.92],e.boxSize=[.1,1.1],e.lastTickBounds=[],n6(t,e)},"vtkScalarBarActorHelper");function a6(t,e){e.classHierarchy.push("vtkScalarBarActor"),t.setTickTextStyle=a=>{e.tickTextStyle={...e.tickTextStyle,...a},t.modified()},t.setAxisTextStyle=a=>{e.axisTextStyle={...e.axisTextStyle,...a},t.modified()},t.setOrientationToHorizontal=()=>t.setOrientation(Oo.HORIZONTAL),t.setOrientationToVertical=()=>t.setOrientation(Oo.VERTICAL),t.resetAutoLayoutToDefault=()=>{t.setAutoLayout(lh(t,e))},t.resetGenerateTicksToDefault=()=>{t.setGenerateTicks(fh())}}function i6(t){return{automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:void 0,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:void 0,fontFamily:"serif"},generateTicks:null,drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0,orientation:null,...t}}function ph(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,i6(a)),e.autoLayout||(e.autoLayout=lh(t,e)),e.generateTicks||(e.generateTicks=fh()),pn.extend(t,e,a),t.getProperty().setDiffuse(0),t.getProperty().setAmbient(1),V.setGet(t,e,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","generateTicks","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch","orientation"]),V.get(t,e,["axisTextStyle","tickTextStyle"]),V.getArray(t,e,["barPosition","barSize","boxPosition","boxSize"]),V.setArray(t,e,["barPosition","barSize","boxPosition","boxSize"],2),a6(t,e)}var hh={newInstance:V.newInstance(ph,"vtkScalarBarActor"),extend:ph,newScalarBarActorHelper:r6,...uh};function o6(t,e){e.classHierarchy.push("vtkOpenGLScalarBarActor"),t.buildPass=a=>{a&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.scalarBarActorHelper.getRenderable()||e.scalarBarActorHelper.setRenderable(e.renderable),t.prepareNodes(),t.addMissingNode(e.scalarBarActorHelper.getBarActor()),t.addMissingNode(e.scalarBarActorHelper.getTmActor()),t.removeUnusedNodes())},t.opaquePass=(a,n)=>{if(a){const r=e._openGLRenderer?e._openGLRenderer.getRenderable().getActiveCamera():null,i=e._openGLRenderer.getTiledSizeAndOrigin();e.scalarBarActorHelper.updateAPISpecificData([i.usize,i.vsize],r,e._openGLRenderWindow.getRenderable())}}}const s6={};function c6(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,s6,a),Ct.extend(t,e,a),e.scalarBarActorHelper=hh.newScalarBarActorHelper(),o6(t,e)}const u6=Je(c6,"vtkOpenGLScalarBarActor");st("vtkScalarBarActor",u6);const{vtkErrorMacro:gh}=Dt;function l6(t,e){e.classHierarchy.push("vtkOpenGLSkybox"),t.buildPass=a=>{if(a){e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow),e.openGLTexture.setOpenGLRenderWindow(e._openGLRenderWindow);const n=e._openGLRenderer.getRenderable();e.openGLCamera=e._openGLRenderer.getViewNodeFor(n.getActiveCamera(),e.openGLCamera)}},t.queryPass=(a,n)=>{if(a){if(!e.renderable||!e.renderable.getVisibility())return;n.incrementOpaqueActorCount()}},t.opaquePass=(a,n)=>{if(a&&!e._openGLRenderer.getSelector()){t.updateBufferObjects(),e.context.depthMask(!0),e._openGLRenderWindow.getShaderCache().readyShaderProgram(e.tris.getProgram()),e.openGLTexture.render(e._openGLRenderWindow);const r=e.openGLTexture.getTextureUnit();e.tris.getProgram().setUniformi("sbtexture",r);const i=e._openGLRenderer.getRenderable(),o=e.openGLCamera.getKeyMatrices(i),s=new Float64Array(16);if(Et(s,o.wcpc),e.tris.getProgram().setUniformMatrix("IMCPCMatrix",s),e.lastFormat==="box"){const c=i.getActiveCamera().getPosition();e.tris.getProgram().setUniform3f("camPos",c[0],c[1],c[2])}e.tris.getVAO().bind(),e.context.drawArrays(e.context.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release(),e.openGLTexture.deactivate()}},t.updateBufferObjects=()=>{if(!e.tris.getCABO().getElementCount()){const n=new Float32Array(12);for(let s=0;s<4;s++)n[s*3]=s%2*2-1,n[s*3+1]=s>1?1:-1,n[s*3+2]=1;const r=pe.newInstance({numberOfComponents:3,values:n});r.setName("points");const i=new Uint16Array(8);i[0]=3,i[1]=0,i[2]=1,i[3]=3,i[4]=3,i[5]=0,i[6]=3,i[7]=2;const o=pe.newInstance({numberOfComponents:1,values:i});e.tris.getCABO().createVBO(o,"polys",Jt.SURFACE,{points:r,cellOffset:0})}e.renderable.getFormat()!==e.lastFormat&&(e.lastFormat=e.renderable.getFormat(),e.lastFormat==="box"&&e.tris.setProgram(e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(`//VTK::System::Dec - attribute vec3 vertexMC; - uniform mat4 IMCPCMatrix; - varying vec3 TexCoords; - void main () { - gl_Position = vec4(vertexMC.xyz, 1.0); - vec4 wpos = IMCPCMatrix * gl_Position; - TexCoords = wpos.xyz/wpos.w; - }`,`//VTK::System::Dec - //VTK::Output::Dec - varying vec3 TexCoords; - uniform samplerCube sbtexture; - uniform vec3 camPos; - void main () { - // skybox looks from inside out - // which means we have to adjust - // our tcoords. Otherwise text would - // be flipped - vec3 tc = normalize(TexCoords - camPos); - if (abs(tc.z) < max(abs(tc.x),abs(tc.y))) - { - tc = vec3(1.0, 1.0, -1.0) * tc; - } - else - { - tc = vec3(-1.0, 1.0, 1.0) * tc; - } - gl_FragData[0] = textureCube(sbtexture, tc); - }`,"")),e.lastFormat==="background"&&e.tris.setProgram(e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(`//VTK::System::Dec - attribute vec3 vertexMC; - uniform mat4 IMCPCMatrix; - varying vec2 TexCoords; - void main () { - gl_Position = vec4(vertexMC.xyz, 1.0); - vec4 wpos = IMCPCMatrix * gl_Position; - TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5; - }`,`//VTK::System::Dec - //VTK::Output::Dec - varying vec2 TexCoords; - uniform sampler2D sbtexture; - void main () { - gl_FragData[0] = texture2D(sbtexture, TexCoords); - }`,"")),e.tris.getShaderSourceTime().modified(),e.tris.getVAO().bind(),e.tris.getVAO().addAttributeArray(e.tris.getProgram(),e.tris.getCABO(),"vertexMC",e.tris.getCABO().getVertexOffset(),e.tris.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||gh("Error setting vertexMC in shader VAO."));const a=e.renderable.getTextures();a.length||gh("vtkSkybox requires a texture map"),e.openGLTexture.getRenderable()!==a[0]&&(e.openGLTexture.releaseGraphicsResources(e._openGLRenderWindow),e.openGLTexture.setRenderable(a[0]))}}const f6={context:null};function p6(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,f6,a),Ct.extend(t,e,a),e.openGLTexture=Re.newInstance(),e.tris=jt.newInstance(),e.keyMatrixTime={},ut(e.keyMatrixTime,{mtime:0}),e.keyMatrices={normalMatrix:It(new Float64Array(9)),mcwc:Te(new Float64Array(16))},pt(t,e,["context"]),At(t,e,["activeTextures"]),l6(t,e)}const h6=Je(p6);st("vtkSkybox",h6);const{FieldAssociations:g6}=dr;function d6(t,e){e.classHierarchy.push("vtkHardwareSelector"),t.getSourceDataAsync=async(a,n,r,i,o)=>{},t.selectAsync=async(a,n,r,i,o)=>{const s=await t.getSourceDataAsync(a,n,r,i,o);return s?s.generateSelection(n,r,i,o):[]}}const v6={fieldAssociation:g6.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function dh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,v6,a),V.obj(t,e),V.setGet(t,e,["fieldAssociation","captureZValues"]),d6(t,e)}var y6={newInstance:V.newInstance(dh,"vtkHardwareSelector"),extend:dh};function m6(t,e){e.classHierarchy.push("vtkFramebuffer"),t.getBothMode=()=>e.context.FRAMEBUFFER,t.saveCurrentBindingsAndBuffers=a=>{const n=typeof a<"u"?a:t.getBothMode();t.saveCurrentBindings(n),t.saveCurrentBuffers(n)},t.saveCurrentBindings=a=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling saveCurrentBindings");return}const n=e.context;e.previousDrawBinding=n.getParameter(e.context.FRAMEBUFFER_BINDING),e.previousActiveFramebuffer=e._openGLRenderWindow.getActiveFramebuffer()},t.saveCurrentBuffers=a=>{},t.restorePreviousBindingsAndBuffers=a=>{const n=typeof a<"u"?a:t.getBothMode();t.restorePreviousBindings(n),t.restorePreviousBuffers(n)},t.restorePreviousBindings=a=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling restorePreviousBindings");return}const n=e.context;n.bindFramebuffer(n.FRAMEBUFFER,e.previousDrawBinding),e._openGLRenderWindow.setActiveFramebuffer(e.previousActiveFramebuffer)},t.restorePreviousBuffers=a=>{},t.bind=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;n===null&&(n=e.context.FRAMEBUFFER),e.context.bindFramebuffer(n,e.glFramebuffer);for(let r=0;r{if(!e.context){ze("you must set the OpenGLRenderWindow before calling create");return}e.glFramebuffer=e.context.createFramebuffer(),e.glFramebuffer.width=a,e.glFramebuffer.height=n},t.setColorBuffer=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=e.context;if(!r){ze("you must set the OpenGLRenderWindow before calling setColorBuffer");return}let i=r.COLOR_ATTACHMENT0;if(n>0)if(e._openGLRenderWindow.getWebgl2())i+=n;else{ze("Using multiple framebuffer attachments requires WebGL 2");return}e.colorBuffers[n]=a,r.framebufferTexture2D(r.FRAMEBUFFER,i,r.TEXTURE_2D,a.getHandle(),0)},t.removeColorBuffer=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;const n=e.context;if(!n){ze("you must set the OpenGLRenderWindow before calling removeColorBuffer");return}let r=n.COLOR_ATTACHMENT0;if(a>0)if(e._openGLRenderWindow.getWebgl2())r+=a;else{ze("Using multiple framebuffer attachments requires WebGL 2");return}n.framebufferTexture2D(n.FRAMEBUFFER,r,n.TEXTURE_2D,null,0),e.colorBuffers=e.colorBuffers.splice(a,1)},t.setDepthBuffer=a=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling setDepthBuffer");return}if(e._openGLRenderWindow.getWebgl2()){const n=e.context;n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,a.getHandle(),0)}else ze("Attaching depth buffer textures to fbo requires WebGL 2")},t.removeDepthBuffer=()=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling removeDepthBuffer");return}if(e._openGLRenderWindow.getWebgl2()){const a=e.context;a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,null,0)}else ze("Attaching depth buffer textures to framebuffers requires WebGL 2")},t.getGLFramebuffer=()=>e.glFramebuffer,t.setOpenGLRenderWindow=a=>{e._openGLRenderWindow!==a&&(t.releaseGraphicsResources(),e._openGLRenderWindow=a,e.context=null,a&&(e.context=e._openGLRenderWindow.getContext()))},t.releaseGraphicsResources=()=>{e.glFramebuffer&&e.context.deleteFramebuffer(e.glFramebuffer)},t.getSize=()=>e.glFramebuffer==null?null:[e.glFramebuffer.width,e.glFramebuffer.height],t.populateFramebuffer=()=>{if(!e.context){ze("you must set the OpenGLRenderWindow before calling populateFrameBuffer");return}t.bind();const a=e.context,n=Re.newInstance();n.setOpenGLRenderWindow(e._openGLRenderWindow),n.setMinificationFilter(me.LINEAR),n.setMagnificationFilter(me.LINEAR),n.create2DFromRaw({width:e.glFramebuffer.width,height:e.glFramebuffer.height,numComps:4,dataType:Ne.UNSIGNED_CHAR,data:null}),t.setColorBuffer(n),e.depthTexture=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,e.depthTexture),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,e.glFramebuffer.width,e.glFramebuffer.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,e.depthTexture)},t.getColorTexture=()=>e.colorBuffers[0]}const x6={glFramebuffer:null,colorBuffers:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function vh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,x6,a),ut(t,e),e.colorBuffers&&ze("you cannot initialize colorBuffers through the constructor. You should call setColorBuffer() instead."),e.colorBuffers=[],Sa(t,e,["colorBuffers"]),m6(t,e)}var Er={newInstance:Je(vh,"vtkFramebuffer"),extend:vh},C6={SelectionContent:{GLOBALIDS:0,PEDIGREEIDS:1,VALUES:2,INDICES:3,FRUSTUM:4,LOCATIONS:5,THRESHOLDS:6,BLOCKS:7,QUERY:8},SelectionField:{CELL:0,POINT:1,FIELD:2,VERTEX:3,EDGE:4,ROW:5}};function S6(t,e){e.classHierarchy.push("vtkSelectionNode"),t.getBounds=()=>e.points.getBounds()}const T6={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function yh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,T6,a),V.obj(t,e),e.properties={},V.setGet(t,e,["contentType","fieldType","properties","selectionList"]),S6(t,e)}var mh={newInstance:V.newInstance(yh,"vtkSelectionNode"),extend:yh,...C6};const{PassTypes:ft}=op,{SelectionContent:w6,SelectionField:xh}=mh,{FieldAssociations:Ka}=dr,{vtkErrorMacro:Ch}=V,Wn=1;function Sh(t){return`${t.propID} ${t.compositeID}`}function Th(t,e,a,n){if(!a)return 0;const r=(e*(n[2]-n[0]+1)+t)*4;return a[r+3]}function Mn(t,e,a,n){if(!a)return 0;const r=(e*(n[2]-n[0]+1)+t)*4,i=a[r],o=a[r+1];return(a[r+2]*256+o)*256+i}function wh(t,e){let a=e;return a<<=24,a|=t,a}function na(t,e,a,n){const r=a<0?0:a;if(r===0){if(n[0]=e[0],n[1]=e[1],e[0]t.area[2]||e[1]t.area[3])return null;const c=[e[0]-t.area[0],e[1]-t.area[1]],l=Mn(c[0],c[1],t.pixBuffer[ft.ACTOR_PASS],t.area);if(l<=0||l-Wn>=t.props.length)return null;const p={};p.valid=!0,p.propID=l-Wn,p.prop=t.props[p.propID];let u=Mn(c[0],c[1],t.pixBuffer[ft.COMPOSITE_INDEX_PASS],t.area);if((u<0||u>16777215)&&(u=0),p.compositeID=u-Wn,t.captureZValues){const d=(c[1]*(t.area[2]-t.area[0]+1)+c[0])*4;p.zValue=(256*t.zBuffer[d]+t.zBuffer[d+1])/65535,p.displayPosition=e}if(t.pixBuffer[ft.ID_LOW24]&&Th(c[0],c[1],t.pixBuffer[ft.ID_LOW24],t.area)===0)return p;const f=Mn(c[0],c[1],t.pixBuffer[ft.ID_LOW24],t.area),h=Mn(c[0],c[1],t.pixBuffer[ft.ID_HIGH24],t.area);return p.attributeID=wh(f,h),p}const i=[e[0],e[1]],o=[0,0];let s=na(t,e,0,n);if(s&&s.valid)return s;for(let c=1;cc?i[1]-c:0;l<=i[1]+c;++l)if(o[1]=l,i[0]>=c&&(o[0]=i[0]-c,s=na(t,o,0,n),s&&s.valid)||(o[0]=i[0]+c,s=na(t,o,0,n),s&&s.valid))return s;for(let l=i[0]>=c?i[0]-(c-1):0;l<=i[0]+(c-1);++l)if(o[0]=l,i[1]>=c&&(o[1]=i[1]-c,s=na(t,o,0,n),s&&s.valid)||(o[1]=i[1]+c,s=na(t,o,0,n),s&&s.valid))return s}return n[0]=e[0],n[1]=e[1],null}function _h(t,e,a,n,r){const i=[];let o=0;return e.forEach((s,c)=>{const l=mh.newInstance();switch(l.setContentType(w6.INDICES),t){case Ka.FIELD_ASSOCIATION_CELLS:l.setFieldType(xh.CELL);break;case Ka.FIELD_ASSOCIATION_POINTS:l.setFieldType(xh.POINT);break;default:Ch("Unknown field association")}l.getProperties().propID=s.info.propID,l.getProperties().prop=s.info.prop,l.getProperties().compositeID=s.info.compositeID,l.getProperties().attributeID=s.info.attributeID,l.getProperties().pixelCount=s.pixelCount,a&&(l.getProperties().displayPosition=[s.info.displayPosition[0],s.info.displayPosition[1],s.info.zValue],l.getProperties().worldPosition=r.displayToWorld(s.info.displayPosition[0],s.info.displayPosition[1],s.info.zValue,n)),l.setSelectionList(s.attributeIDs),i[o]=l,o++}),i}function _6(t,e,a,n,r){const i=Math.floor(e),o=Math.floor(a),s=Math.floor(n),c=Math.floor(r),l=new Map,p=[0,0];for(let u=o;u<=c;u++)for(let f=i;f<=s;f++){const d=na(t,[f,u],0,p);if(d&&d.valid){const v=Sh(d);if(!l.has(v))l.set(v,{info:d,pixelCount:1,attributeIDs:[d.attributeID]});else{const m=l.get(v);m.pixelCount++,t.captureZValues&&d.zValue{e.rawPixBuffer=[],e.pixBuffer=[],e.zBuffer=null},t.beginSelection=()=>{e._openGLRenderer=e._openGLRenderWindow.getViewNodeFor(e._renderer,e._openGLRenderer),e.maxAttributeId=0;const n=e._openGLRenderWindow.getSize();if(!e.framebuffer)e.framebuffer=Er.newInstance(),e.framebuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.create(n[0],n[1]),e.framebuffer.populateFramebuffer();else{e.framebuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.framebuffer.saveCurrentBindingsAndBuffers();const r=e.framebuffer.getSize();!r||r[0]!==n[0]||r[1]!==n[1]?(e.framebuffer.create(n[0],n[1]),e.framebuffer.populateFramebuffer()):e.framebuffer.bind()}if(e._openGLRenderer.clear(),e._openGLRenderer.setSelector(t),e.hitProps={},e.propPixels={},e.props=[],t.releasePixBuffers(),e.fieldAssociation===Ka.FIELD_ASSOCIATION_POINTS){const r=e._openGLRenderWindow.getContext(),i=r.isEnabled(r.BLEND);r.disable(r.BLEND),e._openGLRenderWindow.traverseAllPasses(),i&&r.enable(r.BLEND)}},t.endSelection=()=>{e.hitProps={},e._openGLRenderer.setSelector(null),e.framebuffer.restorePreviousBindingsAndBuffers()},t.preCapturePass=()=>{const n=e._openGLRenderWindow.getContext();e.originalBlending=n.isEnabled(n.BLEND),n.disable(n.BLEND)},t.postCapturePass=()=>{const n=e._openGLRenderWindow.getContext();e.originalBlending&&n.enable(n.BLEND)},t.select=()=>{let n=null;return t.captureBuffers()&&(n=t.generateSelection(e.area[0],e.area[1],e.area[2],e.area[3]),t.releasePixBuffers()),n},t.getSourceDataAsync=async(n,r,i,o,s)=>{if(e._renderer=n,r===void 0){const l=e._openGLRenderWindow.getSize();t.setArea(0,0,l[0]-1,l[1]-1)}else t.setArea(r,i,o,s);if(!t.captureBuffers())return!1;const c={area:[...e.area],pixBuffer:[...e.pixBuffer],captureZValues:e.captureZValues,zBuffer:e.zBuffer,props:[...e.props],fieldAssociation:e.fieldAssociation,renderer:n,openGLRenderWindow:e._openGLRenderWindow};return c.generateSelection=function(){for(var l=arguments.length,p=new Array(l),u=0;u{if(!e._renderer||!e._openGLRenderWindow)return Ch("Renderer and view must be set before calling Select."),!1;e._openGLRenderer=e._openGLRenderWindow.getViewNodeFor(e._renderer,e._openGLRenderer),e._openGLRenderWindow.getRenderable().preRender(),t.invokeEvent({type:"StartEvent"}),e.originalBackground=e._renderer.getBackgroundByReference(),e._renderer.setBackground(0,0,0,0);const n=e._openGLRenderWindow.getRenderPasses();t.beginSelection();const r=[];for(e.currentPass=ft.MIN_KNOWN_PASS;e.currentPass<=ft.MAX_KNOWN_PASS;e.currentPass++)t.passRequired(e.currentPass)&&(t.preCapturePass(e.currentPass),e.captureZValues&&e.currentPass===ft.ACTOR_PASS&&typeof n[0].requestDepth=="function"&&typeof n[0].getFramebuffer=="function"&&n[0].requestDepth(),e._openGLRenderWindow.traverseAllPasses(),t.postCapturePass(e.currentPass),t.savePixelBuffer(e.currentPass),r.push(e.currentPass));return r.forEach(i=>{e.currentPass=i,t.processPixelBuffers()}),e.currentPass=ft.MAX_KNOWN_PASS,t.endSelection(),e._renderer.setBackground(e.originalBackground),t.invokeEvent({type:"EndEvent"}),!0},t.processPixelBuffers=()=>{e.props.forEach((n,r)=>{t.isPropHit(r)&&n.processSelectorPixelBuffers(t,e.propPixels[r])})},t.passRequired=n=>{if(n===ft.ID_HIGH24){if(e.fieldAssociation===Ka.FIELD_ASSOCIATION_POINTS)return e.maximumPointId>16777215;if(e.fieldAssociation===Ka.FIELD_ASSOCIATION_CELLS)return e.maximumCellId>16777215}return!0},t.savePixelBuffer=n=>{if(e.pixBuffer[n]=e._openGLRenderWindow.getPixelData(e.area[0],e.area[1],e.area[2],e.area[3]),!e.rawPixBuffer[n]){const r=(e.area[2]-e.area[0]+1)*(e.area[3]-e.area[1]+1)*4;e.rawPixBuffer[n]=new Uint8Array(r),e.rawPixBuffer[n].set(e.pixBuffer[n])}if(n===ft.ACTOR_PASS){if(e.captureZValues){const r=e._openGLRenderWindow.getRenderPasses();if(typeof r[0].requestDepth=="function"&&typeof r[0].getFramebuffer=="function"){const i=r[0].getFramebuffer();i.saveCurrentBindingsAndBuffers(),i.bind(),e.zBuffer=e._openGLRenderWindow.getPixelData(e.area[0],e.area[1],e.area[2],e.area[3]),i.restorePreviousBindingsAndBuffers()}}t.buildPropHitList(e.rawPixBuffer[n])}},t.buildPropHitList=n=>{let r=0;for(let i=0;i<=e.area[3]-e.area[1];i++)for(let o=0;o<=e.area[2]-e.area[0];o++){let s=Mn(o,i,n,e.area);s>0&&(s--,s in e.hitProps||(e.hitProps[s]=!0,e.propPixels[s]=[]),e.propPixels[s].push(r*4)),++r}},t.renderProp=n=>{e.currentPass===ft.ACTOR_PASS&&(t.setPropColorValueFromInt(e.props.length+Wn),e.props.push(n))},t.renderCompositeIndex=n=>{e.currentPass===ft.COMPOSITE_INDEX_PASS&&t.setPropColorValueFromInt(n+Wn)},t.renderAttributeId=n=>{n<0||(e.maxAttributeId=n>e.maxAttributeId?n:e.maxAttributeId)},t.passTypeToString=n=>V.enumToString(ft,n),t.isPropHit=n=>Boolean(e.hitProps[n]),t.setPropColorValueFromInt=n=>{e.propColorValue[0]=n%256/255,e.propColorValue[1]=Math.floor(n/256)%256/255,e.propColorValue[2]=Math.floor(n/65536)%256/255},t.getPixelInformation=(n,r,i)=>{const o=r<0?0:r;if(console.log("getPixelInformation called",o),o===0){if(i[0]=n[0],i[1]=n[1],n[0]e.area[2]||n[1]e.area[3])return null;console.log(n),console.log(e.area);const p=[n[0]-e.area[0],n[1]-e.area[1]];console.log("adjusted displayPosition",p);const u=Mn(p[0],p[1],e.pixBuffer[ft.ACTOR_PASS],e.area);if(console.log("actorid",u),u<=0||u-Wn>=e.props.length)return null;const f={};f.valid=!0,f.propID=u-Wn,f.prop=e.props[f.propID];let h=Mn(p[0],p[1],e.pixBuffer[ft.COMPOSITE_INDEX_PASS],e.area);if((h<0||h>16777215)&&(h=0),f.compositeID=h-Wn,e.captureZValues){const m=(p[1]*(e.area[2]-e.area[0]+1)+p[0])*4;f.zValue=(256*e.zBuffer[m]+e.zBuffer[m+1])/65535,f.displayPosition=n}if(e.pixBuffer[ft.ID_LOW24]&&Th(p[0],p[1],e.pixBuffer[ft.ID_LOW24],e.area)===0)return f;const d=Mn(p[0],p[1],e.pixBuffer[ft.ID_LOW24],e.area),v=Mn(p[0],p[1],e.pixBuffer[ft.ID_HIGH24],e.area);return f.attributeID=wh(d,v),f}const s=[n[0],n[1]],c=[0,0];let l=t.getPixelInformation(n,0,i);if(l&&l.valid)return l;for(let p=1;pp?s[1]-p:0;u<=s[1]+p;++u)if(c[1]=u,s[0]>=p&&(c[0]=s[0]-p,l=t.getPixelInformation(c,0,i),l&&l.valid)||(c[0]=s[0]+p,l=t.getPixelInformation(c,0,i),l&&l.valid))return l;for(let u=s[0]>=p?s[0]-(p-1):0;u<=s[0]+(p-1);++u)if(c[0]=u,s[1]>=p&&(c[1]=s[1]-p,l=t.getPixelInformation(c,0,i),l&&l.valid)||(c[1]=s[1]+p,l=t.getPixelInformation(c,0,i),l&&l.valid))return l}return i[0]=n[0],i[1]=n[1],null},t.generateSelection=(n,r,i,o)=>{const s=Math.floor(n),c=Math.floor(r),l=Math.floor(i),p=Math.floor(o),u=new Map,f=[0,0];for(let h=c;h<=p;h++)for(let d=s;d<=l;d++){const v=[d,h],m=t.getPixelInformation(v,0,f);if(m&&m.valid){const x=Sh(m);if(!u.has(x))u.set(x,{info:m,pixelCount:1,attributeIDs:[m.attributeID]});else{const y=u.get(x);y.pixelCount++,e.captureZValues&&m.zValuee.rawPixBuffer[n],t.getPixelBuffer=n=>e.pixBuffer[n],t.attach=(n,r)=>{e._openGLRenderWindow=n,e._renderer=r};const a=t.setArea;t.setArea=function(){return a(...arguments)?(e.area[0]=Math.floor(e.area[0]),e.area[1]=Math.floor(e.area[1]),e.area[2]=Math.floor(e.area[2]),e.area[3]=Math.floor(e.area[3]),!0):!1}}const D6={area:void 0,currentPass:-1,propColorValue:null,props:null,maximumPointId:0,maximumCellId:0,idOffset:1};function Eh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,D6,a),y6.extend(t,e,a),e.propColorValue=[0,0,0],e.props=[],e.area||(e.area=[0,0,0,0]),V.setGetArray(t,e,["area"],4),V.setGet(t,e,["_renderer","currentPass","_openGLRenderWindow","maximumPointId","maximumCellId"]),V.setGetArray(t,e,["propColorValue"],3),V.moveToProtected(t,e,["renderer","openGLRenderWindow"]),V.event(t,e,"event"),E6(t,e)}var Xa={newInstance:V.newInstance(Eh,"vtkOpenGLHardwareSelector"),extend:Eh,...op};const{vtkErrorMacro:qa}=Dt,{Representation:O6}=pr,{ObjectType:bo}=On,{PassTypes:b6}=Xa,M6={type:"StartEvent"},N6={type:"EndEvent"},R6=64,L6=16;function F6(t,e){e.classHierarchy.push("vtkOpenGLGlyph3DMapper");const a={...t};t.renderPiece=(n,r)=>{if(t.invokeEvent(M6),e.renderable.getStatic()||e.renderable.update(),e.currentInput=e.renderable.getInputData(1),t.invokeEvent(N6),!e.currentInput){qa("No input!");return}if(!e.currentInput.getPoints||!e.currentInput.getPoints().getNumberOfValues())return;const i=e.context;e._openGLRenderWindow.getWebgl2()?(e.hardwareSupport=!0,e.extension=null):e.extension||(e.extension=e.context.getExtension("ANGLE_instanced_arrays"),e.hardwareSupport=!!e.extension);const o=r.getProperty().getBackfaceCulling(),s=r.getProperty().getFrontfaceCulling();!o&&!s?e._openGLRenderWindow.disableCullFace():s?(e._openGLRenderWindow.enableCullFace(),i.cullFace(i.FRONT)):(e._openGLRenderWindow.enableCullFace(),i.cullFace(i.BACK)),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.multiply4x4WithOffset=(n,r,i,o)=>{const s=r[0],c=r[1],l=r[2],p=r[3],u=r[4],f=r[5],h=r[6],d=r[7],v=r[8],m=r[9],x=r[10],y=r[11],g=r[12],C=r[13],S=r[14],T=r[15];let w=i[o],_=i[o+1],E=i[o+2],D=i[o+3];n[0]=w*s+_*u+E*v+D*g,n[1]=w*c+_*f+E*m+D*C,n[2]=w*l+_*h+E*x+D*S,n[3]=w*p+_*d+E*y+D*T,w=i[o+4],_=i[o+5],E=i[o+6],D=i[o+7],n[4]=w*s+_*u+E*v+D*g,n[5]=w*c+_*f+E*m+D*C,n[6]=w*l+_*h+E*x+D*S,n[7]=w*p+_*d+E*y+D*T,w=i[o+8],_=i[o+9],E=i[o+10],D=i[o+11],n[8]=w*s+_*u+E*v+D*g,n[9]=w*c+_*f+E*m+D*C,n[10]=w*l+_*h+E*x+D*S,n[11]=w*p+_*d+E*y+D*T,w=i[o+12],_=i[o+13],E=i[o+14],D=i[o+15],n[12]=w*s+_*u+E*v+D*g,n[13]=w*c+_*f+E*m+D*C,n[14]=w*l+_*h+E*x+D*S,n[15]=w*p+_*d+E*y+D*T},t.replaceShaderNormal=(n,r,i)=>{if(e.hardwareSupport&&e.lastBoundBO.getReferenceByName("lastLightComplexity")>0){let s=n.Vertex;e.lastBoundBO.getCABO().getNormalOffset()&&(s=Q.substitute(s,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,s=Q.substitute(s,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),n.Vertex=s}a.replaceShaderNormal(n,r,i)},t.replaceShaderClip=(n,r,i)=>{if(e.hardwareSupport){let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){const c=e.renderable.getNumberOfClippingPlanes();o=Q.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`uniform vec4 clipPlanes[${c}];`,`varying float clipDistancesVSOutput[${c}];`]).result,o=Q.substitute(o,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${c}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," vec4 gVertex = gMatrix * vertexMC;"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], gVertex);"," }"]).result,s=Q.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`varying float clipDistancesVSOutput[${c}];`]).result,s=Q.substitute(s,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${c}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s}a.replaceShaderClip(n,r,i)},t.replaceShaderColor=(n,r,i)=>{if(e.hardwareSupport&&e.renderable.getColorArray()){let o=n.Vertex,s=n.Geometry,c=n.Fragment;const l=e.lastBoundBO.getReferenceByName("lastLightComplexity");let p=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(p=p.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));let u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" opacity = opacityUniform;"]),l&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),e.drawingEdges||(p=p.concat(["varying vec4 vertexColorVSOutput;"]),o=Q.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=Q.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,s=Q.substitute(s,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,s=Q.substitute(s,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,u=u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),c=Q.substitute(c,"//VTK::Color::Impl",u).result,c=Q.substitute(c,"//VTK::Color::Dec",p).result,n.Vertex=o,n.Geometry=s,n.Fragment=c}a.replaceShaderColor(n,r,i)},t.replaceShaderPositionVC=(n,r,i)=>{if(e.hardwareSupport){let o=n.Vertex;e.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=Q.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=Q.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=Q.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=Q.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),n.Vertex=o}a.replaceShaderPositionVC(n,r,i)},t.replaceShaderPicking=(n,r,i)=>{if(e.hardwareSupport){let o=n.Fragment,s=n.Vertex;s=Q.substitute(s,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,s=Q.substitute(s,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,n.Vertex=s,o=Q.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=Q.substitute(o,"//VTK::Picking::Impl",[" vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);"," gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];"]).result,n.Fragment=o}else a.replaceShaderPicking(n,r,i)},t.updateGlyphShaderParameters=(n,r,i,o,s,c,l,p)=>{const u=i.getProgram();if(n){const f=e.normalMatrix,h=c,d=l*9,v=e.tmpMat3,m=f[0],x=f[1],y=f[2],g=f[3],C=f[4],S=f[5],T=f[6],w=f[7],_=f[8],E=h[d],D=h[d+1],O=h[d+2],M=h[d+3],N=h[d+4],R=h[d+5],B=h[d+6],I=h[d+7],P=h[d+8];v[0]=E*m+D*g+O*T,v[1]=E*x+D*C+O*w,v[2]=E*y+D*S+O*_,v[3]=M*m+N*g+R*T,v[4]=M*x+N*C+R*w,v[5]=M*y+N*S+R*_,v[6]=B*m+I*g+P*T,v[7]=B*x+I*C+P*w,v[8]=B*y+I*S+P*_,u.setUniformMatrix3x3("normalMatrix",e.tmpMat3)}if(t.multiply4x4WithOffset(e.tmpMat4,e.mcpcMatrix,s,l*16),u.setUniformMatrix("MCPCMatrix",e.tmpMat4),r&&(t.multiply4x4WithOffset(e.tmpMat4,e.mcvcMatrix,s,l*16),u.setUniformMatrix("MCVCMatrix",e.tmpMat4)),o){const f=o.getData();e.tmpColor[0]=f[l*4]/255,e.tmpColor[1]=f[l*4+1]/255,e.tmpColor[2]=f[l*4+2]/255,u.setUniform3fArray("ambientColorUniform",e.tmpColor),u.setUniform3fArray("diffuseColorUniform",e.tmpColor)}p&&u.setUniform3fArray("mapperIndex",p.getPropColorValue())},t.renderPieceDraw=(n,r)=>{const i=r.getProperty().getRepresentation(),o=e.context,s=r.getProperty().getEdgeVisibility()&&i===O6.SURFACE,c=e.openGLCamera.getKeyMatrices(n),l=e.openGLActor.getKeyMatrices();Qn(e.normalMatrix,c.normalMatrix,l.normalMatrix),Ee(e.mcpcMatrix,c.wcpc,l.mcwc),Ee(e.mcvcMatrix,c.wcvc,l.mcwc);const p=e.renderable.getMatrixArray(),u=e.renderable.getNormalArray(),f=e.renderable.getColorArray(),h=p.length/16;let d=!1;e._openGLRenderer.getSelector()&&e._openGLRenderer.getSelector().getCurrentPass()===b6.COMPOSITE_INDEX_PASS&&(d=!0);for(let v=e.primTypes.Start;v{if(n.getCABO().getElementCount()&&(e.glyphBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){n.getProgram().isAttributeUsed("gMatrix")?n.getVAO().addAttributeMatrixWithDivisor(n.getProgram(),e.matrixBuffer,"gMatrix",0,64,e.context.FLOAT,4,!1,1)||qa("Error setting gMatrix in shader VAO."):n.getVAO().removeAttributeArray("gMatrix"),n.getProgram().isAttributeUsed("gNormal")?n.getVAO().addAttributeMatrixWithDivisor(n.getProgram(),e.normalBuffer,"gNormal",0,36,e.context.FLOAT,3,!1,1)||qa("Error setting gNormal in shader VAO."):n.getVAO().removeAttributeArray("gNormal"),n.getProgram().isAttributeUsed("gColor")?n.getVAO().addAttributeArrayWithDivisor(n.getProgram(),e.colorBuffer,"gColor",0,4,e.context.UNSIGNED_BYTE,4,!0,1,!1)||qa("Error setting gColor in shader VAO."):n.getVAO().removeAttributeArray("gColor"),n.getProgram().isAttributeUsed("mapperIndexVS")?n.getVAO().addAttributeArrayWithDivisor(n.getProgram(),e.pickBuffer,"mapperIndexVS",0,4,e.context.UNSIGNED_BYTE,4,!0,1,!1)||qa("Error setting mapperIndexVS in shader VAO."):n.getVAO().removeAttributeArray("mapperIndexVS"),a.setMapperShaderParameters(n,r,i),n.getAttributeUpdateTime().modified();return}a.setMapperShaderParameters(n,r,i)},t.getNeedToRebuildBufferObjects=(n,r)=>(e.renderable.buildArrays(),e.VBOBuildTime.getMTime()!!(a.getNeedToRebuildShaders(n,r,i)||n.getShaderSourceTime().getMTime(){const i=e.renderable.getMatrixArray(),o=e.renderable.getInputData(0).getPoints(),{useShiftAndScale:s,coordShift:c,coordScale:l}=I0(o);if(e.hardwareSupport){const p=e.renderable.getNormalArray(),u=e.renderable.getColorArray();if(e.matrixBuffer||(e.matrixBuffer=On.newInstance(),e.matrixBuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.normalBuffer=On.newInstance(),e.normalBuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.colorBuffer=On.newInstance(),e.colorBuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.pickBuffer=On.newInstance(),e.pickBuffer.setOpenGLRenderWindow(e._openGLRenderWindow)),s){const f=i.buffer,h=Wp(c,l);Et(h,h);for(let d=0;de.glyphBOBuildTime.getMTime()){e.matrixBuffer.upload(i,bo.ARRAY_BUFFER),e.normalBuffer.upload(p,bo.ARRAY_BUFFER),u?e.colorBuffer.upload(u.getData(),bo.ARRAY_BUFFER):e.colorBuffer.releaseGraphicsResources();const f=i.length/16,h=new Uint8Array(4*f);for(let d=0;d2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,k6,a),Do.extend(t,e,a),e.tmpMat3=It(new Float64Array(9)),e.normalMatrix=It(new Float64Array(9)),e.mcpcMatrix=Te(new Float64Array(16)),e.mcvcMatrix=Te(new Float64Array(16)),e.tmpColor=[],e.glyphBOBuildTime={},ut(e.glyphBOBuildTime,{mtime:0}),F6(t,e)}const A6=Je(V6,"vtkOpenGLGlyph3DMapper");st("vtkGlyph3DMapper",A6);const{vtkErrorMacro:B6}=V;class U6{constructor(){this.segmentMapping={},this.segments=[null],this.faces=[]}addSegment(e){const a=e[0],n=e[e.length-1];if(a===n||e.length<2)return;const r=this.segmentMapping[a],i=this.segmentMapping[n];if(r!==void 0&&i!==void 0)if(Math.abs(r)===Math.abs(i)){const o=r0)for(let c=1;c0){const o=this.segments[r];for(let s=1;s0){const o=this.segments[i];for(let s=1;s{var f;const r=a[0];if(!r){B6("Invalid or missing input");return}const i=((f=n[0])==null?void 0:f.initialize())||Xe.newInstance();i.shallowCopy(r);const o=new U6,s=r.getLines().getData();let c=0;for(;c2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,I6,a),V.obj(t,e),V.algo(t,e,1,1),G6(t,e)}var P6={newInstance:V.newInstance(Dh,"vtkClosedPolyLineToSurfaceFilter"),extend:Dh};const{vtkErrorMacro:Oh}=Dt;function z6(t){const e=t.getPolys().getData(),a=t.getStrips().getData(),n={cellSize:0,cell:[],done:!1,polyIdx:0,stripIdx:0,remainingStripLength:0,next(){if(n.polyIdx{let r=a.getMTime();return e.cutFunction&&(r=Math.max(r,e.cutFunction.getMTime())),r};function n(r,i){const o=r.getPoints(),s=o.getData(),c=r.getPointData(),l=o.getNumberOfPoints(),p=[],u=[],f=[],h={},d=c.getNumberOfArrays();for(let w=0;w0;let E=!0;for(let M=1;M0!==_){E=!1;break}if(E)continue;const D=[];for(let M=0;M0;if(C[N]>0===R)continue;let I=M,P=N,L=C[P]-C[I];L<=0&&(I=N,P=M,L*=-1);let k=0;L!==0&&(k=(e.cutValue-C[I])/L);const A=w.cell[I],j=w.cell[P];y[0]=s[A*3],y[1]=s[A*3+1],y[2]=s[A*3+2],g[0]=s[j*3],g[1]=s[j*3+1],g[2]=s[j*3+2];const H=[y[0]+k*(g[0]-y[0]),y[1]+k*(g[1]-y[1]),y[2]+k*(g[2]-y[2])],K={};for(let Y=0;Y{h[B].push(...N.intersectedArrays[B])}),D[M].newPointID=p.length/3-1,x.push(D[M]))}const O=D.length;O===2?u.push(O,D[0].newPointID,D[1].newPointID):O>2&&(f.push(O),D.forEach(M=>{f.push(M.newPointID)}))}i.getPoints().setData(Ai(o.getDataType(),p),3);const T=i.getPointData();for(let w=0;w{var c;const o=r[0];if(!o){Oh("Invalid or missing input");return}if(!e.cutFunction){Oh("Missing cut function");return}const s=((c=i[0])==null?void 0:c.initialize())||Xe.newInstance();n(o,s),i[0]=s}}const W6={cutFunction:null,cutScalars:null,cutValue:0};function bh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,W6,a),ut(t,e),Es(t,e,1,1),pt(t,e,["cutFunction","cutValue"]),j6(t,e)}var $6={newInstance:Je(bh,"vtkCutter"),extend:bh};const H6=t=>t,Mh=1e-6;class Nh{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.matrix=Te(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=e?Ld:H6}rotateFromDirections(e,a){const n=new Float64Array(3),r=new Float64Array(3),i=new Float64Array(16);on(n,e[0],e[1],e[2]),on(r,a[0],a[1],a[2]),cn(n,n),cn(r,r);const o=_i(n,r);return o>=1?this:(Ir(this.tmp,n,r),ya(this.tmp)1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(Jr(Ks,this.matrix))return this;const r=n===-1?e.length:a+n*3;for(let i=a;i{var m;const r=((m=n[0])==null?void 0:m.initialize())||Xe.newInstance();n[0]=r;const i=24,o=V.newTypedArray(e.pointType,i*3);r.getPoints().setData(o,3);const s=V.newTypedArray(e.pointType,i*3),c=pe.newInstance({name:"Normals",values:s,numberOfComponents:3});r.getPointData().setNormals(c);let l=2;e.generate3DTextureCoordinates===!0&&(l=3);const p=V.newTypedArray(e.pointType,i*l),u=pe.newInstance({name:"TextureCoordinates",values:p,numberOfComponents:l});r.getPointData().setTCoords(u);const f=[0,0,0],h=[0,0,0],d=[0,0];let v=0;f[0]=-e.xLength/2,h[0]=-1,h[1]=0,h[2]=0;for(let x=0;x<2;x++){f[1]=-e.yLength/2;for(let y=0;y<2;y++){d[1]=f[1]+.5,f[2]=-e.zLength/2;for(let g=0;g<2;g++)d[0]=(f[2]+.5)*(1-2*x),o[v*3]=f[0],o[v*3+1]=f[1],o[v*3+2]=f[2],s[v*3]=h[0],s[v*3+1]=h[1],s[v*3+2]=h[2],l===2?(p[v*l]=d[0],p[v*l+1]=d[1]):(p[v*l]=2*x-1,p[v*l+1]=2*y-1,p[v*l+2]=2*g-1),v++,f[2]+=e.zLength;f[1]+=e.yLength}f[0]+=e.xLength,h[0]+=2}f[1]=-e.yLength/2,h[1]=-1,h[0]=0,h[2]=0;for(let x=0;x<2;x++){f[0]=-e.xLength/2;for(let y=0;y<2;y++){d[0]=(f[0]+.5)*(2*x-1),f[2]=-e.zLength/2;for(let g=0;g<2;g++)d[1]=(f[2]+.5)*-1,o[v*3]=f[0],o[v*3+1]=f[1],o[v*3+2]=f[2],s[v*3]=h[0],s[v*3+1]=h[1],s[v*3+2]=h[2],l===2?(p[v*l]=d[0],p[v*l+1]=d[1]):(p[v*l]=2*y-1,p[v*l+1]=2*x-1,p[v*l+2]=2*g-1),v++,f[2]+=e.zLength;f[0]+=e.xLength}f[1]+=e.yLength,h[1]+=2}f[2]=-e.zLength/2,h[2]=-1,h[0]=0,h[1]=0;for(let x=0;x<2;x++){f[1]=-e.yLength/2;for(let y=0;y<2;y++){d[1]=f[1]+.5,f[0]=-e.xLength/2;for(let g=0;g<2;g++)d[0]=(f[0]+.5)*(2*x-1),o[v*3]=f[0],o[v*3+1]=f[1],o[v*3+2]=f[2],s[v*3]=h[0],s[v*3+1]=h[1],s[v*3+2]=h[2],l===2?(p[v*l]=d[0],p[v*l+1]=d[1]):(p[v*l]=2*g-1,p[v*l+1]=2*y-1,p[v*l+2]=2*x-1),v++,f[0]+=e.xLength;f[1]+=e.yLength}f[2]+=e.zLength,h[2]+=2}if(e.rotations&&bt.buildFromDegree().rotateX(e.rotations[0]).rotateY(e.rotations[1]).rotateZ(e.rotations[2]).apply(o).apply(s),e.center&&bt.buildFromRadian().translate(...e.center).apply(o),e.matrix){bt.buildFromRadian().setMatrix(e.matrix).apply(o);const x=[e.matrix[0],e.matrix[1],e.matrix[2],0,e.matrix[4],e.matrix[5],e.matrix[6],0,e.matrix[8],e.matrix[9],e.matrix[10],0,0,0,0,1];bt.buildFromRadian().setMatrix(x).apply(s)}e.generateFaces?r.getPolys().deepCopy(e._polys):r.getPolys().initialize(),e.generateLines?(r.getLines().deepCopy(e._lineCells),r.getPointData().setNormals(null)):r.getLines().initialize(),r.modified()},t.setBounds=function(){let a=[];if(Array.isArray(arguments.length<=0?void 0:arguments[0]))a=arguments.length<=0?void 0:arguments[0];else for(let n=0;n2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Z6,a),V.obj(t,e),V.setGet(t,e,["xLength","yLength","zLength","generate3DTextureCoordinates","generateFaces","generateLines"]),V.setGetArray(t,e,["center","rotations"],3),V.setGetArray(t,e,["matrix"],16),e._polys=jn.newInstance({values:Uint16Array.from(Y6)}),e._lineCells=jn.newInstance({values:Uint16Array.from(q6)}),V.moveToProtected(t,e,["polys","lineCells"]),V.algo(t,e,0,1),J6(t,e)}var Q6={newInstance:V.newInstance(Rh,"vtkCubeSource"),extend:Rh};const{vtkErrorMacro:Lh}=V;function e8(t,e){e.classHierarchy.push("vtkImageDataOutlineFilter");const a={...t};t.requestData=(n,r)=>{const i=n[0];if(!i||!i.isA("vtkImageData")){Lh("Invalid or missing input");return}const o=i.getSpatialExtent();if(!o){Lh("Unable to fetch spatial extents of input image.");return}e._cubeSource.setBounds(o),e._cubeSource.setMatrix(i.getIndexToWorld()),r[0]=e._cubeSource.getOutputData()},t.getMTime=()=>Math.max(a.getMTime(),e._cubeSource.getMTime()),t.setGenerateFaces=e._cubeSource.setGenerateFaces,t.setGenerateLines=e._cubeSource.setGenerateLines,t.getGenerateFaces=e._cubeSource.getGenerateFaces,t.getGenerateLines=e._cubeSource.getGenerateLines}const t8={};function Fh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,t8,a),V.obj(t,e),V.algo(t,e,1,1),e._cubeSource=Q6.newInstance(),V.moveToProtected(t,e,["cubeSource","tmpOut"]),e8(t,e)}var n8={newInstance:V.newInstance(Fh,"vtkImageDataOutlineFilter"),extend:Fh};const{vtkWarningMacro:r8}=V;let K0;function a8(t,e){e.classHierarchy.push("vtkAbstractTransform","vtkHomogeneousTransform","vtkTransform"),t.transformPoint=(a,n)=>(_e(n,a,e.matrix),n),t.transformPoints=(a,n)=>{const r=new Float64Array(3),i=new Float64Array(3);for(let o=0;o{t.setPreMultiplyFlag(!0)},t.postMultiply=()=>{t.setPreMultiplyFlag(!1)},t.transformMatrix=(a,n)=>(e.preMultiplyFlag?Ee(n,e.matrix,a):Ee(n,a,e.matrix),n),t.transformMatrices=(a,n)=>{const r=new Float64Array(16),i=new Float64Array(16),o=e.preMultiplyFlag?()=>Ee(i,e.matrix,r):()=>Ee(i,r,e.matrix);for(let s=0;sK0({matrix:Mt.invertMatrix(Array.from(e.matrix),[],4),preMultiplyFlag:e.preMultiplyFlag}),t.translate=(a,n,r)=>{if(a===0&&n===0&&r===0)return;const i=Ur();fs(i,[a,n,r]),e.preMultiplyFlag?Ee(e.matrix,e.matrix,i):Ee(e.matrix,i,e.matrix),t.modified()},t.rotateWXYZ=(a,n,r,i)=>{if(n===0&&r===0&&i===0){r8("No rotation applied, axis is zero vector.");return}if(a===0)return;const o=Mt.radiansFromDegrees(a),s=Bn();Di(s,[n,r,i],o);const c=new Float64Array(16);Gr(c,s),e.preMultiplyFlag?Ee(e.matrix,e.matrix,c):Ee(e.matrix,c,e.matrix),t.modified()},t.rotateX=a=>{t.rotateWXYZ(a,1,0,0)},t.rotateY=a=>{t.rotateWXYZ(a,0,1,0)},t.rotateZ=a=>{t.rotateWXYZ(a,0,0,1)},t.scale=(a,n,r)=>{if(a===1&&n===1&&r===1)return;const i=Ur();yi(i,[a,n,r]),e.preMultiplyFlag?Ee(e.matrix,e.matrix,i):Ee(e.matrix,i,e.matrix),t.modified()},t.transformNormal=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=Vn(an(),e.matrix),i=an();Tn(i,r);const o=an();return Br(o,i),t.transformVector(a,n,o),Mt.normalize(n),n},t.transformNormals=(a,n)=>{const r=a.getData(),i=n.getData(),o=[0,0,0],s=Vn(an(),e.matrix),c=an();Tn(c,s);const l=an();Br(l,c);for(let p=0;p1&&arguments[1]!==void 0?arguments[1]:[];const i=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:null)||Vn(an(),e.matrix);return Ei(n,a,i),n},t.transformVectors=(a,n)=>{const r=a.getData(),i=n.getData(),o=[0,0,0];for(let s=0;s6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null;const p=a.getNumberOfPoints(),u=(c==null?void 0:c.length)??0,f=new Float64Array(3),h=new Float64Array(3),d=new Float64Array(3),v=new Float64Array(3);let m=!1,x=!1,y=!1;const g=[];for(let C=0;Cl[C].modified())}}const i8={preMultiplyFlag:!1,matrix:[...Ks]};function kh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,i8,a),V.obj(t,e),V.setGet(t,e,["preMultiplyFlag"]),V.setGetArray(t,e,["matrix"],16),a8(t,e)}K0=V.newInstance(kh,"vtkTransform");var o8={newInstance:K0,extend:kh};function $n(t,e,a){return t.length>0?`${t.map(n=>(n==null?void 0:n.getMTime())??"x").join("/")}-${e}-${a}`:"0"}function X0(t,e){return`${e.getMTime()}`}var s8=`//VTK::System::Dec +`,{primTypes:en}=jt,{Filter:_1,Wrap:E1}=Ne,{vtkErrorMacro:Ja}=bt,K8={type:"StartEvent"},X8={type:"EndEvent"};function q8(t,e){e.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),t.buildPass=n=>{n&&(e.openGLActor2D=t.getFirstAncestorOfType("vtkOpenGLActor2D"),e._openGLRenderer=e.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),e.openGLCamera=e._openGLRenderer.getViewNodeFor(e._openGLRenderer.getRenderable().getActiveCamera(),e.openGLCamera))},t.overlayPass=n=>{n&&t.render()},t.getShaderTemplate=(n,r,i)=>{n.Vertex=H8,n.Fragment=$8,n.Geometry=""},t.render=()=>{const n=e._openGLRenderWindow.getContext();if(e.context!==n){e.context=n;for(let o=en.Start;o{if(t.invokeEvent(K8),e.renderable.getStatic()||e.renderable.update(),e.currentInput=e.renderable.getInputData(),t.invokeEvent(X8),!e.currentInput){Ja("No input!");return}if(!e.currentInput.getPoints||!e.currentInput.getPoints().getNumberOfValues())return;const i=e.context;e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(i.BACK),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.renderPieceStart=(n,r)=>{if(e.primitiveIDOffset=0,e._openGLRenderer.getSelector())switch(e._openGLRenderer.getSelector().getCurrentPass()){default:e._openGLRenderer.getSelector().renderProp(r)}e.renderable.getColorTextureMap()&&e.internalColorTexture.activate(),t.updateBufferObjects(n,r),e.lastBoundBO=null},t.getNeedToRebuildShaders=(n,r,i)=>n.getShaderSourceTime().getMTime(){t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r)},t.getNeedToRebuildBufferObjects=(n,r)=>{const i=e.VBOBuildTime.getMTime();return!!(i{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,r.getProperty().getOpacity());const o=e.renderable.getColorMapColors(),s=r.getProperty().getRepresentation();let u=i.getPointData().getTCoords();e.openGLActor2D.getActiveTextures()||(u=null);let c=!1;if(e.renderable.getColorCoordinates()){u=e.renderable.getColorCoordinates(),c=e.renderable.getAreScalarsMappedFromCells(),e.internalColorTexture||(e.internalColorTexture=Ne.newInstance({resizable:!0}));const h=e.internalColorTexture;h.setMinificationFilter(_1.NEAREST),h.setMagnificationFilter(_1.NEAREST),h.setWrapS(E1.CLAMP_TO_EDGE),h.setWrapT(E1.CLAMP_TO_EDGE),h.setOpenGLRenderWindow(e._openGLRenderWindow);const v=e.renderable.getColorTextureMap(),m=v.getExtent(),x=v.getPointData().getScalars();h.create2DFromRaw({width:m[1]-m[0]+1,height:m[3]-m[2]+1,numComps:x.getNumberOfComponents(),dataType:x.getDataType(),data:x.getData()}),h.activate(),h.sendParameters(),h.deactivate()}const p=e.renderable.getTransformCoordinate(),l=n.getRenderWindow().getViews()[0].getViewportSize(n),f=`${i.getMTime()}A${s}B${i.getMTime()}C${o?o.getMTime():1}D${u?u.getMTime():1}E${p?n.getMTime():1}F${l}`;if(e.VBOBuildString!==f){let h=i.getPoints();if(p){const m=kt.newInstance(),x=h.getNumberOfPoints();m.setNumberOfPoints(x);const y=[];for(let d=0;di.getPointData().getArrayByName(m))};v.cellOffset+=e.primitives[en.Points].getCABO().createVBO(i.getVerts(),"verts",s,v),v.cellOffset+=e.primitives[en.Lines].getCABO().createVBO(i.getLines(),"lines",s,v),v.cellOffset+=e.primitives[en.Tris].getCABO().createVBO(i.getPolys(),"polys",s,v),v.cellOffset+=e.primitives[en.TriStrips].getCABO().createVBO(i.getStrips(),"strips",s,v),e.VBOBuildTime.modified(),e.VBOBuildString=f}},t.renderPieceDraw=(n,r)=>{const i=r.getProperty().getRepresentation();e.context.depthMask(!0);for(let o=en.Start;o{e.lastBoundBO&&e.lastBoundBO.getVAO().release(),e.renderable.getColorTextureMap()&&e.internalColorTexture.deactivate()},t.replaceShaderValues=(n,r,i)=>{t.replaceShaderColor(n,r,i),t.replaceShaderTCoord(n,r,i),t.replaceShaderPicking(n,r,i),t.replaceShaderPositionVC(n,r,i)},t.replaceShaderColor=(n,r,i)=>{let o=n.Vertex,s=n.Geometry,u=n.Fragment,c=["uniform vec3 diffuseColorUniform;","uniform float opacityUniform;"],p=["vec3 diffuseColor = diffuseColorUniform;","float opacity = opacityUniform;"];e.lastBoundBO.getCABO().getColorComponents()!==0?(c=c.concat(["varying vec4 vertexColorVSOutput;"]),o=Z.substitute(o,"//VTK::Color::Dec",["attribute vec4 scalarColor;","varying vec4 vertexColorVSOutput;"]).result,o=Z.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = scalarColor;"]).result,s=Z.substitute(s,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,s=Z.substitute(s,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,u=Z.substitute(u,"//VTK::Color::Impl",p.concat([" diffuseColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])).result):e.renderable.getAreScalarsMappedFromCells()&&(p=p.concat([" vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);"," diffuseColor = texColor.rgb;"," opacity = opacity*texColor.a;"])),p=p.concat(["gl_FragData[0] = vec4(diffuseColor, opacity);"]),u=Z.substitute(u,"//VTK::Color::Dec",c).result,u=Z.substitute(u,"//VTK::Color::Impl",p).result,n.Vertex=o,n.Geometry=s,n.Fragment=u},t.replaceShaderTCoord=(n,r,i)=>{if(e.lastBoundBO.getCABO().getTCoordOffset()){let o=n.Vertex,s=n.Geometry,u=n.Fragment;const c=e.lastBoundBO.getCABO().getTCoordComponents();c===1?(o=Z.substitute(o,"//VTK::TCoord::Dec",["in float tcoordMC;","out float tcoordVCVSOutput;"]).result,o=Z.substitute(o,"//VTK::TCoord::Impl",["tcoordVCVSOutput = tcoordMC;"]).result,s=Z.substitute(s,"//VTK::TCoord::Dec",[`in float tcoordVCVSOutput[]; +`,"out float tcoordVCGSOutput;"]).result,s=Z.substitute(s,["//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];"]).result,u=Z.substitute(u,"//VTK::TCoord::Dec",["in float tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,u=Z.substitute(u,"//VTK::TCoord::Impl",["gl_FragData[0] = gl_FragData[0]*texture2D(texture1, vec2(tcoordVCVSOutput,0));"]).result):c===2&&(o=Z.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordMC;","out vec2 tcoordVCVSOutput;"]).result,o=Z.substitute(o,"//VTK::TCoord::Impl",["tcoordVCVSOutput = tcoordMC;"]).result,s=Z.substitute(s,"//VTK::TCoord::Dec",[`in vec2 tcoordVCVSOutput[]; +`,"out vec2 tcoordVCGSOutput;"]).result,s=Z.substitute(s,"//VTK::TCoord::Impl",["tcoordVCGSOutput = tcoordVCVSOutput[i];"]).result,u=Z.substitute(u,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,u=Z.substitute(u,"//VTK::TCoord::Impl",["gl_FragData[0] = gl_FragData[0]*texture2D(texture1, tcoordVCVSOutput.st);"]).result),e.renderable.getAreScalarsMappedFromCells()&&(s=Z.substitute(s,"//VTK::PrimID::Impl",["gl_PrimitiveID = gl_PrimitiveIDIn;"]).result),n.Vertex=o,n.Geometry=s,n.Fragment=u}},t.replaceShaderPicking=(n,r,i)=>{let o=n.Fragment;o=Z.substitute(o,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,o=Z.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,n.Fragment=o},t.replaceShaderPositionVC=(n,r,i)=>{e.lastBoundBO.replaceShaderPositionVC(n,r,i)},t.invokeShaderCallbacks=(n,r,i)=>{const o=e.renderable.getViewSpecificProperties().ShadersCallbacks;o&&o.forEach(s=>{s.callback(s.userData,n,r,i)})},t.setMapperShaderParameters=(n,r,i)=>{if(n.getProgram().isUniformUsed("PrimitiveIDOffset")&&n.getProgram().setUniformi("PrimitiveIDOffset",e.primitiveIDOffset),n.getProgram().isAttributeUsed("vertexWC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexWC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),e.context.FLOAT,3,!1)||Ja("Error setting vertexWC in shader VAO.")),n.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){e.renderable.getCustomShaderAttributes().forEach((u,c)=>{n.getProgram().isAttributeUsed(`${u}MC`)&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),`${u}MC`,n.getCABO().getCustomData()[c].offset,n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getCustomData()[c].components,!1)||Ja(`Error setting ${u}MC in shader VAO.`))}),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||Ja("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),e.context.UNSIGNED_BYTE,4,!0)||Ja("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),e.internalColorTexture&&n.getProgram().isUniformUsed("texture1")&&e.internalColorTexture.getTextureUnit()>-1&&n.getProgram().setUniformi("texture1",e.internalColorTexture.getTextureUnit());const o=e.openGLActor2D.getActiveTextures();if(o)for(let u=0;u{const o=e.renderable.getColorMapColors();if(!o||o.getNumberOfComponents()===0){const s=n.getProgram(),u=i.getProperty(),c=u.getOpacity();s.setUniformf("opacityUniform",c);const p=u.getColor();s.setUniform3fArray("diffuseColorUniform",p)}},t.setLightingShaderParameters=(n,r,i)=>{};function a(n,r,i){return r.identity(i),n.reduce((o,s,u)=>u===0?s?r.copy(o,s):r.identity(o):s?r.multiply(o,o,s):o,i)}t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,u=r.getRenderWindow().getViews()[0].getViewportSize(r),c=r.getViewport(),p=i.getActualPositionCoordinate().getComputedDoubleViewportValue(r),l=[0,0,1,1],f=[0,0,1,1];if(f[0]=c[0]>=l[0]?c[0]:l[0],f[1]=c[1]>=l[1]?c[1]:l[1],f[2]=c[2]<=l[2]?c[2]:l[2],f[3]=c[3]<=l[3]?c[3]:l[3],f[0]>=f[2]||f[1]>=f[3])return;u[0]=Ea(u[0]*(f[2]-f[0])/(c[2]-c[0])),u[1]=Ea(u[1]*(f[3]-f[1])/(c[3]-c[1]));const h=e._openGLRenderer.getParent().getSize(),v=Ea(p[0]-(f[0]-c[0])*h[0]),m=Ea(p[1]-(f[1]-c[1])*h[1]),x=-v;let y=-v+u[0];const d=-m;let g=-m+u[1];x===y&&(y=x+1),d===g&&(g=d+1);const C=we(new Float64Array(16));C[0]=2/(y-x),C[5]=2/(g-d),C[3]=-1*(y+x)/(y-x),C[7]=-1*(g+d)/(g-d),C[10]=0,C[11]=i.getProperty().getDisplayLocation()===j8.FOREGROUND?-1:1,C[15]=1,We(C,C),o.setUniformMatrix("WCVCMatrix",a([C,s],Ra,e.tmpMat4))},t.getAllocatedGPUMemoryInBytes=()=>{let n=0;return e.primitives.forEach(r=>{n+=r.getAllocatedGPUMemoryInBytes()}),n}}var Y8={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};function J8(t,e,a={}){Object.assign(e,Y8,a),Ct.extend(t,e,a),xn.implementReplaceShaderCoincidentOffset(t,e,a),xn.implementBuildShadersWithReplacements(t,e,a),e.primitives=[],e.primTypes=en,e.tmpMat4=we(new Float64Array(16));for(let n=en.Start;n{if(a){if(!e.renderable)return;t.updateLights(),t.prepareNodes(),t.addMissingNode(e.renderable.getActiveCamera()),t.addMissingNodes(e.renderable.getViewPropsWithNestedProps(),!0),t.removeUnusedNodes()}},t.updateLights=()=>{let a=0;const n=e.renderable.getLightsByReference();for(let r=0;r0&&a++;return a||(Q8("No lights are on, creating one."),e.renderable.createLight()),a},t.zBufferPass=a=>{if(a){let n=0;const r=e.context;e.renderable.getTransparent()||(e.context.clearColor(1,0,0,1),n|=r.COLOR_BUFFER_BIT),e.renderable.getPreserveDepthBuffer()||(r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT,e.context.depthMask(!0));const i=t.getTiledSizeAndOrigin();r.enable(r.SCISSOR_TEST),r.scissor(i.lowerLeftU,i.lowerLeftV,i.usize,i.vsize),r.viewport(i.lowerLeftU,i.lowerLeftV,i.usize,i.vsize),r.colorMask(!0,!0,!0,!0),n&&r.clear(n),r.enable(r.DEPTH_TEST)}},t.opaqueZBufferPass=a=>t.zBufferPass(a),t.cameraPass=a=>{a&&t.clear()},t.getAspectRatio=()=>{const a=e._parent.getSizeByReference(),n=e.renderable.getViewportByReference();return a[0]*(n[2]-n[0])/((n[3]-n[1])*a[1])},t.getTiledSizeAndOrigin=()=>{const a=e.renderable.getViewportByReference(),n=[0,0,1,1],r=a[0]-n[0],i=a[1]-n[1],o=e._parent.normalizedDisplayToDisplay(r,i),s=Math.round(o[0]),u=Math.round(o[1]),c=a[2]-n[0],p=a[3]-n[1],l=e._parent.normalizedDisplayToDisplay(c,p);let f=Math.round(l[0])-s,h=Math.round(l[1])-u;return f<0&&(f=0),h<0&&(h=0),{usize:f,vsize:h,lowerLeftU:s,lowerLeftV:u}},t.clear=()=>{let a=0;const n=e.context;if(!e.renderable.getTransparent()){const i=e.renderable.getBackgroundByReference();n.clearColor(i[0],i[1],i[2],i[3]),a|=n.COLOR_BUFFER_BIT}e.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),a|=n.DEPTH_BUFFER_BIT,n.depthMask(!0)),n.colorMask(!0,!0,!0,!0);const r=t.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),n.viewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize),a&&n.clear(a),n.enable(n.DEPTH_TEST)},t.releaseGraphicsResources=()=>{e.selector!==null&&e.selector.releaseGraphicsResources(),e.renderable&&e.renderable.getViewProps().forEach(a=>{a.modified()})},t.setOpenGLRenderWindow=a=>{e._openGLRenderWindow!==a&&(t.releaseGraphicsResources(),e._openGLRenderWindow=a,e.context=null,a&&(e.context=e._openGLRenderWindow.getContext()))}}var tx={context:null,_openGLRenderWindow:null,selector:null};function nx(t,e,a={}){Object.assign(e,tx,a),Ct.extend(t,e,a),Bt(t,e,["shaderCache"]),ht(t,e,["selector"]),xa(t,e,["openGLRenderWindow"]),ex(t,e)}var rx=qe(nx,"vtkOpenGLRenderer");ct("vtkRenderer",rx);var{vtkWarningMacro:ax}=A,tc;function ix(t,e){e.classHierarchy.push("vtkAbstractTransform","vtkHomogeneousTransform","vtkTransform"),t.transformPoint=(a,n)=>(_e(n,a,e.matrix),n),t.transformPoints=(a,n)=>{const r=new Float64Array(3),i=new Float64Array(3);for(let o=0;o{t.setPreMultiplyFlag(!0)},t.postMultiply=()=>{t.setPreMultiplyFlag(!1)},t.transformMatrix=(a,n)=>(e.preMultiplyFlag?Ee(n,e.matrix,a):Ee(n,a,e.matrix),n),t.transformMatrices=(a,n)=>{const r=new Float64Array(16),i=new Float64Array(16),o=e.preMultiplyFlag?()=>Ee(i,e.matrix,r):()=>Ee(i,r,e.matrix);for(let s=0;stc({matrix:Ze.invertMatrix(Array.from(e.matrix),[],4),preMultiplyFlag:e.preMultiplyFlag}),t.translate=(a,n,r)=>{if(a===0&&n===0&&r===0)return;const i=qr();s0(i,[a,n,r]),e.preMultiplyFlag?Ee(e.matrix,e.matrix,i):Ee(e.matrix,i,e.matrix),t.modified()},t.rotateWXYZ=(a,n,r,i)=>{if(n===0&&r===0&&i===0){ax("No rotation applied, axis is zero vector.");return}if(a===0)return;const o=Ze.radiansFromDegrees(a),s=Wn();qi(s,[n,r,i],o);const u=new Float64Array(16);Yr(u,s),e.preMultiplyFlag?Ee(e.matrix,e.matrix,u):Ee(e.matrix,u,e.matrix),t.modified()},t.rotateX=a=>{t.rotateWXYZ(a,1,0,0)},t.rotateY=a=>{t.rotateWXYZ(a,0,1,0)},t.rotateZ=a=>{t.rotateWXYZ(a,0,0,1)},t.scale=(a,n,r)=>{if(a===1&&n===1&&r===1)return;const i=qr();Ii(i,[a,n,r]),e.preMultiplyFlag?Ee(e.matrix,e.matrix,i):Ee(e.matrix,i,e.matrix),t.modified()},t.transformNormal=(a,n=[])=>{const r=Pn(sn(),e.matrix),i=sn();cn(i,r);const o=sn();return Xr(o,i),t.transformVector(a,n,o),Ze.normalize(n),n},t.transformNormals=(a,n)=>{const r=a.getData(),i=n.getData(),o=[0,0,0],s=Pn(sn(),e.matrix),u=sn();cn(u,s);const c=sn();Xr(c,u);for(let p=0;p{const i=r||Pn(sn(),e.matrix);return Zr(n,a,i),n},t.transformVectors=(a,n)=>{const r=a.getData(),i=n.getData(),o=[0,0,0];for(let s=0;s{const p=a.getNumberOfPoints(),l=(u==null?void 0:u.length)??0,f=new Float64Array(3),h=new Float64Array(3),v=new Float64Array(3),m=new Float64Array(3);let x=!1,y=!1,d=!1;const g=[];for(let C=0;Cc[C].modified())}}var ox={preMultiplyFlag:!1,matrix:[...ks]};function D1(t,e,a={}){Object.assign(e,ox,a),A.obj(t,e),A.setGet(t,e,["preMultiplyFlag"]),A.setGetArray(t,e,["matrix"],16),ix(t,e)}tc=A.newInstance(D1,"vtkTransform");var sx={newInstance:tc,extend:D1},{vtkErrorMacro:O1}=bt;function cx(t){const e=t.getPolys().getData(),a=t.getStrips().getData(),n={cellSize:0,cell:[],done:!1,polyIdx:0,stripIdx:0,remainingStripLength:0,next(){if(n.polyIdx{let r=a.getMTime();return e.cutFunction&&(r=Math.max(r,e.cutFunction.getMTime())),r};function n(r,i){const o=r.getPoints(),s=o.getData(),u=r.getPointData(),c=o.getNumberOfPoints(),p=[],l=[],f=[],h={},v=u.getNumberOfArrays();for(let T=0;T0;let _=!0;for(let O=1;O0!==w){_=!1;break}if(_)continue;const E=[];for(let O=0;O0;if(C[b]>0===R)continue;let N=O,L=b,B=C[L]-C[N];B<=0&&(N=b,L=O,B*=-1);let P=0;B!==0&&(P=(e.cutValue-C[N])/B);const F=T.cell[N],k=T.cell[L];d[0]=s[F*3],d[1]=s[F*3+1],d[2]=s[F*3+2],g[0]=s[k*3],g[1]=s[k*3+1],g[2]=s[k*3+2];const G=[d[0]+P*(g[0]-d[0]),d[1]+P*(g[1]-d[1]),d[2]+P*(g[2]-d[2])],W={};for(let H=0;H{h[N].push(...b.intersectedArrays[N])}),E[O].newPointID=p.length/3-1,y.push(E[O]))}const D=E.length;D===2?l.push(D,E[0].newPointID,E[1].newPointID):D>2&&(f.push(D),E.forEach(O=>{f.push(O.newPointID)}))}i.getPoints().setData(Ei(o.getDataType(),p),3);const S=i.getPointData();for(let T=0;T{var u;const o=r[0];if(!o){O1("Invalid or missing input");return}if(!e.cutFunction){O1("Missing cut function");return}const s=((u=i[0])==null?void 0:u.initialize())||Je.newInstance();n(o,s),i[0]=s}}var lx={cutFunction:null,cutScalars:null,cutValue:0};function b1(t,e,a={}){Object.assign(e,lx,a),lt(t,e),Ns(t,e,1,1),ht(t,e,["cutFunction","cutValue"]),ux(t,e)}var fx=qe(b1,"vtkCutter"),px={newInstance:fx,extend:b1},{vtkErrorMacro:hx}=A,gx=class{constructor(){this.segmentMapping={},this.segments=[null],this.faces=[]}addSegment(t){const e=t[0],a=t[t.length-1];if(e===a||t.length<2)return;const n=this.segmentMapping[e],r=this.segmentMapping[a];if(n!==void 0&&r!==void 0)if(Math.abs(n)===Math.abs(r)){const i=n0)for(let s=1;s0){const i=this.segments[n];for(let o=1;o0){const i=this.segments[r];for(let o=1;o{var f;const r=a[0];if(!r){hx("Invalid or missing input");return}const i=((f=n[0])==null?void 0:f.initialize())||Je.newInstance();i.shallowCopy(r);const o=new gx,s=r.getLines().getData();let u=0;for(;ut,N1=1e-6,R1=class{constructor(t=!1){this.matrix=we(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=t?k3:xx}rotateFromDirections(t,e){const a=new Float64Array(3),n=new Float64Array(3),r=new Float64Array(16);un(a,t[0],t[1],t[2]),un(n,e[0],e[1],e[2]),fn(a,a),fn(n,n);const i=Xi(a,n);return i>=1?this:(Jr(this.tmp,a,n),La(this.tmp){var x;const r=((x=n[0])==null?void 0:x.initialize())||Je.newInstance();n[0]=r;const i=24,o=A.newTypedArray(e.pointType,i*3);r.getPoints().setData(o,3);const s=A.newTypedArray(e.pointType,i*3),u=pe.newInstance({name:"Normals",values:s,numberOfComponents:3});r.getPointData().setNormals(u);let c=2;e.generate3DTextureCoordinates===!0&&(c=3);const p=A.newTypedArray(e.pointType,i*c),l=pe.newInstance({name:"TextureCoordinates",values:p,numberOfComponents:c});r.getPointData().setTCoords(l);const f=[0,0,0],h=[0,0,0],v=[0,0];let m=0;f[0]=-e.xLength/2,h[0]=-1,h[1]=0,h[2]=0;for(let y=0;y<2;y++){f[1]=-e.yLength/2;for(let d=0;d<2;d++){v[1]=f[1]+.5,f[2]=-e.zLength/2;for(let g=0;g<2;g++)v[0]=(f[2]+.5)*(1-2*y),o[m*3]=f[0],o[m*3+1]=f[1],o[m*3+2]=f[2],s[m*3]=h[0],s[m*3+1]=h[1],s[m*3+2]=h[2],c===2?(p[m*c]=v[0],p[m*c+1]=v[1]):(p[m*c]=2*y-1,p[m*c+1]=2*d-1,p[m*c+2]=2*g-1),m++,f[2]+=e.zLength;f[1]+=e.yLength}f[0]+=e.xLength,h[0]+=2}f[1]=-e.yLength/2,h[1]=-1,h[0]=0,h[2]=0;for(let y=0;y<2;y++){f[0]=-e.xLength/2;for(let d=0;d<2;d++){v[0]=(f[0]+.5)*(2*y-1),f[2]=-e.zLength/2;for(let g=0;g<2;g++)v[1]=(f[2]+.5)*-1,o[m*3]=f[0],o[m*3+1]=f[1],o[m*3+2]=f[2],s[m*3]=h[0],s[m*3+1]=h[1],s[m*3+2]=h[2],c===2?(p[m*c]=v[0],p[m*c+1]=v[1]):(p[m*c]=2*d-1,p[m*c+1]=2*y-1,p[m*c+2]=2*g-1),m++,f[2]+=e.zLength;f[0]+=e.xLength}f[1]+=e.yLength,h[1]+=2}f[2]=-e.zLength/2,h[2]=-1,h[0]=0,h[1]=0;for(let y=0;y<2;y++){f[1]=-e.yLength/2;for(let d=0;d<2;d++){v[1]=f[1]+.5,f[0]=-e.xLength/2;for(let g=0;g<2;g++)v[0]=(f[0]+.5)*(2*y-1),o[m*3]=f[0],o[m*3+1]=f[1],o[m*3+2]=f[2],s[m*3]=h[0],s[m*3+1]=h[1],s[m*3+2]=h[2],c===2?(p[m*c]=v[0],p[m*c+1]=v[1]):(p[m*c]=2*g-1,p[m*c+1]=2*d-1,p[m*c+2]=2*y-1),m++,f[0]+=e.xLength;f[1]+=e.yLength}f[2]+=e.zLength,h[2]+=2}if(e.rotations&&Dt.buildFromDegree().rotateX(e.rotations[0]).rotateY(e.rotations[1]).rotateZ(e.rotations[2]).apply(o).apply(s),e.center&&Dt.buildFromRadian().translate(...e.center).apply(o),e.matrix){Dt.buildFromRadian().setMatrix(e.matrix).apply(o);const y=[e.matrix[0],e.matrix[1],e.matrix[2],0,e.matrix[4],e.matrix[5],e.matrix[6],0,e.matrix[8],e.matrix[9],e.matrix[10],0,0,0,0,1];Dt.buildFromRadian().setMatrix(y).apply(s)}e.generateFaces?r.getPolys().deepCopy(e._polys):r.getPolys().initialize(),e.generateLines?(r.getLines().deepCopy(e._lineCells),r.getPointData().setNormals(null)):r.getLines().initialize(),r.modified()},t.setBounds=(...a)=>{let n=[];if(Array.isArray(a[0]))n=a[0];else for(let r=0;r{const i=n[0];if(!i||!i.isA("vtkImageData")){F1("Invalid or missing input");return}const o=i.getSpatialExtent();if(!o){F1("Unable to fetch spatial extents of input image.");return}e._cubeSource.setBounds(o),e._cubeSource.setMatrix(i.getIndexToWorld()),r[0]=e._cubeSource.getOutputData()},t.getMTime=()=>Math.max(a.getMTime(),e._cubeSource.getMTime()),t.setGenerateFaces=e._cubeSource.setGenerateFaces,t.setGenerateLines=e._cubeSource.setGenerateLines,t.getGenerateFaces=e._cubeSource.getGenerateFaces,t.getGenerateLines=e._cubeSource.getGenerateLines}var Mx={};function k1(t,e,a={}){Object.assign(e,Mx,a),A.obj(t,e),A.algo(t,e,1,1),e._cubeSource=Ox.newInstance(),A.moveToProtected(t,e,["cubeSource","tmpOut"]),bx(t,e)}var Nx=A.newInstance(k1,"vtkImageDataOutlineFilter"),Rx={newInstance:Nx,extend:k1};function Lx(t,e){return t?t.getProperty(e)||t.getProperty():null}function Fx(t,e){const a=[];for(let n=0;n.999999)return[!0,e]}return[!1,2]}function G1(t,e,a){for(let n=0;ni===0?r?e.copy(n,r):e.identity(n):r?e.multiply(n,n,r):n,a)}function l8(t,e){e.classHierarchy.push("vtkOpenGLImageResliceMapper");const a=new Map;function n(c,l){if(!l)return;const u=(a.get(l)??0)-1;u<=0?(c.unregisterGraphicsResourceUser(l,t),a.delete(l)):a.set(l,u)}function r(c,l){if(!l)return;const p=a.get(l)??0,u=p+1;a.set(l,u),p<=0&&c.registerGraphicsResourceUser(l,t)}function i(c,l,p){l!==p&&(n(c,l),r(c,p))}function o(c){[...a.keys()].forEach(l=>c.unregisterGraphicsResourceUser(l,t))}t.buildPass=c=>{if(c){e.currentRenderPass=null,e._openGLImageSlice=t.getFirstAncestorOfType("vtkOpenGLImageSlice"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const l=e._openGLRenderer.getRenderable();e._openGLCamera=e._openGLRenderer.getViewNodeFor(l.getActiveCamera(),e.openGLCamera);const p=e._openGLRenderWindow;e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),p&&!p.isDeleted()&&p!==e._openGLRenderWindow&&o(p),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow)}},t.translucentPass=(c,l)=>{c&&(e.currentRenderPass=l,t.render())},t.zBufferPass=c=>{c&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.opaqueZBufferPass=c=>t.zBufferPass(c),t.opaquePass=c=>{c&&t.render()},t.getCoincidentParameters=(c,l)=>e.renderable.getResolveCoincidentTopology()==Zt.PolygonOffset?e.renderable.getCoincidentTopologyPolygonOffsetParameters():null,t.render=()=>{const c=e._openGLImageSlice.getRenderable(),l=e._openGLRenderer.getRenderable();t.renderPiece(l,c)},t.renderPiece=(c,l)=>{t.invokeEvent({type:"StartEvent"}),e.renderable.update();const p=e.renderable.getNumberOfInputPorts();e.currentValidInputs=[];for(let d=0;d1,e.numberOfComponents=e.multiTexturePerVolumeEnabled?u:h.getNumberOfComponents(),t.updateResliceGeometry(),t.renderPieceStart(c,l),t.renderPieceDraw(c,l),t.renderPieceFinish(c,l),t.invokeEvent({type:"EndEvent"})},t.renderPieceStart=(c,l)=>{t.updateBufferObjects(c,l);const p=l.getProperties();e.currentValidInputs.forEach(d=>{let{inputIndex:v}=d;const x=p[v].getInterpolationType(),y=e.scalarTextures[v];x===Dr.NEAREST?(y.setMinificationFilter(me.NEAREST),y.setMagnificationFilter(me.NEAREST)):(y.setMinificationFilter(me.LINEAR),y.setMagnificationFilter(me.LINEAR))});const u=e.currentValidInputs[0];p[u.inputIndex].getInterpolationType()===Dr.NEAREST?(e.colorTexture.setMinificationFilter(me.NEAREST),e.colorTexture.setMagnificationFilter(me.NEAREST),e.pwfTexture.setMinificationFilter(me.NEAREST),e.pwfTexture.setMagnificationFilter(me.NEAREST)):(e.colorTexture.setMinificationFilter(me.LINEAR),e.colorTexture.setMagnificationFilter(me.LINEAR),e.pwfTexture.setMinificationFilter(me.LINEAR),e.pwfTexture.setMagnificationFilter(me.LINEAR)),e.lastBoundBO=null},t.renderPieceDraw=(c,l)=>{const p=e.context,u=[...e.scalarTextures,e.colorTexture,e.pwfTexture];u.forEach(f=>f.activate()),t.updateShaders(e.tris,c,l),p.drawArrays(p.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release(),u.forEach(f=>f.deactivate())},t.renderPieceFinish=(c,l)=>{},t.updateBufferObjects=(c,l)=>{t.getNeedToRebuildBufferObjects(c,l)&&t.buildBufferObjects(c,l)},t.getNeedToRebuildBufferObjects=(c,l)=>{var p,u,f;return e.VBOBuildTime.getMTime(){let{imageData:d}=h;return e.VBOBuildTime.getMTime()!!(h!=null&&h.getHandle()))||!((u=e.colorTexture)!=null&&u.getHandle())||!((f=e.pwfTexture)!=null&&f.getHandle())},t.buildBufferObjects=(c,l)=>{var O,M;const p=l.getProperties();e.currentValidInputs.forEach((N,R)=>{var K;let{imageData:B}=N;const I=B.getPointData().getScalars(),P=e._openGLRenderWindow.getGraphicsResourceForObject(I),L=X0(B,I),k=!((K=P==null?void 0:P.oglObject)!=null&&K.getHandle())||(P==null?void 0:P.hash)!==L,A=p[R],j=A.getUpdatedExtents(),H=!!j.length;if(k&&!H){const Y=Re.newInstance();Y.setOpenGLRenderWindow(e._openGLRenderWindow);const q=B.getDimensions();Y.setOglNorm16Ext(e.context.getExtension("EXT_texture_norm16")),Y.resetFormatAndType(),Y.create3DFilterableFromDataArray({width:q[0],height:q[1],depth:q[2],dataArray:I}),e._openGLRenderWindow.setGraphicsResourceForObject(I,Y,L),e.scalarTextures[R]=Y}else e.scalarTextures[R]=P.oglObject;if(H){A.setUpdatedExtents([]);const Y=B.getDimensions();e.scalarTextures[R].create3DFilterableFromDataArray({width:Y[0],height:Y[1],depth:Y[2],dataArray:I,updatedExtents:j})}i(e._openGLRenderWindow,e._scalarTexturesCore[R],I),e._scalarTexturesCore[R]=I});const u=e.currentValidInputs[0],f=p[u.inputIndex],h=f.getIndependentComponents(),d=h?e.numberOfComponents:1,v=h?2*d:1,m=[];for(let N=0;N0){const I=e.resliceGeom.getPointData().getNormals();I?B.normals=I:Or("Slab mode requested without normals")}e.tris.getCABO().createVBO(R,"polys",Jt.SURFACE,B)}e.VBOBuildString=D,e.VBOBuildTime.modified()},t.updateShaders=(c,l,p)=>{if(e.lastBoundBO=c,t.getNeedToRebuildShaders(c,l,p)){const u={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(u,l,p);const f=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(u.Vertex,u.Fragment,u.Geometry);f!==c.getProgram()&&(c.setProgram(f),c.getVAO().releaseGraphicsResources()),c.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(c.getProgram());c.getVAO().bind(),t.setMapperShaderParameters(c,l,p),t.setCameraShaderParameters(c,l,p),t.setPropertyShaderParameters(c,l,p)},t.setMapperShaderParameters=(c,l,p)=>{const u=c.getProgram(),f=e.currentValidInputs[0].imageData;if(c.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>c.getAttributeUpdateTime().getMTime()||c.getShaderSourceTime().getMTime()>c.getAttributeUpdateTime().getMTime())){e.scalarTextures.forEach((v,m)=>{u.setUniformi(`volumeTexture[${m}]`,v.getTextureUnit())}),u.isAttributeUsed("vertexWC")&&(c.getVAO().addAttributeArray(u,c.getCABO(),"vertexWC",c.getCABO().getVertexOffset(),c.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||Or("Error setting vertexWC in shader VAO.")),u.isAttributeUsed("normalWC")&&(c.getVAO().addAttributeArray(u,c.getCABO(),"normalWC",c.getCABO().getNormalOffset(),c.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||Or("Error setting normalWC in shader VAO.")),u.isUniformUsed("slabThickness")&&u.setUniformf("slabThickness",e.renderable.getSlabThickness()),u.isUniformUsed("spacing")&&u.setUniform3fv("spacing",f.getSpacing()),u.isUniformUsed("slabType")&&u.setUniformi("slabType",e.renderable.getSlabType()),u.isUniformUsed("slabType")&&u.setUniformi("slabType",e.renderable.getSlabType()),u.isUniformUsed("slabTrapezoid")&&u.setUniformi("slabTrapezoid",e.renderable.getSlabTrapezoidIntegration());const d=c.getCABO().getCoordShiftAndScaleEnabled()?c.getCABO().getInverseShiftAndScaleMatrix():null;if(u.isUniformUsed("WCTCMatrix")){const v=f.getDimensions();gt(e.tmpMat4,f.getIndexToWorld()),Ye(e.tmpMat4,e.tmpMat4,[-.5,-.5,-.5]),An(e.tmpMat4,e.tmpMat4,v),Et(e.tmpMat4,e.tmpMat4),d&&Ee(e.tmpMat4,e.tmpMat4,d),u.setUniformMatrix("WCTCMatrix",e.tmpMat4)}u.isUniformUsed("vboScaling")&&u.setUniform3fv("vboScaling",c.getCABO().getCoordScale()??[1,1,1]),c.getAttributeUpdateTime().modified()}if(e.haveSeenDepthRequest&&c.getProgram().setUniformi("depthRequest",e.renderDepth?1:0),c.getProgram().isUniformUsed("coffset")){const h=t.getCoincidentParameters(l,p);c.getProgram().setUniformf("coffset",h.offset),c.getProgram().isUniformUsed("cfactor")&&c.getProgram().setUniformf("cfactor",h.factor)}},t.setCameraShaderParameters=(c,l,p)=>{const u=e._openGLCamera.getKeyMatrices(l),f=e._openGLImageSlice.getKeyMatrices(),d=c.getCABO().getCoordShiftAndScaleEnabled()?c.getCABO().getInverseShiftAndScaleMatrix():null,v=c.getProgram();v.isUniformUsed("MCPCMatrix")&&(Te(e.tmpMat4),v.setUniformMatrix("MCPCMatrix",Vh([u.wcpc,f.mcwc,d],va,e.tmpMat4))),v.isUniformUsed("MCVCMatrix")&&(Te(e.tmpMat4),v.setUniformMatrix("MCVCMatrix",Vh([u.wcvc,f.mcwc,d],va,e.tmpMat4)))},t.setPropertyShaderParameters=(c,l,p)=>{const u=c.getProgram(),f=p.getProperty(e.currentValidInputs[0].inputIndex),h=f.getOpacity();u.setUniformf("opacity",h);const d=e.numberOfComponents,v=f.getIndependentComponents();if(v)for(let y=0;y{var m;const u=p.getProperty(e.currentValidInputs[0].inputIndex).getIndependentComponents(),f=e.renderable.getSlabThickness(),h=e.renderable.getSlabType(),d=e.renderable.getSlabTrapezoidIntegration();let v=!1;return(!e.currentRenderPass&&e.lastRenderPassShaderReplacement||e.currentRenderPass&&e.currentRenderPass.getShaderReplacement()!==e.lastRenderPassShaderReplacement)&&(v=!0),v||e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||e.lastNumberOfComponents!==e.numberOfComponents||e.lastMultiTexturePerVolumeEnabled!==e.multiTexturePerVolumeEnabled||((m=c.getProgram())==null?void 0:m.getHandle())===0||e.lastIndependentComponents!==u||e.lastSlabThickness!==f||e.lastSlabType!==h||e.lastSlabTrapezoidIntegration!==d?(e.lastHaveSeenDepthRequest=e.haveSeenDepthRequest,e.lastNumberOfComponents=e.numberOfComponents,e.lastMultiTexturePerVolumeEnabled=e.multiTexturePerVolumeEnabled,e.lastIndependentComponents=u,e.lastSlabThickness=f,e.lastSlabType=h,e.lastSlabTrapezoidIntegration=d,!0):!1},t.getShaderTemplate=(c,l,p)=>{c.Vertex=s8,c.Fragment=c8,c.Geometry=""},t.replaceShaderValues=(c,l,p)=>{if(t.replaceShaderTCoord(c,l,p),t.replaceShaderPositionVC(c,l,p),e.haveSeenDepthRequest){let u=c.Fragment;u=Q.substitute(u,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,u=Q.substitute(u,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,c.Fragment=u}t.replaceShaderCoincidentOffset(c,l,p)},t.replaceShaderTCoord=(c,l,p)=>{let u=c.Vertex;const f=c.Geometry;let h=c.Fragment;const d=["uniform mat4 WCTCMatrix;","out vec3 fragTexCoord;"],v=e.renderable.getSlabThickness();u=Q.substitute(u,"//VTK::TCoord::Dec",d).result;const m=["fragTexCoord = (WCTCMatrix * vertexWC).xyz;"];u=Q.substitute(u,"//VTK::TCoord::Impl",m).result;const x=e.numberOfComponents,y=p.getProperty(e.currentValidInputs[0].inputIndex).getIndependentComponents();let g=["in vec3 fragTexCoord;",`uniform highp sampler3D volumeTexture[${e.scalarTextures.length}];`,"uniform mat4 WCTCMatrix;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;","uniform vec4 backgroundColor;"];if(g.push("vec4 rawSampleTexture(vec3 pos) {"),!e.multiTexturePerVolumeEnabled)g.push("return texture(volumeTexture[0], pos);","}");else{g.push("vec4 rawSample;");for(let S=0;S0&&(g=g.concat(["uniform vec3 spacing;","uniform float slabThickness;","uniform int slabType;","uniform int slabTrapezoid;","uniform vec3 vboScaling;"]),g=g.concat(["vec4 compositeValue(vec4 currVal, vec4 valToComp, int trapezoid)","{"," vec4 retVal = vec4(1.0);"," if (slabType == 0) // min"," {"," retVal = min(currVal, valToComp);"," }"," else if (slabType == 1) // max"," {"," retVal = max(currVal, valToComp);"," }"," else if (slabType == 3) // sum"," {"," retVal = currVal + (trapezoid > 0 ? 0.5 * valToComp : valToComp); "," }"," else // mean"," {"," retVal = currVal + (trapezoid > 0 ? 0.5 * valToComp : valToComp); "," }"," return retVal;","}"])),h=Q.substitute(h,"//VTK::TCoord::Dec",g).result;let C=["if (any(greaterThan(fragTexCoord, vec3(1.0))) || any(lessThan(fragTexCoord, vec3(0.0))))","{"," // set the background color and exit"," gl_FragData[0] = backgroundColor;"," return;","}","vec4 tvalue = rawSampleTexture(fragTexCoord);"];if(v>0&&(C=C.concat(["// Get the first and last samples","int numSlices = 1;","float scaling = min(min(spacing.x, spacing.y), spacing.z) * 0.5;","vec3 normalxspacing = scaling * normalWCVSOutput;","float distTraveled = length(normalxspacing);","int trapezoid = 0;","while (distTraveled < slabThickness * 0.5)","{"," distTraveled += length(normalxspacing);"," float fnumSlices = float(numSlices);"," if (distTraveled > slabThickness * 0.5)"," {"," // Before stepping outside the slab, sample at the boundaries"," normalxspacing = normalWCVSOutput * slabThickness * 0.5 / fnumSlices;"," trapezoid = slabTrapezoid;"," }"," vec3 fragTCoordNeg = (WCTCMatrix * vec4(vertexWCVSOutput.xyz - fnumSlices * normalxspacing * vboScaling, 1.0)).xyz;"," if (!any(greaterThan(fragTCoordNeg, vec3(1.0))) && !any(lessThan(fragTCoordNeg, vec3(0.0))))"," {"," vec4 newVal = rawSampleTexture(fragTCoordNeg);"," tvalue = compositeValue(tvalue, newVal, trapezoid);"," numSlices += 1;"," }"," vec3 fragTCoordPos = (WCTCMatrix * vec4(vertexWCVSOutput.xyz + fnumSlices * normalxspacing * vboScaling, 1.0)).xyz;"," if (!any(greaterThan(fragTCoordNeg, vec3(1.0))) && !any(lessThan(fragTCoordNeg, vec3(0.0))))"," {"," vec4 newVal = rawSampleTexture(fragTCoordPos);"," tvalue = compositeValue(tvalue, newVal, trapezoid);"," numSlices += 1;"," }","}","// Finally, if slab type is *mean*, divide the sum by the numSlices","if (slabType == 2)","{"," tvalue = tvalue / float(numSlices);","}"])),y){const S=["r","g","b","a"];for(let T=0;T{let u=c.Vertex;const f=c.Geometry;let h=c.Fragment;const d=e.renderable.getSlabThickness();let v=["attribute vec4 vertexWC;"];v=v.concat([`//${t.getMTime()}${e.resliceGeomUpdateString}`]),d>0&&(v=v.concat(["attribute vec3 normalWC;","varying vec3 normalWCVSOutput;","varying vec4 vertexWCVSOutput;"])),u=Q.substitute(u,"//VTK::PositionVC::Dec",v).result;let m=["gl_Position = MCPCMatrix * vertexWC;"];d>0&&(m=m.concat(["normalWCVSOutput = normalWC;","vertexWCVSOutput = vertexWC;"])),u=Q.substitute(u,"//VTK::PositionVC::Impl",m).result,u=Q.substitute(u,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result;let x=[];d>0&&(x=x.concat(["varying vec3 normalWCVSOutput;","varying vec4 vertexWCVSOutput;"])),h=Q.substitute(h,"//VTK::PositionVC::Dec",x).result,c.Vertex=u,c.Geometry=f,c.Fragment=h};function s(c){Mt.normalize(c);const l=[0,0,0];for(let p=0;p<3;++p){M2(l),l[p]=1;const u=Mt.dot(c,l);if(u<-.999999||u>.999999)return[!0,p]}return[!1,2]}t.updateResliceGeometry=()=>{var v;let c="";const l=e.currentValidInputs[0].imageData,p=l==null?void 0:l.getBounds();let u=!0,f=2;const h=e.renderable.getSlicePolyData(),d=e.renderable.getSlicePlane();if(h)c=c.concat(`PolyData${h.getMTime()}`);else if(d){c=c.concat(`Plane${d.getMTime()}`);const m=an();l&&(c=c.concat(`Image${l.getMTime()}`),Xc(m,...l.getDirection()),Tn(m,m));const x=[...d.getNormal()];Ei(x,x,m),[u,f]=s(x)}else{const m=fn.newInstance();m.setNormal(0,0,1);let x=[0,1,0,1,0,1];l&&(x=p),m.setOrigin(x[0],x[2],.5*(x[5]+x[4])),e.renderable.setSlicePlane(m),c=c.concat(`Plane${d==null?void 0:d.getMTime()}`),l&&(c=c.concat(`Image${l.getMTime()}`))}if(!e.resliceGeom||e.resliceGeomUpdateString!==c){if(h)e.resliceGeom||(e.resliceGeom=Xe.newInstance()),e.resliceGeom.getPoints().setData(h.getPoints().getData(),3),e.resliceGeom.getPolys().setData(h.getPolys().getData(),1),e.resliceGeom.getPointData().setNormals(h.getPointData().getNormals());else if(d)if(u){const m=new Float32Array(12),x=l.worldToIndex(d.getOrigin(),[0,0,0]),y=[(f+1)%3,(f+2)%3].sort(),g=l.getSpatialExtent();let C=0;for(let E=0;E<2;++E)for(let D=0;D<2;++D)m[C+f]=x[f],m[C+y[0]]=g[2*y[0]+D],m[C+y[1]]=g[2*y[1]+E],C+=3;e.transform.setMatrix(l.getIndexToWorld()),e.transform.transformPoints(m,m);const S=new Uint16Array(8);S[0]=3,S[1]=0,S[2]=1,S[3]=3,S[4]=3,S[5]=0,S[6]=3,S[7]=2;const T=d.getNormal();Mt.normalize(T);const w=new Float32Array(12);for(let E=0;E<4;++E)w[3*E]=T[0],w[3*E+1]=T[1],w[3*E+2]=T[2];e.resliceGeom||(e.resliceGeom=Xe.newInstance()),e.resliceGeom.getPoints().setData(m,3),e.resliceGeom.getPolys().setData(S,1);const _=pe.newInstance({numberOfComponents:3,values:w,name:"Normals"});e.resliceGeom.getPointData().setNormals(_)}else{e.outlineFilter.setInputData(l),e.cutter.setInputConnection(e.outlineFilter.getOutputPort()),e.cutter.setCutFunction(d),e.lineToSurfaceFilter.setInputConnection(e.cutter.getOutputPort()),e.lineToSurfaceFilter.update(),e.resliceGeom||(e.resliceGeom=Xe.newInstance());const m=e.lineToSurfaceFilter.getOutputData();e.resliceGeom.getPoints().setData(m.getPoints().getData(),3),e.resliceGeom.getPolys().setData(m.getPolys().getData(),1),e.resliceGeom.getPointData().setNormals(m.getPointData().getNormals());const x=d.getNormal(),y=e.resliceGeom.getNumberOfPoints();Mt.normalize(x);const g=new Float32Array(y*3);for(let S=0;S{e.scalarTextures=[...c],e._externalOpenGLTexture=!0},t.delete=Gn(()=>{e._openGLRenderWindow&&o(e._openGLRenderWindow)},t.delete)}const f8={VBOBuildTime:{},VBOBuildString:null,haveSeenDepthRequest:!1,lastHaveSeenDepthRequest:!1,lastIndependentComponents:!1,lastNumberOfComponents:0,lastMultiTexturePerVolumeEnabled:!1,lastSlabThickness:0,lastSlabTrapezoidIntegration:0,lastSlabType:-1,scalarTextures:[],_scalarTexturesCore:[],colorTexture:null,_colorTextureCore:null,pwfTexture:null,_pwfTextureCore:null,_externalOpenGLTexture:!1,resliceGeom:null,resliceGeomUpdateString:null,tris:null};function p8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,f8,a),Ct.extend(t,e,a),mn.implementReplaceShaderCoincidentOffset(t,e,a),mn.implementBuildShadersWithReplacements(t,e,a),e.tris=jt.newInstance(),e.scalarTextures=[],e.colorTexture=null,e.pwfTexture=null,e.VBOBuildTime={},ut(e.VBOBuildTime),e.tmpMat4=Te(new Float64Array(16)),e.outlineFilter=n8.newInstance(),e.outlineFilter.setGenerateFaces(!0),e.outlineFilter.setGenerateLines(!1),e.cubePolyData=Xe.newInstance(),e.cutter=$6.newInstance(),e.lineToSurfaceFilter=P6.newInstance(),e.transform=o8.newInstance(),At(t,e,["scalarTextures"]),l8(t,e)}const h8=Je(p8,"vtkOpenGLImageResliceMapper");st("vtkImageResliceMapper",h8);var q0={SlicingMode:{NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5}};const{vtkErrorMacro:ra}=Dt,{SlicingMode:Bt}=q0;function g8(t){const e=t.split(` -`),a=[];for(let n=0;n0&&a.push(r)}return a}function d8(t,e){e.classHierarchy.push("vtkOpenGLImageMapper");function a(n){e.openGLTexture.releaseGraphicsResources(n),[e._colorTransferFunc,e._pwFunc,e._labelOutlineThicknessArray,e._labelOutlineOpacity].forEach(r=>n.unregisterGraphicsResourceUser(r,t))}t.buildPass=n=>{if(n){e.currentRenderPass=null,e.openGLImageSlice=t.getFirstAncestorOfType("vtkOpenGLImageSlice"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const r=e._openGLRenderWindow;e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),r&&!r.isDeleted()&&r!==e._openGLRenderWindow&&a(r),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow);const i=e._openGLRenderer.getRenderable();e.openGLCamera=e._openGLRenderer.getViewNodeFor(i.getActiveCamera(),e.openGLCamera),e.renderable.isA("vtkImageMapper")&&e.renderable.getSliceAtFocalPoint()&&e.renderable.setSliceFromCamera(i.getActiveCamera())}},t.translucentPass=(n,r)=>{n&&(e.currentRenderPass=r,t.render())},t.zBufferPass=n=>{n&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.opaqueZBufferPass=n=>t.zBufferPass(n),t.opaquePass=n=>{n&&t.render()},t.getCoincidentParameters=(n,r)=>e.renderable.getResolveCoincidentTopology()==Zt.PolygonOffset?e.renderable.getCoincidentTopologyPolygonOffsetParameters():null,t.render=()=>{const n=e.openGLImageSlice.getRenderable(),r=e._openGLRenderer.getRenderable();t.renderPiece(r,n)},t.getShaderTemplate=(n,r,i)=>{n.Vertex=W0,n.Fragment=$a,n.Geometry=""},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;o=Q.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Q.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result,o=Q.substitute(o,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result,o=Q.substitute(o,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result;const c=e.openGLTexture.getComponents(),l=i.getProperty().getIndependentComponents();let p=["varying vec2 tcoordVCVSOutput;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D texture1;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;"];if(i.getProperty().getUseLabelOutline()&&(p=p.concat(["uniform sampler2D labelOutlineTexture1;","uniform sampler2D labelOutlineOpacityTexture1;"])),l){for(let f=1;ft.split(` +`).map(e=>e.trim()).filter(Boolean);function P1(t,e,a){return e.identity(a),t.reduce((n,r,i)=>i===0?r?e.copy(n,r):e.identity(n):r?e.multiply(n,n,r):n,a)}function jx(t,e){e.classHierarchy.push("vtkOpenGLImageResliceMapper");const a=new Map;function n(h,v){if(!v)return;const m=(a.get(v)??0)-1;m<=0?(h.unregisterGraphicsResourceUser(v,t),a.delete(v)):a.set(v,m)}function r(h,v){if(!v)return;const m=a.get(v)??0,x=m+1;a.set(v,x),m<=0&&h.registerGraphicsResourceUser(v,t)}function i(h,v,m){v!==m&&(n(h,v),r(h,m))}function o(h){[...a.keys()].forEach(v=>h.unregisterGraphicsResourceUser(v,t))}t.buildPass=h=>{if(h){e.currentRenderPass=null,e._openGLImageSlice=t.getFirstAncestorOfType("vtkOpenGLImageSlice"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const v=e._openGLRenderer.getRenderable();e._openGLCamera=e._openGLRenderer.getViewNodeFor(v.getActiveCamera(),e.openGLCamera);const m=e._openGLRenderWindow;e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),m&&!m.isDeleted()&&m!==e._openGLRenderWindow&&o(m),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow)}},t.translucentPass=(h,v)=>{h&&(e.currentRenderPass=v,t.render())},t.zBufferPass=h=>{h&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.opaqueZBufferPass=h=>t.zBufferPass(h),t.opaquePass=h=>{h&&t.render()},t.getCoincidentParameters=(h,v)=>e.renderable.getResolveCoincidentTopology()==Zt.PolygonOffset?e.renderable.getCoincidentTopologyPolygonOffsetParameters():null,t.render=()=>{const h=e._openGLImageSlice.getRenderable(),v=e._openGLRenderer.getRenderable();t.renderPiece(v,h)},t.renderPiece=(h,v)=>{t.invokeEvent({type:"StartEvent"}),e.renderable.update();const m=e.renderable.getNumberOfInputPorts();e.currentValidInputs=[];for(let d=0;d1,e.numberOfComponents=e.multiTexturePerVolumeEnabled?x:y.getNumberOfComponents(),t.updateResliceGeometry(),t.renderPieceStart(h,v),t.renderPieceDraw(h,v),t.renderPieceFinish(h,v),t.invokeEvent({type:"EndEvent"})},t.renderPieceStart=(h,v)=>{var x;t.updateBufferObjects(h,v);const m=v.getProperties();e.currentValidInputs.forEach(({inputIndex:y},d)=>{const g=m[y],C=e.scalarTextures[d];!g||!C||(g.getInterpolationType()===br.NEAREST?(C.setMinificationFilter(me.NEAREST),C.setMagnificationFilter(me.NEAREST)):(C.setMinificationFilter(me.LINEAR),C.setMagnificationFilter(me.LINEAR)))}),((x=m[e.currentValidInputs[0].inputIndex])==null?void 0:x.getInterpolationType())===br.NEAREST?(e.colorTexture.setMinificationFilter(me.NEAREST),e.colorTexture.setMagnificationFilter(me.NEAREST),e.pwfTexture.setMinificationFilter(me.NEAREST),e.pwfTexture.setMagnificationFilter(me.NEAREST)):(e.colorTexture.setMinificationFilter(me.LINEAR),e.colorTexture.setMagnificationFilter(me.LINEAR),e.pwfTexture.setMinificationFilter(me.LINEAR),e.pwfTexture.setMagnificationFilter(me.LINEAR)),e.lastBoundBO=null},t.renderPieceDraw=(h,v)=>{const m=e.context,x=e.labelOutlineProperties.length>0,y=[...e.scalarTextures,e.colorTexture,e.pwfTexture];x&&(y.push(e.labelOutlineThicknessTexture),y.push(e.labelOutlineOpacityTexture)),y.forEach(d=>d.activate()),t.updateShaders(e.tris,h,v),m.drawArrays(m.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release(),y.forEach(d=>d.deactivate())},t.renderPieceFinish=(h,v)=>{},t.updateBufferObjects=(h,v)=>{t.getNeedToRebuildBufferObjects(h,v)&&t.buildBufferObjects(h,v)},t.getNeedToRebuildBufferObjects=(h,v)=>{var y,d,g,C;const m=v.getProperty(e.currentValidInputs[0].inputIndex),x=e.labelOutlineProperties.length>0;return e.VBOBuildTime.getMTime()e.VBOBuildTime.getMTime()!!(S!=null&&S.getHandle()))||!((y=e.colorTexture)!=null&&y.getHandle())||!((d=e.pwfTexture)!=null&&d.getHandle())||x&&(!((g=e.labelOutlineThicknessTexture)!=null&&g.getHandle())||!((C=e.labelOutlineOpacityTexture)!=null&&C.getHandle()))},t.buildBufferObjects=(h,v)=>{var R,N;const m=v.getProperties();e.currentValidInputs.forEach(({imageData:L,inputIndex:B},P)=>{var q;const F=L.getPointData().getScalars(),k=e._openGLRenderWindow.getGraphicsResourceForObject(F),G=ec(L,F),W=!((q=k==null?void 0:k.oglObject)!=null&&q.getHandle())||(k==null?void 0:k.hash)!==G,H=m[B],X=(H==null?void 0:H.getUpdatedExtents())??[],Y=!!X.length;if(W&&!Y){const Q=Ne.newInstance();Q.setOpenGLRenderWindow(e._openGLRenderWindow);const ae=L.getDimensions();Q.setOglNorm16Ext(e.context.getExtension("EXT_texture_norm16")),Q.resetFormatAndType(),Q.create3DFilterableFromDataArray({width:ae[0],height:ae[1],depth:ae[2],dataArray:F}),e._openGLRenderWindow.setGraphicsResourceForObject(F,Q,G),e.scalarTextures[P]=Q}else e.scalarTextures[P]=k.oglObject;if(Y){H.setUpdatedExtents([]);const Q=L.getDimensions();e.scalarTextures[P].create3DFilterableFromDataArray({width:Q[0],height:Q[1],depth:Q[2],dataArray:F,updatedExtents:X})}i(e._openGLRenderWindow,e._scalarTexturesCore[P],F),e._scalarTexturesCore[P]=F});const x=m[e.currentValidInputs[0].inputIndex];if(!x){Mr("Missing property for first input");return}const y=x.getIndependentComponents(),d=y?e.numberOfComponents:1,g=y?2*d:1,C=[];for(let L=0;L0&&(t.updateLabelOutlineThicknessTexture(e.labelOutlineProperties),t.updateLabelOutlineOpacityTexture(e.labelOutlineProperties));const b=`${e.resliceGeom.getMTime()}A${e.renderable.getSlabThickness()}`;if(!e.tris.getCABO().getElementCount()||e.VBOBuildString!==b){const L=pe.newInstance({numberOfComponents:3,values:e.resliceGeom.getPoints().getData()});L.setName("points");const B=pe.newInstance({numberOfComponents:1,values:e.resliceGeom.getPolys().getData()}),P={points:L,cellOffset:0};if(e.renderable.getSlabThickness()>0){const F=e.resliceGeom.getPointData().getNormals();F?P.normals=F:Mr("Slab mode requested without normals")}e.tris.getCABO().createVBO(B,"polys",Jt.SURFACE,P)}e.VBOBuildString=b,e.VBOBuildTime.modified()},t.updateShaders=(h,v,m)=>{if(e.lastBoundBO=h,t.getNeedToRebuildShaders(h,v,m)){const x={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(x,v,m);const y=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(x.Vertex,x.Fragment,x.Geometry);y!==h.getProgram()&&(h.setProgram(y),h.getVAO().releaseGraphicsResources()),h.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(h.getProgram());h.getVAO().bind(),t.setMapperShaderParameters(h,v,m),t.setCameraShaderParameters(h,v,m),t.setPropertyShaderParameters(h,v,m)},t.setMapperShaderParameters=(h,v,m)=>{const x=h.getProgram(),y=e.currentValidInputs[0].imageData;if(h.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>h.getAttributeUpdateTime().getMTime()||h.getShaderSourceTime().getMTime()>h.getAttributeUpdateTime().getMTime())){e.scalarTextures.forEach((g,C)=>{x.setUniformi(`volumeTexture[${C}]`,g.getTextureUnit())}),x.isAttributeUsed("vertexWC")&&(h.getVAO().addAttributeArray(x,h.getCABO(),"vertexWC",h.getCABO().getVertexOffset(),h.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||Mr("Error setting vertexWC in shader VAO.")),x.isAttributeUsed("normalWC")&&(h.getVAO().addAttributeArray(x,h.getCABO(),"normalWC",h.getCABO().getNormalOffset(),h.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||Mr("Error setting normalWC in shader VAO.")),x.isUniformUsed("slabThickness")&&x.setUniformf("slabThickness",e.renderable.getSlabThickness()),x.isUniformUsed("spacing")&&x.setUniform3fv("spacing",y.getSpacing()),x.isUniformUsed("slabType")&&x.setUniformi("slabType",e.renderable.getSlabType()),x.isUniformUsed("slabTrapezoid")&&x.setUniformi("slabTrapezoid",e.renderable.getSlabTrapezoidIntegration());const d=h.getCABO().getCoordShiftAndScaleEnabled()?h.getCABO().getInverseShiftAndScaleMatrix():null;for(let g=0;g{const x=e._openGLCamera.getKeyMatrices(v),y=e._openGLImageSlice.getKeyMatrices(),d=h.getCABO().getCoordShiftAndScaleEnabled()?h.getCABO().getInverseShiftAndScaleMatrix():null,g=h.getProgram();g.isUniformUsed("MCPCMatrix")&&(we(e.tmpMat4),g.setUniformMatrix("MCPCMatrix",P1([x.wcpc,y.mcwc,d],Ra,e.tmpMat4))),g.isUniformUsed("MCVCMatrix")&&(we(e.tmpMat4),g.setUniformMatrix("MCVCMatrix",P1([x.wcvc,y.mcwc,d],Ra,e.tmpMat4)))},t.setPropertyShaderParameters=(h,v,m)=>{var E,D,O;const x=h.getProgram(),y=m.getProperty(e.currentValidInputs[0].inputIndex),d=e.multiTexturePerVolumeEnabled?1:y.getOpacity();x.setUniformf("opacity",d);const g=e.numberOfComponents,C=y.getIndependentComponents(),S=e.multiTexturePerVolumeEnabled,T=m.getProperties();if(C)for(let b=0;b0){const b=e.labelOutlineThicknessTexture.getTextureUnit();x.setUniformi("labelOutlineThicknessTexture",b);const R=e.labelOutlineOpacityTexture.getTextureUnit();x.setUniformi("labelOutlineOpacityTexture",R);let N=e.renderable.getLabelOutlineTextureWidth();N<=0&&(N=e.context.getParameter(e.context.MAX_TEXTURE_SIZE)),x.setUniformf("labelOutlineTextureWidth",N),x.setUniformf("numLabelmaps",e.labelOutlineProperties.length);const{tangent1:L,tangent2:B}=Bx(e.renderable.getSlicePlane());for(let P=0;P{var w,_;const x=m.getProperty(e.currentValidInputs[0].inputIndex).getIndependentComponents(),y=e.labelOutlineProperties.length>0,d=e.renderable.getSlabThickness(),g=e.renderable.getSlabType(),C=e.renderable.getSlabTrapezoidIntegration();let S=!1;(!e.currentRenderPass&&e.lastRenderPassShaderReplacement||e.currentRenderPass&&e.currentRenderPass.getShaderReplacement()!==e.lastRenderPassShaderReplacement)&&(S=!0);const T=((w=e.currentValidInputs)==null?void 0:w.length)??0;return S||e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||e.lastNumberOfComponents!==e.numberOfComponents||e.lastMultiTexturePerVolumeEnabled!==e.multiTexturePerVolumeEnabled||((_=h.getProgram())==null?void 0:_.getHandle())===0||e.lastIndependentComponents!==x||e.lastUseLabelOutline!==y||e.lastNumValidInputs!==T||e.lastSlabThickness!==d||e.lastSlabType!==g||e.lastSlabTrapezoidIntegration!==C?(e.lastHaveSeenDepthRequest=e.haveSeenDepthRequest,e.lastNumberOfComponents=e.numberOfComponents,e.lastMultiTexturePerVolumeEnabled=e.multiTexturePerVolumeEnabled,e.lastIndependentComponents=x,e.lastUseLabelOutline=y,e.lastNumValidInputs=T,e.lastSlabThickness=d,e.lastSlabType=g,e.lastSlabTrapezoidIntegration=C,!0):!1},t.getShaderTemplate=(h,v,m)=>{h.Vertex=zx,h.Fragment=Wx,h.Geometry=""},t.replaceShaderValues=(h,v,m)=>{if(t.replaceShaderTCoord(h,v,m),t.replaceShaderPositionVC(h,v,m),e.haveSeenDepthRequest){let x=h.Fragment;x=Z.substitute(x,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,x=Z.substitute(x,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,h.Fragment=x}t.replaceShaderCoincidentOffset(h,v,m)};function s(h,v){const m=["r","g","b","a"],x=Array.from({length:v},(C,S)=>S).filter(C=>!h.includes(C)),y=h.map(C=>`vec3 labelTexCoord${C} = (WCTCMatrix${C} * vec4(fragWorldPos, 1.0)).xyz;`).join(` + `),d=(()=>h.length===0?"":`float neighborLabel = ${h.map((C,S)=>S===0?`(labelInputIdx == ${S}) ? texture(volumeTexture[${C}], neighborTexCoord).r`:` : (labelInputIdx == ${S}) ? texture(volumeTexture[${C}], neighborTexCoord).r`).join("")} : 0.0;`)(),g=[...x,...h].map(C=>{const S=h.includes(C),T=h.indexOf(C);return S?` + // Process input ${C} as labelmap + { + float labelValue = tvalue.${m[C]}; + int segmentIndex = int(labelValue * 255.0); + + if (segmentIndex > 0) { + float textureCoordinate = float(segmentIndex - 1) / labelOutlineTextureWidth; + float labelmapRow = (float(${T}) + 0.5) / numLabelmaps; + float thicknessValue = texture2D(labelOutlineThicknessTexture, vec2(textureCoordinate, labelmapRow)).r; + float labelOutlineOpacityValue = texture2D(labelOutlineOpacityTexture, vec2(textureCoordinate, labelmapRow)).r; + int actualThickness = int(thicknessValue * 255.0); + + vec3 currentLabelTC = labelTexCoord${C}; + vec3 currentTexelSize = texelSize${C}; + vec3 currentTangent1 = outlineTangent1_${C}; + vec3 currentTangent2 = outlineTangent2_${C}; + + bool pixelOnBorder = false; + int labelInputIdx = ${T}; + for (int i = -actualThickness; i <= actualThickness; i++) { + for (int j = -actualThickness; j <= actualThickness; j++) { + if (i == 0 && j == 0) continue; + vec3 neighborTexCoord = currentLabelTC + float(i) * currentTangent1 * currentTexelSize + float(j) * currentTangent2 * currentTexelSize; + if (any(greaterThan(neighborTexCoord, vec3(1.0))) || any(lessThan(neighborTexCoord, vec3(0.0)))) { + pixelOnBorder = true; + break; + } + ${d} + if (neighborLabel != labelValue) { + pixelOnBorder = true; + break; + } + } + if (pixelOnBorder) break; + } + + if (pixelOnBorder) { + convergentColor.rgb = mix(convergentColor.rgb, tcolor${C}.rgb, labelOutlineOpacityValue); + convergentColor.a = max(convergentColor.a, labelOutlineOpacityValue); + } else if (compWeight${C} > 0.0) { + float fillAlpha = compWeight${C} * opacity; + convergentColor.rgb = mix(convergentColor.rgb, tcolor${C}.rgb, fillAlpha); + convergentColor.a = max(convergentColor.a, fillAlpha); + } + } + }`:` + // Process input ${C} as background image + { + float bgAlpha = compWeight${C} * opacity; + convergentColor.rgb = mix(convergentColor.rgb, tcolor${C}.rgb, bgAlpha); + convergentColor.a = max(convergentColor.a, bgAlpha); + }`}).join(` + `);return I1(` + // Multi-texture mode: ${h.length>0?`labelmaps at input${h.length>1?"s":""} ${h.join(", ")}`:"no labelmaps"}, ${x.length>0?`background at input${x.length>1?"s":""} ${x.join(", ")}`:"no background"} + vec4 convergentColor = vec4(0.0, 0.0, 0.0, 0.0); + + // Compute labelmap texture coordinates + ${y} + + // Process each input in order + ${g} + + gl_FragData[0] = convergentColor; + `)}function u(){return["vec4 compositeValue(vec4 currVal, vec4 valToComp, int trapezoid)","{"," vec4 retVal = vec4(1.0);"," if (slabType == 0) // min"," {"," retVal = min(currVal, valToComp);"," }"," else if (slabType == 1) // max"," {"," retVal = max(currVal, valToComp);"," }"," else if (slabType == 3) // sum"," {"," retVal = currVal + (trapezoid > 0 ? 0.5 * valToComp : valToComp); "," }"," else // mean"," {"," retVal = currVal + (trapezoid > 0 ? 0.5 * valToComp : valToComp); "," }"," return retVal;","}"]}function c(){return["// Get the first and last samples","int numSlices = 1;","float scaling = min(min(spacing.x, spacing.y), spacing.z) * 0.5;","vec3 slabNormal = normalize(normalWCVSOutput);","vec3 normalxspacing = scaling * slabNormal;","float distTraveled = length(normalxspacing);","int trapezoid = 0;","while (distTraveled < slabThickness * 0.5)","{"," distTraveled += length(normalxspacing);"," float fnumSlices = float(numSlices);"," if (distTraveled > slabThickness * 0.5)"," {"," // Before stepping outside the slab, sample at the boundaries"," normalxspacing = slabNormal * slabThickness * 0.5 / fnumSlices;"," trapezoid = slabTrapezoid;"," }"," vec3 worldPosNeg = vertexWCVSOutput.xyz - fnumSlices * normalxspacing * vboScaling;"," vec3 fragTCoordNeg = (WCTCMatrix0 * vec4(worldPosNeg, 1.0)).xyz;"," if (!any(greaterThan(fragTCoordNeg, vec3(1.0))) && !any(lessThan(fragTCoordNeg, vec3(0.0))))"," {"," vec4 newVal = rawSampleTexture(worldPosNeg);"," tvalue = compositeValue(tvalue, newVal, trapezoid);"," numSlices += 1;"," }"," vec3 worldPosPos = vertexWCVSOutput.xyz + fnumSlices * normalxspacing * vboScaling;"," vec3 fragTCoordPos = (WCTCMatrix0 * vec4(worldPosPos, 1.0)).xyz;"," if (!any(greaterThan(fragTCoordPos, vec3(1.0))) && !any(lessThan(fragTCoordPos, vec3(0.0))))"," {"," vec4 newVal = rawSampleTexture(worldPosPos);"," tvalue = compositeValue(tvalue, newVal, trapezoid);"," numSlices += 1;"," }","}","// Finally, if slab type is *mean*, divide the sum by the numSlices","if (slabType == 2)","{"," tvalue = tvalue / float(numSlices);","}"]}function p(h,v){const m=[];for(let x=0;x{let x=h.Vertex;const y=h.Geometry;let d=h.Fragment;const g=e.labelOutlineProperties.length>0,C=e.renderable.getSlabThickness();x=Z.substitute(x,"//VTK::TCoord::Dec",[]).result,x=Z.substitute(x,"//VTK::TCoord::Impl",[]).result;const S=e.numberOfComponents,T=m.getProperty(e.currentValidInputs[0].inputIndex).getIndependentComponents(),w=e.scalarTextures.length;let _=[`uniform highp sampler3D volumeTexture[${w}];`,"uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;","uniform vec4 backgroundColor;"];for(let D=0;D0&&(_=_.concat(["uniform vec3 spacing;","uniform float slabThickness;","uniform int slabType;","uniform int slabTrapezoid;","uniform vec3 vboScaling;"]),_=_.concat(u())),d=Z.substitute(d,"//VTK::TCoord::Dec",_).result;let E=["vec3 fragWorldPos = vertexWCVSOutput.xyz;","vec3 fragTexCoord = (WCTCMatrix0 * vec4(fragWorldPos, 1.0)).xyz;","if (any(greaterThan(fragTexCoord, vec3(1.0))) || any(lessThan(fragTexCoord, vec3(0.0))))","{"," // set the background color and exit"," gl_FragData[0] = backgroundColor;"," return;","}","vec4 tvalue = rawSampleTexture(fragWorldPos);"];if(C>0&&(E=E.concat(c())),T){const D=["r","g","b","a"];for(let R=0;R{var N;return(N=m.getProperty(e.currentValidInputs[R].inputIndex))==null?void 0:N.getUseLabelOutline()}):[],b=R=>{if(R===1)return["gl_FragData[0] = vec4(tcolor0.rgb, compWeight0 * opacity);"];const N=Array.from({length:R},(P,F)=>F),L=N.map(P=>`compWeight${P}`).join(" + "),B=N.map(P=>`(tcolor${P}.rgb * (compWeight${P} / weightSum))`).join(" + ");return[`float weightSum = ${L};`,`gl_FragData[0] = vec4(vec3(${B}), opacity);`]};O.length>0?E=E.concat(s(O,S)):E=E.concat(b(S))}else switch(S){case 1:g?E=E.concat([...I1(` + // Label outline mode for single component + float centerValue = tvalue.r; + int segmentIndex = int(centerValue * 255.0); + + // Skip background (segment 0) + if (segmentIndex == 0) { + gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); + return; + } + + // Get outline parameters for this segment (row 0 for single labelmap) + float textureCoordinate = float(segmentIndex - 1) / labelOutlineTextureWidth; + float labelmapRow = 0.5 / numLabelmaps; + float thicknessValue = texture2D(labelOutlineThicknessTexture, vec2(textureCoordinate, labelmapRow)).r; + float outlineOpacity = texture2D(labelOutlineOpacityTexture, vec2(textureCoordinate, labelmapRow)).r; + int actualThickness = int(thicknessValue * 255.0); + + // Get color for this segment + vec3 tColor = texture2D(colorTexture1, vec2(centerValue * cscale0 + cshift0, 0.5)).rgb; + float scalarOpacity = texture2D(pwfTexture1, vec2(centerValue * pwfscale0 + pwfshift0, 0.5)).r; + float opacityToUse = scalarOpacity * opacity; + + // Check neighbors for border detection + bool pixelOnBorder = false; + for (int i = -actualThickness; i <= actualThickness; i++) { + for (int j = -actualThickness; j <= actualThickness; j++) { + if (i == 0 && j == 0) { + continue; + } + // Sample neighbor using tangent vectors in texture space + vec3 neighborTexCoord = fragTexCoord + float(i) * outlineTangent1_0 * texelSize0 + float(j) * outlineTangent2_0 * texelSize0; - for (int i = -actualThickness; i <= actualThickness; i++) { - for (int j = -actualThickness; j <= actualThickness; j++) { - if (i == 0 || j == 0) { - continue; - } - vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i), - gl_FragCoord.y + float(j), - gl_FragCoord.z, gl_FragCoord.w); - vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord); - float value = texture2D(texture1, getSliceCoords(neighborPosIS, sliceAxis)).r; - if (value != centerValue) { - pixelOnBorder = true; - break; - } + // Skip if outside texture bounds + if (any(greaterThan(neighborTexCoord, vec3(1.0))) || any(lessThan(neighborTexCoord, vec3(0.0)))) { + pixelOnBorder = true; + break; } - if (pixelOnBorder == true) { + + float neighborValue = texture(volumeTexture[0], neighborTexCoord).r; + if (neighborValue != centerValue) { + pixelOnBorder = true; break; } } - if (pixelOnBorder == true) { - gl_FragData[0] = vec4(tColor, outlineOpacity); - } - else { - gl_FragData[0] = vec4(tColor, opacityToUse); + if (pixelOnBorder) { + break; } - #else - float intensity = texture2D(texture1, tcoordVCVSOutput).r; - vec3 tcolor = texture2D(colorTexture1, vec2(intensity * cscale0 + cshift0, 0.5)).rgb; - float scalarOpacity = texture2D(pwfTexture1, vec2(intensity * pwfscale0 + pwfshift0, 0.5)).r; - gl_FragData[0] = vec4(tcolor, scalarOpacity * opacity); - #endif - `)]).result;break;case 2:s=Q.substitute(s,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","float intensity = tcolor.r*cscale0 + cshift0;","gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(intensity, 0.5)).rgb, pwfscale0*tcolor.g + pwfshift0);"]).result;break;case 3:s=Q.substitute(s,"//VTK::TCoord::Impl",["vec4 tcolor = cscale0*texture2D(texture1, tcoordVCVSOutput.st) + cshift0;","gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, opacity);"]).result;break;default:s=Q.substitute(s,"//VTK::TCoord::Impl",["vec4 tcolor = cscale0*texture2D(texture1, tcoordVCVSOutput.st) + cshift0;","gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, tcolor.a);"]).result}e.haveSeenDepthRequest&&(s=Q.substitute(s,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,s=Q.substitute(s,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),n.Vertex=o,n.Fragment=s,t.replaceShaderClip(n,r,i),t.replaceShaderCoincidentOffset(n,r,i)},t.replaceShaderClip=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){let c=e.renderable.getNumberOfClippingPlanes();c>6&&(ze("OpenGL has a limit of 6 clipping planes"),c=6),o=Q.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,o=Q.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=Q.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,s=Q.substitute(s,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s},t.getNeedToRebuildShaders=(n,r,i)=>{var l;const o=e.openGLTexture.getComponents(),s=i.getProperty().getIndependentComponents();let c=!1;return(!e.currentRenderPass&&e.lastRenderPassShaderReplacement||e.currentRenderPass&&e.currentRenderPass.getShaderReplacement()!==e.lastRenderPassShaderReplacement)&&(c=!0),c||e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||((l=n.getProgram())==null?void 0:l.getHandle())===0||n.getShaderSourceTime().getMTime(){if(e.lastBoundBO=n,t.getNeedToRebuildShaders(n,r,i)){const o={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(o,r,i);const s=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);s!==n.getProgram()&&(n.setProgram(s),n.getVAO().releaseGraphicsResources()),n.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(n.getProgram());n.getVAO().bind(),t.setMapperShaderParameters(n,r,i),t.setCameraShaderParameters(n,r,i),t.setPropertyShaderParameters(n,r,i)},t.setMapperShaderParameters=(n,r,i)=>{n.getCABO().getElementCount()&&(e.VBOBuildTime>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||ra("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),e.context.FLOAT,n.getCABO().getTCoordComponents(),e.context.FALSE)||ra("Error setting tcoordMC in shader VAO.")),n.getAttributeUpdateTime().modified());const o=e.openGLTexture.getTextureUnit();n.getProgram().setUniformi("texture1",o);const s=e.openGLTexture.getComponents(),c=i.getProperty().getIndependentComponents();if(c)for(let f=0;f6&&(ze("OpenGL has a limit of 6 clipping planes"),f=6);const d=n.getCABO().getCoordShiftAndScaleEnabled()?n.getCABO().getInverseShiftAndScaleMatrix():null,v=d?gt(e.imagematinv,i.getMatrix()):i.getMatrix();d&&(We(v,v),Ee(v,v,d),We(v,v)),We(e.imagemat,e.currentInput.getIndexToWorld()),Ee(e.imagematinv,v,e.imagemat);const m=[];for(let x=0;x{const o=n.getProgram(),s=e.openGLImageSlice.getKeyMatrices(),c=e.currentInput,l=c.getIndexToWorld();Ee(e.imagemat,s.mcwc,l);const p=e.openGLCamera.getKeyMatrices(r);if(Ee(e.imagemat,p.wcpc,e.imagemat),n.getCABO().getCoordShiftAndScaleEnabled()){const f=n.getCABO().getInverseShiftAndScaleMatrix();Ee(e.imagemat,e.imagemat,f)}if(o.setUniformMatrix("MCPCMatrix",e.imagemat),i.getProperty().getUseLabelOutline()===!0){const f=c.getWorldToIndex(),h=c.getDimensions();let d=e.renderable.getClosestIJKAxis().ijkMode;d===Bt.NONE&&(d=Bt.K),o.setUniform3i("imageDimensions",h[0],h[1],h[2]),o.setUniformi("sliceAxis",d),o.setUniformMatrix("vWCtoIDX",f);const v=e.openGLCamera.getKeyMatrices(r);Et(e.projectionToWorld,v.wcpc),e.openGLCamera.getKeyMatrices(r),o.setUniformMatrix("PCWCMatrix",e.projectionToWorld);const m=t.getRenderTargetSize();o.setUniformf("vpWidth",m[0]),o.setUniformf("vpHeight",m[1]);const x=t.getRenderTargetOffset();o.setUniformf("vpOffsetX",x[0]/m[0]),o.setUniformf("vpOffsetY",x[1]/m[1])}},t.setPropertyShaderParameters=(n,r,i)=>{const o=n.getProgram(),c=i.getProperty().getOpacity();o.setUniformf("opacity",c)},t.renderPieceStart=(n,r)=>{t.updateBufferObjects(n,r),e.lastBoundBO=null},t.renderPieceDraw=(n,r)=>{const i=e.context;e.openGLTexture.activate(),e.colorTexture.activate(),r.getProperty().getUseLabelOutline()&&(e.labelOutlineThicknessTexture.activate(),e.labelOutlineOpacityTexture.activate()),e.pwfTexture.activate(),e.tris.getCABO().getElementCount()&&(t.updateShaders(e.tris,n,r),i.drawArrays(i.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release()),e.openGLTexture.deactivate(),e.colorTexture.deactivate(),r.getProperty().getUseLabelOutline()&&(e.labelOutlineThicknessTexture.deactivate(),e.labelOutlineOpacityTexture.deactivate()),e.pwfTexture.deactivate()},t.renderPieceFinish=(n,r)=>{},t.renderPiece=(n,r)=>{if(t.invokeEvent({type:"StartEvent"}),e.renderable.update(),e.currentInput=e.renderable.getCurrentImage(),t.invokeEvent({type:"EndEvent"}),!e.currentInput){ra("No input!");return}t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r)},t.updateBufferObjects=(n,r)=>{t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r)},t.getNeedToRebuildBufferObjects=(n,r)=>{var i,o,s,c,l;return e.VBOBuildTime.getMTime(){var R,B,I,P;const i=e.currentInput;if(!i)return;const o=i.getPointData()&&i.getPointData().getScalars();if(!o)return;const s=o.getDataType(),c=o.getNumberOfComponents(),l=r.getProperty(),p=l.getInterpolationType(),u=l.getIndependentComponents(),f=u?c:1,h=u?2*f:1,d=[];for(let L=0;L1?1:0;const H=[Bt.X,Bt.Y,Bt.Z].includes(e.renderable.getSlicingMode())?E:D,K=i.getSpatialExtent(),Y=o.getData();let q=null;if(_===Bt.I){q=new Y.constructor(L[2]*L[1]*c);let b=0;for(let G=0;G{var c,l;let r=n.getProperty().getLabelOutlineOpacity();typeof r=="number"&&(((c=e._cachedLabelOutlineOpacityObj)==null?void 0:c[0])===r?r=e._cachedLabelOutlineOpacityObj:r=[r],e._cachedLabelOutlineOpacityObj=r);const i=e._openGLRenderWindow.getGraphicsResourceForObject(r),o=`${r.join("-")}`;if(!((l=i==null?void 0:i.oglObject)!=null&&l.getHandle())||(i==null?void 0:i.hash)!==o){let p=e.renderable.getLabelOutlineTextureWidth();p<=0&&(p=e.context.getParameter(e.context.MAX_TEXTURE_SIZE));const u=1,f=p*u,h=new Float32Array(f);for(let d=0;d{var c;const r=n.getProperty().getLabelOutlineThicknessByReference(),i=e._openGLRenderWindow.getGraphicsResourceForObject(r),o=`${r.join("-")}`;if(!((c=i==null?void 0:i.oglObject)!=null&&c.getHandle())||(i==null?void 0:i.hash)!==o){let l=e.renderable.getLabelOutlineTextureWidth();l<=0&&(l=e.context.getParameter(e.context.MAX_TEXTURE_SIZE));const p=1,u=l*p,f=new Uint8Array(u);for(let h=0;h{if(e._useSmallViewport)return[e._smallViewportWidth,e._smallViewportHeight];const{usize:n,vsize:r}=e._openGLRenderer.getTiledSizeAndOrigin();return[n,r]},t.getRenderTargetOffset=()=>{const{lowerLeftU:n,lowerLeftV:r}=e._openGLRenderer.getTiledSizeAndOrigin();return[n,r]},t.delete=Gn(()=>{e._openGLRenderWindow&&a(e._openGLRenderWindow)},t.delete)}const v8={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,imagematinv:null,colorTexture:null,pwfTexture:null,labelOutlineThicknessTexture:null,labelOutlineOpacityTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};function y8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,v8,a),Ct.extend(t,e,a),mn.implementReplaceShaderCoincidentOffset(t,e,a),mn.implementBuildShadersWithReplacements(t,e,a),e.tris=jt.newInstance(),e.imagemat=Te(new Float64Array(16)),e.imagematinv=Te(new Float64Array(16)),e.projectionToWorld=Te(new Float64Array(16)),e.idxToView=Te(new Float64Array(16)),e.idxNormalMatrix=It(new Float64Array(9)),e.modelToView=Te(new Float64Array(16)),e.projectionToView=Te(new Float64Array(16)),pt(t,e,[]),e.VBOBuildTime={},ut(e.VBOBuildTime),d8(t,e)}const m8=Je(y8,"vtkOpenGLImageMapper");st("vtkAbstractImageMapper",m8);const br={MAX:0,MIN:1,AVERAGE:2},{vtkErrorMacro:Mo}=V;function x8(t,e){e.classHierarchy.push("vtkOpenGLImageCPRMapper");function a(n){[e._scalars,e._colorTransferFunc,e._pwFunc].forEach(r=>n.unregisterGraphicsResourceUser(r,t))}t.buildPass=n=>{if(n){e.currentRenderPass=null,e.openGLImageSlice=t.getFirstAncestorOfType("vtkOpenGLImageSlice"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const r=e._openGLRenderWindow;e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),r&&!r.isDeleted()&&r!==e._openGLRenderWindow&&a(r),e.context=e._openGLRenderWindow.getContext(),e.openGLCamera=e._openGLRenderer.getViewNodeFor(e._openGLRenderer.getRenderable().getActiveCamera(),e.openGLCamera),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow)}},t.opaquePass=(n,r)=>{n&&(e.currentRenderPass=r,t.render())},t.opaqueZBufferPass=n=>{n&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.getCoincidentParameters=(n,r)=>e.renderable.getResolveCoincidentTopology()===Zt.PolygonOffset?e.renderable.getCoincidentTopologyPolygonOffsetParameters():null,t.render=()=>{const n=e.openGLImageSlice.getRenderable(),r=e._openGLRenderer.getRenderable();t.renderPiece(r,n)},t.renderPiece=(n,r)=>{t.invokeEvent({type:"StartEvent"}),e.renderable.update(),t.invokeEvent({type:"EndEvent"}),e.renderable.preRenderCheck()&&(e.currentImageDataInput=e.renderable.getInputData(0),e.currentCenterlineInput=e.renderable.getOrientedCenterline(),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r))},t.renderPieceStart=(n,r)=>{t.updateBufferObjects(n,r)},t.renderPieceDraw=(n,r)=>{const i=e.context;e.volumeTexture.activate(),e.colorTexture.activate(),e.pwfTexture.activate(),e.tris.getCABO().getElementCount()&&(t.updateShaders(e.tris,n,r),i.drawArrays(i.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release()),e.volumeTexture.deactivate(),e.colorTexture.deactivate(),e.pwfTexture.deactivate()},t.renderPieceFinish=(n,r)=>{},t.updateBufferObjects=(n,r)=>{t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r),r.getProperty().getInterpolationType()===Dr.NEAREST?(e.volumeTexture.setMinificationFilter(me.NEAREST),e.volumeTexture.setMagnificationFilter(me.NEAREST),e.colorTexture.setMinificationFilter(me.NEAREST),e.colorTexture.setMagnificationFilter(me.NEAREST),e.pwfTexture.setMinificationFilter(me.NEAREST),e.pwfTexture.setMagnificationFilter(me.NEAREST)):(e.volumeTexture.setMinificationFilter(me.LINEAR),e.volumeTexture.setMagnificationFilter(me.LINEAR),e.colorTexture.setMinificationFilter(me.LINEAR),e.colorTexture.setMagnificationFilter(me.LINEAR),e.pwfTexture.setMinificationFilter(me.LINEAR),e.pwfTexture.setMagnificationFilter(me.LINEAR))},t.getNeedToRebuildBufferObjects=(n,r)=>{var o;const i=e.VBOBuildTime.getMTime();return i{var N,R,B,I;const i=e.currentImageDataInput,o=e.currentCenterlineInput,s=r.getProperty(),c=(N=i==null?void 0:i.getPointData())==null?void 0:N.getScalars();if(!c)return;const l=e._openGLRenderWindow.getGraphicsResourceForObject(c),p=X0(i,c),u=!((R=l==null?void 0:l.oglObject)!=null&&R.getHandle())||(l==null?void 0:l.hash)!==p,f=s.getUpdatedExtents(),h=!!f.length;if(u){e.volumeTexture=Re.newInstance(),e.volumeTexture.setOpenGLRenderWindow(e._openGLRenderWindow);const P=i.getDimensions();e.volumeTexture.setOglNorm16Ext(e.context.getExtension("EXT_texture_norm16")),e.volumeTexture.resetFormatAndType(),e.volumeTexture.create3DFilterableFromDataArray({width:P[0],height:P[1],depth:P[2],dataArray:c,preferSizeOverAccuracy:e.renderable.getPreferSizeOverAccuracy()}),e._openGLRenderWindow.setGraphicsResourceForObject(c,e.volumeTexture,p),c!==e._scalars&&(e._openGLRenderWindow.registerGraphicsResourceUser(c,t),e._openGLRenderWindow.unregisterGraphicsResourceUser(e._scalars,t)),e._scalars=c}else e.volumeTexture=l.oglObject;if(h){s.setUpdatedExtents([]);const P=i.getDimensions();e.volumeTexture.create3DFilterableFromDataArray({width:P[0],height:P[1],depth:P[2],dataArray:c,updatedExtents:f})}const d=c.getNumberOfComponents(),v=r.getProperty(),m=v.getIndependentComponents(),x=m?d:1,y=m?2*x:1,g=[];for(let P=0;P{const o=e.volumeTexture.getComponents(),s=i.getProperty().getIndependentComponents(),c=!!e.renderable.getCenterPoint(),l=e.renderable.getUseUniformOrientation(),p=e.renderable.isProjectionEnabled()&&e.renderable.getProjectionMode();return n.getProgram()===0||e.lastUseCenterPoint!==c||e.lastUseUniformOrientation!==l||e.lastProjectionMode!==p||e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||e.lastTextureComponents!==o||e.lastIndependentComponents!==s?(e.lastUseCenterPoint=c,e.lastUseUniformOrientation=l,e.lastProjectionMode=p,e.lastHaveSeenDepthRequest=e.haveSeenDepthRequest,e.lastTextureComponents=o,e.lastIndependentComponents=s,!0):!1},t.buildShaders=(n,r,i)=>{t.getShaderTemplate(n,r,i),t.replaceShaderValues(n,r,i)},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;const c=["vec3 applyQuaternionToVec(vec4 q, vec3 v) {"," float uvx = q.y * v.z - q.z * v.y;"," float uvy = q.z * v.x - q.x * v.z;"," float uvz = q.x * v.y - q.y * v.x;"," float uuvx = q.y * uvz - q.z * uvy;"," float uuvy = q.z * uvx - q.x * uvz;"," float uuvz = q.x * uvy - q.y * uvx;"," float w2 = q.w * 2.0;"," uvx *= w2;"," uvy *= w2;"," uvz *= w2;"," uuvx *= 2.0;"," uuvy *= 2.0;"," uuvz *= 2.0;"," return vec3(v.x + uvx + uuvx, v.y + uvy + uuvy, v.z + uvz + uuvz);","}"];o=Q.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Q.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result;const l=["attribute vec3 centerlinePosition;","attribute float quadIndex;","uniform float width;","out vec2 quadOffsetVSOutput;","out vec3 centerlinePosVSOutput;"],p=e.renderable.isProjectionEnabled(),u=e.renderable.getUseUniformOrientation();u?(l.push("out vec3 samplingDirVSOutput;","uniform vec4 centerlineOrientation;","uniform vec3 tangentDirection;",...c),p&&l.push("out vec3 projectionDirVSOutput;","uniform vec3 bitangentDirection;")):l.push("out vec4 centerlineTopOrientationVSOutput;","out vec4 centerlineBotOrientationVSOutput;","attribute vec4 centerlineTopOrientation;","attribute vec4 centerlineBotOrientation;"),o=Q.substitute(o,"//VTK::Color::Dec",l).result;const f=["quadOffsetVSOutput = vec2(width * (mod(quadIndex, 2.0) == 0.0 ? -0.5 : 0.5), quadIndex > 1.0 ? 0.0 : 1.0);","centerlinePosVSOutput = centerlinePosition;"];u?(f.push("samplingDirVSOutput = applyQuaternionToVec(centerlineOrientation, tangentDirection);"),p&&f.push("projectionDirVSOutput = applyQuaternionToVec(centerlineOrientation, bitangentDirection);")):f.push("centerlineTopOrientationVSOutput = centerlineTopOrientation;","centerlineBotOrientationVSOutput = centerlineBotOrientation;"),o=Q.substitute(o,"//VTK::Color::Impl",f).result;const h=e.volumeTexture.getComponents(),d=i.getProperty().getIndependentComponents();let v=["uniform mat4 MCTCMatrix; // Model coordinates to texture coordinates","in vec2 quadOffsetVSOutput;","in vec3 centerlinePosVSOutput;","uniform highp sampler3D volumeTexture;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;","uniform vec4 backgroundColor;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;"];p&&v.push("uniform vec3 volumeSizeMC;","uniform int projectionSlabNumberOfSamples;","uniform float projectionConstantOffset;","uniform float projectionStepLength;"),u?(v.push("in vec3 samplingDirVSOutput;"),p&&v.push("in vec3 projectionDirVSOutput;")):(v.push("uniform vec3 tangentDirection;","in vec4 centerlineTopOrientationVSOutput;","in vec4 centerlineBotOrientationVSOutput;",...c),p&&v.push("uniform vec3 bitangentDirection;"));const m=e.renderable.getCenterPoint();if(m&&v.push("uniform vec3 globalCenterPoint;"),d){for(let y=1;y 0.999 || qCosAngle < -0.999) {"," // Use LERP instead of SLERP when the two quaternions are close or opposite"," interpolatedOrientation = normalize(mix(q0, q1, quadOffsetVSOutput.y));","} else {"," float omega = acos(qCosAngle);"," interpolatedOrientation = normalize(sin((1.0 - quadOffsetVSOutput.y) * omega) * q0 + sin(quadOffsetVSOutput.y * omega) * q1);","}","vec3 samplingDirection = applyQuaternionToVec(interpolatedOrientation, tangentDirection);"),p&&x.push("vec3 projectionDirection = applyQuaternionToVec(interpolatedOrientation, bitangentDirection);")),m?x.push("float baseOffset = dot(samplingDirection, globalCenterPoint - centerlinePosVSOutput);","float horizontalOffset = quadOffsetVSOutput.x + baseOffset;"):x.push("float horizontalOffset = quadOffsetVSOutput.x;"),x.push("vec3 volumePosMC = centerlinePosVSOutput + horizontalOffset * samplingDirection;","vec3 volumePosTC = (MCTCMatrix * vec4(volumePosMC, 1.0)).xyz;","if (any(lessThan(volumePosTC, vec3(0.0))) || any(greaterThan(volumePosTC, vec3(1.0))))","{"," // set the background color and exit"," gl_FragData[0] = backgroundColor;"," return;","}"),p){const y=e.renderable.getProjectionMode();switch(y){case br.MIN:x.push("const vec4 initialProjectionTextureValue = vec4(1.0);");break;case br.MAX:case br.AVERAGE:default:x.push("const vec4 initialProjectionTextureValue = vec4(0.0);");break}switch(x.push("vec3 projectionScaledDirection = projectionDirection / volumeSizeMC;","vec3 projectionStep = projectionStepLength * projectionScaledDirection;","vec3 projectionStartPosition = volumePosTC + projectionConstantOffset * projectionScaledDirection;","vec4 tvalue = initialProjectionTextureValue;","for (int projectionSampleIdx = 0; projectionSampleIdx < projectionSlabNumberOfSamples; ++projectionSampleIdx) {"," vec3 projectionSamplePosition = projectionStartPosition + float(projectionSampleIdx) * projectionStep;"," vec4 sampledTextureValue = texture(volumeTexture, projectionSamplePosition);"),y){case br.MAX:x.push(" tvalue = max(tvalue, sampledTextureValue);");break;case br.MIN:x.push(" tvalue = min(tvalue, sampledTextureValue);");break;case br.AVERAGE:default:x.push(" tvalue = tvalue + sampledTextureValue;");break}x.push("}"),y===br.AVERAGE&&x.push("tvalue = tvalue / float(projectionSlabNumberOfSamples);")}else x.push("vec4 tvalue = texture(volumeTexture, volumePosTC);");if(d){const y=["r","g","b","a"];for(let g=0;g{let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){let c=e.renderable.getNumberOfClippingPlanes();c>6&&(V.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),c=6),o=Q.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,o=Q.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=Q.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,s=Q.substitute(s,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s},t.getShaderTemplate=(n,r,i)=>{n.Vertex=W0,n.Fragment=$a,n.Geometry=""},t.setMapperShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=n.getCABO();s.getElementCount()&&(e.VBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(o,s,"vertexMC",s.getVertexOffset(),s.getStride(),e.context.FLOAT,3,e.context.FALSE)||Mo("Error setting vertexMC in shader VAO.")),n.getCABO().getCustomData().forEach(h=>{h&&o.isAttributeUsed(h.name)&&!n.getVAO().addAttributeArray(o,s,h.name,h.offset,s.getStride(),e.context.FLOAT,h.components,e.context.FALSE)&&Mo(`Error setting ${h.name} in shader VAO.`)}),n.getAttributeUpdateTime().modified());const c=e.volumeTexture.getTextureUnit();if(o.setUniformi("volumeTexture",c),o.setUniformf("width",e.renderable.getWidth()),n.getProgram().setUniform4fv("backgroundColor",e.renderable.getBackgroundColor()),o.isUniformUsed("tangentDirection")){const h=e.renderable.getTangentDirection();n.getProgram().setUniform3fArray("tangentDirection",h)}if(o.isUniformUsed("bitangentDirection")){const h=e.renderable.getBitangentDirection();n.getProgram().setUniform3fArray("bitangentDirection",h)}if(o.isUniformUsed("centerlineOrientation")){const h=e.renderable.getUniformOrientation();n.getProgram().setUniform4fv("centerlineOrientation",h)}if(o.isUniformUsed("globalCenterPoint")){const h=e.renderable.getCenterPoint();o.setUniform3fArray("globalCenterPoint",h)}if(e.renderable.isProjectionEnabled()){const h=e.currentImageDataInput,d=h.getSpacing(),v=h.getDimensions(),m=e.renderable.getProjectionSlabThickness(),x=e.renderable.getProjectionSlabNumberOfSamples(),y=N2([],d,v);o.setUniform3fArray("volumeSizeMC",y),o.setUniformi("projectionSlabNumberOfSamples",x);const g=-.5*m;o.setUniformf("projectionConstantOffset",g);const C=m/(x-1);o.setUniformf("projectionStepLength",C)}const l=e.currentImageDataInput,p=l.getWorldToIndex(),u=yi(new Float32Array(16),wi([],l.getDimensions())),f=iu(u,u,p);if(o.setUniformMatrix("MCTCMatrix",f),e.haveSeenDepthRequest&&n.getProgram().setUniformi("depthRequest",e.renderDepth?1:0),e.renderable.getNumberOfClippingPlanes()){let h=e.renderable.getNumberOfClippingPlanes();h>6&&(V.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),h=6);const v=s.getCoordShiftAndScaleEnabled()?s.getInverseShiftAndScaleMatrix():null,m=v?gt(e.imagematinv,i.getMatrix()):i.getMatrix();v&&(We(m,m),Ee(m,m,v),We(m,m)),We(e.imagemat,e.currentImageDataInput.getIndexToWorld()),Ee(e.imagematinv,m,e.imagemat);const x=[];for(let y=0;y{const o=e.openGLImageSlice.getKeyMatrices().mcwc,s=e.openGLCamera.getKeyMatrices(r).wcpc;if(Ee(e.imagemat,s,o),n.getCABO().getCoordShiftAndScaleEnabled()){const c=n.getCABO().getInverseShiftAndScaleMatrix();Ee(e.imagemat,e.imagemat,c)}n.getProgram().setUniformMatrix("MCPCMatrix",e.imagemat)},t.setPropertyShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=i.getProperty(),c=s.getOpacity();o.setUniformf("opacity",c);const l=e.volumeTexture.getComponents(),p=s.getIndependentComponents();if(p)for(let d=0;d{if(t.getNeedToRebuildShaders(n,r,i)){const o={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(o,r,i);const s=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);s!==n.getProgram()&&(n.setProgram(s),n.getVAO().releaseGraphicsResources()),n.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(n.getProgram());n.getVAO().bind(),t.setMapperShaderParameters(n,r,i),t.setCameraShaderParameters(n,r,i),t.setPropertyShaderParameters(n,r,i)},t.delete=V.chain(()=>{e._openGLRenderWindow&&a(e._openGLRenderWindow)},t.delete)}const C8={currentRenderPass:null,volumeTexture:null,colorTexture:null,pwfTexture:null,tris:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0,lastIndependentComponents:0,imagemat:null,imagematinv:null};function S8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,C8,a),Ct.extend(t,e,a),mn.implementReplaceShaderCoincidentOffset(t,e,a),V.algo(t,e,2,0),e.tris=jt.newInstance(),e.volumeTexture=null,e.colorTexture=null,e.pwfTexture=null,e.imagemat=Te(new Float64Array(16)),e.imagematinv=Te(new Float64Array(16)),e.VBOBuildTime={},V.obj(e.VBOBuildTime,{mtime:0}),x8(t,e)}const T8=V.newInstance(S8,"vtkOpenGLImageCPRMapper");st("vtkImageCPRMapper",T8);function w8(t,e){e.classHierarchy.push("vtkOpenGLImageSlice"),t.buildPass=a=>{if(!(!e.renderable||!e.renderable.getVisibility())&&a){if(!e.renderable)return;e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes()}},t.traverseZBufferPass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children.forEach(n=>{n.traverse(a)}),t.apply(a,!1))},t.traverseOpaqueZBufferPass=a=>t.traverseOpaquePass(a),t.traverseOpaquePass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||!e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children.forEach(n=>{n.traverse(a)}),t.apply(a,!1))},t.traverseTranslucentPass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e.renderable.getIsOpaque()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children.forEach(n=>{n.traverse(a)}),t.apply(a,!1))},t.queryPass=(a,n)=>{if(a){if(!e.renderable||!e.renderable.getVisibility())return;e.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},t.zBufferPass=(a,n)=>t.opaquePass(a,n),t.opaqueZBufferPass=(a,n)=>t.opaquePass(a,n),t.opaquePass=(a,n)=>{a&&e.context.depthMask(!0)},t.translucentPass=(a,n)=>{e.context.depthMask(!a)},t.getKeyMatrices=()=>(e.renderable.getMTime()>e.keyMatrixTime.getMTime()&&(gt(e.keyMatrices.mcwc,e.renderable.getMatrix()),We(e.keyMatrices.mcwc,e.keyMatrices.mcwc),e.keyMatrixTime.modified()),e.keyMatrices)}const _8={context:null,keyMatrixTime:null,keyMatrices:null};function E8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,_8,a),Ct.extend(t,e,a),e.keyMatrixTime={},ut(e.keyMatrixTime,{mtime:0}),e.keyMatrices={mcwc:Te(new Float64Array(16))},pt(t,e,["context"]),w8(t,e)}const D8=Je(E8,"vtkOpenGLImageSlice");st("vtkImageSlice",D8);function O8(t,e){e.classHierarchy.push("vtkOpenGLVolume"),t.buildPass=a=>{!e.renderable||!e.renderable.getVisibility()||a&&(e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes())},t.queryPass=(a,n)=>{if(a){if(!e.renderable||!e.renderable.getVisibility())return;n.incrementVolumeCount()}},t.traverseVolumePass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children[0].traverse(a),t.apply(a,!1))},t.volumePass=a=>{!e.renderable||!e.renderable.getVisibility()||e.context.depthMask(!a)},t.getKeyMatrices=()=>(e.renderable.getMTime()>e.keyMatrixTime.getMTime()&&(e.renderable.computeMatrix(),gt(e.MCWCMatrix,e.renderable.getMatrix()),We(e.MCWCMatrix,e.MCWCMatrix),e.renderable.getIsIdentity()?It(e.normalMatrix):(Vn(e.normalMatrix,e.MCWCMatrix),Tn(e.normalMatrix,e.normalMatrix),Br(e.normalMatrix,e.normalMatrix)),e.keyMatrixTime.modified()),{mcwc:e.MCWCMatrix,normalMatrix:e.normalMatrix})}const b8={};function M8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,b8,a),Ct.extend(t,e,a),e.keyMatrixTime={},ut(e.keyMatrixTime,{mtime:0}),e.normalMatrix=new Float64Array(9),e.MCWCMatrix=new Float64Array(16),pt(t,e,["context"]),O8(t,e)}const N8=Je(M8,"vtkOpenGLVolume");st("vtkVolume",N8);const Ah={NEAREST:0,LINEAR:1,FAST_LINEAR:2},Bh={FRACTIONAL:0,PROPORTIONAL:1},No={DEFAULT:0,ADDITIVE:1,COLORIZE:2,CUSTOM:3};var Uh={InterpolationType:Ah,OpacityMode:Bh,ColorMixPreset:No,FilterMode:{OFF:0,NORMALIZED:1,RAW:2}};const Ro={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3,ADDITIVE_INTENSITY_BLEND:4,RADON_TRANSFORM_BLEND:5,LABELMAP_EDGE_PROJECTION_BLEND:6};var R8={BlendMode:Ro},L8=`//VTK::System::Dec + } + + if (pixelOnBorder) { + gl_FragData[0] = vec4(tColor, outlineOpacity); + } else { + gl_FragData[0] = vec4(tColor, opacityToUse); + } + `)]):E=E.concat(["// Dependent components","float intensity = tvalue.r;","vec3 tcolor = texture2D(colorTexture1, vec2(intensity * cscale0 + cshift0, 0.5)).rgb;","float scalarOpacity = texture2D(pwfTexture1, vec2(intensity * pwfscale0 + pwfshift0, 0.5)).r;","gl_FragData[0] = vec4(tcolor, scalarOpacity * opacity);"]);break;case 2:E=E.concat(["float intensity = tvalue.r*cscale0 + cshift0;","gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(intensity, 0.5)).rgb, pwfscale0*tvalue.g + pwfshift0);"]);break;case 3:E=E.concat(["vec4 tcolor = cscale0*tvalue + cshift0;","gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, opacity);"]);break;default:E=E.concat(["vec4 tcolor = cscale0*tvalue + cshift0;","gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,"," texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, tcolor.a);"])}d=Z.substitute(d,"//VTK::TCoord::Impl",E).result,h.Vertex=x,h.Fragment=d,h.Geometry=y},t.replaceShaderPositionVC=(h,v,m)=>{let x=h.Vertex;const y=h.Geometry;let d=h.Fragment;const g=e.renderable.getSlabThickness();let C=["attribute vec4 vertexWC;","varying vec4 vertexWCVSOutput;"];C=C.concat([`//${t.getMTime()}${e.resliceGeomUpdateString}`]),g>0&&(C=C.concat(["attribute vec3 normalWC;","varying vec3 normalWCVSOutput;"])),x=Z.substitute(x,"//VTK::PositionVC::Dec",C).result;let S=["gl_Position = MCPCMatrix * vertexWC;","vertexWCVSOutput = vertexWC;"];g>0&&(S=S.concat(["normalWCVSOutput = normalWC;"])),x=Z.substitute(x,"//VTK::PositionVC::Impl",S).result,x=Z.substitute(x,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result;let T=["varying vec4 vertexWCVSOutput;"];g>0&&(T=T.concat(["varying vec3 normalWCVSOutput;"])),d=Z.substitute(d,"//VTK::PositionVC::Dec",T).result,h.Vertex=x,h.Geometry=y,h.Fragment=d},t.updateResliceGeometry=()=>{var g;const h=e.currentValidInputs[0].imageData,{resGeomString:v,slicePD:m,slicePlane:x,orthoSlicing:y,orthoAxis:d}=Gx(e.renderable,h);if(!e.resliceGeom||e.resliceGeomUpdateString!==v){if(m)e.resliceGeom||(e.resliceGeom=Je.newInstance()),e.resliceGeom.getPoints().setData(m.getPoints().getData(),3),e.resliceGeom.getPolys().setData(m.getPolys().getData(),1),e.resliceGeom.getPointData().setNormals(m.getPointData().getNormals());else if(x)if(e.resliceGeom||(e.resliceGeom=Je.newInstance()),y){const{points:C,polys:S,normalsData:T}=Px(h,x,d,e.transform);e.resliceGeom.getPoints().setData(C,3),e.resliceGeom.getPolys().setData(S,1);const w=pe.newInstance({numberOfComponents:3,values:T,name:"Normals"});e.resliceGeom.getPointData().setNormals(w)}else{const{points:C,polys:S,normalsData:T}=Ix(h,x,e.outlineFilter,e.cutter,e.lineToSurfaceFilter);e.resliceGeom.getPoints().setData(C,3),e.resliceGeom.getPolys().setData(S,1);const w=pe.newInstance({numberOfComponents:3,values:T,name:"Normals"});e.resliceGeom.getPointData().setNormals(w)}else Mr("Something went wrong.","A default slice plane should have been created in the beginning of","updateResliceGeometry.");e.resliceGeomUpdateString=v,(g=e.resliceGeom)==null||g.modified()}};function l(h,v,m){const{width:x,height:y}=A1(h.map(S=>({property:S})),S=>S);let d=e.renderable.getLabelOutlineTextureWidth();d<=0&&(d=Math.max(x,e.context.getParameter(e.context.MAX_TEXTURE_SIZE)));const g=new v(d*y);kx(g,h,d);const C=Ne.newInstance({resizable:!1});return C.setOpenGLRenderWindow(e._openGLRenderWindow),C.resetFormatAndType(),C.setMinificationFilter(me.NEAREST),C.setMagnificationFilter(me.NEAREST),C.create2DFromRaw({width:d,height:y,numComps:1,dataType:m,data:g}),C}function f(h,v,m,x,y){const{hash:d}=A1(h.map(g=>({property:g})),g=>g);d!==e[x]&&(e[x]=d,e[y]&&e[y].releaseGraphicsResources(),e[y]=l(h,v,m))}t.updateLabelOutlineThicknessTexture=h=>{f(h.map(({property:v})=>v.getLabelOutlineThicknessByReference()),Uint8Array,be.UNSIGNED_CHAR,"_labelOutlineThicknessHash","labelOutlineThicknessTexture")},t.updateLabelOutlineOpacityTexture=h=>{f(h.map(({property:v})=>{let m=v.getLabelOutlineOpacity();return typeof m=="number"&&(m=[m]),m}),Float32Array,be.FLOAT,"_labelOutlineOpacityHash","labelOutlineOpacityTexture")},t.setScalarTextures=h=>{e.scalarTextures=[...h],e._externalOpenGLTexture=!0},t.delete=In(()=>{e._openGLRenderWindow&&o(e._openGLRenderWindow),e.labelOutlineThicknessTexture&&(e.labelOutlineThicknessTexture.releaseGraphicsResources(),e.labelOutlineThicknessTexture=null),e.labelOutlineOpacityTexture&&(e.labelOutlineOpacityTexture.releaseGraphicsResources(),e.labelOutlineOpacityTexture=null)},t.delete)}var $x={VBOBuildTime:{},VBOBuildString:null,haveSeenDepthRequest:!1,lastHaveSeenDepthRequest:!1,lastIndependentComponents:!1,lastUseLabelOutline:!1,lastNumValidInputs:0,lastNumberOfComponents:0,lastMultiTexturePerVolumeEnabled:!1,lastSlabThickness:0,lastSlabTrapezoidIntegration:0,lastSlabType:-1,scalarTextures:[],_scalarTexturesCore:[],colorTexture:null,_colorTextureCore:null,pwfTexture:null,_pwfTextureCore:null,labelOutlineProperties:[],labelOutlineThicknessTexture:null,_labelOutlineThicknessHash:null,labelOutlineOpacityTexture:null,_labelOutlineOpacityHash:null,_externalOpenGLTexture:!1,resliceGeom:null,resliceGeomUpdateString:null,tris:null};function Hx(t,e,a={}){Object.assign(e,$x,a),Ct.extend(t,e,a),xn.implementReplaceShaderCoincidentOffset(t,e,a),xn.implementBuildShadersWithReplacements(t,e,a),e.tris=jt.newInstance(),e.scalarTextures=[],e.colorTexture=null,e.pwfTexture=null,e.VBOBuildTime={},lt(e.VBOBuildTime),e.tmpMat4=we(new Float64Array(16)),e._tmpTexelSize=[0,0,0],e.outlineFilter=Rx.newInstance(),e.outlineFilter.setGenerateFaces(!0),e.outlineFilter.setGenerateLines(!1),e.cubePolyData=Je.newInstance(),e.cutter=px.newInstance(),e.lineToSurfaceFilter=mx.newInstance(),e.transform=sx.newInstance(),Bt(t,e,["scalarTextures"]),jx(t,e)}var Kx=qe(Hx,"vtkOpenGLImageResliceMapper");ct("vtkImageResliceMapper",Kx);var Xx={HORIZONTAL:"horizontal",VERTICAL:"vertical",AUTO:"auto"},z1={Orientation:Xx},{VectorMode:qx}=uo,{Orientation:ko}=z1;function rc(t,e,a){t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeSize,t.fillStyle=e.fontColor;const n=e.fontSize??a;t.font=`${e.fontStyle} ${n}px ${e.fontFamily}`}function W1(t,e){return a=>{const n=a.getLastSize(),r=(n[0]/700)**.8,i=(n[1]/700)**.8,o=Math.min(r,i),s=a.getAxisTextStyle(),u=a.getTickTextStyle();Object.assign(s,e.axisTextStyle),Object.assign(u,e.tickTextStyle),s.fontSize===void 0&&(s.fontSize=Math.max(24*o,12)),u.fontSize===void 0&&(a.getLastAspectRatio()>1?u.fontSize=Math.max(20*o,10):u.fontSize=Math.max(16*o,10));const c=a.updateTextureAtlas();a.setTopTitle(!1);const p=a.getBoxSizeByReference();let l=!1;if(e.orientation===ko.VERTICAL?l=!0:e.orientation===ko.HORIZONTAL?l=!1:l=a.getLastAspectRatio()>1,l)a.setTickLabelPixelOffset(.3*u.fontSize),c.titleWidth<=c.tickWidth+a.getTickLabelPixelOffset()+.8*u.fontSize?(a.setTopTitle(!0),a.setAxisTitlePixelOffset(.2*u.fontSize),p[0]=2*(c.tickWidth+a.getTickLabelPixelOffset()+.8*u.fontSize)/n[0],a.setBoxPosition([.98-p[0],-.92])):(a.setAxisTitlePixelOffset(.2*u.fontSize),p[0]=2*(c.titleHeight+a.getAxisTitlePixelOffset()+c.tickWidth+a.getTickLabelPixelOffset()+.8*u.fontSize)/n[0],a.setBoxPosition([.99-p[0],-.92])),p[1]=Math.max(1.2,Math.min(1.84/i,1.84));else{a.setAxisTitlePixelOffset(1.2*u.fontSize),a.setTickLabelPixelOffset(.1*u.fontSize);const f=2*(.8*u.fontSize+c.titleHeight+a.getAxisTitlePixelOffset())/n[1],h=2*c.tickWidth/n[0];p[0]=Math.min(1.9,Math.max(1.4,1.4*h*(a.getTicks().length+3))),p[1]=f,a.setBoxPosition([-.5*p[0],-.97])}a.recomputeBarSegments(c)}}function j1(t,e){return a=>{const n=a.getLastTickBounds(),r=$0().domain([n[0],n[1]]),i=r.ticks(5),o=r.tickFormat(5);a.setTicks(i),a.setTickStrings(i.map(o))}}function Yx(t,e){e.classHierarchy.push("vtkScalarBarActorHelper"),t.setRenderable=r=>{e.renderable!==r&&(e.renderable=r,e.barActor.setProperty(r.getProperty()),e.barActor.setParentProp(r),e.barActor.setCoordinateSystemToDisplay(),e.tmActor.setProperty(r.getProperty()),e.tmActor.setParentProp(r),e.tmActor.setCoordinateSystemToDisplay(),e.generateTicks=r.generateTicks,e.axisTextStyle={...r.getAxisTextStyle()},e.tickTextStyle={...r.getTickTextStyle()},t.modified())},t.updateAPISpecificData=(r,i,o)=>{(e.lastSize[0]!==r[0]||e.lastSize[1]!==r[1])&&(e.lastSize[0]=r[0],e.lastSize[1]=r[1],e.lastAspectRatio=r[0]/r[1],e.forceUpdate=!0);const s=e.renderable.getScalarsToColors();if(!(!s||!e.renderable.getVisibility())&&(e.barMapper.setLookupTable(s),e.camera=i,e.renderWindow=o,e.forceUpdate||Math.max(s.getMTime(),t.getMTime(),e.renderable.getMTime())>e.lastRebuildTime.getMTime())){if(e.lastTickBounds=[...s.getMappingRange()],e.renderable.getGenerateTicks()(t),e.renderable.getAutomated())e.renderable.getAutoLayout()(t);else{e.axisTextStyle={...e.renderable.getAxisTextStyle()},e.tickTextStyle={...e.renderable.getTickTextStyle()},e.barPosition=[...e.renderable.getBarPosition()],e.barSize=[...e.renderable.getBarSize()],e.boxPosition=[...e.renderable.getBoxPosition()],e.boxSize=[...e.renderable.getBoxSize()],e.axisTitlePixelOffset=e.renderable.getAxisTitlePixelOffset(),e.tickLabelPixelOffset=e.renderable.getTickLabelPixelOffset();const u=t.updateTextureAtlas();t.recomputeBarSegments(u)}t.updatePolyDataForLabels(),t.updatePolyDataForBarSegments(),e.lastRebuildTime.modified(),e.forceUpdate=!1}},t.updateTextureAtlas=()=>{e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left";const r={},i=new Map;let o=0,s=1;rc(e.tmContext,e.axisTextStyle,18);let u=e.tmContext.measureText(e.renderable.getAxisLabel()),c={height:u.actualBoundingBoxAscent+2,startingHeight:s,width:u.width+2,textStyle:e.axisTextStyle};i.set(e.renderable.getAxisLabel(),c),s+=c.height,o=c.width,r.titleWidth=c.width,r.titleHeight=c.height,r.tickWidth=0,r.tickHeight=0,rc(e.tmContext,e.tickTextStyle,14);const p=[...t.getTickStrings(),"NaN","Below","Above"];for(let l=0;l{l.tcoords=[0,(s-l.startingHeight-l.height)/s,l.width/o,(s-l.startingHeight-l.height)/s,l.width/o,(s-l.startingHeight)/s,0,(s-l.startingHeight)/s]}),e.tmCanvas.width=o,e.tmCanvas.height=s,e.tmContext.textBaseline="bottom",e.tmContext.textAlign="left",e.tmContext.clearRect(0,0,o,s),i.forEach((l,f)=>{const h=l.textStyle===e.axisTextStyle?18:14;rc(e.tmContext,l.textStyle,h),e.tmContext.fillText(f,1,l.startingHeight+l.height-1)}),e.tmTexture.setCanvas(e.tmCanvas),e.tmTexture.modified(),e._tmAtlas=i,r},t.computeBarSize=r=>{e.vertical=e.boxSize[1]>e.boxSize[0];const i=2*r.tickHeight/e.lastSize[1],o=[1,1];if(e.vertical){const s=2*(r.tickWidth+e.tickLabelPixelOffset)/e.lastSize[0];if(e.topTitle){const u=2*(r.titleHeight+e.axisTitlePixelOffset)/e.lastSize[1];e.barSize[0]=e.boxSize[0]-s,e.barSize[1]=e.boxSize[1]-u}else{const u=2*(r.titleHeight+e.axisTitlePixelOffset)/e.lastSize[0];e.barSize[0]=e.boxSize[0]-u-s,e.barSize[1]=e.boxSize[1]}e.barPosition[0]=e.boxPosition[0]+s,e.barPosition[1]=e.boxPosition[1],o[1]=i}else{const s=(2*r.tickWidth-8)/e.lastSize[0],u=2*(r.titleHeight+e.axisTitlePixelOffset)/e.lastSize[1];e.barSize[0]=e.boxSize[0],e.barPosition[0]=e.boxPosition[0],e.barSize[1]=e.boxSize[1]-u,e.barPosition[1]=e.boxPosition[1],o[0]=s}return o},t.recomputeBarSegments=r=>{var f,h,v,m;const i=t.computeBarSize(r);e.barSegments=[];const o=[0,0],s=e.vertical?1:0,u=e.vertical?.01:.02;function c(x,y){e.barSegments.push({corners:[[...o],[o[0]+i[0],o[1]],[o[0]+i[0],o[1]+i[1]],[o[0],o[1]+i[1]]],scalars:y,title:x}),o[s]+=i[s]+u}e.renderable.getDrawNanAnnotation()&&e.renderable.getScalarsToColors().getNanColor()&&c("NaN",[NaN,NaN,NaN,NaN]),e.renderable.getDrawBelowRangeSwatch()&&((h=(f=e.renderable.getScalarsToColors()).getUseBelowRangeColor)!=null&&h.call(f))&&c("Below",[-.1,-.1,-.1,-.1]);const p=(m=(v=e.renderable.getScalarsToColors()).getUseAboveRangeColor)==null?void 0:m.call(v);o[s]+=u;const l=i[s];i[s]=p?1-2*u-i[s]-o[s]:1-u-o[s],c("ticks",e.vertical?[0,0,.995,.995]:[0,.995,.995,0]),e.renderable.getDrawAboveRangeSwatch()&&p&&(i[s]=l,o[s]+=u,c("Above",[1.1,1.1,1.1,1.1]))};const a=new Float64Array(3);t.createPolyDataForOneLabel=(r,i,o,s,u,c)=>{const p=e._tmAtlas.get(r);if(!p)return;let l=c.ptIdx,f=c.cellIdx;a[0]=(.5*i[0]+.5)*e.lastSize[0],a[1]=(.5*i[1]+.5)*e.lastSize[1],a[2]=i[2],a[0]+=u[0],a[1]+=u[1];const h=[],v=s==="vertical"?[1,0]:[0,1];s==="vertical"?(h[0]=p.width,h[1]=-p.height,o[0]==="middle"?a[1]-=p.width/2:o[0]==="right"&&(a[1]-=p.width),o[1]==="middle"?a[0]+=p.height/2:o[1]==="top"&&(a[0]+=p.height)):(h[0]=p.width,h[1]=p.height,o[0]==="middle"?a[0]-=p.width/2:o[0]==="right"&&(a[0]-=p.width),o[1]==="middle"?a[1]-=p.height/2:o[1]==="top"&&(a[1]-=p.height)),c.points[l*3]=a[0],c.points[l*3+1]=a[1],c.points[l*3+2]=a[2],c.tcoords[l*2]=p.tcoords[0],c.tcoords[l*2+1]=p.tcoords[1],l++,a[v[0]]+=h[0],c.points[l*3]=a[0],c.points[l*3+1]=a[1],c.points[l*3+2]=a[2],c.tcoords[l*2]=p.tcoords[2],c.tcoords[l*2+1]=p.tcoords[3],l++,a[v[1]]+=h[1],c.points[l*3]=a[0],c.points[l*3+1]=a[1],c.points[l*3+2]=a[2],c.tcoords[l*2]=p.tcoords[4],c.tcoords[l*2+1]=p.tcoords[5],l++,a[v[0]]-=h[0],c.points[l*3]=a[0],c.points[l*3+1]=a[1],c.points[l*3+2]=a[2],c.tcoords[l*2]=p.tcoords[6],c.tcoords[l*2+1]=p.tcoords[7],l++,c.polys[f*4]=3,c.polys[f*4+1]=l-4,c.polys[f*4+2]=l-3,c.polys[f*4+3]=l-2,f++,c.polys[f*4]=3,c.polys[f*4+1]=l-4,c.polys[f*4+2]=l-2,c.polys[f*4+3]=l-1,c.ptIdx+=4,c.cellIdx+=2};const n=new Float64Array(3);t.updatePolyDataForLabels=()=>{const r=t.getTickStrings().length+e.barSegments.length,i=r*4,o=r*2,s=new Float64Array(i*3),u=new Uint16Array(o*4),c=new Float32Array(i*2),p={ptIdx:0,cellIdx:0,polys:u,points:s,tcoords:c},l=e.vertical?0:1,f=e.vertical?1:0;n[2]=-.99;const h=e.vertical?["right","middle"]:["middle","bottom"];let v=[0,1];const m=[0,0];e.vertical?(m[0]=-e.tickLabelPixelOffset,e.topTitle?(n[0]=e.boxPosition[0]+.5*e.boxSize[0],n[1]=e.barPosition[1]+e.barSize[1],t.createPolyDataForOneLabel(e.renderable.getAxisLabel(),n,["middle","bottom"],"horizontal",[0,e.axisTitlePixelOffset],p)):(n[0]=e.barPosition[0]+e.barSize[0],n[1]=e.barPosition[1]+.5*e.barSize[1],t.createPolyDataForOneLabel(e.renderable.getAxisLabel(),n,["middle","top"],"vertical",[e.axisTitlePixelOffset,0],p)),v=[-1,0]):(m[1]=e.tickLabelPixelOffset,n[0]=e.barPosition[0]+.5*e.barSize[0],n[1]=e.barPosition[1]+e.barSize[1],t.createPolyDataForOneLabel(e.renderable.getAxisLabel(),n,["middle","bottom"],"horizontal",[0,e.axisTitlePixelOffset],p)),n[l]=e.barPosition[l]+(.5*v[l]+.5)*e.barSize[l],n[f]=e.barPosition[f]+e.barSize[f]*.5;let x=null;for(let w=0;w{var m,x;const r=e.renderable.getScalarsToColors();let i=0;e.renderable.getDrawNanAnnotation()&&r.getNanColor()&&(i+=1),e.renderable.getDrawBelowRangeSwatch()&&((m=r.getUseBelowRangeColor)!=null&&m.call(r))&&(i+=1),e.renderable.getDrawAboveRangeSwatch()&&((x=r.getUseAboveRangeColor)!=null&&x.call(r))&&(i+=1);const o=4*(1+i),s=o;let u=1;r.getVectorMode()===qx.COMPONENT&&(u=r.getVectorComponent()+1);const c=new Float64Array(o*3),p=new Uint16Array(s*5),l=new Float32Array(o*u);let f=0,h=0;for(let y=0;y{Object.assign(e,{},a),A.obj(t,e),A.setGet(t,e,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle","ticks","tickStrings","tickPositions"]),A.get(t,e,["lastSize","lastAspectRatio","lastTickBounds","axisTextStyle","tickTextStyle","barActor","tmActor"]),A.getArray(t,e,["boxPosition","boxSize"]),A.setArray(t,e,["boxPosition","boxSize"],2),e.forceUpdate=!1,e.lastRebuildTime={},A.obj(e.lastRebuildTime,{mtime:0}),e.lastSize=[-1,-1],e.tmCanvas=document.createElement("canvas"),e.tmContext=e.tmCanvas.getContext("2d"),e._tmAtlas=new Map,e.barMapper=dn.newInstance(),e.barMapper.setInterpolateScalarsBeforeMapping(!0),e.barMapper.setUseLookupTableScalarRange(!0),e.polyData=Je.newInstance(),e.barMapper.setInputData(e.polyData),e.barActor=hn.newInstance(),e.barActor.setMapper(e.barMapper),e.tmPolyData=Je.newInstance(),e.tmMapper=dn.newInstance(),e.tmMapper.setInputData(e.tmPolyData),e.tmTexture=k0.newInstance({resizable:!0}),e.tmTexture.setInterpolate(!1),e.tmActor=hn.newInstance({parentProp:t}),e.tmActor.setMapper(e.tmMapper),e.tmActor.addTexture(e.tmTexture),e.barPosition=[0,0],e.barSize=[0,0],e.boxPosition=[.88,-.92],e.boxSize=[.1,1.1],e.lastTickBounds=[],Yx(t,e)},"vtkScalarBarActorHelper");function Zx(t,e){e.classHierarchy.push("vtkScalarBarActor"),t.setTickTextStyle=a=>{e.tickTextStyle={...e.tickTextStyle,...a},t.modified()},t.setAxisTextStyle=a=>{e.axisTextStyle={...e.axisTextStyle,...a},t.modified()},t.setOrientationToHorizontal=()=>t.setOrientation(ko.HORIZONTAL),t.setOrientationToVertical=()=>t.setOrientation(ko.VERTICAL),t.resetAutoLayoutToDefault=()=>{t.setAutoLayout(W1(t,e))},t.resetGenerateTicksToDefault=()=>{t.setGenerateTicks(j1())}}function Qx(t){return{automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:void 0,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:void 0,fontFamily:"serif"},generateTicks:null,drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0,orientation:null,...t}}function $1(t,e,a={}){Object.assign(e,Qx(a)),e.autoLayout||(e.autoLayout=W1(t,e)),e.generateTicks||(e.generateTicks=j1()),hn.extend(t,e,a),t.getProperty().setDiffuse(0),t.getProperty().setAmbient(1),A.setGet(t,e,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","generateTicks","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch","orientation"]),A.get(t,e,["axisTextStyle","tickTextStyle"]),A.getArray(t,e,["barPosition","barSize","boxPosition","boxSize"]),A.setArray(t,e,["barPosition","barSize","boxPosition","boxSize"],2),Zx(t,e)}var e7=A.newInstance($1,"vtkScalarBarActor"),H1={newInstance:e7,extend:$1,newScalarBarActorHelper:Jx,...z1};function t7(t,e){e.classHierarchy.push("vtkOpenGLScalarBarActor"),t.buildPass=a=>{a&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.scalarBarActorHelper.getRenderable()||e.scalarBarActorHelper.setRenderable(e.renderable),t.prepareNodes(),t.addMissingNode(e.scalarBarActorHelper.getBarActor()),t.addMissingNode(e.scalarBarActorHelper.getTmActor()),t.removeUnusedNodes())},t.opaquePass=(a,n)=>{if(a){const r=e._openGLRenderer?e._openGLRenderer.getRenderable().getActiveCamera():null,i=e._openGLRenderer.getTiledSizeAndOrigin();e.scalarBarActorHelper.updateAPISpecificData([i.usize,i.vsize],r,e._openGLRenderWindow.getRenderable())}}}var n7={};function r7(t,e,a={}){Object.assign(e,n7,a),Ct.extend(t,e,a),e.scalarBarActorHelper=H1.newScalarBarActorHelper(),t7(t,e)}var a7=qe(r7,"vtkOpenGLScalarBarActor");ct("vtkScalarBarActor",a7);var{vtkErrorMacro:K1}=bt;function i7(t,e){e.classHierarchy.push("vtkOpenGLSkybox"),t.buildPass=a=>{if(a){e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow),e.openGLTexture.setOpenGLRenderWindow(e._openGLRenderWindow);const n=e._openGLRenderer.getRenderable();e.openGLCamera=e._openGLRenderer.getViewNodeFor(n.getActiveCamera(),e.openGLCamera)}},t.queryPass=(a,n)=>{if(a){if(!e.renderable||!e.renderable.getVisibility())return;n.incrementOpaqueActorCount()}},t.opaquePass=(a,n)=>{if(a&&!e._openGLRenderer.getSelector()){t.updateBufferObjects(),e.context.depthMask(!0),e._openGLRenderWindow.getShaderCache().readyShaderProgram(e.tris.getProgram()),e.openGLTexture.render(e._openGLRenderWindow);const r=e.openGLTexture.getTextureUnit();e.tris.getProgram().setUniformi("sbtexture",r);const i=e._openGLRenderer.getRenderable(),o=e.openGLCamera.getKeyMatrices(i),s=new Float64Array(16);if(Et(s,o.wcpc),e.tris.getProgram().setUniformMatrix("IMCPCMatrix",s),e.lastFormat==="box"){const u=i.getActiveCamera().getPosition();e.tris.getProgram().setUniform3f("camPos",u[0],u[1],u[2])}e.tris.getVAO().bind(),e.context.drawArrays(e.context.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release(),e.openGLTexture.deactivate()}},t.updateBufferObjects=()=>{if(!e.tris.getCABO().getElementCount()){const n=new Float32Array(12);for(let s=0;s<4;s++)n[s*3]=s%2*2-1,n[s*3+1]=s>1?1:-1,n[s*3+2]=1;const r=pe.newInstance({numberOfComponents:3,values:n});r.setName("points");const i=new Uint16Array(8);i[0]=3,i[1]=0,i[2]=1,i[3]=3,i[4]=3,i[5]=0,i[6]=3,i[7]=2;const o=pe.newInstance({numberOfComponents:1,values:i});e.tris.getCABO().createVBO(o,"polys",Jt.SURFACE,{points:r,cellOffset:0})}e.renderable.getFormat()!==e.lastFormat&&(e.lastFormat=e.renderable.getFormat(),e.lastFormat==="box"&&e.tris.setProgram(e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(`//VTK::System::Dec + attribute vec3 vertexMC; + uniform mat4 IMCPCMatrix; + varying vec3 TexCoords; + void main () { + gl_Position = vec4(vertexMC.xyz, 1.0); + vec4 wpos = IMCPCMatrix * gl_Position; + TexCoords = wpos.xyz/wpos.w; + }`,`//VTK::System::Dec + //VTK::Output::Dec + varying vec3 TexCoords; + uniform samplerCube sbtexture; + uniform vec3 camPos; + void main () { + // skybox looks from inside out + // which means we have to adjust + // our tcoords. Otherwise text would + // be flipped + vec3 tc = normalize(TexCoords - camPos); + if (abs(tc.z) < max(abs(tc.x),abs(tc.y))) + { + tc = vec3(1.0, 1.0, -1.0) * tc; + } + else + { + tc = vec3(-1.0, 1.0, 1.0) * tc; + } + gl_FragData[0] = textureCube(sbtexture, tc); + }`,"")),e.lastFormat==="background"&&e.tris.setProgram(e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(`//VTK::System::Dec + attribute vec3 vertexMC; + uniform mat4 IMCPCMatrix; + varying vec2 TexCoords; + void main () { + gl_Position = vec4(vertexMC.xyz, 1.0); + vec4 wpos = IMCPCMatrix * gl_Position; + TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5; + }`,`//VTK::System::Dec + //VTK::Output::Dec + varying vec2 TexCoords; + uniform sampler2D sbtexture; + void main () { + gl_FragData[0] = texture2D(sbtexture, TexCoords); + }`,"")),e.tris.getShaderSourceTime().modified(),e.tris.getVAO().bind(),e.tris.getVAO().addAttributeArray(e.tris.getProgram(),e.tris.getCABO(),"vertexMC",e.tris.getCABO().getVertexOffset(),e.tris.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||K1("Error setting vertexMC in shader VAO."));const a=e.renderable.getTextures();a.length||K1("vtkSkybox requires a texture map"),e.openGLTexture.getRenderable()!==a[0]&&(e.openGLTexture.releaseGraphicsResources(e._openGLRenderWindow),e.openGLTexture.setRenderable(a[0]))}}var o7={context:null};function s7(t,e,a={}){Object.assign(e,o7,a),Ct.extend(t,e,a),e.openGLTexture=Ne.newInstance(),e.tris=jt.newInstance(),e.keyMatrixTime={},lt(e.keyMatrixTime,{mtime:0}),e.keyMatrices={normalMatrix:zt(new Float64Array(9)),mcwc:we(new Float64Array(16))},ht(t,e,["context"]),Bt(t,e,["activeTextures"]),i7(t,e)}var c7=qe(s7);ct("vtkSkybox",c7);var u7=`//VTK::System::Dec /*========================================================================= Program: Visualization Toolkit - Module: vtkVolumeVS.glsl + Module: vtkSphereMapperVS.glsl Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. @@ -576,203 +697,481 @@ void main() PURPOSE. See the above copyright notice for more information. =========================================================================*/ +// this shader implements imposters in OpenGL for Spheres -attribute vec4 vertexDC; - -varying vec3 vertexVCVSOutput; -uniform mat4 PCVCMatrix; +attribute vec4 vertexMC; +attribute vec2 offsetMC; -uniform float dcxmin; -uniform float dcxmax; -uniform float dcymin; -uniform float dcymax; +// optional normal declaration +//VTK::Normal::Dec -void main() -{ - // dcsmall is the device coords reduced to the - // x y area covered by the volume - vec4 dcsmall = vec4( - dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin), - dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin), - vertexDC.z, - vertexDC.w); - vec4 vcpos = PCVCMatrix * dcsmall; - vertexVCVSOutput = vcpos.xyz/vcpos.w; - gl_Position = dcsmall; -} -`,F8=`//VTK::System::Dec +//VTK::Picking::Dec -/*========================================================================= +// Texture coordinates +//VTK::TCoord::Dec - Program: Visualization Toolkit - Module: vtkVolumeFS.glsl +uniform mat3 normalMatrix; // transform model coordinate directions to view coordinates - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +// material property values +//VTK::Color::Dec - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. +// clipping plane vars +//VTK::Clip::Dec -=========================================================================*/ -// Template for the volume mappers fragment shader +// camera and actor matrix values +//VTK::Camera::Dec -const float infinity = 3.402823466e38; +varying vec4 vertexVCVSOutput; +varying float radiusVCVSOutput; +varying vec3 centerVCVSOutput; -// the output of this shader -//VTK::Output::Dec +uniform int cameraParallel; +uniform float scaleFactor; -in vec3 vertexVCVSOutput; +void main() +{ + //VTK::Picking::Impl -// From Sources\\Rendering\\Core\\VolumeProperty\\Constants.js -#define COMPOSITE_BLEND 0 -#define MAXIMUM_INTENSITY_BLEND 1 -#define MINIMUM_INTENSITY_BLEND 2 -#define AVERAGE_INTENSITY_BLEND 3 -#define ADDITIVE_INTENSITY_BLEND 4 -#define RADON_TRANSFORM_BLEND 5 -#define LABELMAP_EDGE_PROJECTION_BLEND 6 + //VTK::Color::Impl -#define vtkNumberOfLights //VTK::NumberOfLights -#define vtkMaxLaoKernelSize //VTK::MaxLaoKernelSize -#define vtkNumberOfComponents //VTK::NumberOfComponents -#define vtkBlendMode //VTK::BlendMode -#define vtkMaximumNumberOfSamples //VTK::MaximumNumberOfSamples + //VTK::Normal::Impl -//VTK::EnabledColorFunctions + //VTK::TCoord::Impl -//VTK::EnabledLightings + //VTK::Clip::Impl -//VTK::EnabledMultiTexturePerVolume + // compute the projected vertex position + vec2 scaledOffsetMC = scaleFactor * offsetMC; + vertexVCVSOutput = MCVCMatrix * vertexMC; + centerVCVSOutput = vertexVCVSOutput.xyz; + radiusVCVSOutput = length(scaledOffsetMC)*0.5; -//VTK::EnabledGradientOpacity + // make the triangle face the camera + if (cameraParallel == 0) + { + vec3 dir = normalize(-vertexVCVSOutput.xyz); + vec3 base2 = normalize(cross(dir,vec3(1.0,0.0,0.0))); + vec3 base1 = cross(base2,dir); + vertexVCVSOutput.xyz = vertexVCVSOutput.xyz + scaledOffsetMC.x*base1 + scaledOffsetMC.y*base2; + } + else + { + // add in the offset + vertexVCVSOutput.xy = vertexVCVSOutput.xy + scaledOffsetMC; + } -//VTK::EnabledIndependentComponents + gl_Position = VCPCMatrix * vertexVCVSOutput; +} +`,{vtkErrorMacro:l7}=bt;function f7(t,e){e.classHierarchy.push("vtkOpenGLSphereMapper");const a={...t};t.getShaderTemplate=(n,r,i)=>{n.Vertex=u7,n.Fragment=Ha,n.Geometry=""},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;o=Z.substitute(o,"//VTK::Camera::Dec",[`uniform mat4 VCPCMatrix; +`,"uniform mat4 MCVCMatrix;"]).result,s=Z.substitute(s,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,s=Z.substitute(s,"//VTK::PositionVC::Impl",[`vec4 vertexVC = vertexVCVSOutput; +`]).result,s=Z.substitute(s,"//VTK::Normal::Dec",[`uniform float invertedDepth; +`,`uniform int cameraParallel; +`,`varying float radiusVCVSOutput; +`,`varying vec3 centerVCVSOutput; +`,`uniform mat4 VCPCMatrix; +`]).result;let u="";e.context.getExtension("EXT_frag_depth")&&(u=`gl_FragDepthEXT = (pos.z / pos.w + 1.0) / 2.0; +`),e._openGLRenderWindow.getWebgl2()&&(u=`gl_FragDepth = (pos.z / pos.w + 1.0) / 2.0; +`),s=Z.substitute(s,"//VTK::Depth::Impl",[` vec3 EyePos; +`,` vec3 EyeDir; +`,` if (cameraParallel != 0) { +`,` EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVCVSOutput); +`,` EyeDir = vec3(0.0,0.0,-1.0); } +`,` else { +`,` EyeDir = vertexVC.xyz; +`,` EyePos = vec3(0.0,0.0,0.0); +`,` float lengthED = length(EyeDir); +`,` EyeDir = normalize(EyeDir); +`,` if (lengthED > radiusVCVSOutput*3.0) { +`,` EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; } +`,` } +`,` EyePos = EyePos - centerVCVSOutput; +`,` EyePos = EyePos/radiusVCVSOutput; +`,` float b = 2.0*dot(EyePos,EyeDir); +`,` float c = dot(EyePos,EyePos) - 1.0; +`,` float d = b*b - 4.0*c; +`,` vec3 normalVCVSOutput = vec3(0.0,0.0,1.0); +`,` if (d < 0.0) { discard; } +`,` else { +`,` float t = (-b - invertedDepth*sqrt(d))*0.5; +`,` normalVCVSOutput = invertedDepth*normalize(EyePos + t*EyeDir); +`,` vertexVC.xyz = normalVCVSOutput*radiusVCVSOutput + centerVCVSOutput; +`,` } +`,` vec4 pos = VCPCMatrix * vertexVC; +`,u]).result,s=Z.substitute(s,"//VTK::Normal::Impl","").result,e.haveSeenDepthRequest&&(s=Z.substitute(s,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),n.Vertex=o,n.Fragment=s,a.replaceShaderValues(n,r,i)},t.setMapperShaderParameters=(n,r,i)=>{if(n.getCABO().getElementCount()&&(e.VBOBuildTime>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&n.getProgram().isAttributeUsed("offsetMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"offsetMC",12,n.getCABO().getStride(),e.context.FLOAT,2,!1)||l7("Error setting 'offsetMC' in shader VAO.")),n.getProgram().isUniformUsed("invertedDepth")&&n.getProgram().setUniformf("invertedDepth",e.invert?-1:1),n.getProgram().isUniformUsed("scaleFactor")){const o=e.currentInput.getPointData();e.renderable.getScaleArray()!=null&&o.hasArray(e.renderable.getScaleArray())?n.getProgram().setUniformf("scaleFactor",e.renderable.getScaleFactor()):n.getProgram().setUniformf("scaleFactor",1)}a.setMapperShaderParameters(n,r,i)},t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=r.getActiveCamera(),u=e.openGLCamera.getKeyMatrices(r);o.isUniformUsed("VCPCMatrix")&&o.setUniformMatrix("VCPCMatrix",u.vcpc);const c=new Float64Array(16);if(o.isUniformUsed("MCVCMatrix"))if(i.getIsIdentity())vt(c,u.wcvc),n.getCABO().getCoordShiftAndScaleEnabled()&&Ee(c,c,n.getCABO().getInverseShiftAndScaleMatrix()),o.setUniformMatrix("MCVCMatrix",c);else{const p=e.openGLActor.getKeyMatrices();Ee(c,u.wcvc,p.mcwc),n.getCABO().getCoordShiftAndScaleEnabled()&&Ee(c,c,n.getCABO().getInverseShiftAndScaleMatrix()),o.setUniformMatrix("MCVCMatrix",c)}o.isUniformUsed("cameraParallel")&&n.getProgram().setUniformi("cameraParallel",s.getParallelProjection())},t.getOpenGLMode=(n,r)=>e.context.TRIANGLES,t.buildBufferObjects=(n,r)=>{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,1);const o=e.renderable.getColorMapColors(),s=e.primitives[e.primTypes.Tris].getCABO(),u=i.getPointData(),c=i.getPoints(),p=c.getNumberOfPoints(),l=c.getData(),f=5;let h=null;e.renderable.getScaleArray()!=null&&u.hasArray(e.renderable.getScaleArray())&&(h=u.getArray(e.renderable.getScaleArray()).getData());let v=null,m=0,x=null;o?(m=o.getNumberOfComponents(),s.setColorOffset(0),s.setColorBOStride(4),v=o.getData(),x=new Uint8Array(3*p*4),s.getColorBO()||s.setColorBO(Ln.newInstance()),s.getColorBO().setOpenGLRenderWindow(e._openGLRenderWindow)):s.getColorBO()&&s.setColorBO(null),s.setColorComponents(m);const y=new Float32Array(f*p*3);s.setStride(f*4);const d=Math.cos(et(30));let g=0,C=0;const{useShiftAndScale:S,coordShift:T,coordScale:w}=Y0(c);s.setCoordShiftAndScale(S?T:null,S?w:null);let _=0,E=0;for(let D=0;D 0 - vec2 kernelSample[vtkMaxLaoKernelSize]; -#endif + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. -// Textures -#ifdef EnabledMultiTexturePerVolume - #define vtkNumberOfVolumeTextures vtkNumberOfComponents -#else - #define vtkNumberOfVolumeTextures 1 -#endif -uniform highp sampler3D volumeTexture[vtkNumberOfVolumeTextures]; -uniform sampler2D colorTexture; -uniform sampler2D opacityTexture; -uniform sampler2D jtexture; -uniform sampler2D labelOutlineThicknessTexture; +=========================================================================*/ +// this shader implements imposters in OpenGL for Sticks -struct Volume { - // ---- Volume geometry settings ---- +attribute vec4 vertexMC; +attribute vec3 orientMC; +attribute vec4 offsetMC; +attribute float radiusMC; - vec3 originVC; // in VC - vec3 spacing; // in VC per IC - vec3 inverseSpacing; // 1/spacing - ivec3 dimensions; // in IC - vec3 inverseDimensions; // 1/vec3(dimensions) - mat3 vecISToVCMatrix; // convert from IS to VC without translation - mat3 vecVCToISMatrix; // convert from VC to IS without translation - mat4 PCWCMatrix; - mat4 worldToIndex; - float diagonalLength; // in VC, this is: length(size) +// optional normal declaration +//VTK::Normal::Dec - // ---- Texture settings ---- +//VTK::Picking::Dec - // Texture shift and scale - vec4 colorTextureScale; - vec4 colorTextureShift; - vec4 opacityTextureScale; - vec4 opacityTextureShift; +// Texture coordinates +//VTK::TCoord::Dec - // The heights defined below are the locations for the up to four components - // of the transfer functions. The transfer functions have a height of (2 * - // numberOfComponents) pixels so the values are computed to hit the middle of - // the two rows for that component - vec4 transferFunctionsSampleHeight; +uniform mat3 normalMatrix; // transform model coordinate directions to view coordinates - // ---- Mode specific settings ---- +// material property values +//VTK::Color::Dec - // Independent component default preset settings per component - vec4 independentComponentMix; +// clipping plane vars +//VTK::Clip::Dec - // Additive / average blending mode settings - vec4 ipScalarRangeMin; - vec4 ipScalarRangeMax; +// camera and actor matrix values +//VTK::Camera::Dec - // ---- Rendering settings ---- +varying vec4 vertexVCVSOutput; +varying float radiusVCVSOutput; +varying float lengthVCVSOutput; +varying vec3 centerVCVSOutput; +varying vec3 orientVCVSOutput; - // Lighting - float ambient; - float diffuse; - float specular; - float specularPower; - int computeNormalFromOpacity; +uniform int cameraParallel; - // Gradient opacity - vec4 gradientOpacityScale; - vec4 gradientOpacityShift; - vec4 gradientOpacityMin; - vec4 gradientOpacityMax; +void main() +{ + //VTK::Picking::Impl - // Volume shadow - float volumetricScatteringBlending; - float globalIlluminationReach; - float anisotropy; - float anisotropySquared; + //VTK::Color::Impl - // LAO - int kernelSize; - int kernelRadius; + //VTK::Normal::Impl - // Label outline - float outlineOpacity; -}; -uniform Volume volume; + //VTK::TCoord::Impl -struct Light { - vec3 color; - vec3 positionVC; - vec3 directionVC; // normalized - vec3 halfAngleVC; - vec3 attenuation; - float exponent; - float coneAngle; - int isPositional; -}; -#if vtkNumberOfLights > 0 - uniform Light lights[vtkNumberOfLights]; -#endif + //VTK::Clip::Impl -uniform float vpWidth; -uniform float vpHeight; -uniform float vpOffsetX; -uniform float vpOffsetY; + vertexVCVSOutput = MCVCMatrix * vertexMC; + centerVCVSOutput = vertexVCVSOutput.xyz; + radiusVCVSOutput = radiusMC; + lengthVCVSOutput = length(orientMC); + orientVCVSOutput = normalMatrix * normalize(orientMC); -// Bitmasks for label outline -const int MAX_SEGMENT_INDEX = 256; // Define as per expected maximum -#define MAX_SEGMENTS 256 -#define UINT_SIZE 32 -// We add UINT_SIZE - 1, as we want the ceil of the division instead of the -// floor -#define BITMASK_SIZE ((MAX_SEGMENTS + UINT_SIZE - 1) / UINT_SIZE) -uint labelOutlineBitmasks[BITMASK_SIZE]; + // make sure it is pointing out of the screen + if (orientVCVSOutput.z < 0.0) + { + orientVCVSOutput = -orientVCVSOutput; + } -// Set the corresponding bit in the bitmask -void setLabelOutlineBit(int segmentIndex) { - int arrayIndex = segmentIndex / UINT_SIZE; - int bitIndex = segmentIndex % UINT_SIZE; - labelOutlineBitmasks[arrayIndex] |= 1u << bitIndex; -} + // make the basis + vec3 xbase; + vec3 ybase; + vec3 dir = vec3(0.0,0.0,1.0); + if (cameraParallel == 0) + { + dir = normalize(-vertexVCVSOutput.xyz); + } + if (abs(dot(dir,orientVCVSOutput)) == 1.0) + { + xbase = normalize(cross(vec3(0.0,1.0,0.0),orientVCVSOutput)); + ybase = cross(xbase,orientVCVSOutput); + } + else + { + xbase = normalize(cross(orientVCVSOutput,dir)); + ybase = cross(orientVCVSOutput,xbase); + } + + vec3 offsets = offsetMC.xyz*2.0-1.0; + vertexVCVSOutput.xyz = vertexVCVSOutput.xyz + + radiusVCVSOutput*offsets.x*xbase + + radiusVCVSOutput*offsets.y*ybase + + 0.5*lengthVCVSOutput*offsets.z*orientVCVSOutput; + + gl_Position = VCPCMatrix * vertexVCVSOutput; +} +`,{vtkErrorMacro:Ao}=bt;function v7(t,e){e.classHierarchy.push("vtkOpenGLStickMapper");const a={...t};t.getShaderTemplate=(n,r,i)=>{n.Vertex=d7,n.Fragment=Ha,n.Geometry=""},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;o=Z.substitute(o,"//VTK::Camera::Dec",[`uniform mat4 VCPCMatrix; +`,"uniform mat4 MCVCMatrix;"]).result,s=Z.substitute(s,"//VTK::PositionVC::Dec","varying vec4 vertexVCVSOutput;").result,s=Z.substitute(s,"//VTK::PositionVC::Impl",` vec4 vertexVC = vertexVCVSOutput; +`).result,s=Z.substitute(s,"//VTK::Normal::Dec",[`uniform int cameraParallel; +`,`varying float radiusVCVSOutput; +`,`varying vec3 orientVCVSOutput; +`,`varying float lengthVCVSOutput; +`,`varying vec3 centerVCVSOutput; +`,`uniform mat4 VCPCMatrix; +`]).result;let u="";e.context.getExtension("EXT_frag_depth")&&(u=` gl_FragDepthEXT = (pos.z / pos.w + 1.0) / 2.0; +`),e._openGLRenderWindow.getWebgl2()&&(u=`gl_FragDepth = (pos.z / pos.w + 1.0) / 2.0; +`),s=Z.substitute(s,"//VTK::Depth::Impl",[` vec3 EyePos; +`,` vec3 EyeDir; +`,` if (cameraParallel != 0) { +`,` EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVCVSOutput); +`,` EyeDir = vec3(0.0,0.0,-1.0); } +`,` else { +`,` EyeDir = vertexVC.xyz; +`,` EyePos = vec3(0.0,0.0,0.0); +`,` float lengthED = length(EyeDir); +`,` EyeDir = normalize(EyeDir); +`,` if (lengthED > radiusVCVSOutput*3.0) { +`,` EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; } +`,` } +`,` EyePos = EyePos - centerVCVSOutput; +`,` vec3 base1; +`,` if (abs(orientVCVSOutput.z) < 0.99) { +`,` base1 = normalize(cross(orientVCVSOutput,vec3(0.0,0.0,1.0))); } +`,` else { +`,` base1 = normalize(cross(orientVCVSOutput,vec3(0.0,1.0,0.0))); } +`,` vec3 base2 = cross(orientVCVSOutput,base1); +`,` EyePos = vec3(dot(EyePos,base1),dot(EyePos,base2),dot(EyePos,orientVCVSOutput)); +`,` EyeDir = vec3(dot(EyeDir,base1),dot(EyeDir,base2),dot(EyeDir,orientVCVSOutput)); +`,` EyePos = EyePos/radiusVCVSOutput; +`,` float a = EyeDir.x*EyeDir.x + EyeDir.y*EyeDir.y; +`,` float b = 2.0*(EyePos.x*EyeDir.x + EyePos.y*EyeDir.y); +`,` float c = EyePos.x*EyePos.x + EyePos.y*EyePos.y - 1.0; +`,` float d = b*b - 4.0*a*c; +`,` vec3 normalVCVSOutput = vec3(0.0,0.0,1.0); +`,` if (d < 0.0) { discard; } +`,` else { +`,` float t = (-b - sqrt(d))/(2.0*a); +`,` float tz = EyePos.z + t*EyeDir.z; +`,` vec3 iPoint = EyePos + t*EyeDir; +`,` if (abs(iPoint.z)*radiusVCVSOutput > lengthVCVSOutput*0.5) { +`,` float t2 = (-b + sqrt(d))/(2.0*a); +`,` float tz2 = EyePos.z + t2*EyeDir.z; +`,` if (tz2*radiusVCVSOutput > lengthVCVSOutput*0.5 || tz*radiusVCVSOutput < -0.5*lengthVCVSOutput) { discard; } +`,` else { +`,` normalVCVSOutput = orientVCVSOutput; +`,` float t3 = (lengthVCVSOutput*0.5/radiusVCVSOutput - EyePos.z)/EyeDir.z; +`,` iPoint = EyePos + t3*EyeDir; +`,` vertexVC.xyz = radiusVCVSOutput*(iPoint.x*base1 + iPoint.y*base2 + iPoint.z*orientVCVSOutput) + centerVCVSOutput; +`,` } +`,` } +`,` else { +`,` normalVCVSOutput = iPoint.x*base1 + iPoint.y*base2; +`,` vertexVC.xyz = radiusVCVSOutput*(normalVCVSOutput + iPoint.z*orientVCVSOutput) + centerVCVSOutput; +`,` } +`,` } +`,` vec4 pos = VCPCMatrix * vertexVC; +`,u]).result,s=Z.substitute(s,"//VTK::Normal::Impl","").result,e.haveSeenDepthRequest&&(s=Z.substitute(s,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),n.Vertex=o,n.Fragment=s,a.replaceShaderValues(n,r,i)},t.setMapperShaderParameters=(n,r,i)=>{n.getCABO().getElementCount()&&(e.VBOBuildTime>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("orientMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"orientMC",12,n.getCABO().getStride(),e.context.FLOAT,3,!1)||Ao("Error setting 'orientMC' in shader VAO.")),n.getProgram().isAttributeUsed("offsetMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"offsetMC",0,n.getCABO().getColorBOStride(),e.context.UNSIGNED_BYTE,3,!0)||Ao("Error setting 'offsetMC' in shader VAO.")),n.getProgram().isAttributeUsed("radiusMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"radiusMC",24,n.getCABO().getStride(),e.context.FLOAT,1,!1)||Ao("Error setting 'radiusMC' in shader VAO."))),a.setMapperShaderParameters(n,r,i)},t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=r.getActiveCamera(),u=e.openGLCamera.getKeyMatrices(r);if(o.isUniformUsed("VCPCMatrix")&&o.setUniformMatrix("VCPCMatrix",u.vcpc),i.getIsIdentity())o.isUniformUsed("MCVCMatrix")&&o.setUniformMatrix("MCVCMatrix",u.wcvc),o.isUniformUsed("normalMatrix")&&o.setUniformMatrix3x3("normalMatrix",u.normalMatrix);else{const c=e.openGLActor.getKeyMatrices();if(o.isUniformUsed("MCVCMatrix")){const p=new Float64Array(16);Ee(p,u.wcvc,c.mcwc),o.setUniformMatrix("MCVCMatrix",p)}if(o.isUniformUsed("normalMatrix")){const p=new Float64Array(9);fr(p,u.normalMatrix,c.normalMatrix),o.setUniformMatrix3x3("normalMatrix",p)}}o.isUniformUsed("cameraParallel")&&n.getProgram().setUniformi("cameraParallel",s.getParallelProjection())},t.getOpenGLMode=(n,r)=>e.context.TRIANGLES,t.buildBufferObjects=(n,r)=>{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,1);const o=e.renderable.getColorMapColors(),s=e.primitives[e.primTypes.Tris].getCABO(),u=i.getPointData(),c=i.getPoints(),p=c.getNumberOfPoints(),l=c.getData();let f=3;f+=4;let h=null,v=0;s.setColorBOStride(4),s.getColorBO()||s.setColorBO(Ln.newInstance()),s.getColorBO().setOpenGLRenderWindow(e._openGLRenderWindow),o&&(v=o.getNumberOfComponents(),s.setColorOffset(4),h=o.getData(),s.setColorBOStride(8)),s.setColorComponents(v),s.setStride(f*4);const m=new Float32Array(f*p*12),x=new Uint8Array(12*p*(h?8:4));let y=null,d=null;e.renderable.getScaleArray()!=null&&u.hasArray(e.renderable.getScaleArray())&&(y=u.getArray(e.renderable.getScaleArray()).getData()),e.renderable.getOrientationArray()!=null&&u.hasArray(e.renderable.getOrientationArray())?d=u.getArray(e.renderable.getOrientationArray()).getData():Ao([`Error setting orientationArray. +`,"You have to specify the stick orientation"]);const g=[0,1,3,0,3,2,2,3,5,2,5,4];let C=0,S=0,T=0,w=0;for(let _=0;_=4?255:0,x[w++]=g[O]>=2?255:0,x[w++]=255,S=_*v,h&&(x[w++]=h[S],x[w++]=h[S+1],x[w++]=h[S+2],x[w++]=h[S+3])}s.setElementCount(T/f),s.upload(m,Rn.ARRAY_BUFFER),s.getColorBO().upload(x,Rn.ARRAY_BUFFER),e.VBOBuildTime.modified()}}var y7={};function m7(t,e,a={}){Object.assign(e,y7,a),Lo.extend(t,e,a),v7(t,e)}var x7=qe(m7,"vtkOpenGLStickMapper");ct("vtkStickMapper",x7);function C7(t,e){e.classHierarchy.push("vtkOpenGLVolume"),t.buildPass=a=>{!e.renderable||!e.renderable.getVisibility()||a&&(e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e.context=e._openGLRenderWindow.getContext(),t.prepareNodes(),t.addMissingNode(e.renderable.getMapper()),t.removeUnusedNodes())},t.queryPass=(a,n)=>{if(a){if(!e.renderable||!e.renderable.getVisibility())return;n.incrementVolumeCount()}},t.traverseVolumePass=a=>{!e.renderable||!e.renderable.getNestedVisibility()||e._openGLRenderer.getSelector()&&!e.renderable.getNestedPickable()||(t.apply(a,!0),e.children[0].traverse(a),t.apply(a,!1))},t.volumePass=a=>{!e.renderable||!e.renderable.getVisibility()||e.context.depthMask(!a)},t.getKeyMatrices=()=>(e.renderable.getMTime()>e.keyMatrixTime.getMTime()&&(e.renderable.computeMatrix(),vt(e.MCWCMatrix,e.renderable.getMatrix()),We(e.MCWCMatrix,e.MCWCMatrix),e.renderable.getIsIdentity()?zt(e.normalMatrix):(Pn(e.normalMatrix,e.MCWCMatrix),cn(e.normalMatrix,e.normalMatrix),Xr(e.normalMatrix,e.normalMatrix)),e.keyMatrixTime.modified()),{mcwc:e.MCWCMatrix,normalMatrix:e.normalMatrix})}var S7={};function T7(t,e,a={}){Object.assign(e,S7,a),Ct.extend(t,e,a),e.keyMatrixTime={},lt(e.keyMatrixTime,{mtime:0}),e.normalMatrix=new Float64Array(9),e.MCWCMatrix=new Float64Array(16),ht(t,e,["context"]),C7(t,e)}var w7=qe(T7,"vtkOpenGLVolume");ct("vtkVolume",w7);var X1={NEAREST:0,LINEAR:1,FAST_LINEAR:2},q1={FRACTIONAL:0,PROPORTIONAL:1},Vo={DEFAULT:0,ADDITIVE:1,COLORIZE:2,CUSTOM:3},_7={OFF:0,NORMALIZED:1,RAW:2},Y1={InterpolationType:X1,OpacityMode:q1,ColorMixPreset:Vo,FilterMode:_7},Bo={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3,ADDITIVE_INTENSITY_BLEND:4,RADON_TRANSFORM_BLEND:5,LABELMAP_EDGE_PROJECTION_BLEND:6},E7={BlendMode:Bo},D7=`//VTK::System::Dec + +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkVolumeVS.glsl + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +attribute vec4 vertexDC; + +varying vec3 vertexVCVSOutput; +uniform mat4 PCVCMatrix; + +uniform float dcxmin; +uniform float dcxmax; +uniform float dcymin; +uniform float dcymax; + +void main() +{ + // dcsmall is the device coords reduced to the + // x y area covered by the volume + vec4 dcsmall = vec4( + dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin), + dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin), + vertexDC.z, + vertexDC.w); + vec4 vcpos = PCVCMatrix * dcsmall; + vertexVCVSOutput = vcpos.xyz/vcpos.w; + gl_Position = dcsmall; +} +`,O7=`//VTK::System::Dec + +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkVolumeFS.glsl + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +// Template for the volume mappers fragment shader + +const float infinity = 3.402823466e38; + +// the output of this shader +//VTK::Output::Dec + +in vec3 vertexVCVSOutput; + +// From Sources\\Rendering\\Core\\VolumeProperty\\Constants.js +#define COMPOSITE_BLEND 0 +#define MAXIMUM_INTENSITY_BLEND 1 +#define MINIMUM_INTENSITY_BLEND 2 +#define AVERAGE_INTENSITY_BLEND 3 +#define ADDITIVE_INTENSITY_BLEND 4 +#define RADON_TRANSFORM_BLEND 5 +#define LABELMAP_EDGE_PROJECTION_BLEND 6 + +#define vtkNumberOfLights //VTK::NumberOfLights +#define vtkMaxLaoKernelSize //VTK::MaxLaoKernelSize +#define vtkNumberOfComponents //VTK::NumberOfComponents +#define vtkBlendMode //VTK::BlendMode +#define vtkMaximumNumberOfSamples //VTK::MaximumNumberOfSamples + +//VTK::EnabledColorFunctions + +//VTK::EnabledLightings + +//VTK::EnabledMultiTexturePerVolume + +//VTK::EnabledGradientOpacity + +//VTK::EnabledIndependentComponents + +//VTK::vtkProportionalComponents + +//VTK::vtkForceNearestComponents + +uniform int twoSidedLighting; + +#if vtkMaxLaoKernelSize > 0 + vec2 kernelSample[vtkMaxLaoKernelSize]; +#endif + +// Textures +#ifdef EnabledMultiTexturePerVolume + #define vtkNumberOfVolumeTextures vtkNumberOfComponents +#else + #define vtkNumberOfVolumeTextures 1 +#endif +uniform highp sampler3D volumeTexture[vtkNumberOfVolumeTextures]; +uniform sampler2D colorTexture; +uniform sampler2D opacityTexture; +uniform sampler2D jtexture; +uniform sampler2D labelOutlineThicknessTexture; + +struct Volume { + // ---- Volume geometry settings ---- + + vec3 originVC; // in VC + vec3 spacing; // in VC per IC + vec3 inverseSpacing; // 1/spacing + ivec3 dimensions; // in IC + vec3 inverseDimensions; // 1/vec3(dimensions) + mat3 vecISToVCMatrix; // convert from IS to VC without translation + mat3 vecVCToISMatrix; // convert from VC to IS without translation + mat4 PCWCMatrix; + mat4 worldToIndex; + float diagonalLength; // in VC, this is: length(size) + + // ---- Texture settings ---- + + // Texture shift and scale + vec4 colorTextureScale; + vec4 colorTextureShift; + vec4 opacityTextureScale; + vec4 opacityTextureShift; + + // The heights defined below are the locations for the up to four components + // of the transfer functions. The transfer functions have a height of (2 * + // numberOfComponents) pixels so the values are computed to hit the middle of + // the two rows for that component + vec4 transferFunctionsSampleHeight; + + // ---- Mode specific settings ---- + + // Independent component default preset settings per component + vec4 independentComponentMix; + + // Additive / average blending mode settings + vec4 ipScalarRangeMin; + vec4 ipScalarRangeMax; + + // ---- Rendering settings ---- + + // Lighting + float ambient; + float diffuse; + float specular; + float specularPower; + int computeNormalFromOpacity; + + // Gradient opacity + vec4 gradientOpacityScale; + vec4 gradientOpacityShift; + vec4 gradientOpacityMin; + vec4 gradientOpacityMax; + + // Volume shadow + float volumetricScatteringBlending; + float globalIlluminationReach; + float anisotropy; + float anisotropySquared; + + // LAO + int kernelSize; + int kernelRadius; + + // Label outline + float outlineOpacity; +}; +uniform Volume volume; + +struct Light { + vec3 color; + vec3 positionVC; + vec3 directionVC; // normalized + vec3 halfAngleVC; + vec3 attenuation; + float exponent; + float coneAngle; + int isPositional; +}; +#if vtkNumberOfLights > 0 + uniform Light lights[vtkNumberOfLights]; +#endif + +uniform float vpWidth; +uniform float vpHeight; +uniform float vpOffsetX; +uniform float vpOffsetY; + +// Bitmasks for label outline +const int MAX_SEGMENT_INDEX = 256; // Define as per expected maximum +#define MAX_SEGMENTS 256 +#define UINT_SIZE 32 +// We add UINT_SIZE - 1, as we want the ceil of the division instead of the +// floor +#define BITMASK_SIZE ((MAX_SEGMENTS + UINT_SIZE - 1) / UINT_SIZE) +uint labelOutlineBitmasks[BITMASK_SIZE]; + +// Set the corresponding bit in the bitmask +void setLabelOutlineBit(int segmentIndex) { + int arrayIndex = segmentIndex / UINT_SIZE; + int bitIndex = segmentIndex % UINT_SIZE; + labelOutlineBitmasks[arrayIndex] |= 1u << bitIndex; +} // Check if a bit is set in the bitmask bool isLabelOutlineBitSet(int segmentIndex) { @@ -911,6 +1310,30 @@ vec3 getColorFromTexture(float scalar, int component, float height) { return texture2D(colorTexture, vec2(scaledScalar, height)).rgb; } +float getRadonOpacity(vec4 tValue) { + #ifdef EnabledIndependentComponents + return getOpacityFromTexture(tValue.r, 0, 0.5); + #else + #if vtkNumberOfComponents == 1 + return getOpacityFromTexture(tValue.r, 0, 0.5); + #endif + #if vtkNumberOfComponents == 2 + return getOpacityFromTexture(tValue.a, 1, 0.5); + #endif + #if vtkNumberOfComponents == 3 + return getOpacityFromTexture(tValue.a, 0, 0.5); + #endif + #if vtkNumberOfComponents == 4 + return getOpacityFromTexture(tValue.a, 3, 0.5); + #endif + #endif +} + +vec3 getRadonColor(float normalizedRayIntensity) { + float colorCoord = clamp(normalizedRayIntensity, 0.0, 1.0); + return texture2D(colorTexture, vec2(colorCoord, 0.5)).rgb; +} + //======================================================================= // transformation between VC and IS space @@ -1548,7 +1971,7 @@ vec4 getColorForLabelOutline() { // TODO define epsilon when building shader? for (int i = -actualThickness; i <= actualThickness; i++) { for (int j = -actualThickness; j <= actualThickness; j++) { - if (i == 0 || j == 0) { + if (i == 0 && j == 0) { continue; } @@ -2156,7 +2579,8 @@ void applyBlend(vec3 rayOriginVC, vec3 rayDirVC, float minDistance, #if vtkBlendMode == RADON_TRANSFORM_BLEND float normalizedRayIntensity = 1.0; - vec3 posVC = rayOriginVC + minDistance * rayDirVC; + vec3 firstPosVC = rayOriginVC + minDistance * rayDirVC; + vec3 posVC = firstPosVC; float stepsTraveled = 0.0; // handle very thin volumes @@ -2164,12 +2588,17 @@ void applyBlend(vec3 rayOriginVC, vec3 rayDirVC, float minDistance, vec3 posIS = posVCtoIS(posVC); vec4 tValue = getTextureValue(posIS); normalizedRayIntensity -= raySteps * sampleDistance * - getOpacityFromTexture(tValue.r, 0, 0.5); + getRadonOpacity(tValue); gl_FragData[0] = - vec4(getColorFromTexture(normalizedRayIntensity, 0, 0.5), 1.0); + vec4(getRadonColor(normalizedRayIntensity), 1.0); return; } + vec3 firstPosIS = posVCtoIS(firstPosVC); + vec4 firstValue = getTextureValue(firstPosIS); + normalizedRayIntensity -= + jitter * sampleDistance * getRadonOpacity(firstValue); + posVC += jitter * stepVC; stepsTraveled += jitter; @@ -2183,15 +2612,24 @@ void applyBlend(vec3 rayOriginVC, vec3 rayDirVC, float minDistance, // Convert scalar value to normalizedRayIntensity coefficient and // accumulate normalizedRayIntensity normalizedRayIntensity -= - sampleDistance * getOpacityFromTexture(value.r, 0, 0.5); + sampleDistance * getRadonOpacity(value); posVC += stepVC; stepsTraveled++; } + if ((raySteps - stepsTraveled) > 0.0) { + vec3 endPosIS = clamp( + posVCtoIS(rayOriginVC + maxDistance * rayDirVC), + vec3(0.0), vec3(1.0)); + vec4 endValue = getTextureValue(endPosIS); + normalizedRayIntensity -= + (raySteps - stepsTraveled) * sampleDistance * getRadonOpacity(endValue); + } + // map normalizedRayIntensity to color gl_FragData[0] = - vec4(getColorFromTexture(normalizedRayIntensity, 0, 0.5), 1.0); + vec4(getRadonColor(normalizedRayIntensity), 1.0); #endif #if vtkBlendMode == LABELMAP_EDGE_PROJECTION_BLEND @@ -2415,13 +2853,39 @@ void main() { // Perform the blending operation along the ray applyBlend(rayOriginVC, rayDirVC, rayStartEndDistancesVC[0], rayStartEndDistancesVC[1]); } -`;const{vtkWarningMacro:k8,vtkErrorMacro:Gh}=Dt,V8={idxToView:Te(new Float64Array(16)),vecISToVCMatrix:It(new Float64Array(9)),modelToView:Te(new Float64Array(16)),projectionToView:Te(new Float64Array(16)),projectionToWorld:Te(new Float64Array(16))};function A8(t,e){e.classHierarchy.push("vtkOpenGLVolumeMapper");function a(l,p){const u=l.getIndependentComponents(),f=l.getColorMixPreset();return u&&p>=2||!!f}function n(l){return l.getUseLabelOutline()||e.renderable.getBlendMode()===Ro.LABELMAP_EDGE_PROJECTION_BLEND}const r=new Map;function i(l,p){if(!p)return;const f=(r.get(p)??0)-1;f<=0?(l.unregisterGraphicsResourceUser(p,t),r.delete(p)):r.set(p,f)}function o(l,p){if(!p)return;const u=r.get(p)??0,f=u+1;r.set(p,f),u<=0&&l.registerGraphicsResourceUser(p,t)}function s(l,p,u){p!==u&&(i(l,p),o(l,u))}function c(l){[...r.keys()].forEach(p=>l.unregisterGraphicsResourceUser(p,t))}t.buildPass=()=>{e.zBufferTexture=null},t.zBufferPass=(l,p)=>{if(l){const u=p.getZBufferTexture();u!==e.zBufferTexture&&(e.zBufferTexture=u)}},t.opaqueZBufferPass=(l,p)=>t.zBufferPass(l,p),t.volumePass=(l,p)=>{if(l){const u=e._openGLRenderWindow;e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),u&&!u.isDeleted()&&u!==e._openGLRenderWindow&&c(u),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow),e.jitterTexture.setOpenGLRenderWindow(e._openGLRenderWindow),e.framebuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.openGLVolume=t.getFirstAncestorOfType("vtkOpenGLVolume");const f=e.openGLVolume.getRenderable();e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const h=e._openGLRenderer.getRenderable();e.openGLCamera=e._openGLRenderer.getViewNodeFor(h.getActiveCamera(),e.openGLCamera),t.renderPiece(h,f)}},t.getShaderTemplate=(l,p,u)=>{l.Vertex=L8,l.Fragment=F8,l.Geometry=""},t.replaceShaderValues=(l,p,u)=>{let f=l.Fragment;f=Q.substitute(f,"//VTK::EnabledColorFunctions",`#define EnableColorForValueFunctionId${e.previousState.colorForValueFunctionId}`).result;const h=[];e.previousState.surfaceLightingEnabled&&h.push("Surface"),e.previousState.volumeLightingEnabled&&h.push("Volume"),f=Q.substitute(f,"//VTK::EnabledLightings",h.map(v=>`#define Enable${v}Lighting`)).result,e.previousState.multiTexturePerVolumeEnabled&&(f=Q.substitute(f,"//VTK::EnabledMultiTexturePerVolume","#define EnabledMultiTexturePerVolume").result),e.previousState.useIndependentComponents&&(f=Q.substitute(f,"//VTK::EnabledIndependentComponents","#define EnabledIndependentComponents").result),e.previousState.gradientOpacityEnabled&&(f=Q.substitute(f,"//VTK::EnabledGradientOpacity","#define EnabledGradientOpacity").result),f=Q.substitute(f,"//VTK::vtkProportionalComponents",e.previousState.proportionalComponents.map(v=>`#define vtkComponent${v}Proportional`).join(` -`)).result,f=Q.substitute(f,"//VTK::vtkForceNearestComponents",e.previousState.forceNearestComponents.map(v=>`#define vtkComponent${v}ForceNearest`).join(` -`)).result,e.previousState.hasZBufferTexture&&(f=Q.substitute(f,"//VTK::ZBuffer::Dec",["uniform sampler2D zBufferTexture;","uniform float vpZWidth;","uniform float vpZHeight;"]).result,f=Q.substitute(f,"//VTK::ZBuffer::Impl",["vec4 depthVec = texture2D(zBufferTexture, vec2(gl_FragCoord.x / vpZWidth, gl_FragCoord.y/vpZHeight));","float zdepth = (depthVec.r*256.0 + depthVec.g)/257.0;","zdepth = zdepth * 2.0 - 1.0;","if (cameraParallel == 0) {","zdepth = -2.0 * camFar * camNear / (zdepth*(camFar-camNear)-(camFar+camNear)) - camNear;}","else {",`zdepth = (zdepth + 1.0) * 0.5 * (camFar - camNear);} -`,"zdepth = -zdepth/rayDirVC.z;","dists.y = min(zdepth,dists.y);"]).result),f=Q.substitute(f,"//VTK::BlendMode",`${e.previousState.blendMode}`).result,f=Q.substitute(f,"//VTK::NumberOfLights",`${e.previousState.numberOfLights}`).result,f=Q.substitute(f,"//VTK::MaxLaoKernelSize",`${e.previousState.maxLaoKernelSize}`).result,f=Q.substitute(f,"//VTK::NumberOfComponents",`${e.previousState.numberOfComponents}`).result,f=Q.substitute(f,"//VTK::MaximumNumberOfSamples",`${e.previousState.maximumNumberOfSamples}`).result,l.Fragment=f;const d=e.previousState.numberOfClippingPlanes;d>0&&(f=Q.substitute(f,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","uniform vec3 vClipPlaneOrigins[6];","uniform int clip_numPlanes;","//VTK::ClipPlane::Dec","#define vtkClippingPlanesOn"],!1).result,f=Q.substitute(f,"//VTK::ClipPlane::Impl",[`for(int i = 0; i < ${d}; i++) {`," float rayDirRatio = dot(rayDirVC, vClipPlaneNormals[i]);"," float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];"," if (rayDirRatio == 0.0)"," {"," if (equationResult < 0.0) dists.x = dists.y;"," continue;"," }"," float result = -1.0 * equationResult / rayDirRatio;"," if (rayDirRatio < 0.0) dists.y = min(dists.y, result);"," else dists.x = max(dists.x, result);","}","//VTK::ClipPlane::Impl"],!1).result),l.Fragment=f},t.getNeedToRebuildShaders=(l,p,u)=>{var K,Y,q;const f=!!e.zBufferTexture,h=e.currentValidInputs.length,d=e.numberOfLights,v=e.numberOfComponents,m=e.useIndependentComponents,x=u.getProperties(),y=e.currentValidInputs[0],g=x[y.inputIndex],C=h>1,S=y.imageData.getBounds(),T=we.getDiagonalLength(S),w=Math.ceil(T/t.getCurrentSampleDistance(p));w>e.renderable.getMaximumSamplesPerRay()&&k8(`The number of steps required ${w} is larger than the specified maximum number of steps ${e.renderable.getMaximumSamplesPerRay()}. -Please either change the volumeMapper sampleDistance or its maximum number of samples.`);const _=m?v:1;let E=!1;for(let Z=0;Z<_;++Z)if(g.getUseGradientOpacity(Z)){E=!0;break}let D=0;const O=g.getLAOKernelSize();O>D&&g.getLocalAmbientOcclusion()&&g.getAmbient()>0&&(D=O);const M=e.renderable.getClippingPlanes().length,N=(K=e.renderable.getViewSpecificProperties().OpenGL)==null?void 0:K.ShaderReplacements,R=(Y=e.currentRenderPass)==null?void 0:Y.getShaderReplacement(),B=e.renderable.getBlendMode(),I=(()=>{if(B!==Ro.LABELMAP_EDGE_PROJECTION_BLEND&&n(g))return 5;if(m)switch(g.getColorMixPreset()){case No.ADDITIVE:return 1;case No.COLORIZE:return 2;case No.CUSTOM:return 3;default:return 4}return 0})(),P=g.getVolumetricScatteringBlending()<1,L=g.getVolumetricScatteringBlending()>0;let k=!1;for(let Z=0;Z{if(t.getNeedToRebuildShaders(l,p,u)){const f={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(f,p,u);const h=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(f.Vertex,f.Fragment,f.Geometry);h!==l.getProgram()&&(l.setProgram(h),l.getVAO().releaseGraphicsResources()),l.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(l.getProgram());l.getVAO().bind(),t.setMapperShaderParameters(l,p,u),t.setCameraShaderParameters(l,p,u),t.setPropertyShaderParameters(l,p,u),t.getClippingPlaneShaderParameters(l,p,u)},t.setMapperShaderParameters=(l,p,u)=>{const f=l.getProgram();l.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>l.getAttributeUpdateTime().getMTime()||l.getShaderSourceTime().getMTime()>l.getAttributeUpdateTime().getMTime())&&(f.isAttributeUsed("vertexDC")&&(l.getVAO().addAttributeArray(f,l.getCABO(),"vertexDC",l.getCABO().getVertexOffset(),l.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||Gh("Error setting vertexDC in shader VAO.")),l.getAttributeUpdateTime().modified());const h=t.getCurrentSampleDistance(p);f.setUniformf("sampleDistance",h);const d=h*e.renderable.getVolumeShadowSamplingDistFactor();f.setUniformf("volumeShadowSampleDistance",d),e.scalarTextures.forEach((w,_)=>{f.setUniformi(`volumeTexture[${_}]`,w.getTextureUnit())});const v=u.getProperties(),m=e.currentValidInputs[0],y=v[m.inputIndex].getIpScalarRange(),g=new Float32Array(4),C=new Float32Array(4),S=(w,_,E)=>{var D;(D=_==null?void 0:_.dataComputedScale)!=null&&D.length&&(g[w]=y[0]*_.dataComputedScale[E]+_.dataComputedOffset[E],C[w]=y[1]*_.dataComputedScale[E]+_.dataComputedOffset[E],g[w]=(g[w]-_.offset[E])/_.scale[E],C[w]=(C[w]-_.offset[E])/_.scale[E])};if(e.previousState.multiTexturePerVolumeEnabled)e.scalarTextures.forEach((w,_)=>{const E=w.getVolumeInfo();S(_,E,0)});else{const w=e.scalarTextures[0].getVolumeInfo();for(let _=0;_<4;++_)S(_,w,_)}const T="volume";if(f.setUniform4f(`${T}.ipScalarRangeMin`,g[0],g[1],g[2],g[3]),f.setUniform4f(`${T}.ipScalarRangeMax`,C[0],C[1],C[2],C[3]),e.zBufferTexture!==null){f.setUniformi("zBufferTexture",e.zBufferTexture.getTextureUnit());const w=e._useSmallViewport?[e._smallViewportWidth,e._smallViewportHeight]:e._openGLRenderWindow.getFramebufferSize();f.setUniformf("vpZWidth",w[0]),f.setUniformf("vpZHeight",w[1])}},t.setCameraShaderParameters=(l,p,u)=>{const{idxToView:f,vecISToVCMatrix:h,modelToView:d,projectionToView:v,projectionToWorld:m}=V8,x=e.openGLCamera.getKeyMatrices(p),y=e.openGLVolume.getKeyMatrices();Ee(d,x.wcvc,y.mcwc);const g=l.getProgram(),C=e.openGLCamera.getRenderable(),S=C.getParallelProjection(),T=C.getClippingRange();g.setUniformf("camThick",T[1]-T[0]),g.setUniformf("camNear",T[0]),g.setUniformf("camFar",T[1]),g.setUniformi("cameraParallel",S);const w=e.currentValidInputs[0],_=w.imageData.getBounds(),D=we.getCorners(_,[]).map(F=>{if(_e(F,F,d),!S){const b=-T[0]/(F[2]*ya(F));Kt(F,F,b)}return _e(F,F,x.vcpc),F}),O=we.addPoints([...we.INIT_BOUNDS],D);g.setUniformf("dcxmin",O[0]),g.setUniformf("dcxmax",O[1]),g.setUniformf("dcymin",O[2]),g.setUniformf("dcymax",O[3]);const M=t.getRenderTargetSize();g.setUniformf("vpWidth",M[0]),g.setUniformf("vpHeight",M[1]);const N=t.getRenderTargetOffset();g.setUniformf("vpOffsetX",N[0]/M[0]),g.setUniformf("vpOffsetY",N[1]/M[1]),Et(v,x.vcpc),g.setUniformMatrix("PCVCMatrix",v),g.setUniformi("twoSidedLighting",p.getTwoSidedLighting());const R=new Array(2*e.previousState.maxLaoKernelSize);for(let F=0;F0){let F=0;p.getLights().forEach(b=>{if(b.getSwitch()>0){const G=`lights[${F}]`,U=b.getColor(),z=b.getIntensity(),W=Kt([],U,z);g.setUniform3fv(`${G}.color`,W);const $=b.getTransformedPosition();_e($,$,d),g.setUniform3fv(`${G}.positionVC`,$);const J=[...b.getDirection()];Ei(J,J,x.normalMatrix),cn(J,J),g.setUniform3fv(`${G}.directionVC`,J);const ne=[-.5*J[0],-.5*J[1],-.5*(J[2]-1)];g.setUniform3fv(`${G}.halfAngleVC`,ne);const oe=b.getAttenuationValues();g.setUniform3fv(`${G}.attenuation`,oe);const ue=b.getExponent();g.setUniformf(`${G}.exponent`,ue);const Ce=b.getConeAngle();g.setUniformf(`${G}.coneAngle`,Ce);const ye=b.getPositional();g.setUniformi(`${G}.isPositional`,ye),F++}})}const B="volume",P=u.getProperties()[w.inputIndex],L=w.imageData,k=L.getSpatialExtent(),A=L.getSpacing(),j=L.getDimensions(),H=L.getIndexToWorld(),K=L.getWorldToIndex(),Y=L.getDirectionByReference();Ee(f,d,H),g.setUniform3fv(`${B}.spacing`,A);const q=wi([],A);g.setUniform3fv(`${B}.inverseSpacing`,q),g.setUniform3iv(`${B}.dimensions`,j),g.setUniform3fv(`${B}.inverseDimensions`,wi([],j)),g.setUniformMatrix(`${B}.worldToIndex`,K),h.fill(0);const Z=su(new Float64Array(3),j,A);h[0]=Z[0],h[4]=Z[1],h[8]=Z[2],Qn(h,Y,h),Qn(h,y.normalMatrix,h),Qn(h,x.normalMatrix,h),g.setUniformMatrix3x3(`${B}.vecISToVCMatrix`,h),g.setUniformMatrix3x3(`${B}.vecVCToISMatrix`,Tn(new Float32Array(9),h));const re=Ci(k[0],k[2],k[4]),ae=_e(new Float64Array(3),re,f);g.setUniform3fv(`${B}.originVC`,ae);const ee=ya(Z);if(g.setUniformf(`${B}.diagonalLength`,ee),n(P)){const F=C.getDistance();C.setClippingRange(F,F+.1);const b=e.openGLCamera.getKeyMatrices(p);Et(m,b.wcpc),C.setClippingRange(T[0],T[1]),e.openGLCamera.getKeyMatrices(p),g.setUniformMatrix(`${B}.PCWCMatrix`,m)}if(P.getVolumetricScatteringBlending()>0&&(g.setUniformf(`${B}.globalIlluminationReach`,P.getGlobalIlluminationReach()),g.setUniformf(`${B}.volumetricScatteringBlending`,P.getVolumetricScatteringBlending()),g.setUniformf(`${B}.anisotropy`,P.getAnisotropy()),g.setUniformf(`${B}.anisotropySquared`,P.getAnisotropy()**2)),P.getLocalAmbientOcclusion()&&P.getAmbient()>0){const F=P.getLAOKernelSize();g.setUniformi(`${B}.kernelSize`,F);const b=P.getLAOKernelRadius();g.setUniformi(`${B}.kernelRadius`,b)}else g.setUniformi(`${B}.kernelSize`,0)},t.setPropertyShaderParameters=(l,p,u)=>{const f=l.getProgram();f.setUniformi("jtexture",e.jitterTexture.getTextureUnit());const h=u.getProperties();f.setUniformi("labelOutlineThicknessTexture",e.labelOutlineThicknessTexture.getTextureUnit()),f.setUniformi("opacityTexture",e.opacityTexture.getTextureUnit()),f.setUniformi("colorTexture",e.colorTexture.getTextureUnit());const d="volume",v=e.currentValidInputs[0],m=h[v.inputIndex],x=e.previousState.numberOfComponents,y=e.previousState.useIndependentComponents;if(y){const D=new Float32Array(4);for(let N=0;N0){f.setUniformf(`${d}.ambient`,m.getAmbient()),f.setUniformf(`${d}.diffuse`,m.getDiffuse()),f.setUniformf(`${d}.specular`,m.getSpecular());const D=m.getSpecularPower();f.setUniformf(`${d}.specularPower`,D===0?1:D)}},t.getClippingPlaneShaderParameters=(l,p,u)=>{if(e.renderable.getClippingPlanes().length>0){const f=e.openGLCamera.getKeyMatrices(p),h=[],d=[],v=[],m=e.renderable.getClippingPlanes(),x=m.length;for(let g=0;g{e._animationRateSubscription&&(e._animationRateSubscription.unsubscribe(),e._animationRateSubscription=null)},()=>{e._openGLRenderWindow&&c(e._openGLRenderWindow)},t.delete),t.getRenderTargetSize=()=>{if(e._useSmallViewport)return[e._smallViewportWidth,e._smallViewportHeight];const{usize:l,vsize:p}=e._openGLRenderer.getTiledSizeAndOrigin();return[l,p]},t.getRenderTargetOffset=()=>{const{lowerLeftU:l,lowerLeftV:p}=e._openGLRenderer.getTiledSizeAndOrigin();return[l,p]},t.getCurrentSampleDistance=l=>{const p=l.getVTKWindow().getInteractor(),u=e.renderable.getSampleDistance();if(p.isAnimating()){const f=e.renderable.getInteractionSampleDistanceFactor();return u*f}return u},t.renderPieceStart=(l,p)=>{const u=l.getVTKWindow().getInteractor();if(e._lastScale||(e._lastScale=e.renderable.getInitialInteractionScale()),e._useSmallViewport=!1,u.isAnimating()&&e._lastScale>1.5&&(e._useSmallViewport=!0),e._animationRateSubscription||(e._animationRateSubscription=u.onAnimationFrameRateUpdate(()=>{if(e.renderable.getAutoAdjustSampleDistances()){const h=u.getRecentAnimationFrameRate(),d=u.getDesiredUpdateRate()/h;(d>1.15||d<.85)&&(e._lastScale*=d),e._lastScale>400&&(e._lastScale=400),e._lastScale<1.5&&(e._lastScale=1.5)}else e._lastScale=e.renderable.getImageSampleDistance()*e.renderable.getImageSampleDistance()})),e._useSmallViewport){const h=e._openGLRenderWindow.getFramebufferSize(),d=1/Math.sqrt(e._lastScale);if(e._smallViewportWidth=Math.ceil(d*h[0]),e._smallViewportHeight=Math.ceil(d*h[1]),e._smallViewportHeight>h[1]&&(e._smallViewportHeight=h[1]),e._smallViewportWidth>h[0]&&(e._smallViewportWidth=h[0]),e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.getGLFramebuffer()===null)e.framebuffer.create(h[0],h[1]),e.framebuffer.populateFramebuffer();else{const m=e.framebuffer.getSize();(!m||m[0]!==h[0]||m[1]!==h[1])&&(e.framebuffer.create(h[0],h[1]),e.framebuffer.populateFramebuffer())}e.framebuffer.bind();const v=e.context;v.clearColor(0,0,0,0),v.colorMask(!0,!0,!0,!0),v.clear(v.COLOR_BUFFER_BIT),v.viewport(0,0,e._smallViewportWidth,e._smallViewportHeight),e.fvp=[e._smallViewportWidth/h[0],e._smallViewportHeight/h[1]]}e.context.disable(e.context.DEPTH_TEST),t.updateBufferObjects(l,p);const f=p.getProperties();e.currentValidInputs.forEach(h=>{let{inputIndex:d}=h;const m=f[d].getInterpolationType(),x=e.scalarTextures[d];m===Ah.NEAREST?(x.setMinificationFilter(me.NEAREST),x.setMagnificationFilter(me.NEAREST)):(x.setMinificationFilter(me.LINEAR),x.setMagnificationFilter(me.LINEAR))}),e.zBufferTexture!==null&&e.zBufferTexture.activate()},t.renderPieceDraw=(l,p)=>{const u=e.context,f=[...e.scalarTextures,e.colorTexture,e.opacityTexture,e.labelOutlineThicknessTexture,e.jitterTexture];f.forEach(h=>h.activate()),t.updateShaders(e.tris,l,p),u.drawArrays(u.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release(),f.forEach(h=>h.deactivate())},t.renderPieceFinish=(l,p)=>{if(e.zBufferTexture!==null&&e.zBufferTexture.deactivate(),e._useSmallViewport){if(e.framebuffer.restorePreviousBindingsAndBuffers(),e.copyShader===null){e.copyShader=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","uniform vec2 tfactor;","varying vec2 tcoord;","void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }"].join(` +`,{vtkWarningMacro:b7,vtkErrorMacro:ac}=bt,M7={idxToView:we(new Float64Array(16)),vecISToVCMatrix:zt(new Float64Array(9)),modelToView:we(new Float64Array(16)),projectionToView:we(new Float64Array(16)),projectionToWorld:we(new Float64Array(16))};function N7(t,e){e.classHierarchy.push("vtkOpenGLVolumeMapper");function a(c,p){const l=c.getIndependentComponents(),f=c.getColorMixPreset();return l&&p>=2||!!f}function n(c){return c.getUseLabelOutline()||e.renderable.getBlendMode()===Bo.LABELMAP_EDGE_PROJECTION_BLEND}const r=new Map;function i(c,p){if(!p)return;const l=(r.get(p)??0)-1;l<=0?(c.unregisterGraphicsResourceUser(p,t),r.delete(p)):r.set(p,l)}function o(c,p){if(!p)return;const l=r.get(p)??0,f=l+1;r.set(p,f),l<=0&&c.registerGraphicsResourceUser(p,t)}function s(c,p,l){p!==l&&(i(c,p),o(c,l))}function u(c){[...r.keys()].forEach(p=>c.unregisterGraphicsResourceUser(p,t))}t.buildPass=()=>{e.zBufferTexture=null},t.zBufferPass=(c,p)=>{if(c){const l=p.getZBufferTexture();l!==e.zBufferTexture&&(e.zBufferTexture=l)}},t.opaqueZBufferPass=(c,p)=>t.zBufferPass(c,p),t.volumePass=(c,p)=>{if(c){const l=e._openGLRenderWindow;e._openGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),l&&!l.isDeleted()&&l!==e._openGLRenderWindow&&u(l),e.context=e._openGLRenderWindow.getContext(),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow),e.jitterTexture.setOpenGLRenderWindow(e._openGLRenderWindow),e.framebuffer.setOpenGLRenderWindow(e._openGLRenderWindow),e.openGLVolume=t.getFirstAncestorOfType("vtkOpenGLVolume");const f=e.openGLVolume.getRenderable();e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const h=e._openGLRenderer.getRenderable();e.openGLCamera=e._openGLRenderer.getViewNodeFor(h.getActiveCamera(),e.openGLCamera),t.renderPiece(h,f)}},t.getShaderTemplate=(c,p,l)=>{c.Vertex=D7,c.Fragment=O7,c.Geometry=""},t.replaceShaderValues=(c,p,l)=>{let f=c.Fragment;f=Z.substitute(f,"//VTK::EnabledColorFunctions",`#define EnableColorForValueFunctionId${e.previousState.colorForValueFunctionId}`).result;const h=[];e.previousState.surfaceLightingEnabled&&h.push("Surface"),e.previousState.volumeLightingEnabled&&h.push("Volume"),f=Z.substitute(f,"//VTK::EnabledLightings",h.map(m=>`#define Enable${m}Lighting`)).result,e.previousState.multiTexturePerVolumeEnabled&&(f=Z.substitute(f,"//VTK::EnabledMultiTexturePerVolume","#define EnabledMultiTexturePerVolume").result),e.previousState.useIndependentComponents&&(f=Z.substitute(f,"//VTK::EnabledIndependentComponents","#define EnabledIndependentComponents").result),e.previousState.gradientOpacityEnabled&&(f=Z.substitute(f,"//VTK::EnabledGradientOpacity","#define EnabledGradientOpacity").result),f=Z.substitute(f,"//VTK::vtkProportionalComponents",e.previousState.proportionalComponents.map(m=>`#define vtkComponent${m}Proportional`).join(` +`)).result,f=Z.substitute(f,"//VTK::vtkForceNearestComponents",e.previousState.forceNearestComponents.map(m=>`#define vtkComponent${m}ForceNearest`).join(` +`)).result,e.previousState.hasZBufferTexture&&(f=Z.substitute(f,"//VTK::ZBuffer::Dec",["uniform sampler2D zBufferTexture;","uniform float vpZWidth;","uniform float vpZHeight;"]).result,f=Z.substitute(f,"//VTK::ZBuffer::Impl",["vec4 depthVec = texture2D(zBufferTexture, vec2(gl_FragCoord.x / vpZWidth, gl_FragCoord.y/vpZHeight));","float zdepth = (depthVec.r*256.0 + depthVec.g)/257.0;","zdepth = zdepth * 2.0 - 1.0;","if (cameraParallel == 0) {","zdepth = -2.0 * camFar * camNear / (zdepth*(camFar-camNear)-(camFar+camNear)) - camNear;}","else {",`zdepth = (zdepth + 1.0) * 0.5 * (camFar - camNear);} +`,"zdepth = -zdepth/rayDirVC.z;","dists.y = min(zdepth,dists.y);"]).result),f=Z.substitute(f,"//VTK::BlendMode",`${e.previousState.blendMode}`).result,f=Z.substitute(f,"//VTK::NumberOfLights",`${e.previousState.numberOfLights}`).result,f=Z.substitute(f,"//VTK::MaxLaoKernelSize",`${e.previousState.maxLaoKernelSize}`).result,f=Z.substitute(f,"//VTK::NumberOfComponents",`${e.previousState.numberOfComponents}`).result,f=Z.substitute(f,"//VTK::MaximumNumberOfSamples",`${e.previousState.maximumNumberOfSamples}`).result,c.Fragment=f;const v=e.previousState.numberOfClippingPlanes;v>0&&(f=Z.substitute(f,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","uniform vec3 vClipPlaneOrigins[6];","uniform int clip_numPlanes;","//VTK::ClipPlane::Dec","#define vtkClippingPlanesOn"],!1).result,f=Z.substitute(f,"//VTK::ClipPlane::Impl",[`for(int i = 0; i < ${v}; i++) {`," float rayDirRatio = dot(rayDirVC, vClipPlaneNormals[i]);"," float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];"," if (rayDirRatio == 0.0)"," {"," if (equationResult < 0.0) dists.x = dists.y;"," continue;"," }"," float result = -1.0 * equationResult / rayDirRatio;"," if (rayDirRatio < 0.0) dists.y = min(dists.y, result);"," else dists.x = max(dists.x, result);","}","//VTK::ClipPlane::Impl"],!1).result),c.Fragment=f},t.getNeedToRebuildShaders=(c,p,l)=>{var X,Y,q;const f=!!e.zBufferTexture,h=e.currentValidInputs.length,v=e.numberOfLights,m=e.numberOfComponents,x=e.useIndependentComponents,y=l.getProperties(),d=e.currentValidInputs[0],g=y[d.inputIndex],C=h>1,S=d.imageData.getBounds(),T=de.getDiagonalLength(S),w=Math.ceil(T/t.getCurrentSampleDistance(p));w>e.renderable.getMaximumSamplesPerRay()&&b7(`The number of steps required ${w} is larger than the specified maximum number of steps ${e.renderable.getMaximumSamplesPerRay()}. +Please either change the volumeMapper sampleDistance or its maximum number of samples.`);const _=x?m:1;let E=!1;for(let Q=0;Q<_;++Q)if(g.getUseGradientOpacity(Q)){E=!0;break}let D=0;const O=g.getLAOKernelSize();O>D&&g.getLocalAmbientOcclusion()&&g.getAmbient()>0&&(D=O);const b=e.renderable.getClippingPlanes().length,R=(X=e.renderable.getViewSpecificProperties().OpenGL)==null?void 0:X.ShaderReplacements,N=(Y=e.currentRenderPass)==null?void 0:Y.getShaderReplacement(),L=e.renderable.getBlendMode(),B=(()=>{if(L!==Bo.LABELMAP_EDGE_PROJECTION_BLEND&&n(g))return 5;if(x)switch(g.getColorMixPreset()){case Vo.ADDITIVE:return 1;case Vo.COLORIZE:return 2;case Vo.CUSTOM:return 3;default:return 4}return 0})(),P=g.getVolumetricScatteringBlending()<1,F=g.getVolumetricScatteringBlending()>0;let k=!1;for(let Q=0;Q{if(t.getNeedToRebuildShaders(c,p,l)){const f={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(f,p,l);const h=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(f.Vertex,f.Fragment,f.Geometry);if(!h)return ac("Error compiling volume mapper shader program."),c.setProgram(null),!1;h!==c.getProgram()&&(c.setProgram(h),c.getVAO().releaseGraphicsResources()),c.getShaderSourceTime().modified()}else if(!e._openGLRenderWindow.getShaderCache().readyShaderProgram(c.getProgram()))return c.setProgram(null),!1;return c.getVAO().bind(),t.setMapperShaderParameters(c,p,l),t.setCameraShaderParameters(c,p,l),t.setPropertyShaderParameters(c,p,l),t.getClippingPlaneShaderParameters(c,p,l),!0},t.setMapperShaderParameters=(c,p,l)=>{const f=c.getProgram();if(!f)return;c.getCABO().getElementCount()&&(e.VBOBuildTime.getMTime()>c.getAttributeUpdateTime().getMTime()||c.getShaderSourceTime().getMTime()>c.getAttributeUpdateTime().getMTime())&&(f.isAttributeUsed("vertexDC")&&(c.getVAO().addAttributeArray(f,c.getCABO(),"vertexDC",c.getCABO().getVertexOffset(),c.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||ac("Error setting vertexDC in shader VAO.")),c.getAttributeUpdateTime().modified());const h=t.getCurrentSampleDistance(p);f.setUniformf("sampleDistance",h);const v=h*e.renderable.getVolumeShadowSamplingDistFactor();f.setUniformf("volumeShadowSampleDistance",v),e.scalarTextures.forEach((C,S)=>{f.setUniformi(`volumeTexture[${S}]`,C.getTextureUnit())});const m=l.getProperties()[e.currentValidInputs[0].inputIndex].getIpScalarRange(),x=new Float32Array(4),y=new Float32Array(4),d=(C,S,T)=>{var w;(w=S==null?void 0:S.dataComputedScale)!=null&&w.length&&(x[C]=m[0]*S.dataComputedScale[T]+S.dataComputedOffset[T],y[C]=m[1]*S.dataComputedScale[T]+S.dataComputedOffset[T],x[C]=(x[C]-S.offset[T])/S.scale[T],y[C]=(y[C]-S.offset[T])/S.scale[T])};if(e.previousState.multiTexturePerVolumeEnabled)e.scalarTextures.forEach((C,S)=>{d(S,C.getVolumeInfo(),0)});else{const C=e.scalarTextures[0].getVolumeInfo();for(let S=0;S<4;++S)d(S,C,S)}const g="volume";if(f.setUniform4f(`${g}.ipScalarRangeMin`,x[0],x[1],x[2],x[3]),f.setUniform4f(`${g}.ipScalarRangeMax`,y[0],y[1],y[2],y[3]),e.zBufferTexture!==null){f.setUniformi("zBufferTexture",e.zBufferTexture.getTextureUnit());const C=e._useSmallViewport?[e._smallViewportWidth,e._smallViewportHeight]:e._openGLRenderWindow.getFramebufferSize();f.setUniformf("vpZWidth",C[0]),f.setUniformf("vpZHeight",C[1])}},t.setCameraShaderParameters=(c,p,l)=>{const{idxToView:f,vecISToVCMatrix:h,modelToView:v,projectionToView:m,projectionToWorld:x}=M7,y=e.openGLCamera.getKeyMatrices(p),d=e.openGLVolume.getKeyMatrices();Ee(v,y.wcvc,d.mcwc);const g=c.getProgram(),C=e.openGLCamera.getRenderable(),S=C.getParallelProjection(),T=C.getClippingRange();g.setUniformf("camThick",T[1]-T[0]),g.setUniformf("camNear",T[0]),g.setUniformf("camFar",T[1]),g.setUniformi("cameraParallel",S);const w=e.currentValidInputs[0],_=w.imageData.getBounds(),E=de.getCorners(_,[]).map(ne=>{if(_e(ne,ne,v),!S){const ee=-T[0]/(ne[2]*La(ne));Yt(ne,ne,ee)}return _e(ne,ne,y.vcpc),ne}),D=de.addPoints([...de.INIT_BOUNDS],E);g.setUniformf("dcxmin",D[0]),g.setUniformf("dcxmax",D[1]),g.setUniformf("dcymin",D[2]),g.setUniformf("dcymax",D[3]);const O=t.getRenderTargetSize();g.setUniformf("vpWidth",O[0]),g.setUniformf("vpHeight",O[1]);const b=t.getRenderTargetOffset();g.setUniformf("vpOffsetX",b[0]/O[0]),g.setUniformf("vpOffsetY",b[1]/O[1]),Et(m,y.vcpc),g.setUniformMatrix("PCVCMatrix",m),g.setUniformi("twoSidedLighting",p.getTwoSidedLighting());const R=new Array(2*e.previousState.maxLaoKernelSize);for(let ne=0;ne0){let ne=0;p.getLights().forEach(ee=>{if(ee.getSwitch()>0){const V=`lights[${ne}]`,M=ee.getColor(),I=ee.getIntensity(),U=Yt([],M,I);g.setUniform3fv(`${V}.color`,U);const z=ee.getTransformedPosition();_e(z,z,v),g.setUniform3fv(`${V}.positionVC`,z);const j=[...ee.getDirection()];Zr(j,j,y.normalMatrix),fn(j,j),g.setUniform3fv(`${V}.directionVC`,j);const $=[-.5*j[0],-.5*j[1],-.5*(j[2]-1)];g.setUniform3fv(`${V}.halfAngleVC`,$);const J=ee.getAttenuationValues();g.setUniform3fv(`${V}.attenuation`,J);const re=ee.getExponent();g.setUniformf(`${V}.exponent`,re);const oe=ee.getConeAngle();g.setUniformf(`${V}.coneAngle`,oe);const ue=ee.getPositional();g.setUniformi(`${V}.isPositional`,ue),ne++}})}const N="volume",L=l.getProperties()[w.inputIndex],B=w.imageData,P=B.getSpatialExtent(),F=B.getSpacing(),k=B.getDimensions(),G=B.getIndexToWorld(),W=B.getWorldToIndex(),H=B.getDirectionByReference();Ee(f,v,G),g.setUniform3fv(`${N}.spacing`,F);const X=Ki([],F);g.setUniform3fv(`${N}.inverseSpacing`,X),g.setUniform3iv(`${N}.dimensions`,k),g.setUniform3fv(`${N}.inverseDimensions`,Ki([],k)),g.setUniformMatrix(`${N}.worldToIndex`,W),h.fill(0);const Y=Bl(new Float64Array(3),k,F);h[0]=Y[0],h[4]=Y[1],h[8]=Y[2],fr(h,H,h),fr(h,d.normalMatrix,h),fr(h,y.normalMatrix,h),g.setUniformMatrix3x3(`${N}.vecISToVCMatrix`,h),g.setUniformMatrix3x3(`${N}.vecVCToISMatrix`,cn(new Float32Array(9),h));const q=ji(P[0],P[2],P[4]),Q=_e(new Float64Array(3),q,f);g.setUniform3fv(`${N}.originVC`,Q);const ae=La(Y);if(g.setUniformf(`${N}.diagonalLength`,ae),n(L)){const ne=C.getDistance();C.setClippingRange(ne,ne+.1);const ee=e.openGLCamera.getKeyMatrices(p);Et(x,ee.wcpc),C.setClippingRange(T[0],T[1]),e.openGLCamera.getKeyMatrices(p),g.setUniformMatrix(`${N}.PCWCMatrix`,x)}if(L.getVolumetricScatteringBlending()>0&&(g.setUniformf(`${N}.globalIlluminationReach`,L.getGlobalIlluminationReach()),g.setUniformf(`${N}.volumetricScatteringBlending`,L.getVolumetricScatteringBlending()),g.setUniformf(`${N}.anisotropy`,L.getAnisotropy()),g.setUniformf(`${N}.anisotropySquared`,L.getAnisotropy()**2)),L.getLocalAmbientOcclusion()&&L.getAmbient()>0){const ne=L.getLAOKernelSize();g.setUniformi(`${N}.kernelSize`,ne);const ee=L.getLAOKernelRadius();g.setUniformi(`${N}.kernelRadius`,ee)}else g.setUniformi(`${N}.kernelSize`,0)},t.setPropertyShaderParameters=(c,p,l)=>{const f=c.getProgram();f.setUniformi("jtexture",e.jitterTexture.getTextureUnit());const h=l.getProperties();f.setUniformi("labelOutlineThicknessTexture",e.labelOutlineThicknessTexture.getTextureUnit()),f.setUniformi("opacityTexture",e.opacityTexture.getTextureUnit()),f.setUniformi("colorTexture",e.colorTexture.getTextureUnit());const v="volume",m=h[e.currentValidInputs[0].inputIndex],x=e.previousState.numberOfComponents,y=e.previousState.useIndependentComponents;if(y){const E=new Float32Array(4);for(let b=0;b0){f.setUniformf(`${v}.ambient`,m.getAmbient()),f.setUniformf(`${v}.diffuse`,m.getDiffuse()),f.setUniformf(`${v}.specular`,m.getSpecular());const E=m.getSpecularPower();f.setUniformf(`${v}.specularPower`,E===0?1:E)}},t.getClippingPlaneShaderParameters=(c,p,l)=>{if(e.renderable.getClippingPlanes().length>0){const f=e.openGLCamera.getKeyMatrices(p),h=[],v=[],m=[],x=e.renderable.getClippingPlanes(),y=x.length;for(let g=0;g{e._animationRateSubscription&&(e._animationRateSubscription.unsubscribe(),e._animationRateSubscription=null)},()=>{e._openGLRenderWindow&&u(e._openGLRenderWindow)},t.delete),t.getRenderTargetSize=()=>{if(e._useSmallViewport)return[e._smallViewportWidth,e._smallViewportHeight];const{usize:c,vsize:p}=e._openGLRenderer.getTiledSizeAndOrigin();return[c,p]},t.getRenderTargetOffset=()=>{const{lowerLeftU:c,lowerLeftV:p}=e._openGLRenderer.getTiledSizeAndOrigin();return[c,p]},t.getCurrentSampleDistance=c=>{const p=c.getVTKWindow().getInteractor(),l=e.renderable.getSampleDistance();return p.isAnimating()?l*e.renderable.getInteractionSampleDistanceFactor():l},t.renderPieceStart=(c,p)=>{const l=c.getVTKWindow().getInteractor();if(e._lastScale||(e._lastScale=e.renderable.getInitialInteractionScale()),e._useSmallViewport=!1,l.isAnimating()&&e._lastScale>1.5&&(e._useSmallViewport=!0),e._animationRateSubscription||(e._animationRateSubscription=l.onAnimationFrameRateUpdate(()=>{if(e.renderable.getAutoAdjustSampleDistances()){const h=l.getRecentAnimationFrameRate(),v=l.getDesiredUpdateRate()/h;(v>1.15||v<.85)&&(e._lastScale*=v),e._lastScale>400&&(e._lastScale=400),e._lastScale<1.5&&(e._lastScale=1.5)}else e._lastScale=e.renderable.getImageSampleDistance()*e.renderable.getImageSampleDistance()})),e._useSmallViewport){const h=e._openGLRenderWindow.getFramebufferSize(),v=1/Math.sqrt(e._lastScale);if(e._smallViewportWidth=Math.ceil(v*h[0]),e._smallViewportHeight=Math.ceil(v*h[1]),e._smallViewportHeight>h[1]&&(e._smallViewportHeight=h[1]),e._smallViewportWidth>h[0]&&(e._smallViewportWidth=h[0]),e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.getGLFramebuffer()===null)e.framebuffer.create(h[0],h[1]),e.framebuffer.populateFramebuffer();else{const x=e.framebuffer.getSize();(!x||x[0]!==h[0]||x[1]!==h[1])&&(e.framebuffer.create(h[0],h[1]),e.framebuffer.populateFramebuffer())}e.framebuffer.bind();const m=e.context;m.clearColor(0,0,0,0),m.colorMask(!0,!0,!0,!0),m.clear(m.COLOR_BUFFER_BIT),m.viewport(0,0,e._smallViewportWidth,e._smallViewportHeight),e.fvp=[e._smallViewportWidth/h[0],e._smallViewportHeight/h[1]]}e.context.disable(e.context.DEPTH_TEST),t.updateBufferObjects(c,p);const f=p.getProperties();e.currentValidInputs.forEach(({inputIndex:h})=>{const v=f[h].getInterpolationType(),m=e.scalarTextures[h];v===X1.NEAREST?(m.setMinificationFilter(me.NEAREST),m.setMagnificationFilter(me.NEAREST)):(m.setMinificationFilter(me.LINEAR),m.setMagnificationFilter(me.LINEAR))}),e.zBufferTexture!==null&&e.zBufferTexture.activate()},t.renderPieceDraw=(c,p)=>{const l=e.context,f=[...e.scalarTextures,e.colorTexture,e.opacityTexture,e.labelOutlineThicknessTexture,e.jitterTexture];if(f.forEach(h=>h.activate()),!t.updateShaders(e.tris,c,p)){f.forEach(h=>h.deactivate());return}l.drawArrays(l.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release(),f.forEach(h=>h.deactivate())},t.renderPieceFinish=(c,p)=>{if(e.zBufferTexture!==null&&e.zBufferTexture.deactivate(),e._useSmallViewport){if(e.framebuffer.restorePreviousBindingsAndBuffers(),e.copyShader===null){e.copyShader=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","uniform vec2 tfactor;","varying vec2 tcoord;","void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }"].join(` `),["//VTK::System::Dec","//VTK::Output::Dec","uniform sampler2D texture1;","varying vec2 tcoord;","void main() { gl_FragData[0] = texture2D(texture1,tcoord); }"].join(` -`),"");const d=e.copyShader;e.copyVAO=ja.newInstance(),e.copyVAO.setOpenGLRenderWindow(e._openGLRenderWindow),e.tris.getCABO().bind(),e.copyVAO.addAttributeArray(d,e.tris.getCABO(),"vertexDC",e.tris.getCABO().getVertexOffset(),e.tris.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||Gh("Error setting vertexDC in copy shader VAO.")}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(e.copyShader);const u=e._openGLRenderWindow.getFramebufferSize();e.context.viewport(0,0,u[0],u[1]);const f=e.framebuffer.getColorTexture();f.activate(),e.copyShader.setUniformi("texture",f.getTextureUnit()),e.copyShader.setUniform2f("tfactor",e.fvp[0],e.fvp[1]);const h=e.context;h.blendFuncSeparate(h.ONE,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA),e.context.drawArrays(e.context.TRIANGLES,0,e.tris.getCABO().getElementCount()),f.deactivate(),h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA)}},t.renderPiece=(l,p)=>{t.invokeEvent({type:"StartEvent"}),e.renderable.update();const u=e.renderable.getNumberOfInputPorts();e.currentValidInputs=[];for(let h=0;h0){const h=p.getProperties(),d=e.currentValidInputs[0],m=d.imageData.getPointData().getScalars(),x=h[d.inputIndex];x.getShade()&&e.renderable.getBlendMode()===Ro.COMPOSITE_BLEND&&l.getLights().forEach(C=>{C.getSwitch()>0&&f++});const y=e.currentValidInputs.length,g=y>1;e.numberOfComponents=g?y:m.getNumberOfComponents(),e.useIndependentComponents=a(x,e.numberOfComponents)}f!==e.numberOfLights&&(e.numberOfLights=f,t.modified()),t.invokeEvent({type:"EndEvent"}),e.currentValidInputs.length!==0&&(t.renderPieceStart(l,p),t.renderPieceDraw(l,p),t.renderPieceFinish(l,p))},t.updateBufferObjects=(l,p)=>{t.getNeedToRebuildBufferObjects(l,p)&&t.buildBufferObjects(l,p)},t.getNeedToRebuildBufferObjects=(l,p)=>{var u,f,h,d,v;return e.VBOBuildTime.getMTime(){let{imageData:x}=m;return e.VBOBuildTime.getMTime()!!(m!=null&&m.getHandle()))||!((f=e.colorTexture)!=null&&f.getHandle())||!((h=e.opacityTexture)!=null&&h.getHandle())||!((d=e.labelOutlineThicknessTexture)!=null&&d.getHandle())||!((v=e.jitterTexture)!=null&&v.getHandle())},t.buildBufferObjects=(l,p)=>{var B,I,P;if(!e.jitterTexture.getHandle()){const L=new Float32Array(1024);for(let k=0;k<32*32;++k)L[k]=Math.random();e.jitterTexture.setMinificationFilter(me.NEAREST),e.jitterTexture.setMagnificationFilter(me.NEAREST),e.jitterTexture.create2DFromRaw({width:32,height:32,numComps:1,dataType:Ne.FLOAT,data:L})}const u=p.getProperties(),f=e.currentValidInputs[0],h=u[f.inputIndex],d=e.numberOfComponents,v=e.useIndependentComponents,m=v?d:1,x=[];for(let L=0;L{var ee;let{imageData:A,inputIndex:j}=L;const H=u[j],K=A.getPointData().getScalars(),Y=e._openGLRenderWindow.getGraphicsResourceForObject(K),q=X0(A,K),Z=!((ee=Y==null?void 0:Y.oglObject)!=null&&ee.getHandle())||(Y==null?void 0:Y.hash)!==q,re=H.getUpdatedExtents(),ae=!!re.length;if(Z&&!ae){const F=Re.newInstance();F.setOpenGLRenderWindow(e._openGLRenderWindow);const b=A.getDimensions();F.setOglNorm16Ext(e.context.getExtension("EXT_texture_norm16")),F.resetFormatAndType(),F.create3DFilterableFromDataArray({width:b[0],height:b[1],depth:b[2],dataArray:K,preferSizeOverAccuracy:H.getPreferSizeOverAccuracy()}),e._openGLRenderWindow.setGraphicsResourceForObject(K,F,q),e.scalarTextures[k]=F}else e.scalarTextures[k]=Y.oglObject;if(ae){H.setUpdatedExtents([]);const F=A.getDimensions();e.scalarTextures[k].create3DFilterableFromDataArray({width:F[0],height:F[1],depth:F[2],dataArray:K,updatedExtents:re})}s(e._openGLRenderWindow,e._scalarTexturesCore[k],K),e._scalarTexturesCore[k]=K});const O=h.getLabelOutlineThickness(),M=e._openGLRenderWindow.getGraphicsResourceForObject(O),N=O.join("-");if(!((P=M==null?void 0:M.oglObject)!=null&&P.getHandle())||(M==null?void 0:M.hash)!==N){const L=Re.newInstance();L.setOpenGLRenderWindow(e._openGLRenderWindow);let k=e.renderable.getLabelOutlineTextureWidth();k<=0&&(k=e.context.getParameter(e.context.MAX_TEXTURE_SIZE));const A=1,j=k*A,H=new Uint8Array(j);for(let K=0;K1?1:-1,L[H*3+2]=-1;const k=new Uint16Array(8);k[0]=3,k[1]=0,k[2]=1,k[3]=3,k[4]=3,k[5]=0,k[6]=3,k[7]=2;const A=pe.newInstance({numberOfComponents:3,values:L});A.setName("points");const j=pe.newInstance({numberOfComponents:1,values:k});e.tris.getCABO().createVBO(j,"polys",Jt.SURFACE,{points:A,cellOffset:0})}e.VBOBuildTime.modified()}}const B8={context:null,VBOBuildTime:null,scalarTextures:[],_scalarTexturesCore:[],opacityTexture:null,_opacityTextureCore:null,colorTexture:null,_colorTextureCore:null,labelOutlineThicknessTexture:null,_labelOutlineThicknessTextureCore:null,jitterTexture:null,tris:null,framebuffer:null,copyShader:null,copyVAO:null,lastXYF:1,targetXYF:1,zBufferTexture:null,lastZBufferTexture:null,fullViewportTime:1,idxToView:null,vecISToVCMatrix:null,modelToView:null,projectionToView:null,avgWindowArea:0,avgFrameTime:0};function U8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,B8,a),Ct.extend(t,e,a),mn.implementBuildShadersWithReplacements(t,e,a),e.VBOBuildTime={},ut(e.VBOBuildTime,{mtime:0}),e.tris=jt.newInstance(),e.jitterTexture=Re.newInstance(),e.jitterTexture.setWrapS(Wa.REPEAT),e.jitterTexture.setWrapT(Wa.REPEAT),e.framebuffer=Er.newInstance(),pt(t,e,["context"]),A8(t,e)}const G8=Je(U8,"vtkOpenGLVolumeMapper");st("vtkVolumeMapper",G8);const{vtkDebugMacro:I8}=Dt;function P8(t,e){e.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),t.opaquePass=(a,n)=>{e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow");const r=e._openGLRenderer.getAspectRatio(),i=e._openGLRenderer?e._openGLRenderer.getRenderable().getActiveCamera():null,o=e._openGLRenderer.getTiledSizeAndOrigin();let s=null;if(e.renderable.getUseZValues()){const c=n.getZBufferTexture(),l=Math.floor(c.getWidth()),p=Math.floor(c.getHeight()),u=e._openGLRenderWindow.getContext();c.bind();const f=n.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():I8("No framebuffer to save/restore");const h=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,h),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,c.getHandle(),0),u.checkFramebufferStatus(u.FRAMEBUFFER)===u.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(l*p*4),u.viewport(0,0,l,p),u.readPixels(0,0,l,p,u.RGBA,u.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),u.deleteFramebuffer(h)}e.renderable.invokeCallback(e.renderable.getInputData(),i,r,o,s)},t.queryPass=(a,n)=>{a&&e.renderable.getUseZValues()&&n.requestDepth()}}const z8={};function j8(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,z8,a),Ct.extend(t,e,a),P8(t,e)}const W8=Je(j8,"vtkOpenGLPixelSpaceCallbackMapper");st("vtkPixelSpaceCallbackMapper",W8);var $8=`//VTK::System::Dec +`),"");const v=e.copyShader;e.copyVAO=$a.newInstance(),e.copyVAO.setOpenGLRenderWindow(e._openGLRenderWindow),e.tris.getCABO().bind(),e.copyVAO.addAttributeArray(v,e.tris.getCABO(),"vertexDC",e.tris.getCABO().getVertexOffset(),e.tris.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE)||ac("Error setting vertexDC in copy shader VAO.")}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(e.copyShader);const l=e._openGLRenderWindow.getFramebufferSize();e.context.viewport(0,0,l[0],l[1]);const f=e.framebuffer.getColorTexture();f.activate(),e.copyShader.setUniformi("texture",f.getTextureUnit()),e.copyShader.setUniform2f("tfactor",e.fvp[0],e.fvp[1]);const h=e.context;h.blendFuncSeparate(h.ONE,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA),e.context.drawArrays(e.context.TRIANGLES,0,e.tris.getCABO().getElementCount()),f.deactivate(),h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA)}},t.renderPiece=(c,p)=>{t.invokeEvent({type:"StartEvent"}),e.renderable.update();const l=e.renderable.getNumberOfInputPorts();e.currentValidInputs=[];for(let h=0;h0){const h=p.getProperties(),v=e.currentValidInputs[0],m=v.imageData.getPointData().getScalars(),x=h[v.inputIndex];x.getShade()&&e.renderable.getBlendMode()===Bo.COMPOSITE_BLEND&&c.getLights().forEach(d=>{d.getSwitch()>0&&f++});const y=e.currentValidInputs.length;e.numberOfComponents=y>1?y:m.getNumberOfComponents(),e.useIndependentComponents=a(x,e.numberOfComponents)}f!==e.numberOfLights&&(e.numberOfLights=f,t.modified()),t.invokeEvent({type:"EndEvent"}),e.currentValidInputs.length!==0&&(t.renderPieceStart(c,p),t.renderPieceDraw(c,p),t.renderPieceFinish(c,p))},t.updateBufferObjects=(c,p)=>{t.getNeedToRebuildBufferObjects(c,p)&&t.buildBufferObjects(c,p)},t.getNeedToRebuildBufferObjects=(c,p)=>{var l,f,h,v,m;return e.VBOBuildTime.getMTime()e.VBOBuildTime.getMTime()!!(x!=null&&x.getHandle()))||!((f=e.colorTexture)!=null&&f.getHandle())||!((h=e.opacityTexture)!=null&&h.getHandle())||!((v=e.labelOutlineThicknessTexture)!=null&&v.getHandle())||!((m=e.jitterTexture)!=null&&m.getHandle())},t.buildBufferObjects=(c,p)=>{var O,b,R;if(!e.jitterTexture.getHandle()){const N=new Float32Array(1024);for(let L=0;L<1024;++L)N[L]=Math.random();e.jitterTexture.setMinificationFilter(me.NEAREST),e.jitterTexture.setMagnificationFilter(me.NEAREST),e.jitterTexture.create2DFromRaw({width:32,height:32,numComps:1,dataType:be.FLOAT,data:N})}const l=p.getProperties(),f=l[e.currentValidInputs[0].inputIndex],h=e.numberOfComponents,v=e.useIndependentComponents,m=v?h:1,x=[];for(let N=0;N{var Y;const P=l[L],F=N.getPointData().getScalars(),k=e._openGLRenderWindow.getGraphicsResourceForObject(F),G=ec(N,F),W=!((Y=k==null?void 0:k.oglObject)!=null&&Y.getHandle())||(k==null?void 0:k.hash)!==G,H=P.getUpdatedExtents(),X=!!H.length;if(W&&!X){const q=Ne.newInstance();q.setOpenGLRenderWindow(e._openGLRenderWindow);const Q=N.getDimensions();q.setOglNorm16Ext(e.context.getExtension("EXT_texture_norm16")),q.resetFormatAndType(),q.create3DFilterableFromDataArray({width:Q[0],height:Q[1],depth:Q[2],dataArray:F,preferSizeOverAccuracy:P.getPreferSizeOverAccuracy()}),e._openGLRenderWindow.setGraphicsResourceForObject(F,q,G),e.scalarTextures[B]=q}else e.scalarTextures[B]=k.oglObject;if(X){P.setUpdatedExtents([]);const q=N.getDimensions();e.scalarTextures[B].create3DFilterableFromDataArray({width:q[0],height:q[1],depth:q[2],dataArray:F,updatedExtents:H})}s(e._openGLRenderWindow,e._scalarTexturesCore[B],F),e._scalarTexturesCore[B]=F});const _=f.getLabelOutlineThickness(),E=e._openGLRenderWindow.getGraphicsResourceForObject(_),D=_.join("-");if(!((R=E==null?void 0:E.oglObject)!=null&&R.getHandle())||(E==null?void 0:E.hash)!==D){const N=Ne.newInstance();N.setOpenGLRenderWindow(e._openGLRenderWindow);let L=e.renderable.getLabelOutlineTextureWidth();L<=0&&(L=e.context.getParameter(e.context.MAX_TEXTURE_SIZE));const B=1,P=L*B,F=new Uint8Array(P);for(let k=0;k1?1:-1,N[F*3+2]=-1;const L=new Uint16Array(8);L[0]=3,L[1]=0,L[2]=1,L[3]=3,L[4]=3,L[5]=0,L[6]=3,L[7]=2;const B=pe.newInstance({numberOfComponents:3,values:N});B.setName("points");const P=pe.newInstance({numberOfComponents:1,values:L});e.tris.getCABO().createVBO(P,"polys",Jt.SURFACE,{points:B,cellOffset:0})}e.VBOBuildTime.modified()}}var R7={context:null,VBOBuildTime:null,scalarTextures:[],_scalarTexturesCore:[],opacityTexture:null,_opacityTextureCore:null,colorTexture:null,_colorTextureCore:null,labelOutlineThicknessTexture:null,_labelOutlineThicknessTextureCore:null,jitterTexture:null,tris:null,framebuffer:null,copyShader:null,copyVAO:null,lastXYF:1,targetXYF:1,zBufferTexture:null,lastZBufferTexture:null,fullViewportTime:1,idxToView:null,vecISToVCMatrix:null,modelToView:null,projectionToView:null,avgWindowArea:0,avgFrameTime:0};function L7(t,e,a={}){Object.assign(e,R7,a),Ct.extend(t,e,a),xn.implementBuildShadersWithReplacements(t,e,a),e.VBOBuildTime={},lt(e.VBOBuildTime,{mtime:0}),e.tris=jt.newInstance(),e.jitterTexture=Ne.newInstance(),e.jitterTexture.setWrapS(Ma.REPEAT),e.jitterTexture.setWrapT(Ma.REPEAT),e.framebuffer=Or.newInstance(),ht(t,e,["context"]),N7(t,e)}var F7=qe(L7,"vtkOpenGLVolumeMapper");ct("vtkVolumeMapper",F7);var Nr={MAX:0,MIN:1,AVERAGE:2},{vtkErrorMacro:Uo}=A;function k7(t,e){e.classHierarchy.push("vtkOpenGLImageCPRMapper");function a(n){[e._scalars,e._colorTransferFunc,e._pwFunc].forEach(r=>n.unregisterGraphicsResourceUser(r,t))}t.buildPass=n=>{if(n){e.currentRenderPass=null,e.openGLImageSlice=t.getFirstAncestorOfType("vtkOpenGLImageSlice"),e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer");const r=e._openGLRenderWindow;e._openGLRenderWindow=e._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),r&&!r.isDeleted()&&r!==e._openGLRenderWindow&&a(r),e.context=e._openGLRenderWindow.getContext(),e.openGLCamera=e._openGLRenderer.getViewNodeFor(e._openGLRenderer.getRenderable().getActiveCamera(),e.openGLCamera),e.tris.setOpenGLRenderWindow(e._openGLRenderWindow)}},t.opaquePass=(n,r)=>{n&&(e.currentRenderPass=r,t.render())},t.opaqueZBufferPass=n=>{n&&(e.haveSeenDepthRequest=!0,e.renderDepth=!0,t.render(),e.renderDepth=!1)},t.getCoincidentParameters=(n,r)=>e.renderable.getResolveCoincidentTopology()===Zt.PolygonOffset?e.renderable.getCoincidentTopologyPolygonOffsetParameters():null,t.render=()=>{const n=e.openGLImageSlice.getRenderable(),r=e._openGLRenderer.getRenderable();t.renderPiece(r,n)},t.renderPiece=(n,r)=>{t.invokeEvent({type:"StartEvent"}),e.renderable.update(),t.invokeEvent({type:"EndEvent"}),e.renderable.preRenderCheck()&&(e.currentImageDataInput=e.renderable.getInputData(0),e.currentCenterlineInput=e.renderable.getOrientedCenterline(),t.renderPieceStart(n,r),t.renderPieceDraw(n,r),t.renderPieceFinish(n,r))},t.renderPieceStart=(n,r)=>{t.updateBufferObjects(n,r)},t.renderPieceDraw=(n,r)=>{const i=e.context;e.volumeTexture.activate(),e.colorTexture.activate(),e.pwfTexture.activate(),e.tris.getCABO().getElementCount()&&(t.updateShaders(e.tris,n,r),i.drawArrays(i.TRIANGLES,0,e.tris.getCABO().getElementCount()),e.tris.getVAO().release()),e.volumeTexture.deactivate(),e.colorTexture.deactivate(),e.pwfTexture.deactivate()},t.renderPieceFinish=(n,r)=>{},t.updateBufferObjects=(n,r)=>{t.getNeedToRebuildBufferObjects(n,r)&&t.buildBufferObjects(n,r),r.getProperty().getInterpolationType()===br.NEAREST?(e.volumeTexture.setMinificationFilter(me.NEAREST),e.volumeTexture.setMagnificationFilter(me.NEAREST),e.colorTexture.setMinificationFilter(me.NEAREST),e.colorTexture.setMagnificationFilter(me.NEAREST),e.pwfTexture.setMinificationFilter(me.NEAREST),e.pwfTexture.setMagnificationFilter(me.NEAREST)):(e.volumeTexture.setMinificationFilter(me.LINEAR),e.volumeTexture.setMagnificationFilter(me.LINEAR),e.colorTexture.setMinificationFilter(me.LINEAR),e.colorTexture.setMagnificationFilter(me.LINEAR),e.pwfTexture.setMinificationFilter(me.LINEAR),e.pwfTexture.setMagnificationFilter(me.LINEAR))},t.getNeedToRebuildBufferObjects=(n,r)=>{var o;const i=e.VBOBuildTime.getMTime();return i{var O,b,R,N;const i=e.currentImageDataInput,o=e.currentCenterlineInput,s=r.getProperty(),u=(O=i==null?void 0:i.getPointData())==null?void 0:O.getScalars();if(!u)return;const c=e._openGLRenderWindow.getGraphicsResourceForObject(u),p=ec(i,u),l=!((b=c==null?void 0:c.oglObject)!=null&&b.getHandle())||(c==null?void 0:c.hash)!==p,f=s.getUpdatedExtents(),h=!!f.length;if(l){e.volumeTexture=Ne.newInstance(),e.volumeTexture.setOpenGLRenderWindow(e._openGLRenderWindow);const L=i.getDimensions();e.volumeTexture.setOglNorm16Ext(e.context.getExtension("EXT_texture_norm16")),e.volumeTexture.resetFormatAndType(),e.volumeTexture.create3DFilterableFromDataArray({width:L[0],height:L[1],depth:L[2],dataArray:u,preferSizeOverAccuracy:e.renderable.getPreferSizeOverAccuracy()}),e._openGLRenderWindow.setGraphicsResourceForObject(u,e.volumeTexture,p),u!==e._scalars&&(e._openGLRenderWindow.registerGraphicsResourceUser(u,t),e._openGLRenderWindow.unregisterGraphicsResourceUser(e._scalars,t)),e._scalars=u}else e.volumeTexture=c.oglObject;if(h){s.setUpdatedExtents([]);const L=i.getDimensions();e.volumeTexture.create3DFilterableFromDataArray({width:L[0],height:L[1],depth:L[2],dataArray:u,updatedExtents:f})}const v=u.getNumberOfComponents(),m=r.getProperty(),x=m.getIndependentComponents(),y=x?v:1,d=x?2*y:1,g=[];for(let L=0;L{const o=e.volumeTexture.getComponents(),s=i.getProperty().getIndependentComponents(),u=!!e.renderable.getCenterPoint(),c=e.renderable.getUseUniformOrientation(),p=e.renderable.isProjectionEnabled()&&e.renderable.getProjectionMode();return n.getProgram()===0||e.lastUseCenterPoint!==u||e.lastUseUniformOrientation!==c||e.lastProjectionMode!==p||e.lastHaveSeenDepthRequest!==e.haveSeenDepthRequest||e.lastTextureComponents!==o||e.lastIndependentComponents!==s?(e.lastUseCenterPoint=u,e.lastUseUniformOrientation=c,e.lastProjectionMode=p,e.lastHaveSeenDepthRequest=e.haveSeenDepthRequest,e.lastTextureComponents=o,e.lastIndependentComponents=s,!0):!1},t.buildShaders=(n,r,i)=>{t.getShaderTemplate(n,r,i),t.replaceShaderValues(n,r,i)},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;const u=["vec3 applyQuaternionToVec(vec4 q, vec3 v) {"," float uvx = q.y * v.z - q.z * v.y;"," float uvy = q.z * v.x - q.x * v.z;"," float uvz = q.x * v.y - q.y * v.x;"," float uuvx = q.y * uvz - q.z * uvy;"," float uuvy = q.z * uvx - q.x * uvz;"," float uuvz = q.x * uvy - q.y * uvx;"," float w2 = q.w * 2.0;"," uvx *= w2;"," uvy *= w2;"," uvz *= w2;"," uuvx *= 2.0;"," uuvy *= 2.0;"," uuvz *= 2.0;"," return vec3(v.x + uvx + uuvx, v.y + uvy + uuvy, v.z + uvz + uuvz);","}"];o=Z.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Z.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result;const c=["attribute vec3 centerlinePosition;","attribute float quadIndex;","uniform float width;","out vec2 quadOffsetVSOutput;","out vec3 centerlinePosVSOutput;"],p=e.renderable.isProjectionEnabled(),l=e.renderable.getUseUniformOrientation();l?(c.push("out vec3 samplingDirVSOutput;","uniform vec4 centerlineOrientation;","uniform vec3 tangentDirection;",...u),p&&c.push("out vec3 projectionDirVSOutput;","uniform vec3 bitangentDirection;")):c.push("out vec4 centerlineTopOrientationVSOutput;","out vec4 centerlineBotOrientationVSOutput;","attribute vec4 centerlineTopOrientation;","attribute vec4 centerlineBotOrientation;"),o=Z.substitute(o,"//VTK::Color::Dec",c).result;const f=["quadOffsetVSOutput = vec2(width * (mod(quadIndex, 2.0) == 0.0 ? -0.5 : 0.5), quadIndex > 1.0 ? 0.0 : 1.0);","centerlinePosVSOutput = centerlinePosition;"];l?(f.push("samplingDirVSOutput = applyQuaternionToVec(centerlineOrientation, tangentDirection);"),p&&f.push("projectionDirVSOutput = applyQuaternionToVec(centerlineOrientation, bitangentDirection);")):f.push("centerlineTopOrientationVSOutput = centerlineTopOrientation;","centerlineBotOrientationVSOutput = centerlineBotOrientation;"),o=Z.substitute(o,"//VTK::Color::Impl",f).result;const h=e.volumeTexture.getComponents(),v=i.getProperty().getIndependentComponents();let m=["uniform mat4 MCTCMatrix; // Model coordinates to texture coordinates","in vec2 quadOffsetVSOutput;","in vec3 centerlinePosVSOutput;","uniform highp sampler3D volumeTexture;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;","uniform vec4 backgroundColor;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;"];p&&m.push("uniform vec3 volumeSizeMC;","uniform int projectionSlabNumberOfSamples;","uniform float projectionConstantOffset;","uniform float projectionStepLength;"),l?(m.push("in vec3 samplingDirVSOutput;"),p&&m.push("in vec3 projectionDirVSOutput;")):(m.push("uniform vec3 tangentDirection;","in vec4 centerlineTopOrientationVSOutput;","in vec4 centerlineBotOrientationVSOutput;",...u),p&&m.push("uniform vec3 bitangentDirection;"));const x=e.renderable.getCenterPoint();if(x&&m.push("uniform vec3 globalCenterPoint;"),v){for(let d=1;d 0.999 || qCosAngle < -0.999) {"," // Use LERP instead of SLERP when the two quaternions are close or opposite"," interpolatedOrientation = normalize(mix(q0, q1, quadOffsetVSOutput.y));","} else {"," float omega = acos(qCosAngle);"," interpolatedOrientation = normalize(sin((1.0 - quadOffsetVSOutput.y) * omega) * q0 + sin(quadOffsetVSOutput.y * omega) * q1);","}","vec3 samplingDirection = applyQuaternionToVec(interpolatedOrientation, tangentDirection);"),p&&y.push("vec3 projectionDirection = applyQuaternionToVec(interpolatedOrientation, bitangentDirection);")),x?y.push("float baseOffset = dot(samplingDirection, globalCenterPoint - centerlinePosVSOutput);","float horizontalOffset = quadOffsetVSOutput.x + baseOffset;"):y.push("float horizontalOffset = quadOffsetVSOutput.x;"),y.push("vec3 volumePosMC = centerlinePosVSOutput + horizontalOffset * samplingDirection;","vec3 volumePosTC = (MCTCMatrix * vec4(volumePosMC, 1.0)).xyz;","if (any(lessThan(volumePosTC, vec3(0.0))) || any(greaterThan(volumePosTC, vec3(1.0))))","{"," // set the background color and exit"," gl_FragData[0] = backgroundColor;"," return;","}"),p){const d=e.renderable.getProjectionMode();switch(d){case Nr.MIN:y.push("const vec4 initialProjectionTextureValue = vec4(1.0);");break;case Nr.MAX:case Nr.AVERAGE:default:y.push("const vec4 initialProjectionTextureValue = vec4(0.0);");break}switch(y.push("vec3 projectionScaledDirection = projectionDirection / volumeSizeMC;","vec3 projectionStep = projectionStepLength * projectionScaledDirection;","vec3 projectionStartPosition = volumePosTC + projectionConstantOffset * projectionScaledDirection;","vec4 tvalue = initialProjectionTextureValue;","for (int projectionSampleIdx = 0; projectionSampleIdx < projectionSlabNumberOfSamples; ++projectionSampleIdx) {"," vec3 projectionSamplePosition = projectionStartPosition + float(projectionSampleIdx) * projectionStep;"," vec4 sampledTextureValue = texture(volumeTexture, projectionSamplePosition);"),d){case Nr.MAX:y.push(" tvalue = max(tvalue, sampledTextureValue);");break;case Nr.MIN:y.push(" tvalue = min(tvalue, sampledTextureValue);");break;case Nr.AVERAGE:default:y.push(" tvalue = tvalue + sampledTextureValue;");break}y.push("}"),d===Nr.AVERAGE&&y.push("tvalue = tvalue / float(projectionSlabNumberOfSamples);")}else y.push("vec4 tvalue = texture(volumeTexture, volumePosTC);");if(v){const d=["r","g","b","a"];for(let g=0;g{let o=n.Vertex,s=n.Fragment;if(e.renderable.getNumberOfClippingPlanes()){let u=e.renderable.getNumberOfClippingPlanes();u>6&&(A.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),u=6),o=Z.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,o=Z.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,s=Z.substitute(s,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,s=Z.substitute(s,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}n.Vertex=o,n.Fragment=s},t.getShaderTemplate=(n,r,i)=>{n.Vertex=J0,n.Fragment=Ha,n.Geometry=""},t.setMapperShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=n.getCABO();s.getElementCount()&&(e.VBOBuildTime.getMTime()>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(o,s,"vertexMC",s.getVertexOffset(),s.getStride(),e.context.FLOAT,3,e.context.FALSE)||Uo("Error setting vertexMC in shader VAO.")),n.getCABO().getCustomData().forEach(h=>{h&&o.isAttributeUsed(h.name)&&!n.getVAO().addAttributeArray(o,s,h.name,h.offset,s.getStride(),e.context.FLOAT,h.components,e.context.FALSE)&&Uo(`Error setting ${h.name} in shader VAO.`)}),n.getAttributeUpdateTime().modified());const u=e.volumeTexture.getTextureUnit();if(o.setUniformi("volumeTexture",u),o.setUniformf("width",e.renderable.getWidth()),n.getProgram().setUniform4fv("backgroundColor",e.renderable.getBackgroundColor()),o.isUniformUsed("tangentDirection")){const h=e.renderable.getTangentDirection();n.getProgram().setUniform3fArray("tangentDirection",h)}if(o.isUniformUsed("bitangentDirection")){const h=e.renderable.getBitangentDirection();n.getProgram().setUniform3fArray("bitangentDirection",h)}if(o.isUniformUsed("centerlineOrientation")){const h=e.renderable.getUniformOrientation();n.getProgram().setUniform4fv("centerlineOrientation",h)}if(o.isUniformUsed("globalCenterPoint")){const h=e.renderable.getCenterPoint();o.setUniform3fArray("globalCenterPoint",h)}if(e.renderable.isProjectionEnabled()){const h=e.currentImageDataInput,v=h.getSpacing(),m=h.getDimensions(),x=e.renderable.getProjectionSlabThickness(),y=e.renderable.getProjectionSlabNumberOfSamples(),d=L9([],v,m);o.setUniform3fArray("volumeSizeMC",d),o.setUniformi("projectionSlabNumberOfSamples",y);const g=-.5*x;o.setUniformf("projectionConstantOffset",g);const C=x/(y-1);o.setUniformf("projectionStepLength",C)}const c=e.currentImageDataInput,p=c.getWorldToIndex(),l=Ii(new Float32Array(16),Ki([],c.getDimensions())),f=Vl(l,l,p);if(o.setUniformMatrix("MCTCMatrix",f),e.haveSeenDepthRequest&&n.getProgram().setUniformi("depthRequest",e.renderDepth?1:0),e.renderable.getNumberOfClippingPlanes()){let h=e.renderable.getNumberOfClippingPlanes();h>6&&(A.vtkErrorMacro("OpenGL has a limit of 6 clipping planes"),h=6);const v=s.getCoordShiftAndScaleEnabled()?s.getInverseShiftAndScaleMatrix():null,m=v?vt(e.imagematinv,i.getMatrix()):i.getMatrix();v&&(We(m,m),Ee(m,m,v),We(m,m)),We(e.imagemat,e.currentImageDataInput.getIndexToWorld()),Ee(e.imagematinv,m,e.imagemat);const x=[];for(let y=0;y{const o=e.openGLImageSlice.getKeyMatrices().mcwc,s=e.openGLCamera.getKeyMatrices(r).wcpc;if(Ee(e.imagemat,s,o),n.getCABO().getCoordShiftAndScaleEnabled()){const u=n.getCABO().getInverseShiftAndScaleMatrix();Ee(e.imagemat,e.imagemat,u)}n.getProgram().setUniformMatrix("MCPCMatrix",e.imagemat)},t.setPropertyShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=i.getProperty(),u=s.getOpacity();o.setUniformf("opacity",u);const c=e.volumeTexture.getComponents(),p=s.getIndependentComponents();if(p)for(let v=0;v{if(t.getNeedToRebuildShaders(n,r,i)){const o={Vertex:null,Fragment:null,Geometry:null};t.buildShaders(o,r,i);const s=e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(o.Vertex,o.Fragment,o.Geometry);s!==n.getProgram()&&(n.setProgram(s),n.getVAO().releaseGraphicsResources()),n.getShaderSourceTime().modified()}else e._openGLRenderWindow.getShaderCache().readyShaderProgram(n.getProgram());n.getVAO().bind(),t.setMapperShaderParameters(n,r,i),t.setCameraShaderParameters(n,r,i),t.setPropertyShaderParameters(n,r,i)},t.delete=A.chain(()=>{e._openGLRenderWindow&&a(e._openGLRenderWindow)},t.delete)}var A7={currentRenderPass:null,volumeTexture:null,colorTexture:null,pwfTexture:null,tris:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0,lastIndependentComponents:0,imagemat:null,imagematinv:null};function V7(t,e,a={}){Object.assign(e,A7,a),Ct.extend(t,e,a),xn.implementReplaceShaderCoincidentOffset(t,e,a),A.algo(t,e,2,0),e.tris=jt.newInstance(),e.volumeTexture=null,e.colorTexture=null,e.pwfTexture=null,e.imagemat=we(new Float64Array(16)),e.imagematinv=we(new Float64Array(16)),e.VBOBuildTime={},A.obj(e.VBOBuildTime,{mtime:0}),k7(t,e)}var B7=A.newInstance(V7,"vtkOpenGLImageCPRMapper");ct("vtkImageCPRMapper",B7);var Rr={NONE:0,LIC:1,COLOR:2,BOTH:3},ic={UNIFORM:0,GAUSSIAN:1},U7={BLEND:0,MULTIPLY:1};function G7(t,e){e.classHierarchy.push("vtkSurfaceLICInterface")}var I7={enableLIC:!1,nuberOfSteps:40,stepSize:.25,transformVectors:!0,normalizeVectors:!0,maskOnSurface:!1,maskThreshold:0,maskColor:[0,0,0],maskIntensity:0,enhancedLIC:!0,enhanceContrast:Rr.NONE,lowLICContrastEnhancementFactor:0,highLICContrastEnhancementFactor:0,lowColorContrastEnhancementFactor:0,highColorContrastEnhancementFactor:0,antiAlias:0,colorMode:U7.BLEND,LICIntensity:1,mapModeBias:0,noiseTextureSize:200,noiseTextureType:ic.GAUSSIAN,noiseGrainSize:8,noiseImpulseProbability:.1,noiseImpulseBackgroundValue:0,noiseGeneratorSeed:0,minNoiseValue:0,maxNoiseValue:1,numberOfNoiseLevels:2,shadersNeedBuilding:!0,reallocateTextures:!0,rebuildNoiseTexture:!1,viewPortScale:1};function J1(t,e,a={}){Object.assign(e,I7,a),A.obj(t,e),A.setGet(t,e,["enableLIC","numberOfSteps","stepSize","normalizeVectors","transformVectors","maskOnSurface","maskThreshold","maskColor","maskIntensity","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","lowColorContrastEnhancementFactor","highColorContrastEnhancementFactor","antiAlias","colorMode","LICIntensity","mapModeBias","noiseTextureSize","noiseTextureType","noiseGrainSize","minNoiseValue","maxNoiseValue","numberOfNoiseLevels","noiseImpulseProbability","noiseImpulseBackgroundValue","noiseGeneratorSeed","viewPortScale","rebuildNoiseTexture"]),G7(t,e)}var P7=A.newInstance(J1,"vtkSurfaceLICInterface"),Z1={newInstance:P7,extend:J1},Q1=`//VTK::System::Dec + +/*========================================================================= + + Program: Visualization Toolkit + Module: vtktextureObjectVS.glsl + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +attribute vec4 vertexDC; +attribute vec2 tcoordDC; +varying vec2 tcoordVC; + +void main() +{ + tcoordVC = tcoordDC; + gl_Position = vertexDC; +} +`,z7=`//VTK::System::Dec //========================================================================= // @@ -2516,7 +2980,7 @@ void main(void) // initial seed SeedOutput = vec4(vectc, 0.0, 1.0); } -`,H8=`//VTK::System::Dec +`,W7=`//VTK::System::Dec //========================================================================= // @@ -2653,7 +3117,7 @@ void main(void) SeedOutput = vec4(pt0, 0.0, 1.0); } } -`,K8=` //VTK::System::Dec +`,j7=` //VTK::System::Dec //========================================================================= // @@ -2680,247 +3144,24 @@ applying the normalization. eg. if box kernel is used the this is the number of steps taken. */ -uniform sampler2D texLIC; - -in vec2 tcoordVC; - -void main(void) -{ - vec4 conv = texture2D(texLIC, tcoordVC.st); - conv.r = conv.r/conv.a; - // lic => (convolution, mask, 0, 1) - LICOutput = vec4(conv.rg , 0.0, 1.0); - SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); -} -`,X8=`//VTK::System::Dec - -//========================================================================= -// -// Program: Visualization Toolkit -// Module: vtkLineIntegralConvolution2D_CE.glsl -// -// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen -// All rights reserved. -// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -//========================================================================= - -// gray scale contrast enhance stage implemented via histogram stretching -// if the min and max are tweaked it can generate out-of-range values -// these will be clamped in 0 to 1 - -// the output of this shader -layout(location = 0) out vec4 LICOutput; -layout(location = 1) out vec4 SeedOutput; - - -uniform sampler2D texLIC; // most recent lic pass -uniform float uMin; // min gray scale color value -uniform float uMaxMinDiff; // max-min - -in vec2 tcoordVC; - -void main( void ) -{ - vec4 lic = texture2D(texLIC, tcoordVC.st); - if (lic.g!=0.0) - { - LICOutput = lic; - } - else - { - float CElic = clamp((lic.r - uMin)/uMaxMinDiff, 0.0, 1.0); - LICOutput = vec4(CElic, lic.gb, 1.0); - } - SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); -} -`,q8=`//VTK::System::Dec - -//========================================================================= -// -// Program: Visualization Toolkit -// Module: vtkLineIntegralConvolution2D_fs2.glsl -// -// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen -// All rights reserved. -// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -//========================================================================= - -// high-pass filter stage employed by vtkLineIntegralConvolution2D -// between LIC pass 1 and LIC pass 2. filtered LIC pass 1, becomes -// noise for pass2. - -// the output of this shader -layout(location = 0) out vec4 EEOutput; - -uniform sampler2D texLIC; // most recent lic pass -uniform float uDx; // fragment size -uniform float uDy; // fragment size - -in vec2 tcoordVC; - -// kernel for simple laplace edge enhancement. -// p=Laplace(p)+p -float K[9] = float[9]( - -1.0, -1.0, -1.0, - -1.0, 9.0, -1.0, - -1.0, -1.0, -1.0 - ); - -// determine if the fragment was masked -bool Masked(float val) { return val != 0.0; } - -void main(void) -{ - // tex coord neighbor offsets - vec2 fragDx[9] = vec2[9]( - vec2(-uDx, uDy), vec2(0.0, uDy), vec2(uDx, uDy), - vec2(-uDx, 0.0), vec2(0.0, 0.0), vec2(uDx, 0.0), - vec2(-uDx,-uDy), vec2(0.0,-uDy), vec2(uDx,-uDy) - ); - - vec2 lictc = tcoordVC.st; - - // compute the convolution but don't use convovled values if - // any masked fragments on the stencil. Fragments outside - // the valid domain are masked during initialization, and - // texture wrap parameters are clamp to border with border - // color that contains masked flag - float conv = 0.0; - bool dontUse = false; - for (int i=0; i<9; ++i) - { - vec2 tc = lictc + fragDx[i]; - vec4 lic = texture2D(texLIC, tc); - dontUse = dontUse || Masked(lic.g); - conv = conv + K[i] * lic.r; - } - - if (dontUse) - { - EEOutput = vec4(texture2D(texLIC, lictc).rg, 0.0, 1.0); - } - else - { - conv = clamp(conv, 0.0, 1.0); - EEOutput = vec4(conv,texture2D(texLIC, lictc).g, 0.0, 1.0); - } - -} -`,Y8=`//VTK::System::Dec - -//========================================================================= -// -// Program: Visualization Toolkit -// Module: vtkLineIntegralConvolution2D_AAH.glsl -// -// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen -// All rights reserved. -// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -//========================================================================= - -// Anti-alias stage in vtkLineIntegralConvolution2D -// horizontal pass of a Gaussian convolution - -// the output of this shader -layout(location = 0) out vec4 LICOutput; -layout(location = 1) out vec4 SeedOutput; - -uniform sampler2D texLIC; // input texture -uniform float uDx; // fragment size - -in vec2 tcoordVC; - -// factored 3x3 Gaussian kernel -// K^T*K = G -float K[3] = float[3](0.141421356, 0.707106781, 0.141421356); - -// determine if the fragment was masked -bool Masked(float val){ return val != 0.0; } - -void main(void) -{ -// neighbor offsets -vec2 fragDx[3] = vec2[3](vec2(-uDx,0.0), vec2(0.0,0.0), vec2(uDx,0.0)); - - vec2 lictc = tcoordVC.st; - vec4 lic[3]; - bool dontUse = false; - float conv = 0.0; - for (int i=0; i<3; ++i) - { - vec2 tc = lictc + fragDx[i]; - lic[i] = texture2D(texLIC, tc); - dontUse = dontUse || Masked(lic[i].g); - conv = conv + K[i] * lic[i].r; - } - // output is (conv, mask, skip, 1) - if (dontUse) - { - LICOutput = vec4(lic[1].rg, 1.0, 1.0); - } - else - { - LICOutput = vec4(conv, lic[1].gb, 1.0); - } - SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); -} -`,J8=`//VTK::System::Dec - -//========================================================================= -// -// Program: Visualization Toolkit -// Module: vtkLineIntegralConvolution2D_VT.glsl -// -// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen -// All rights reserved. -// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. -// -// This software is distributed WITHOUT ANY WARRANTY; without even -// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE. See the above copyright notice for more information. -// -//========================================================================= - -// move vector field to normalized image space -// pre-processing for vtkLineIntegralConvolution2D - -// the output of this shader -//VTK::Output::Dec - -// Fragment shader used by the gaussian blur filter render pass. - -uniform sampler2D texVectors; // input texture -uniform vec2 uTexSize; // size of texture +uniform sampler2D texLIC; in vec2 tcoordVC; void main(void) { - //VTK::LICComponentSelection::Impl - V = V/uTexSize; - gl_FragData[0] = vec4(V, 0.0, 1.0); + vec4 conv = texture2D(texLIC, tcoordVC.st); + conv.r = conv.r/conv.a; + // lic => (convolution, mask, 0, 1) + LICOutput = vec4(conv.rg , 0.0, 1.0); + SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); } -`,Z8=`//VTK::System::Dec +`,$7=`//VTK::System::Dec //========================================================================= // // Program: Visualization Toolkit -// Module: vtkLineIntegralConvolution2D_AAV.glsl +// Module: vtkLineIntegralConvolution2D_CE.glsl // // Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen // All rights reserved. @@ -2932,124 +3173,41 @@ void main(void) // //========================================================================= -// Anti-alias stage in vtkLineIntegralConvolution2D -// vertical pass of a Gaussian convolution +// gray scale contrast enhance stage implemented via histogram stretching +// if the min and max are tweaked it can generate out-of-range values +// these will be clamped in 0 to 1 // the output of this shader layout(location = 0) out vec4 LICOutput; layout(location = 1) out vec4 SeedOutput; -uniform sampler2D texLIC; // input texture -uniform float uDy; // fragment size - -in vec2 tcoordVC; - -// factored 3x3 Gaussian kernel -// K^T*K = G -float K[3] = float[3](0.141421356, 0.707106781, 0.141421356); +uniform sampler2D texLIC; // most recent lic pass +uniform float uMin; // min gray scale color value +uniform float uMaxMinDiff; // max-min -// determine if the fragment was masked -bool Masked(float val){ return val != 0.0; } +in vec2 tcoordVC; -void main(void) +void main( void ) { -// neighbor offsets -vec2 fragDy[3] = vec2[3](vec2(0.0,-uDy), vec2(0.0,0.0), vec2(0.0,uDy)); - - - vec2 lictc = tcoordVC.st; - vec4 lic[3]; - bool dontUse = false; - float conv = 0.0; - for (int i=0; i<3; ++i) - { - vec2 tc = lictc + fragDy[i]; - lic[i] = texture2D(texLIC, tc); - dontUse = dontUse || Masked(lic[i].g); - conv = conv + K[i] * lic[i].r; - } - // output is (conv, mask, skip, 1) - if (dontUse) + vec4 lic = texture2D(texLIC, tcoordVC.st); + if (lic.g!=0.0) { - LICOutput = vec4(lic[1].rg, 1.0, 1.0); + LICOutput = lic; } else { - LICOutput = vec4(conv, lic[1].gb, 1.0); + float CElic = clamp((lic.r - uMin)/uMaxMinDiff, 0.0, 1.0); + LICOutput = vec4(CElic, lic.gb, 1.0); } - SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); -} -`,Ih=`//VTK::System::Dec - -/*========================================================================= - - Program: Visualization Toolkit - Module: vtktextureObjectVS.glsl - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -attribute vec4 vertexDC; -attribute vec2 tcoordDC; -varying vec2 tcoordVC; - -void main() -{ - tcoordVC = tcoordDC; - gl_Position = vertexDC; + SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); } -`;const{Representation:Q8}=pr;function ex(t){const e=jt.newInstance();e.setOpenGLRenderWindow(t);const a=new Float32Array(12);for(let c=0;c<4;c++)a[c*3]=c%2*2-1,a[c*3+1]=c>1?1:-1,a[c*3+2]=0;const n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array(8);r[0]=3,r[1]=0,r[2]=1,r[3]=3,r[4]=3,r[5]=0,r[6]=3,r[7]=2;const i=pe.newInstance({numberOfComponents:3,values:a});i.setName("points");const o=pe.newInstance({numberOfComponents:1,values:r}),s=pe.newInstance({numberOfComponents:2,values:n});return e.getCABO().createVBO(o,"polys",Q8.SURFACE,{points:i,cellOffset:0,tcoords:s}),e}function Y0(t,e,a,n){let[r,i]=e;const o=t.getContext(),s=Re.newInstance({autoParameters:!1,wrapS:n,wrapT:n,minificationFilter:a,magnificationFilter:a,generateMipmap:!1,openGLDataType:o.FLOAT,baseLevel:0,maxLevel:0});return s.setOpenGLRenderWindow(t),s.setInternalFormat(o.RGBA32F),s.create2DFromRaw({width:r,height:i,numComps:4,dataType:"Float32Array",data:null}),s.activate(),s.sendParameters(),s.deactivate(),s}function Lo(t,e){return Y0(t,e,Re.Filter.NEAREST,Re.Wrap.CLAMP_TO_EDGE)}function tx(t,e){return Y0(t,e,Re.Filter.NEAREST,Re.Wrap.CLAMP_TO_EDGE)}function nx(t,e){return Y0(t,e,Re.Filter.LINEAR,Re.Wrap.CLAMP_TO_EDGE)}function rx(t,e){if(e.classHierarchy.push("vtkLICPingPongBufferManager"),!e._openGLRenderWindow){console.error("Pass renderwindow to ping pong manager");return}e.quad=ex(e._openGLRenderWindow),e.context=e._openGLRenderWindow.getContext(),e.licTexture0=Lo(e._openGLRenderWindow,e.size),e.seedTexture0=Lo(e._openGLRenderWindow,e.size),e.licTexture1=Lo(e._openGLRenderWindow,e.size),e.seedTexture1=Lo(e._openGLRenderWindow,e.size),e.eeTexture=e.doEEPass?tx(e._openGLRenderWindow,e.size):null,e.imageVectorTexture=e.doVTPass?nx(e._openGLRenderWindow,e.size):null,e.pingTextures[0]=e.licTexture0,e.pingTextures[1]=e.seedTexture0,e.pongTextures[0]=e.licTexture1,e.pongTextures[1]=e.seedTexture1,e.textures[0]=e.pingTextures,e.textures[1]=e.pongTextures,t.swap=()=>{e.readIndex=1-e.readIndex},t.renderQuad=(a,n)=>{const r=e.quad,i=e.context;let o=e.quadVAO;o||(o=ja.newInstance(),o.setOpenGLRenderWindow(e._openGLRenderWindow),e.quadVAO=o),e.previousProgramHash!==n.getMd5Hash()&&(o.shaderProgramChanged(),r.getCABO().bind(),o.addAttributeArray(n,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE),o.addAttributeArray(n,r.getCABO(),"tcoordDC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),e.context.FLOAT,2,e.context.FALSE),e.previousProgramHash=n.getMd5Hash()),i.drawArrays(i.TRIANGLES,0,r.getCABO().getElementCount()),o.release()},t.getLastLICBuffer=()=>e.readIndex===0?e.licTexture0:e.licTexture1,t.getLastSeedBuffer=()=>e.readIndex===0?e.seedTexture0:e.seedTexture1,t.getLICBuffer=()=>1-e.readIndex===0?e.licTexture0:e.licTexture1,t.getSeedBuffer=()=>1-e.readIndex===0?e.seedTexture0:e.seedTexture1,t.getLICTextureUnit=()=>{const a=e.textures[e.readIndex][0];return a.activate(),a.getTextureUnit()},t.getSeedTextureUnit=()=>{const a=e.textures[e.readIndex][1];return a.activate(),a.getTextureUnit()},t.getNoiseTextureUnit=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)===0?(e.noiseTexture.activate(),e.noiseTexture.getTextureUnit()):(e.eeTexture.activate(),e.eeTexture.getTextureUnit())},t.getVectorTextureUnit=()=>(e.vectorTexture.activate(),e.vectorTexture.getTextureUnit()),t.getImageVectorTextureUnit=()=>e.imageVectorTexture?(e.imageVectorTexture.activate(),e.imageVectorTexture.getTextureUnit()):t.getVectorTextureUnit(),t.getMaskVectorTextureUnit=()=>e.maskVectorTexture?(e.maskVectorTexture.activate(),e.maskVectorTexture.getTextureUnit()):t.getImageVectorTextureUnit(),t.clearBuffers=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=e.framebuffer,r=e.context;n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeColorBuffer(3),n.setColorBuffer(e.licTexture0,0),n.setColorBuffer(e.seedTexture0,1),n.setColorBuffer(e.licTexture1,2),n.setColorBuffer(e.seedTexture1,3);const i=[r.COLOR_ATTACHMENT0,r.COLOR_ATTACHMENT1,r.COLOR_ATTACHMENT2,r.COLOR_ATTACHMENT3];a&&(n.removeColorBuffer(4),n.setColorBuffer(e.eeTexture,4),i.push(r.COLOR_ATTACHMENT4)),r.drawBuffers(i),r.clearColor(0,1,0,0),r.disable(r.SCISSOR_TEST),r.disable(r.BLEND),r.clear(r.COLOR_BUFFER_BIT),n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeColorBuffer(3),a&&n.removeColorBuffer(4),r.drawBuffers([r.NONE])},t.clearBuffer=a=>{const n=e.framebuffer,r=e.context;n.removeColorBuffer(0),n.setColorBuffer(a,0),r.drawBuffers([r.COLOR_ATTACHMENT0]),r.clearColor(0,1,0,0),r.disable(r.SCISSOR_TEST),r.disable(r.BLEND),r.clear(r.COLOR_BUFFER_BIT),n.removeColorBuffer(a,0),r.drawBuffers([r.NONE])},t.activateVectorTextures=()=>{e.imageVectorTexture?e.imageVectorTexture.activate():e.vectorTexture.activate(),e.maskVectorTexture&&e.maskVectorTexture.activate()},t.deactivateVectorTextures=()=>{e.imageVectorTexture?e.imageVectorTexture.deactivate():e.vectorTexture.deactivate(),e.maskVectorTexture&&e.maskVectorTexture.deactivate()},t.activateNoiseTexture=function(){switch(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0){case 0:e.noiseTexture.activate();break;case 1:e.eeTexture.activate();break;default:console.error("Wrong LIC pass number")}},t.deactivateNoiseTexture=function(){switch(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0){case 0:e.noiseTexture.deactivate();break;case 1:e.eeTexture.deactivate();break;default:console.error("Wrong LIC pass number")}},t.attachLICBuffers=()=>{const a=e.textures[e.readIndex],n=e.textures[1-e.readIndex],r=e.framebuffer,i=e.context;a[0].activate(),a[1].activate(),r.removeColorBuffer(0),r.removeColorBuffer(1),r.setColorBuffer(n[0],0),r.setColorBuffer(n[1],1),i.drawBuffers([i.COLOR_ATTACHMENT0,i.COLOR_ATTACHMENT1])},t.detachLICBuffers=()=>{const a=e.textures[e.readIndex],n=e.context,r=e.framebuffer;a[0].deactivate(),a[1].deactivate(),r.removeColorBuffer(0),r.removeColorBuffer(1),n.drawBuffers([n.NONE])},t.attachImageVectorBuffer=()=>{const a=e.framebuffer,n=e.context;e.vectorTexture.activate(),a.removeColorBuffer(0),a.setColorBuffer(e.imageVectorTexture,0),n.drawBuffers([n.COLOR_ATTACHMENT0])},t.detachImageVectorBuffer=()=>{const a=e.context,n=e.framebuffer;e.vectorTexture.deactivate(),n.removeColorBuffer(0),a.drawBuffers([a.NONE])},t.attachEEBuffer=()=>{e.textures[e.readIndex][0].activate(),e.framebuffer.removeColorBuffer(0),e.framebuffer.setColorBuffer(e.eeTexture,0);const n=e.context;n.drawBuffers([n.COLOR_ATTACHMENT0])},t.detachEEBuffer=()=>{const a=e.context;e.framebuffer.removeColorBuffer(0),a.drawBuffers([a.NONE]),e.textures[e.readIndex][0].deactivate()},t.detachBuffers=()=>{const a=e.context,n=e.framebuffer;n.removeColorBuffer(0),n.removeColorBuffer(1),a.drawBuffers([a.NONE]);const r=e.textures[e.readIndex],i=e.textures[1-e.readIndex];r[0]&&r[0].deactivate(),r[1]&&r[1].deactivate(),i[0]&&i[0].deactivate(),i[1]&&i[1].deactivate(),e.eeTexture&&e.eeTexture.deactivate(),e.noiseTexture&&e.noiseTexture.deactivate()},t.getWriteIndex=()=>1-e.readIndex,t.detachBuffers()}const ax={vectorTexture:null,maskVectorTexture:null,noiseTexture:null,doEEPass:!1,doVTPass:!1,readIndex:0,quad:null,lastProgramHash:null,framebuffer:null,size:null,pingTextures:[],pongTextures:[],textures:[]};function Ph(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,ax,a),V.obj(t,e),V.get(t,e,["readIndex"]),V.setGet(t,e,["doEEPass","doVTPass","_openGLRenderWindow","vectorTexture","maskVectorTexture","noiseTexture","framebuffer","size"]),V.moveToProtected(t,e,["openGLRenderWindow"]),rx(t,e)}var ix={newInstance:V.newInstance(Ph,"vtkLICPingPongBufferManager"),extend:Ph};const Mr={NONE:0,LIC:1,COLOR:2,BOTH:3},J0={UNIFORM:0,GAUSSIAN:1},ox={BLEND:0,MULTIPLY:1};function sx(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=` - vec2 getVector( vec2 vectc ) - - { - - vec2 V = texture2D( texVectors, vectc ).xy; - - // normalize if |V| not 0 - - float lenV = length( V ); - - if ( lenV > 1.0e-8 ) - - { - - return V/lenV; - - } - - else - - { - - return vec2( 0.0, 0.0 ); - - } - - } - - `,a=` - vec2 getVector( vec2 vectc ) - - { - - return texture2D( texVectors, vectc ).xy; - - } - - `;return t?e:a}function cx(t,e){e.classHierarchy.push("vtkLineIntegralConvolution2D"),t.buildAShader=r=>e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(Ih,r,""),t.dumpTextureValues=function(r,i){let[o,s]=i,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.context,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e._openGLRenderWindow,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:4;const u=Er.newInstance(),f=c;let h=null;return u.setOpenGLRenderWindow(l),u.saveCurrentBindingsAndBuffers(),u.create(o,s),u.populateFramebuffer(),u.setColorBuffer(r),h=new Float32Array(o*s*p),f.readPixels(0,0,o,s,p===4?f.RGBA:f.RGB,f.FLOAT,h),u.restorePreviousBindingsAndBuffers(),h},t.getTextureMinMax=function(r,i){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.context,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e._openGLRenderWindow;const c=t.dumpTextureValues(r,i,o,s,4);let l=Number.MAX_VALUE,p=Number.MIN_VALUE;for(let u=0;up&&(p=f)}return{min:l,max:p}},t.getComponentSelectionProgram=r=>{const i="xyzw";return`.${i[r[0]]}${i[r[1]]}`},t.buildShaders=()=>{e.LIC0ShaderProgram=t.buildAShader($8);const r=Q.substitute(J8,"//VTK::LICComponentSelection::Impl",`vec2 V = texture2D(texVectors, tcoordVC.st)${t.getComponentSelectionProgram(e.componentIds)};`).result;e.VTProgram=t.buildAShader(r);const i=Q.substitute(H8,"//VTK::LICVectorLookup::Impl",sx(e.normalizeVectors),!0).result;e.LICIShaderProgram=t.buildAShader(i),e.LICNShaderProgram=t.buildAShader(K8),e.CEProgram=t.buildAShader(X8),e.EEProgram=t.buildAShader(q8),e.AAHProgram=t.buildAShader(Y8),e.AAVProgram=t.buildAShader(Z8)};function a(r,i){r.setUniformi("texLIC",i.getLICTextureUnit()),r.setUniformi("texSeedPts",i.getSeedTextureUnit())}function n(r,i,o){r.attachLICBuffers(),r.renderQuad(i,o),r.detachLICBuffers(),r.swap()}t.executeLIC=(r,i,o,s,c,l)=>{if(e._openGLRenderWindow=c,e.context=c.getContext(),Object.assign(e,l),r[0]<=0||r[1]<=0)return null;const p=[1/r[0],1/r[1]];let u=e.stepSize*Math.sqrt(p[0]*p[0]+p[1]*p[1]);u<=0&&(u=1e-10);const f=e.context;let h=e.framebuffer;const d=h==null?void 0:h.getSize();(!h||!d||r[0]!==d||r[1]!==d)&&(h=Er.newInstance(),h.setOpenGLRenderWindow(e._openGLRenderWindow),h.saveCurrentBindingsAndBuffers(),h.create(...r),h.populateFramebuffer(),h.restorePreviousBindingsAndBuffers(),e.framebuffer=h),h.saveCurrentBindingsAndBuffers(),h.bind(),f.viewport(0,0,...r),f.scissor(0,0,...r),e.shadersNeedBuild&&(t.buildShaders(),e.shadersNeedBuild=!1),e.bufs?(e.bufs.setVectorTexture(i),e.bufs.setMaskVectorTexture(o),e.bufs.setNoiseTexture(s)):e.bufs=ix.newInstance({openGLRenderWindow:c,doEEPass:e.enhancedLIC,doVTPass:e.transformVectors,vectorTexture:i,maskVectorTexture:o,noiseTexture:s,framebuffer:h,size:r});const v=[(s.getWidth()+1)/r[0],(s.getHeight()+1)/r[1]],m=1/r[0],x=1/r[1],y=e._openGLRenderWindow.getShaderCache();if(e.transformVectors){const T=e.VTProgram;y.readyShaderProgram(T),e.bufs.attachImageVectorBuffer(),T.setUniform2f("uTexSize",...r),T.setUniformi("texVectors",e.bufs.getVectorTextureUnit()),f.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT),e.bufs.renderQuad(r,T),e.bufs.detachImageVectorBuffer()}e.bufs.clearBuffers(e.enhancedLIC),e.bufs.activateVectorTextures(),e.bufs.activateNoiseTexture(0);const{LIC0ShaderProgram:g}=e;y.readyShaderProgram(g),g.setUniformi("uStepNo",0),g.setUniformi("uPassNo",0),g.setUniformf("uMaskThreshold",e.maskThreshold),g.setUniform2f("uNoiseBoundsPt1",...v),g.setUniformi("texMaskVectors",e.bufs.getMaskVectorTextureUnit()),g.setUniformi("texLIC",e.bufs.getLICTextureUnit()),g.setUniformi("texNoise",e.bufs.getNoiseTextureUnit(0)),n(e.bufs,r,g);const{LICIShaderProgram:C}=e;y.readyShaderProgram(C),C.setUniformi("uPassNo",0),C.setUniformf("uStepSize",-u),C.setUniform2f("uNoiseBoundsPt1",...v),C.setUniformi("texVectors",e.bufs.getImageVectorTextureUnit()),C.setUniformi("texNoise",e.bufs.getNoiseTextureUnit(0));for(let T=0;T{const o=e._openGLRenderWindow.getShaderCache();let{min:s,max:c}=t.getTextureMinMax(e.bufs.getLastLICBuffer(),i,e.context,e._openGLRenderWindow);(c<=s||c>1||s<0)&&(console.error("Invalid color range: ",s,c),s=0,c=1);let l=c-s;r&&(s+=l*e.lowLICContrastEnhancementFactor,c-=l*e.highLICContrastEnhancementFactor,l=c-s);const{CEProgram:p}=e;o.readyShaderProgram(p),p.setUniformi("texLIC",e.bufs.getLICTextureUnit()),p.setUniformf("uMin",s),p.setUniformf("uMaxMinDiff",l),n(e.bufs,i,p)}}const ux={shadersNeedBuild:!0,stepSize:1,numberOfSteps:10,enhancedLIC:!0,enhanceContrast:!1,lowContrastEnhancementFactor:0,highContrastEnhancementFactor:0,antiAlias:0,componentIds:[0,1],normalizeVectors:!0,maskThreshold:0,transformVectors:!0,bufs:null,isComposite:!0};function zh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,ux,a),V.obj(t,e),V.setGet(t,e,["context","_openGLRenderWindow","nuberOfSteps","stepSize","normalizeVectors","maskThreshold","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","antiAlias","componentIds","isComposite"]),V.moveToProtected(t,e,["openGLRenderWindow"]),cx(t,e)}var lx={newInstance:V.newInstance(zh,"vtkLineIntegralConvolution2D"),extend:zh},fx=`//VTK::System::Dec +`,H7=`//VTK::System::Dec //========================================================================= // // Program: Visualization Toolkit -// Module: vtkSurfaceLICMapper_fs2.glsl +// Module: vtkLineIntegralConvolution2D_fs2.glsl // // Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen // All rights reserved. @@ -3061,203 +3219,136 @@ void main() // //========================================================================= -// This shader combines surface geometry, LIC, and scalar colors. +// high-pass filter stage employed by vtkLineIntegralConvolution2D +// between LIC pass 1 and LIC pass 2. filtered LIC pass 1, becomes +// noise for pass2. // the output of this shader -layout(location = 0) out vec4 RGBOutput; -layout(location = 1) out vec4 HSLOutput; +layout(location = 0) out vec4 EEOutput; -uniform sampler2D texVectors; // vectors, depth -uniform sampler2D texGeomColors; // scalar colors + lighting -uniform sampler2D texLIC; // image lic -uniform int uScalarColorMode; // select between blend, and map shader -uniform float uLICIntensity; // blend shader: blending factor for lic'd colors -uniform float uMapBias; // map shader: adjust the brightness of the result -uniform float uMaskIntensity; // blending factor for mask color -uniform vec3 uMaskColor; // color for the masked out fragments +uniform sampler2D texLIC; // most recent lic pass +uniform float uDx; // fragment size +uniform float uDy; // fragment size in vec2 tcoordVC; -/** -Convert from RGB color space into HSL colorspace. -*/ -vec3 RGBToHSL(vec3 RGB) -{ - vec3 HSL = vec3(0.0, 0.0, 0.0); - - float RGBMin = min(min(RGB.r, RGB.g), RGB.b); - float RGBMax = max(max(RGB.r, RGB.g), RGB.b); - float RGBMaxMinDiff = RGBMax - RGBMin; - - HSL.z = (RGBMax + RGBMin) / 2.0; - - if (RGBMaxMinDiff == 0.0) - { - // Gray scale - HSL.x = 0.0; - HSL.y = 0.0; - } - else - { - // Color - if (HSL.z < 0.5) - HSL.y = RGBMaxMinDiff / (RGBMax + RGBMin); - else - HSL.y = RGBMaxMinDiff / (2.0 - RGBMax - RGBMin); - - float dR - = (((RGBMax - RGB.r) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff; - float dG - = (((RGBMax - RGB.g) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff; - float dB - = (((RGBMax - RGB.b) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff; - - if (RGB.r == RGBMax) - HSL.x = dB - dG; - else - if (RGB.g == RGBMax) - HSL.x = (1.0 / 3.0) + dR - dB; - else - if (RGB.b == RGBMax) - HSL.x = (2.0 / 3.0) + dG - dR; - - if (HSL.x < 0.0) - HSL.x += 1.0; - - if (HSL.x > 1.0) - HSL.x -= 1.0; - } +// kernel for simple laplace edge enhancement. +// p=Laplace(p)+p +float K[9] = float[9]( + -1.0, -1.0, -1.0, + -1.0, 9.0, -1.0, + -1.0, -1.0, -1.0 + ); - return HSL; -} +// determine if the fragment was masked +bool Masked(float val) { return val != 0.0; } -/** -Helper for HSL to RGB conversion. -*/ -float Util(float v1, float v2, float vH) +void main(void) { - if (vH < 0.0) - vH += 1.0; - - if (vH > 1.0) - vH -= 1.0; - - if ((6.0 * vH) < 1.0) - return (v1 + (v2 - v1) * 6.0 * vH); - - if ((2.0 * vH) < 1.0) - return (v2); + // tex coord neighbor offsets + vec2 fragDx[9] = vec2[9]( + vec2(-uDx, uDy), vec2(0.0, uDy), vec2(uDx, uDy), + vec2(-uDx, 0.0), vec2(0.0, 0.0), vec2(uDx, 0.0), + vec2(-uDx,-uDy), vec2(0.0,-uDy), vec2(uDx,-uDy) + ); - if ((3.0 * vH) < 2.0) - return (v1 + (v2 - v1) * ((2.0 / 3.0) - vH) * 6.0); + vec2 lictc = tcoordVC.st; - return v1; -} + // compute the convolution but don't use convovled values if + // any masked fragments on the stencil. Fragments outside + // the valid domain are masked during initialization, and + // texture wrap parameters are clamp to border with border + // color that contains masked flag + float conv = 0.0; + bool dontUse = false; + for (int i=0; i<9; ++i) + { + vec2 tc = lictc + fragDx[i]; + vec4 lic = texture2D(texLIC, tc); + dontUse = dontUse || Masked(lic.g); + conv = conv + K[i] * lic.r; + } -/** -Convert from HSL space into RGB space. -*/ -vec3 HSLToRGB(vec3 HSL) -{ - vec3 RGB; - if (HSL.y == 0.0) + if (dontUse) { - // Gray - RGB.r = HSL.z; - RGB.g = HSL.z; - RGB.b = HSL.z; + EEOutput = vec4(texture2D(texLIC, lictc).rg, 0.0, 1.0); } else { - // Chromatic - float v2; - if (HSL.z < 0.5) - v2 = HSL.z * (1.0 + HSL.y); - else - v2 = (HSL.z + HSL.y) - (HSL.y * HSL.z); - - float v1 = 2.0 * HSL.z - v2; - - RGB.r = Util(v1, v2, HSL.x + (1.0 / 3.0)); - RGB.g = Util(v1, v2, HSL.x); - RGB.b = Util(v1, v2, HSL.x - (1.0 / 3.0)); + conv = clamp(conv, 0.0, 1.0); + EEOutput = vec4(conv,texture2D(texLIC, lictc).g, 0.0, 1.0); } - return RGB.rgb; } +`,K7=`//VTK::System::Dec -void main() -{ - vec4 lic = texture2D(texLIC, tcoordVC.st); - vec4 geomColor = texture2D(texGeomColors, tcoordVC.st); +//========================================================================= +// +// Program: Visualization Toolkit +// Module: vtkLineIntegralConvolution2D_AAH.glsl +// +// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +// All rights reserved. +// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +// +// This software is distributed WITHOUT ANY WARRANTY; without even +// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. See the above copyright notice for more information. +// +//========================================================================= - // depth is used to determine which fragment belong to us - // and we can change - float depth = texture2D(texVectors, tcoordVC.st).a; +// Anti-alias stage in vtkLineIntegralConvolution2D +// horizontal pass of a Gaussian convolution - vec3 fragColorRGB; - float valid; - if (depth > 1.0e-3) +// the output of this shader +layout(location = 0) out vec4 LICOutput; +layout(location = 1) out vec4 SeedOutput; + +uniform sampler2D texLIC; // input texture +uniform float uDx; // fragment size + +in vec2 tcoordVC; + +// factored 3x3 Gaussian kernel +// K^T*K = G +float K[3] = float[3](0.141421356, 0.707106781, 0.141421356); + +// determine if the fragment was masked +bool Masked(float val){ return val != 0.0; } + +void main(void) +{ +// neighbor offsets +vec2 fragDx[3] = vec2[3](vec2(-uDx,0.0), vec2(0.0,0.0), vec2(uDx,0.0)); + + vec2 lictc = tcoordVC.st; + vec4 lic[3]; + bool dontUse = false; + float conv = 0.0; + for (int i=0; i<3; ++i) { - // we own it - // shade LIC'ed geometry, or apply mask - if (lic.g!=0.0) - { - // it's masked - // apply fragment mask - fragColorRGB = uMaskIntensity * uMaskColor + (1.0 - uMaskIntensity) * geomColor.rgb; - valid = 0.0; - } - else - { - if (uScalarColorMode==0) - { - // blend with scalars - fragColorRGB = lic.rrr * uLICIntensity + geomColor.rgb * (1.0 - uLICIntensity); - } - else - { - // multiply with scalars - fragColorRGB = geomColor.rgb * clamp((uMapBias + lic.r), 0.0, 1.0); - } - if (lic.b != 0.0) - { - // didn't have the required guard pixels - // don't consider it in min max estimation - // for histpgram stretching - valid = 0.0; - } - else - { - // ok to use in min/max estimates for histogram - // stretching - valid = 1.0; - } - } + vec2 tc = lictc + fragDx[i]; + lic[i] = texture2D(texLIC, tc); + dontUse = dontUse || Masked(lic[i].g); + conv = conv + K[i] * lic[i].r; + } + // output is (conv, mask, skip, 1) + if (dontUse) + { + LICOutput = vec4(lic[1].rg, 1.0, 1.0); } else { - // we don't own it - // pass through scalars - fragColorRGB = geomColor.rgb; - valid = 0.0; + LICOutput = vec4(conv, lic[1].gb, 1.0); } - - // if no further stages this texture is - // copied to the screen - RGBOutput = vec4(fragColorRGB, geomColor.a); - - // if further stages, move to hsl space for contrast - // enhancement. encoding validity saves moving a texture to the cpu - vec3 fragColorHSL = RGBToHSL(fragColorRGB); - HSLOutput = vec4(fragColorHSL, valid); + SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); } -`,px=`//VTK::System::Dec +`,X7=`//VTK::System::Dec //========================================================================= // // Program: Visualization Toolkit -// Module: vtkSurfaceLICMapper_DCpy.glsl +// Module: vtkLineIntegralConvolution2D_VT.glsl // // Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen // All rights reserved. @@ -3269,37 +3360,31 @@ void main() // //========================================================================= -// This shader copies fragments and depths to the output buffer +// move vector field to normalized image space +// pre-processing for vtkLineIntegralConvolution2D // the output of this shader //VTK::Output::Dec -uniform sampler2D texDepth; // z values from vertex shader -uniform sampler2D texRGBColors; // final rgb LIC colors +// Fragment shader used by the gaussian blur filter render pass. + +uniform sampler2D texVectors; // input texture +uniform vec2 uTexSize; // size of texture in vec2 tcoordVC; -void main() +void main(void) { - gl_FragDepth = texture2D(texDepth, tcoordVC).x; - gl_FragData[0] = texture2D(texRGBColors, tcoordVC); - - // since we render a screen aligned quad - // we're going to be writing fragments - // not touched by the original geometry - // it's critical not to modify those - // fragments. - if (gl_FragDepth == 1.0) - { - discard; - } + //VTK::LICComponentSelection::Impl + V = V/uTexSize; + gl_FragData[0] = vec4(V, 0.0, 1.0); } -`,hx=`//VTK::System::Dec +`,q7=`//VTK::System::Dec //========================================================================= // // Program: Visualization Toolkit -// Module: vtkSurfaceLICMapper_CE.glsl +// Module: vtkLineIntegralConvolution2D_AAV.glsl // // Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen // All rights reserved. @@ -3311,419 +3396,494 @@ void main() // //========================================================================= -// color contrast enhance stage implemented via histogram stretching -// on lightness channel. if the min and max are tweaked it can generate -// out-of-range values these will be clamped in 0 to 1 +// Anti-alias stage in vtkLineIntegralConvolution2D +// vertical pass of a Gaussian convolution // the output of this shader -//VTK::Output::Dec - -uniform sampler2D texGeomColors; // scalars + lighting -uniform sampler2D texLIC; // image lic, mask -uniform sampler2D texHSLColors; // hsla colors +layout(location = 0) out vec4 LICOutput; +layout(location = 1) out vec4 SeedOutput; -uniform float uLMin; // min lightness over all fragments -uniform float uLMaxMinDiff; // max - min lightness over all fragments +uniform sampler2D texLIC; // input texture +uniform float uDy; // fragment size in vec2 tcoordVC; -vec3 HSLToRGB(vec3 HSL) -{ - vec3 RGB; - float v; - float h = HSL.x; - float sl = HSL.y; - float l = HSL.z; - v = (l <= 0.5) ? (l * (1.0 + sl)) : (l + sl - l * sl); - if (v <= 0.0) { - RGB = vec3(0.0,0.0,0.0); - } else { - float m; - int sextant; - float fract, vsf, mid1, mid2; +// factored 3x3 Gaussian kernel +// K^T*K = G +float K[3] = float[3](0.141421356, 0.707106781, 0.141421356); - m = l + l - v; - h *= 6.0; - sextant = int(h); - fract = h - float(sextant); +// determine if the fragment was masked +bool Masked(float val){ return val != 0.0; } - vsf = (v - m) * fract; - mid1 = m + vsf; - mid2 = v - vsf; - switch (sextant) { - case 0: RGB.r = v; RGB.g = mid1; RGB.b = m; break; - case 1: RGB.r = mid2; RGB.g = v; RGB.b = m; break; - case 2: RGB.r = m; RGB.g = v; RGB.b = mid1; break; - case 3: RGB.r = m; RGB.g = mid2; RGB.b = v; break; - case 4: RGB.r = mid1; RGB.g = m; RGB.b = v; break; - case 5: RGB.r = v; RGB.g = m; RGB.b = mid2; break; +void main(void) +{ +// neighbor offsets +vec2 fragDy[3] = vec2[3](vec2(0.0,-uDy), vec2(0.0,0.0), vec2(0.0,uDy)); + + + vec2 lictc = tcoordVC.st; + vec4 lic[3]; + bool dontUse = false; + float conv = 0.0; + for (int i=0; i<3; ++i) + { + vec2 tc = lictc + fragDy[i]; + lic[i] = texture2D(texLIC, tc); + dontUse = dontUse || Masked(lic[i].g); + conv = conv + K[i] * lic[i].r; } - } - return RGB; + // output is (conv, mask, skip, 1) + if (dontUse) + { + LICOutput = vec4(lic[1].rg, 1.0, 1.0); + } + else + { + LICOutput = vec4(conv, lic[1].gb, 1.0); + } + SeedOutput = vec4(0.0, 0.0, 0.0, 0.0); } +`,{Representation:Y7}=yr;function J7(t){const e=jt.newInstance();e.setOpenGLRenderWindow(t);const a=new Float32Array(12);for(let u=0;u<4;u++)a[u*3]=u%2*2-1,a[u*3+1]=u>1?1:-1,a[u*3+2]=0;const n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array(8);r[0]=3,r[1]=0,r[2]=1,r[3]=3,r[4]=3,r[5]=0,r[6]=3,r[7]=2;const i=pe.newInstance({numberOfComponents:3,values:a});i.setName("points");const o=pe.newInstance({numberOfComponents:1,values:r}),s=pe.newInstance({numberOfComponents:2,values:n});return e.getCABO().createVBO(o,"polys",Y7.SURFACE,{points:i,cellOffset:0,tcoords:s}),e}function oc(t,[e,a],n,r){const i=t.getContext(),o=Ne.newInstance({autoParameters:!1,wrapS:r,wrapT:r,minificationFilter:n,magnificationFilter:n,generateMipmap:!1,openGLDataType:i.FLOAT,baseLevel:0,maxLevel:0});return o.setOpenGLRenderWindow(t),o.setInternalFormat(i.RGBA32F),o.create2DFromRaw({width:e,height:a,numComps:4,dataType:"Float32Array",data:null}),o.activate(),o.sendParameters(),o.deactivate(),o}function Go(t,e){return oc(t,e,Ne.Filter.NEAREST,Ne.Wrap.CLAMP_TO_EDGE)}function Z7(t,e){return oc(t,e,Ne.Filter.NEAREST,Ne.Wrap.CLAMP_TO_EDGE)}function Q7(t,e){return oc(t,e,Ne.Filter.LINEAR,Ne.Wrap.CLAMP_TO_EDGE)}function eC(t,e){if(e.classHierarchy.push("vtkLICPingPongBufferManager"),!e._openGLRenderWindow){console.error("Pass renderwindow to ping pong manager");return}e.quad=J7(e._openGLRenderWindow),e.context=e._openGLRenderWindow.getContext(),e.licTexture0=Go(e._openGLRenderWindow,e.size),e.seedTexture0=Go(e._openGLRenderWindow,e.size),e.licTexture1=Go(e._openGLRenderWindow,e.size),e.seedTexture1=Go(e._openGLRenderWindow,e.size),e.eeTexture=e.doEEPass?Z7(e._openGLRenderWindow,e.size):null,e.imageVectorTexture=e.doVTPass?Q7(e._openGLRenderWindow,e.size):null,e.pingTextures[0]=e.licTexture0,e.pingTextures[1]=e.seedTexture0,e.pongTextures[0]=e.licTexture1,e.pongTextures[1]=e.seedTexture1,e.textures[0]=e.pingTextures,e.textures[1]=e.pongTextures,t.swap=()=>{e.readIndex=1-e.readIndex},t.renderQuad=(a,n)=>{const r=e.quad,i=e.context;let o=e.quadVAO;o||(o=$a.newInstance(),o.setOpenGLRenderWindow(e._openGLRenderWindow),e.quadVAO=o),e.previousProgramHash!==n.getMd5Hash()&&(o.shaderProgramChanged(),r.getCABO().bind(),o.addAttributeArray(n,r.getCABO(),"vertexDC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE),o.addAttributeArray(n,r.getCABO(),"tcoordDC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),e.context.FLOAT,2,e.context.FALSE),e.previousProgramHash=n.getMd5Hash()),i.drawArrays(i.TRIANGLES,0,r.getCABO().getElementCount()),o.release()},t.getLastLICBuffer=()=>e.readIndex===0?e.licTexture0:e.licTexture1,t.getLastSeedBuffer=()=>e.readIndex===0?e.seedTexture0:e.seedTexture1,t.getLICBuffer=()=>1-e.readIndex===0?e.licTexture0:e.licTexture1,t.getSeedBuffer=()=>1-e.readIndex===0?e.seedTexture0:e.seedTexture1,t.getLICTextureUnit=()=>{const a=e.textures[e.readIndex][0];return a.activate(),a.getTextureUnit()},t.getSeedTextureUnit=()=>{const a=e.textures[e.readIndex][1];return a.activate(),a.getTextureUnit()},t.getNoiseTextureUnit=(a=0)=>a===0?(e.noiseTexture.activate(),e.noiseTexture.getTextureUnit()):(e.eeTexture.activate(),e.eeTexture.getTextureUnit()),t.getVectorTextureUnit=()=>(e.vectorTexture.activate(),e.vectorTexture.getTextureUnit()),t.getImageVectorTextureUnit=()=>e.imageVectorTexture?(e.imageVectorTexture.activate(),e.imageVectorTexture.getTextureUnit()):t.getVectorTextureUnit(),t.getMaskVectorTextureUnit=()=>e.maskVectorTexture?(e.maskVectorTexture.activate(),e.maskVectorTexture.getTextureUnit()):t.getImageVectorTextureUnit(),t.clearBuffers=(a=!1)=>{const n=e.framebuffer,r=e.context;n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeColorBuffer(3),n.setColorBuffer(e.licTexture0,0),n.setColorBuffer(e.seedTexture0,1),n.setColorBuffer(e.licTexture1,2),n.setColorBuffer(e.seedTexture1,3);const i=[r.COLOR_ATTACHMENT0,r.COLOR_ATTACHMENT1,r.COLOR_ATTACHMENT2,r.COLOR_ATTACHMENT3];a&&(n.removeColorBuffer(4),n.setColorBuffer(e.eeTexture,4),i.push(r.COLOR_ATTACHMENT4)),r.drawBuffers(i),r.clearColor(0,1,0,0),r.disable(r.SCISSOR_TEST),r.disable(r.BLEND),r.clear(r.COLOR_BUFFER_BIT),n.removeColorBuffer(0),n.removeColorBuffer(1),n.removeColorBuffer(2),n.removeColorBuffer(3),a&&n.removeColorBuffer(4),r.drawBuffers([r.NONE])},t.clearBuffer=a=>{const n=e.framebuffer,r=e.context;n.removeColorBuffer(0),n.setColorBuffer(a,0),r.drawBuffers([r.COLOR_ATTACHMENT0]),r.clearColor(0,1,0,0),r.disable(r.SCISSOR_TEST),r.disable(r.BLEND),r.clear(r.COLOR_BUFFER_BIT),n.removeColorBuffer(a,0),r.drawBuffers([r.NONE])},t.activateVectorTextures=()=>{e.imageVectorTexture?e.imageVectorTexture.activate():e.vectorTexture.activate(),e.maskVectorTexture&&e.maskVectorTexture.activate()},t.deactivateVectorTextures=()=>{e.imageVectorTexture?e.imageVectorTexture.deactivate():e.vectorTexture.deactivate(),e.maskVectorTexture&&e.maskVectorTexture.deactivate()},t.activateNoiseTexture=(a=0)=>{switch(a){case 0:e.noiseTexture.activate();break;case 1:e.eeTexture.activate();break;default:console.error("Wrong LIC pass number")}},t.deactivateNoiseTexture=(a=0)=>{switch(a){case 0:e.noiseTexture.deactivate();break;case 1:e.eeTexture.deactivate();break;default:console.error("Wrong LIC pass number")}},t.attachLICBuffers=()=>{const a=e.textures[e.readIndex],n=e.textures[1-e.readIndex],r=e.framebuffer,i=e.context;a[0].activate(),a[1].activate(),r.removeColorBuffer(0),r.removeColorBuffer(1),r.setColorBuffer(n[0],0),r.setColorBuffer(n[1],1),i.drawBuffers([i.COLOR_ATTACHMENT0,i.COLOR_ATTACHMENT1])},t.detachLICBuffers=()=>{const a=e.textures[e.readIndex],n=e.context,r=e.framebuffer;a[0].deactivate(),a[1].deactivate(),r.removeColorBuffer(0),r.removeColorBuffer(1),n.drawBuffers([n.NONE])},t.attachImageVectorBuffer=()=>{const a=e.framebuffer,n=e.context;e.vectorTexture.activate(),a.removeColorBuffer(0),a.setColorBuffer(e.imageVectorTexture,0),n.drawBuffers([n.COLOR_ATTACHMENT0])},t.detachImageVectorBuffer=()=>{const a=e.context,n=e.framebuffer;e.vectorTexture.deactivate(),n.removeColorBuffer(0),a.drawBuffers([a.NONE])},t.attachEEBuffer=()=>{e.textures[e.readIndex][0].activate(),e.framebuffer.removeColorBuffer(0),e.framebuffer.setColorBuffer(e.eeTexture,0);const a=e.context;a.drawBuffers([a.COLOR_ATTACHMENT0])},t.detachEEBuffer=()=>{const a=e.context;e.framebuffer.removeColorBuffer(0),a.drawBuffers([a.NONE]),e.textures[e.readIndex][0].deactivate()},t.detachBuffers=()=>{const a=e.context,n=e.framebuffer;n.removeColorBuffer(0),n.removeColorBuffer(1),a.drawBuffers([a.NONE]);const r=e.textures[e.readIndex],i=e.textures[1-e.readIndex];r[0]&&r[0].deactivate(),r[1]&&r[1].deactivate(),i[0]&&i[0].deactivate(),i[1]&&i[1].deactivate(),e.eeTexture&&e.eeTexture.deactivate(),e.noiseTexture&&e.noiseTexture.deactivate()},t.getWriteIndex=()=>1-e.readIndex,t.detachBuffers()}var tC={vectorTexture:null,maskVectorTexture:null,noiseTexture:null,doEEPass:!1,doVTPass:!1,readIndex:0,quad:null,lastProgramHash:null,framebuffer:null,size:null,pingTextures:[],pongTextures:[],textures:[]};function eh(t,e,a={}){Object.assign(e,tC,a),A.obj(t,e),A.get(t,e,["readIndex"]),A.setGet(t,e,["doEEPass","doVTPass","_openGLRenderWindow","vectorTexture","maskVectorTexture","noiseTexture","framebuffer","size"]),A.moveToProtected(t,e,["openGLRenderWindow"]),eC(t,e)}var nC=A.newInstance(eh,"vtkLICPingPongBufferManager"),rC={newInstance:nC,extend:eh};function aC(t=!0){const e=` + vec2 getVector( vec2 vectc ) + + { + + vec2 V = texture2D( texVectors, vectc ).xy; + + // normalize if |V| not 0 + + float lenV = length( V ); + + if ( lenV > 1.0e-8 ) + + { + + return V/lenV; + + } + + else + + { + + return vec2( 0.0, 0.0 ); -void main() -{ - // lookup hsl color , mask - vec4 fragColor = texture2D(texHSLColors, tcoordVC.st); + } - // don't modify masked fragments (masked => lic.g==1) - vec4 lic = texture2D(texLIC, tcoordVC.st); - if (lic.g==0.0) - { - // normalize lightness channel - fragColor.z = clamp((fragColor.z - uLMin)/uLMaxMinDiff, 0.0, 1.0); - } + } - // back into rgb space - fragColor.rgb = HSLToRGB(fragColor.xyz); + `,a=` + vec2 getVector( vec2 vectc ) - // add alpha - vec4 geomColor = texture2D(texGeomColors, tcoordVC.st); - fragColor.a = geomColor.a; + { - gl_FragData[0] = fragColor; -} -`;function gx(t,e){e.classHierarchy.push("vtkSurfaceLICInterface")}const dx={enableLIC:!1,nuberOfSteps:40,stepSize:.25,transformVectors:!0,normalizeVectors:!0,maskOnSurface:!1,maskThreshold:0,maskColor:[0,0,0],maskIntensity:0,enhancedLIC:!0,enhanceContrast:Mr.NONE,lowLICContrastEnhancementFactor:0,highLICContrastEnhancementFactor:0,lowColorContrastEnhancementFactor:0,highColorContrastEnhancementFactor:0,antiAlias:0,colorMode:ox.BLEND,LICIntensity:1,mapModeBias:0,noiseTextureSize:200,noiseTextureType:J0.GAUSSIAN,noiseGrainSize:8,noiseImpulseProbability:.1,noiseImpulseBackgroundValue:0,noiseGeneratorSeed:0,minNoiseValue:0,maxNoiseValue:1,numberOfNoiseLevels:2,shadersNeedBuilding:!0,reallocateTextures:!0,rebuildNoiseTexture:!1,viewPortScale:1};function jh(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,dx,a),V.obj(t,e),V.setGet(t,e,["enableLIC","numberOfSteps","stepSize","normalizeVectors","transformVectors","maskOnSurface","maskThreshold","maskColor","maskIntensity","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","lowColorContrastEnhancementFactor","highColorContrastEnhancementFactor","antiAlias","colorMode","LICIntensity","mapModeBias","noiseTextureSize","noiseTextureType","noiseGrainSize","minNoiseValue","maxNoiseValue","numberOfNoiseLevels","noiseImpulseProbability","noiseImpulseBackgroundValue","noiseGeneratorSeed","viewPortScale","rebuildNoiseTexture"]),gx(t,e)}var Wh={newInstance:V.newInstance(jh,"vtkSurfaceLICInterface"),extend:jh};const{Representation:vx}=pr;function yx(t){const e=jt.newInstance();e.setOpenGLRenderWindow(t);const a=new Float32Array(12);for(let c=0;c<4;c++)a[c*3]=c%2*2-1,a[c*3+1]=c>1?1:-1,a[c*3+2]=0;const n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array(8);r[0]=3,r[1]=0,r[2]=1,r[3]=3,r[4]=3,r[5]=0,r[6]=3,r[7]=2;const i=pe.newInstance({numberOfComponents:3,values:a});i.setName("points");const o=pe.newInstance({numberOfComponents:1,values:r}),s=pe.newInstance({numberOfComponents:2,values:n});return e.getCABO().createVBO(o,"polys",vx.SURFACE,{points:i,cellOffset:0,tcoords:s}),e}function mx(t,e){e.classHierarchy.push("vtkOpenGLSurfaceLICInterface"),t.renderQuad=(r,i)=>{const o=e.licQuad,s=e.context;let c=e.licQuadVAO;c||(c=ja.newInstance(),c.setOpenGLRenderWindow(e._openGLRenderWindow),e.licQuadVAO=c),e.previousProgramHash!==i.getMd5Hash()&&(c.shaderProgramChanged(),o.getCABO().bind(),c.addAttributeArray(i,o.getCABO(),"vertexDC",o.getCABO().getVertexOffset(),o.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE),c.addAttributeArray(i,o.getCABO(),"tcoordDC",o.getCABO().getTCoordOffset(),o.getCABO().getStride(),e.context.FLOAT,2,e.context.FALSE),e.previousProgramHash=i.getMd5Hash()),s.drawArrays(s.TRIANGLES,0,o.getCABO().getElementCount()),c.release()};function a(r,i,o,s,c,l){const u=Math.max(0,Math.min(1,o)),f=Float32Array.from({length:r*r},()=>{let g=0;if(u===1||Math.random()>1-u)for(let C=0;C<2048;++C)g+=Math.random();return g});let h=0,d=2048+1;f.forEach(g=>{u===1?d=g0?g:d,h=g>h?g:h});let v=h-d;v===0&&(d=0,h===0?v=1:v=h);const m=i-1,x=m!==0?1/m:0,y=l-c;return f.map(g=>{const C=gm?m:S;return g>=d?i===1?l:c+T*x*y:s})}function n(r,i,o,s){let[c,l]=r;const p=s-o;return Float32Array.from({length:c*l},()=>{let u=Math.random();return u=Math.floor(u*i)/i,u=u*p+o,u>1?1:u<0?0:u})}t.generateNoiseTexture=r=>{if(!e.noiseTexture||e.licInterface.getRebuildNoiseTexture()){e.licInterface.setRebuildNoiseTexture(!1),e.noiseTexture&&e.noiseTexture.releaseGraphicsResources(),Ol(e.noiseGeneratorSeed,{global:!0});let i=[];const{noiseTextureType:o,noiseGrainSize:s,numberOfNoiseLevels:c,noiseImpulseProbability:l,noiseImpulseBackgroundValue:p,minNoiseValue:u,maxNoiseValue:f}=e.licInterface.get("noiseTextureType","noiseGrainSize","numberOfNoiseLevels","noiseImpulseProbability","noiseImpulseBackgroundValue","minNoiseValue","maxNoiseValue");switch(o){case J0.GAUSSIAN:i=a(Math.floor(r/s),c,l,p,u,f);break;case J0.UNIFORM:default:i=n([Math.ceil(r/s),Math.ceil(r/s)],c,u,f)}const h=1/s,d=Float32Array.from({length:r*r*4},(m,x)=>{const y=x/4;if(x%4===0){const g=Math.floor(y%r*h),C=Math.floor(y/r*h);return i[C*(r/s)+g]}return x%4===1||x%4===3?1:0}),v=Re.newInstance({wrapS:Re.Wrap.REPEAT,wrapT:Re.Wrap.REPEAT,minificationFilter:Re.Filter.NEAREST,magnificationFilter:Re.Filter.NEAREST,generateMipMap:!1,openGLDataType:e.context.FLOAT,baseLevel:0,maxLevel:0,autoParameters:!1});v.setOpenGLRenderWindow(e._openGLRenderWindow),v.create2DFromRaw({width:r,height:r,numComps:4,dataType:"Float32Array",data:d}),v.activate(),v.sendParameters(),v.deactivate(),e.noiseTexture=v}},t.buildAShader=r=>e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(Ih,r,""),t.allocateTextures=()=>{const r=Re.Filter.NEAREST,i=Re.Filter.LINEAR,o=e._openGLRenderWindow;e.geometryImage||(e.geometryImage=t.allocateTexture(o,r)),e.vectorImage||(e.vectorImage=t.allocateTexture(o,i)),e.maskVectorImage||(e.maskVectorImage=t.allocateTexture(o,i)),e.LICImage||(e.LICImage=t.allocateTexture(o,r)),e.RGBColorImage||(e.RGBColorImage=t.allocateTexture(o,r)),e.HSLColorImage||(e.HSLColorImage=t.allocateTexture(o,r)),e.depthTexture||(e.depthTexture=t.allocateDepthTexture(o))},t.allocateTexture=(r,i)=>{const o=e.context,s=Re.newInstance({wrapS:Re.Wrap.CLAMP_TO_EDGE,wrapT:Re.Wrap.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:i,generateMipmap:!1,openGLDataType:o.FLOAT,baseLevel:0,maxLevel:0,autoParameters:!1});return s.setOpenGLRenderWindow(r),s.setInternalFormat(o.RGBA32F),s.create2DFromRaw({width:e.size[0],height:e.size[1],numComps:4,dataType:"Float32Array",data:null}),s.activate(),s.sendParameters(),s.deactivate(),s},t.allocateDepthTexture=r=>{const i=e.context,o=Re.newInstance({generateMipmap:!1,openGLDataType:i.FLOAT,autoParameters:!1});return o.setOpenGLRenderWindow(r),o.createDepthFromRaw({width:e.size[0],height:e.size[1],dataType:"Float32Array",data:null}),o.activate(),o.sendParameters(),o.deactivate(),o},t.createFBO=()=>{if(!e.framebuffer){e.licHelper=null;const r=Er.newInstance();r.setOpenGLRenderWindow(e._openGLRenderWindow),r.saveCurrentBindingsAndBuffers(),r.create(...e.size),r.populateFramebuffer(),e.framebuffer=r,r.restorePreviousBindingsAndBuffers()}},t.completedGeometry=()=>{const r=e.context,i=e.framebuffer;i.removeColorBuffer(0),i.removeColorBuffer(1),i.removeColorBuffer(2),i.removeDepthBuffer(),r.drawBuffers([r.NONE]),i.restorePreviousBindingsAndBuffers()},t.buildAllShaders=()=>{e.shadersNeedBuilding&&(e.licColorPass=t.buildAShader(fx),e.licCopyPass=t.buildAShader(px),e.enhanceContrastPass=t.buildAShader(hx),e.shadersNeedBuilding=!1)},t.initializeResources=()=>{t.createFBO(),t.generateNoiseTexture(e.licInterface.getNoiseTextureSize()),t.allocateTextures(),t.buildAllShaders(),e.licQuad||(e.licQuad=yx(e._openGLRenderWindow)),e.licHelper||(e.licHelper=lx.newInstance())},t.prepareForGeometry=()=>{const r=e.framebuffer;r.saveCurrentBindingsAndBuffers(),r.bind(),e.geometryImage.activate(),e.vectorImage.activate(),e.maskVectorImage.activate(),r.removeColorBuffer(0),r.removeColorBuffer(2),r.removeColorBuffer(3),r.setColorBuffer(e.geometryImage,0),r.setColorBuffer(e.vectorImage,2),r.setColorBuffer(e.maskVectorImage,3),r.setDepthBuffer(e.depthTexture);const i=e.context;i.drawBuffers([i.COLOR_ATTACHMENT0,i.NONE,i.COLOR_ATTACHMENT2,i.COLOR_ATTACHMENT3]),i.viewport(0,0,...e.size),i.scissor(0,0,...e.size),i.disable(i.BLEND),i.disable(i.DEPTH_TEST),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.DEPTH_BUFFER_BIT|i.COLOR_BUFFER_BIT)},t.copyToScreen=r=>{e.RGBColorImage.activate(),e.depthTexture.activate(),e.licCopyPass||t.initializeResources();const i=e.licCopyPass;e._openGLRenderWindow.getShaderCache().readyShaderProgram(i);const o=e.context;o.viewport(0,0,...r),o.scissor(0,0,...r),o.disable(o.BLEND),o.enable(o.DEPTH_TEST),o.disable(o.SCISSOR_TEST),i.setUniformi("texDepth",e.depthTexture.getTextureUnit()),i.setUniformi("texRGBColors",e.RGBColorImage.getTextureUnit()),t.renderQuad(r,i),e.RGBColorImage.deactivate(),e.depthTexture.deactivate()},t.combineColorsAndLIC=()=>{const r=e.context,i=e.framebuffer;i.saveCurrentBindingsAndBuffers(),i.bind(),i.create(...e.size),i.removeColorBuffer(0),i.removeColorBuffer(1),i.setColorBuffer(e.RGBColorImage,0),i.setColorBuffer(e.HSLColorImage,1),r.drawBuffers([r.COLOR_ATTACHMENT0,r.COLOR_ATTACHMENT1]),r.disable(r.DEPTH_TEST),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),e.vectorImage.activate(),e.geometryImage.activate(),e.LICImage.activate(),e.licColorPass||t.initializeResources();const o=e.licColorPass;e._openGLRenderWindow.getShaderCache().readyShaderProgram(o),o.setUniformi("texVectors",e.vectorImage.getTextureUnit()),o.setUniformi("texGeomColors",e.geometryImage.getTextureUnit());const{colorMode:s,LICIntensity:c,mapModeBias:l,maskIntensity:p,maskColor:u,enhanceContrast:f,lowColorContrastEnhancementFactor:h,highColorContrastEnhancementFactor:d}=e.licInterface.get("colorMode","LICIntensity","mapModeBias","maskIntensity","maskColor","enhanceContrast","lowColorContrastEnhancementFactor","highColorContrastEnhancementFactor");if(o.setUniformi("texLIC",e.LICImage.getTextureUnit()),o.setUniformi("uScalarColorMode",s),o.setUniformf("uLICIntensity",c),o.setUniformf("uMapBias",l),o.setUniformf("uMaskIntensity",p),o.setUniform3f("uMaskColor",...u),t.renderQuad(e.size,o),e.vectorImage.deactivate(),e.geometryImage.deactivate(),e.LICImage.deactivate(),i.removeColorBuffer(0),i.removeColorBuffer(1),r.drawBuffers([r.NONE]),f===Mr.COLOR||f===Mr.BOTH){let v=0,m=1,x=m-v;v+=x*h,m-=x*d,x=m-v,i.setColorBuffer(e.RGBColorImage),r.drawBuffers([r.COLOR_ATTACHMENT0]),e.geometryImage.activate(),e.HSLColorImage.activate(),e.LICImage.activate(),e.enhanceContrastPass||t.initializeResources();const{enhanceContrastPass:y}=e;e._openGLRenderWindow.getShaderCache().readyShaderProgram(y),y.setUniformi("texGeomColors",e.geometryImage.getTextureUnit()),y.setUniformi("texHSLColors",e.HSLColorImage.getTextureUnit()),y.setUniformi("texLIC",e.LICImage.getTextureUnit()),y.setUniformf("uLMin",v),y.setUniformf("uLMaxMinDiff",x),t.renderQuad(e.size,y),e.geometryImage.deactivate(),e.HSLColorImage.deactivate(),e.LICImage.deactivate(),i.removeColorBuffer(0),r.drawBuffers([r.NONE])}i.restorePreviousBindingsAndBuffers()},t.applyLIC=()=>{const r=e.licInterface.get("stepSize","numberOfSteps","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","antiAlias","normalizeVectors","maskThreshold","transformVectors"),i=e.licHelper.executeLIC(e.size,e.vectorImage,e.maskVectorImage,e.noiseTexture,e._openGLRenderWindow,r);if(!i){console.error("Failed to compute image LIC"),e.LICImage=null;return}e.LICImage=i},t.setSize=r=>{Array.isArray(r)&&r.length===2&&(!e.size||e.size[0]!==r[0]||e.size[1]!==r[1])&&(e.size=r,t.releaseGraphicsResources())},t.releaseGraphicsResources=()=>{e.geometryImage&&(e.geometryImage.releaseGraphicsResources(),e.geometryImage=null),e.vectorImage&&(e.vectorImage.releaseGraphicsResources(),e.vectorImage=null),e.maskVectorImage&&(e.maskVectorImage.releaseGraphicsResources(),e.maskVectorImage=null),e.LICImage&&(e.LICImage.releaseGraphicsResources(),e.LICImage=null),e.RGBColorImage&&(e.RGBColorImage.releaseGraphicsResources(),e.RGBColorImage=null),e.HSLColorImage&&(e.HSLColorImage.releaseGraphicsResources(),e.HSLColorImage=null),e.depthTexture&&(e.depthTexture.releaseGraphicsResources(),e.depthTexture=null),e.framebuffer&&(e.framebuffer.releaseGraphicsResources(),e.framebuffer=null)}}const xx={context:null,shadersNeedBuilding:!0,reallocateTextures:!0,size:null,licInterface:null};function $h(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,xx,a),Wh.extend(t,e,a),V.obj(t,e),V.setGet(t,e,["context","_openGLRenderWindow","reallocateTextures","licInterface","size"]),V.moveToProtected(t,e,["openGLRenderWindow"]),mx(t,e)}var Cx={newInstance:V.newInstance($h,"vtkSurfaceLICInterface"),extend:$h};const{vtkErrorMacro:Fo}=Dt;function Sx(t,e){e.classHierarchy.push("vtkOpenGLSurfaceLICMapper");const a={...t};t.getNeedToRebuildShaders=(n,r,i)=>e.rebuildLICShaders||a.getNeedToRebuildShaders(n,r,i),t.replaceShaderValues=(n,r,i)=>{const o=e.lastBoundBO.getReferenceByName("lastLightComplexity");let s=n.Vertex,c=n.Fragment;const l=e.renderable.getInputArrayToProcess(0);if(l&&e.canDrawLIC){c=Q.substitute(c,"//VTK::Output::Dec",["//VTK::Output::Dec","layout(location = 2) out vec4 vectorTexture;","layout(location = 3) out vec4 maskVectorTexture;"]).result;const u=`${l.getName()}MC`;o===0&&e.lastBoundBO.set({lastLightComplexity:1},!0),s=Q.substitute(s,"//VTK::TCoord::Dec",[`attribute vec3 ${u};`,"out vec3 licOutput;","//VTK::TCoord::Dec"]).result,s=Q.substitute(s,"//VTK::TCoord::Impl",[`licOutput = ${u};`,"//VTK::TCoord::Impl"]).result,c=Q.substitute(c,"//VTK::TCoord::Dec",["uniform int uMaskOnSurface;","uniform mat3 normalMatrix;","in vec3 licOutput;","//VTK::TCoord::Dec"]).result,c=Q.substitute(c,"//VTK::TCoord::Impl",["// projected vectors"," vec3 tcoordLIC = normalMatrix * licOutput;"," vec3 normN = normalize(normalVCVSOutput);"," float k = dot(tcoordLIC, normN);"," vec3 projected = (tcoordLIC - k*normN);"," vectorTexture = vec4(projected.x, projected.y, 0.0 , 1.0);","// vectors for fragment masking"," if (uMaskOnSurface == 0)"," {"," maskVectorTexture = vec4(licOutput, 1.0);"," }"," else"," {"," maskVectorTexture = vec4(projected.x, projected.y, 0.0 , 1.0);"," }","//VTK::TCoord::Impl"],!1).result,n.Vertex=s}e.rebuildLICShaders=!1,n.Fragment=c,a.replaceShaderValues(n,r,i),o>0&&e.lastBoundBO.set({lastLightComplexity:o},!0)},t.setMapperShaderParameters=(n,r,i)=>{a.setMapperShaderParameters(n,r,i),e.canDrawLIC&&n.getProgram().setUniformi("uMaskOnSurface",e.maskOnSurface)},t.getNeedToRebuildBufferObjects=(n,r)=>e.rebuildLICBuffers||a.getNeedToRebuildBufferObjects(n,r),t.buildBufferObjects=(n,r)=>{if(e.canDrawLIC){const i=e.renderable.getInputArrayToProcess(0);i&&i.getNumberOfComponents()>1&&e.renderable.setCustomShaderAttributes([i.getName()])}e.rebuildLICBuffers=!1,a.buildBufferObjects(n,r)},t.pushState=n=>{e.stateCache={[n.BLEND]:n.isEnabled(n.BLEND),[n.DEPTH_TEST]:n.isEnabled(n.DEPTH_TEST),[n.SCISSOR_TEST]:n.isEnabled(n.SCISSOR_TEST),[n.CULL_FACE]:n.isEnabled(n.CULL_FACE)}},t.popState=n=>{const r=i=>e.stateCache[i]?n.enable(i):n.disable(i);r(n.BLEND),r(n.DEPTH_TEST),r(n.SCISSOR_TEST),r(n.CULL_FACE)},t.renderPiece=(n,r)=>{let i=!0;e._openGLRenderWindow.getWebgl2()||(Fo("SurfaceLICMapper Requires WebGL 2"),i=!1),(!e.context.getExtension("EXT_color_buffer_float")||!e.context.getExtension("OES_texture_float_linear"))&&(Fo("SurfaceLICMapper requires the EXT_color_buffer_float and OES_texture_float_linear WebGL2 extensions."),i=!1),e.currentInput=e.renderable.getInputData(),e.currentInput||(Fo("No input"),i=!1);let s=e.renderable.getLicInterface();s||(s=Wh.newInstance(),e.renderable.setLicInterface(s)),e.openGLLicInterface||(e.openGLLicInterface=Cx.newInstance()),s!==e.openGLLicInterface.getLicInterface()&&e.openGLLicInterface.setLicInterface(s);const c=e.renderable.getInputArrayToProcess(0);if(s.getEnableLIC()&&(!c||c.getNumberOfComponents()<2)&&(Fo("No vector input array"),i=!1),s.getEnableLIC()||(i=!1),e.canDrawLIC!==i&&(e.rebuildLICShaders=!0,e.rebuildLICBuffers=!0),e.canDrawLIC=i,!i||!s.getEnableLIC()){a.renderPiece(n,r);return}const l=e.context,p=r.getProperty().getBackfaceCulling(),u=r.getProperty().getFrontfaceCulling();!p&&!u?e._openGLRenderWindow.disableCullFace():u?(e._openGLRenderWindow.enableCullFace(),l.cullFace(l.FRONT)):(e._openGLRenderWindow.enableCullFace(),l.cullFace(l.BACK));const f=e._openGLRenderWindow.getSize(),h=f.map(d=>Math.round(d*s.getViewPortScale()));e.openGLLicInterface.setSize(h),e.openGLLicInterface.setOpenGLRenderWindow(e._openGLRenderWindow),e.openGLLicInterface.setContext(e.context),t.pushState(e.context),e.openGLLicInterface.initializeResources(),e.openGLLicInterface.prepareForGeometry(),t.popState(e.context),a.renderPieceStart(n,r),a.renderPieceDraw(n,r),a.renderPieceFinish(n,r),t.pushState(e.context),e.VBOBuildTime.modified(),e.openGLLicInterface.completedGeometry(),e.context.disable(e.context.CULL_FACE),e.openGLLicInterface.applyLIC(),e.openGLLicInterface.combineColorsAndLIC(),e.openGLLicInterface.copyToScreen(f),t.popState(e.context)}}const Tx={canDrawLIC:!1,rebuildLICShaders:!1,rebuildLICBuffers:!1,openGLLicInterface:null};function wx(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Tx,a),Do.extend(t,e,a),Sx(t,e),pt(t,e,["openGLLicInterface"])}const _x=Je(wx,"vtkOpenGLSurfaceLICMapper");st("vtkSurfaceLICMapper",_x);var Ex=`//VTK::System::Dec + return texture2D( texVectors, vectc ).xy; -/*========================================================================= + } - Program: Visualization Toolkit - Module: vtkSphereMapperVS.glsl + `;return t?e:a}function iC(t,e){e.classHierarchy.push("vtkLineIntegralConvolution2D"),t.buildAShader=r=>e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(Q1,r,""),t.dumpTextureValues=(r,[i,o],s=e.context,u=e._openGLRenderWindow,c=4)=>{const p=Or.newInstance(),l=s;let f=null;return p.setOpenGLRenderWindow(u),p.saveCurrentBindingsAndBuffers(),p.create(i,o),p.populateFramebuffer(),p.setColorBuffer(r),f=new Float32Array(i*o*c),l.readPixels(0,0,i,o,c===4?l.RGBA:l.RGB,l.FLOAT,f),p.restorePreviousBindingsAndBuffers(),f},t.getTextureMinMax=(r,i,o=e.context,s=e._openGLRenderWindow)=>{const u=t.dumpTextureValues(r,i,o,s,4);let c=Number.MAX_VALUE,p=Number.MIN_VALUE;for(let l=0;lp&&(p=f)}return{min:c,max:p}},t.getComponentSelectionProgram=r=>{const i="xyzw";return`.${i[r[0]]}${i[r[1]]}`},t.buildShaders=()=>{e.LIC0ShaderProgram=t.buildAShader(z7);const r=Z.substitute(X7,"//VTK::LICComponentSelection::Impl",`vec2 V = texture2D(texVectors, tcoordVC.st)${t.getComponentSelectionProgram(e.componentIds)};`).result;e.VTProgram=t.buildAShader(r);const i=Z.substitute(W7,"//VTK::LICVectorLookup::Impl",aC(e.normalizeVectors),!0).result;e.LICIShaderProgram=t.buildAShader(i),e.LICNShaderProgram=t.buildAShader(j7),e.CEProgram=t.buildAShader($7),e.EEProgram=t.buildAShader(H7),e.AAHProgram=t.buildAShader(K7),e.AAVProgram=t.buildAShader(q7)};function a(r,i){r.setUniformi("texLIC",i.getLICTextureUnit()),r.setUniformi("texSeedPts",i.getSeedTextureUnit())}function n(r,i,o){r.attachLICBuffers(),r.renderQuad(i,o),r.detachLICBuffers(),r.swap()}t.executeLIC=(r,i,o,s,u,c)=>{if(e._openGLRenderWindow=u,e.context=u.getContext(),Object.assign(e,c),r[0]<=0||r[1]<=0)return null;const p=[1/r[0],1/r[1]];let l=e.stepSize*Math.sqrt(p[0]*p[0]+p[1]*p[1]);l<=0&&(l=1e-10);const f=e.context;let h=e.framebuffer;const v=h==null?void 0:h.getSize();(!h||!v||r[0]!==v||r[1]!==v)&&(h=Or.newInstance(),h.setOpenGLRenderWindow(e._openGLRenderWindow),h.saveCurrentBindingsAndBuffers(),h.create(...r),h.populateFramebuffer(),h.restorePreviousBindingsAndBuffers(),e.framebuffer=h),h.saveCurrentBindingsAndBuffers(),h.bind(),f.viewport(0,0,...r),f.scissor(0,0,...r),e.shadersNeedBuild&&(t.buildShaders(),e.shadersNeedBuild=!1),e.bufs?(e.bufs.setVectorTexture(i),e.bufs.setMaskVectorTexture(o),e.bufs.setNoiseTexture(s)):e.bufs=rC.newInstance({openGLRenderWindow:u,doEEPass:e.enhancedLIC,doVTPass:e.transformVectors,vectorTexture:i,maskVectorTexture:o,noiseTexture:s,framebuffer:h,size:r});const m=[(s.getWidth()+1)/r[0],(s.getHeight()+1)/r[1]],x=1/r[0],y=1/r[1],d=e._openGLRenderWindow.getShaderCache();if(e.transformVectors){const T=e.VTProgram;d.readyShaderProgram(T),e.bufs.attachImageVectorBuffer(),T.setUniform2f("uTexSize",...r),T.setUniformi("texVectors",e.bufs.getVectorTextureUnit()),f.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT),e.bufs.renderQuad(r,T),e.bufs.detachImageVectorBuffer()}e.bufs.clearBuffers(e.enhancedLIC),e.bufs.activateVectorTextures(),e.bufs.activateNoiseTexture(0);const{LIC0ShaderProgram:g}=e;d.readyShaderProgram(g),g.setUniformi("uStepNo",0),g.setUniformi("uPassNo",0),g.setUniformf("uMaskThreshold",e.maskThreshold),g.setUniform2f("uNoiseBoundsPt1",...m),g.setUniformi("texMaskVectors",e.bufs.getMaskVectorTextureUnit()),g.setUniformi("texLIC",e.bufs.getLICTextureUnit()),g.setUniformi("texNoise",e.bufs.getNoiseTextureUnit(0)),n(e.bufs,r,g);const{LICIShaderProgram:C}=e;d.readyShaderProgram(C),C.setUniformi("uPassNo",0),C.setUniformf("uStepSize",-l),C.setUniform2f("uNoiseBoundsPt1",...m),C.setUniformi("texVectors",e.bufs.getImageVectorTextureUnit()),C.setUniformi("texNoise",e.bufs.getNoiseTextureUnit(0));for(let T=0;T{const o=e._openGLRenderWindow.getShaderCache();let{min:s,max:u}=t.getTextureMinMax(e.bufs.getLastLICBuffer(),i,e.context,e._openGLRenderWindow);(u<=s||u>1||s<0)&&(console.error("Invalid color range: ",s,u),s=0,u=1);let c=u-s;r&&(s+=c*e.lowLICContrastEnhancementFactor,u-=c*e.highLICContrastEnhancementFactor,c=u-s);const{CEProgram:p}=e;o.readyShaderProgram(p),p.setUniformi("texLIC",e.bufs.getLICTextureUnit()),p.setUniformf("uMin",s),p.setUniformf("uMaxMinDiff",c),n(e.bufs,i,p)}}var oC={shadersNeedBuild:!0,stepSize:1,numberOfSteps:10,enhancedLIC:!0,enhanceContrast:!1,lowContrastEnhancementFactor:0,highContrastEnhancementFactor:0,antiAlias:0,componentIds:[0,1],normalizeVectors:!0,maskThreshold:0,transformVectors:!0,bufs:null,isComposite:!0};function th(t,e,a={}){Object.assign(e,oC,a),A.obj(t,e),A.setGet(t,e,["context","_openGLRenderWindow","nuberOfSteps","stepSize","normalizeVectors","maskThreshold","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","antiAlias","componentIds","isComposite"]),A.moveToProtected(t,e,["openGLRenderWindow"]),iC(t,e)}var sC=A.newInstance(th,"vtkLineIntegralConvolution2D"),cC={newInstance:sC,extend:th},uC=`//VTK::System::Dec - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +//========================================================================= +// +// Program: Visualization Toolkit +// Module: vtkSurfaceLICMapper_fs2.glsl +// +// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +// All rights reserved. +// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +// +// This software is distributed WITHOUT ANY WARRANTY; without even +// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. See the above copyright notice for more information. +// +//========================================================================= - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. +// This shader combines surface geometry, LIC, and scalar colors. -=========================================================================*/ -// this shader implements imposters in OpenGL for Spheres +// the output of this shader +layout(location = 0) out vec4 RGBOutput; +layout(location = 1) out vec4 HSLOutput; -attribute vec4 vertexMC; -attribute vec2 offsetMC; +uniform sampler2D texVectors; // vectors, depth +uniform sampler2D texGeomColors; // scalar colors + lighting +uniform sampler2D texLIC; // image lic +uniform int uScalarColorMode; // select between blend, and map shader +uniform float uLICIntensity; // blend shader: blending factor for lic'd colors +uniform float uMapBias; // map shader: adjust the brightness of the result +uniform float uMaskIntensity; // blending factor for mask color +uniform vec3 uMaskColor; // color for the masked out fragments -// optional normal declaration -//VTK::Normal::Dec +in vec2 tcoordVC; -//VTK::Picking::Dec +/** +Convert from RGB color space into HSL colorspace. +*/ +vec3 RGBToHSL(vec3 RGB) +{ + vec3 HSL = vec3(0.0, 0.0, 0.0); -// Texture coordinates -//VTK::TCoord::Dec + float RGBMin = min(min(RGB.r, RGB.g), RGB.b); + float RGBMax = max(max(RGB.r, RGB.g), RGB.b); + float RGBMaxMinDiff = RGBMax - RGBMin; -uniform mat3 normalMatrix; // transform model coordinate directions to view coordinates + HSL.z = (RGBMax + RGBMin) / 2.0; -// material property values -//VTK::Color::Dec + if (RGBMaxMinDiff == 0.0) + { + // Gray scale + HSL.x = 0.0; + HSL.y = 0.0; + } + else + { + // Color + if (HSL.z < 0.5) + HSL.y = RGBMaxMinDiff / (RGBMax + RGBMin); + else + HSL.y = RGBMaxMinDiff / (2.0 - RGBMax - RGBMin); -// clipping plane vars -//VTK::Clip::Dec + float dR + = (((RGBMax - RGB.r) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff; + float dG + = (((RGBMax - RGB.g) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff; + float dB + = (((RGBMax - RGB.b) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff; -// camera and actor matrix values -//VTK::Camera::Dec + if (RGB.r == RGBMax) + HSL.x = dB - dG; + else + if (RGB.g == RGBMax) + HSL.x = (1.0 / 3.0) + dR - dB; + else + if (RGB.b == RGBMax) + HSL.x = (2.0 / 3.0) + dG - dR; -varying vec4 vertexVCVSOutput; -varying float radiusVCVSOutput; -varying vec3 centerVCVSOutput; + if (HSL.x < 0.0) + HSL.x += 1.0; -uniform int cameraParallel; -uniform float scaleFactor; + if (HSL.x > 1.0) + HSL.x -= 1.0; + } -void main() + return HSL; +} + +/** +Helper for HSL to RGB conversion. +*/ +float Util(float v1, float v2, float vH) { - //VTK::Picking::Impl + if (vH < 0.0) + vH += 1.0; - //VTK::Color::Impl + if (vH > 1.0) + vH -= 1.0; - //VTK::Normal::Impl + if ((6.0 * vH) < 1.0) + return (v1 + (v2 - v1) * 6.0 * vH); - //VTK::TCoord::Impl + if ((2.0 * vH) < 1.0) + return (v2); - //VTK::Clip::Impl + if ((3.0 * vH) < 2.0) + return (v1 + (v2 - v1) * ((2.0 / 3.0) - vH) * 6.0); - // compute the projected vertex position - vec2 scaledOffsetMC = scaleFactor * offsetMC; - vertexVCVSOutput = MCVCMatrix * vertexMC; - centerVCVSOutput = vertexVCVSOutput.xyz; - radiusVCVSOutput = length(scaledOffsetMC)*0.5; + return v1; +} - // make the triangle face the camera - if (cameraParallel == 0) +/** +Convert from HSL space into RGB space. +*/ +vec3 HSLToRGB(vec3 HSL) +{ + vec3 RGB; + if (HSL.y == 0.0) { - vec3 dir = normalize(-vertexVCVSOutput.xyz); - vec3 base2 = normalize(cross(dir,vec3(1.0,0.0,0.0))); - vec3 base1 = cross(base2,dir); - vertexVCVSOutput.xyz = vertexVCVSOutput.xyz + scaledOffsetMC.x*base1 + scaledOffsetMC.y*base2; + // Gray + RGB.r = HSL.z; + RGB.g = HSL.z; + RGB.b = HSL.z; } else { - // add in the offset - vertexVCVSOutput.xy = vertexVCVSOutput.xy + scaledOffsetMC; + // Chromatic + float v2; + if (HSL.z < 0.5) + v2 = HSL.z * (1.0 + HSL.y); + else + v2 = (HSL.z + HSL.y) - (HSL.y * HSL.z); + + float v1 = 2.0 * HSL.z - v2; + + RGB.r = Util(v1, v2, HSL.x + (1.0 / 3.0)); + RGB.g = Util(v1, v2, HSL.x); + RGB.b = Util(v1, v2, HSL.x - (1.0 / 3.0)); } - gl_Position = VCPCMatrix * vertexVCVSOutput; + return RGB.rgb; } -`;const{vtkErrorMacro:Dx}=Dt;function Ox(t,e){e.classHierarchy.push("vtkOpenGLSphereMapper");const a={...t};t.getShaderTemplate=(n,r,i)=>{n.Vertex=Ex,n.Fragment=$a,n.Geometry=""},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;o=Q.substitute(o,"//VTK::Camera::Dec",[`uniform mat4 VCPCMatrix; -`,"uniform mat4 MCVCMatrix;"]).result,s=Q.substitute(s,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,s=Q.substitute(s,"//VTK::PositionVC::Impl",[`vec4 vertexVC = vertexVCVSOutput; -`]).result;const c=[`uniform float invertedDepth; -`,`uniform int cameraParallel; -`,`varying float radiusVCVSOutput; -`,`varying vec3 centerVCVSOutput; -`,`uniform mat4 VCPCMatrix; -`];s=Q.substitute(s,"//VTK::Normal::Dec",c).result;let l="";e.context.getExtension("EXT_frag_depth")&&(l=`gl_FragDepthEXT = (pos.z / pos.w + 1.0) / 2.0; -`),e._openGLRenderWindow.getWebgl2()&&(l=`gl_FragDepth = (pos.z / pos.w + 1.0) / 2.0; -`),s=Q.substitute(s,"//VTK::Depth::Impl",[` vec3 EyePos; -`,` vec3 EyeDir; -`,` if (cameraParallel != 0) { -`,` EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVCVSOutput); -`,` EyeDir = vec3(0.0,0.0,-1.0); } -`,` else { -`,` EyeDir = vertexVC.xyz; -`,` EyePos = vec3(0.0,0.0,0.0); -`,` float lengthED = length(EyeDir); -`,` EyeDir = normalize(EyeDir); -`,` if (lengthED > radiusVCVSOutput*3.0) { -`,` EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; } -`,` } -`,` EyePos = EyePos - centerVCVSOutput; -`,` EyePos = EyePos/radiusVCVSOutput; -`,` float b = 2.0*dot(EyePos,EyeDir); -`,` float c = dot(EyePos,EyePos) - 1.0; -`,` float d = b*b - 4.0*c; -`,` vec3 normalVCVSOutput = vec3(0.0,0.0,1.0); -`,` if (d < 0.0) { discard; } -`,` else { -`,` float t = (-b - invertedDepth*sqrt(d))*0.5; -`,` normalVCVSOutput = invertedDepth*normalize(EyePos + t*EyeDir); -`,` vertexVC.xyz = normalVCVSOutput*radiusVCVSOutput + centerVCVSOutput; -`,` } -`,` vec4 pos = VCPCMatrix * vertexVC; -`,l]).result,s=Q.substitute(s,"//VTK::Normal::Impl","").result,e.haveSeenDepthRequest&&(s=Q.substitute(s,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),n.Vertex=o,n.Fragment=s,a.replaceShaderValues(n,r,i)},t.setMapperShaderParameters=(n,r,i)=>{if(n.getCABO().getElementCount()&&(e.VBOBuildTime>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&n.getProgram().isAttributeUsed("offsetMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"offsetMC",12,n.getCABO().getStride(),e.context.FLOAT,2,!1)||Dx("Error setting 'offsetMC' in shader VAO.")),n.getProgram().isUniformUsed("invertedDepth")&&n.getProgram().setUniformf("invertedDepth",e.invert?-1:1),n.getProgram().isUniformUsed("scaleFactor")){const s=e.currentInput.getPointData();e.renderable.getScaleArray()!=null&&s.hasArray(e.renderable.getScaleArray())?n.getProgram().setUniformf("scaleFactor",e.renderable.getScaleFactor()):n.getProgram().setUniformf("scaleFactor",1)}a.setMapperShaderParameters(n,r,i)},t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=r.getActiveCamera(),c=e.openGLCamera.getKeyMatrices(r);o.isUniformUsed("VCPCMatrix")&&o.setUniformMatrix("VCPCMatrix",c.vcpc);const l=new Float64Array(16);if(o.isUniformUsed("MCVCMatrix"))if(i.getIsIdentity())gt(l,c.wcvc),n.getCABO().getCoordShiftAndScaleEnabled()&&Ee(l,l,n.getCABO().getInverseShiftAndScaleMatrix()),o.setUniformMatrix("MCVCMatrix",l);else{const p=e.openGLActor.getKeyMatrices();Ee(l,c.wcvc,p.mcwc),n.getCABO().getCoordShiftAndScaleEnabled()&&Ee(l,l,n.getCABO().getInverseShiftAndScaleMatrix()),o.setUniformMatrix("MCVCMatrix",l)}o.isUniformUsed("cameraParallel")&&n.getProgram().setUniformi("cameraParallel",s.getParallelProjection())},t.getOpenGLMode=(n,r)=>e.context.TRIANGLES,t.buildBufferObjects=(n,r)=>{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,1);const o=e.renderable.getColorMapColors(),s=e.primitives[e.primTypes.Tris].getCABO(),c=i.getPointData(),l=i.getPoints(),p=l.getNumberOfPoints(),u=l.getData(),f=5;let h=null;e.renderable.getScaleArray()!=null&&c.hasArray(e.renderable.getScaleArray())&&(h=c.getArray(e.renderable.getScaleArray()).getData());let d=null,v=0,m=null;o?(v=o.getNumberOfComponents(),s.setColorOffset(0),s.setColorBOStride(4),d=o.getData(),m=new Uint8Array(3*p*4),s.getColorBO()||s.setColorBO(On.newInstance()),s.getColorBO().setOpenGLRenderWindow(e._openGLRenderWindow)):s.getColorBO()&&s.setColorBO(null),s.setColorComponents(v);const x=new Float32Array(f*p*3);s.setStride(f*4);const y=Math.cos(Qe(30));let g=0,C=0;const{useShiftAndScale:S,coordShift:T,coordScale:w}=I0(l);S&&s.setCoordShiftAndScale(T,w);let _=0,E=0;for(let D=0;D2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,bx,a),Do.extend(t,e,a),Ox(t,e)}const Nx=Je(Mx,"vtkOpenGLSphereMapper");st("vtkSphereMapper",Nx);var Rx=`//VTK::System::Dec -/*========================================================================= +void main() +{ + vec4 lic = texture2D(texLIC, tcoordVC.st); + vec4 geomColor = texture2D(texGeomColors, tcoordVC.st); + + // depth is used to determine which fragment belong to us + // and we can change + float depth = texture2D(texVectors, tcoordVC.st).a; + + vec3 fragColorRGB; + float valid; + if (depth > 1.0e-3) + { + // we own it + // shade LIC'ed geometry, or apply mask + if (lic.g!=0.0) + { + // it's masked + // apply fragment mask + fragColorRGB = uMaskIntensity * uMaskColor + (1.0 - uMaskIntensity) * geomColor.rgb; + valid = 0.0; + } + else + { + if (uScalarColorMode==0) + { + // blend with scalars + fragColorRGB = lic.rrr * uLICIntensity + geomColor.rgb * (1.0 - uLICIntensity); + } + else + { + // multiply with scalars + fragColorRGB = geomColor.rgb * clamp((uMapBias + lic.r), 0.0, 1.0); + } + if (lic.b != 0.0) + { + // didn't have the required guard pixels + // don't consider it in min max estimation + // for histpgram stretching + valid = 0.0; + } + else + { + // ok to use in min/max estimates for histogram + // stretching + valid = 1.0; + } + } + } + else + { + // we don't own it + // pass through scalars + fragColorRGB = geomColor.rgb; + valid = 0.0; + } + + // if no further stages this texture is + // copied to the screen + RGBOutput = vec4(fragColorRGB, geomColor.a); - Program: Visualization Toolkit - Module: vtkStickMapperVS.glsl + // if further stages, move to hsl space for contrast + // enhancement. encoding validity saves moving a texture to the cpu + vec3 fragColorHSL = RGBToHSL(fragColorRGB); + HSLOutput = vec4(fragColorHSL, valid); +} +`,lC=`//VTK::System::Dec - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +//========================================================================= +// +// Program: Visualization Toolkit +// Module: vtkSurfaceLICMapper_DCpy.glsl +// +// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +// All rights reserved. +// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +// +// This software is distributed WITHOUT ANY WARRANTY; without even +// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. See the above copyright notice for more information. +// +//========================================================================= - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. +// This shader copies fragments and depths to the output buffer -=========================================================================*/ -// this shader implements imposters in OpenGL for Sticks +// the output of this shader +//VTK::Output::Dec -attribute vec4 vertexMC; -attribute vec3 orientMC; -attribute vec4 offsetMC; -attribute float radiusMC; +uniform sampler2D texDepth; // z values from vertex shader +uniform sampler2D texRGBColors; // final rgb LIC colors -// optional normal declaration -//VTK::Normal::Dec +in vec2 tcoordVC; -//VTK::Picking::Dec +void main() +{ + gl_FragDepth = texture2D(texDepth, tcoordVC).x; + gl_FragData[0] = texture2D(texRGBColors, tcoordVC); -// Texture coordinates -//VTK::TCoord::Dec + // since we render a screen aligned quad + // we're going to be writing fragments + // not touched by the original geometry + // it's critical not to modify those + // fragments. + if (gl_FragDepth == 1.0) + { + discard; + } +} +`,fC=`//VTK::System::Dec -uniform mat3 normalMatrix; // transform model coordinate directions to view coordinates +//========================================================================= +// +// Program: Visualization Toolkit +// Module: vtkSurfaceLICMapper_CE.glsl +// +// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +// All rights reserved. +// See Copyright.txt or http://www.kitware.com/Copyright.htm for details. +// +// This software is distributed WITHOUT ANY WARRANTY; without even +// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE. See the above copyright notice for more information. +// +//========================================================================= -// material property values -//VTK::Color::Dec +// color contrast enhance stage implemented via histogram stretching +// on lightness channel. if the min and max are tweaked it can generate +// out-of-range values these will be clamped in 0 to 1 -// clipping plane vars -//VTK::Clip::Dec +// the output of this shader +//VTK::Output::Dec -// camera and actor matrix values -//VTK::Camera::Dec +uniform sampler2D texGeomColors; // scalars + lighting +uniform sampler2D texLIC; // image lic, mask +uniform sampler2D texHSLColors; // hsla colors -varying vec4 vertexVCVSOutput; -varying float radiusVCVSOutput; -varying float lengthVCVSOutput; -varying vec3 centerVCVSOutput; -varying vec3 orientVCVSOutput; +uniform float uLMin; // min lightness over all fragments +uniform float uLMaxMinDiff; // max - min lightness over all fragments -uniform int cameraParallel; +in vec2 tcoordVC; -void main() +vec3 HSLToRGB(vec3 HSL) { - //VTK::Picking::Impl - - //VTK::Color::Impl + vec3 RGB; + float v; + float h = HSL.x; + float sl = HSL.y; + float l = HSL.z; - //VTK::Normal::Impl + v = (l <= 0.5) ? (l * (1.0 + sl)) : (l + sl - l * sl); + if (v <= 0.0) { + RGB = vec3(0.0,0.0,0.0); + } else { + float m; + int sextant; + float fract, vsf, mid1, mid2; - //VTK::TCoord::Impl + m = l + l - v; + h *= 6.0; + sextant = int(h); + fract = h - float(sextant); - //VTK::Clip::Impl + vsf = (v - m) * fract; + mid1 = m + vsf; + mid2 = v - vsf; + switch (sextant) { + case 0: RGB.r = v; RGB.g = mid1; RGB.b = m; break; + case 1: RGB.r = mid2; RGB.g = v; RGB.b = m; break; + case 2: RGB.r = m; RGB.g = v; RGB.b = mid1; break; + case 3: RGB.r = m; RGB.g = mid2; RGB.b = v; break; + case 4: RGB.r = mid1; RGB.g = m; RGB.b = v; break; + case 5: RGB.r = v; RGB.g = m; RGB.b = mid2; break; + } + } + return RGB; +} - vertexVCVSOutput = MCVCMatrix * vertexMC; - centerVCVSOutput = vertexVCVSOutput.xyz; - radiusVCVSOutput = radiusMC; - lengthVCVSOutput = length(orientMC); - orientVCVSOutput = normalMatrix * normalize(orientMC); +void main() +{ + // lookup hsl color , mask + vec4 fragColor = texture2D(texHSLColors, tcoordVC.st); - // make sure it is pointing out of the screen - if (orientVCVSOutput.z < 0.0) + // don't modify masked fragments (masked => lic.g==1) + vec4 lic = texture2D(texLIC, tcoordVC.st); + if (lic.g==0.0) { - orientVCVSOutput = -orientVCVSOutput; + // normalize lightness channel + fragColor.z = clamp((fragColor.z - uLMin)/uLMaxMinDiff, 0.0, 1.0); } - // make the basis - vec3 xbase; - vec3 ybase; - vec3 dir = vec3(0.0,0.0,1.0); - if (cameraParallel == 0) - { - dir = normalize(-vertexVCVSOutput.xyz); - } - if (abs(dot(dir,orientVCVSOutput)) == 1.0) - { - xbase = normalize(cross(vec3(0.0,1.0,0.0),orientVCVSOutput)); - ybase = cross(xbase,orientVCVSOutput); - } - else - { - xbase = normalize(cross(orientVCVSOutput,dir)); - ybase = cross(orientVCVSOutput,xbase); - } + // back into rgb space + fragColor.rgb = HSLToRGB(fragColor.xyz); - vec3 offsets = offsetMC.xyz*2.0-1.0; - vertexVCVSOutput.xyz = vertexVCVSOutput.xyz + - radiusVCVSOutput*offsets.x*xbase + - radiusVCVSOutput*offsets.y*ybase + - 0.5*lengthVCVSOutput*offsets.z*orientVCVSOutput; + // add alpha + vec4 geomColor = texture2D(texGeomColors, tcoordVC.st); + fragColor.a = geomColor.a; - gl_Position = VCPCMatrix * vertexVCVSOutput; + gl_FragData[0] = fragColor; } -`;const{vtkErrorMacro:ko}=Dt;function Lx(t,e){e.classHierarchy.push("vtkOpenGLStickMapper");const a={...t};t.getShaderTemplate=(n,r,i)=>{n.Vertex=Rx,n.Fragment=$a,n.Geometry=""},t.replaceShaderValues=(n,r,i)=>{let o=n.Vertex,s=n.Fragment;o=Q.substitute(o,"//VTK::Camera::Dec",[`uniform mat4 VCPCMatrix; -`,"uniform mat4 MCVCMatrix;"]).result,s=Q.substitute(s,"//VTK::PositionVC::Dec","varying vec4 vertexVCVSOutput;").result,s=Q.substitute(s,"//VTK::PositionVC::Impl",` vec4 vertexVC = vertexVCVSOutput; -`).result;const c=[`uniform int cameraParallel; -`,`varying float radiusVCVSOutput; -`,`varying vec3 orientVCVSOutput; -`,`varying float lengthVCVSOutput; -`,`varying vec3 centerVCVSOutput; -`,`uniform mat4 VCPCMatrix; -`];s=Q.substitute(s,"//VTK::Normal::Dec",c).result;let l="";e.context.getExtension("EXT_frag_depth")&&(l=` gl_FragDepthEXT = (pos.z / pos.w + 1.0) / 2.0; -`),e._openGLRenderWindow.getWebgl2()&&(l=`gl_FragDepth = (pos.z / pos.w + 1.0) / 2.0; -`),s=Q.substitute(s,"//VTK::Depth::Impl",[` vec3 EyePos; -`,` vec3 EyeDir; -`,` if (cameraParallel != 0) { -`,` EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVCVSOutput); -`,` EyeDir = vec3(0.0,0.0,-1.0); } -`,` else { -`,` EyeDir = vertexVC.xyz; -`,` EyePos = vec3(0.0,0.0,0.0); -`,` float lengthED = length(EyeDir); -`,` EyeDir = normalize(EyeDir); -`,` if (lengthED > radiusVCVSOutput*3.0) { -`,` EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; } -`,` } -`,` EyePos = EyePos - centerVCVSOutput; -`,` vec3 base1; -`,` if (abs(orientVCVSOutput.z) < 0.99) { -`,` base1 = normalize(cross(orientVCVSOutput,vec3(0.0,0.0,1.0))); } -`,` else { -`,` base1 = normalize(cross(orientVCVSOutput,vec3(0.0,1.0,0.0))); } -`,` vec3 base2 = cross(orientVCVSOutput,base1); -`,` EyePos = vec3(dot(EyePos,base1),dot(EyePos,base2),dot(EyePos,orientVCVSOutput)); -`,` EyeDir = vec3(dot(EyeDir,base1),dot(EyeDir,base2),dot(EyeDir,orientVCVSOutput)); -`,` EyePos = EyePos/radiusVCVSOutput; -`,` float a = EyeDir.x*EyeDir.x + EyeDir.y*EyeDir.y; -`,` float b = 2.0*(EyePos.x*EyeDir.x + EyePos.y*EyeDir.y); -`,` float c = EyePos.x*EyePos.x + EyePos.y*EyePos.y - 1.0; -`,` float d = b*b - 4.0*a*c; -`,` vec3 normalVCVSOutput = vec3(0.0,0.0,1.0); -`,` if (d < 0.0) { discard; } -`,` else { -`,` float t = (-b - sqrt(d))/(2.0*a); -`,` float tz = EyePos.z + t*EyeDir.z; -`,` vec3 iPoint = EyePos + t*EyeDir; -`,` if (abs(iPoint.z)*radiusVCVSOutput > lengthVCVSOutput*0.5) { -`,` float t2 = (-b + sqrt(d))/(2.0*a); -`,` float tz2 = EyePos.z + t2*EyeDir.z; -`,` if (tz2*radiusVCVSOutput > lengthVCVSOutput*0.5 || tz*radiusVCVSOutput < -0.5*lengthVCVSOutput) { discard; } -`,` else { -`,` normalVCVSOutput = orientVCVSOutput; -`,` float t3 = (lengthVCVSOutput*0.5/radiusVCVSOutput - EyePos.z)/EyeDir.z; -`,` iPoint = EyePos + t3*EyeDir; -`,` vertexVC.xyz = radiusVCVSOutput*(iPoint.x*base1 + iPoint.y*base2 + iPoint.z*orientVCVSOutput) + centerVCVSOutput; -`,` } -`,` } -`,` else { -`,` normalVCVSOutput = iPoint.x*base1 + iPoint.y*base2; -`,` vertexVC.xyz = radiusVCVSOutput*(normalVCVSOutput + iPoint.z*orientVCVSOutput) + centerVCVSOutput; -`,` } -`,` } -`,` vec4 pos = VCPCMatrix * vertexVC; -`,l]).result,s=Q.substitute(s,"//VTK::Normal::Impl","").result,e.haveSeenDepthRequest&&(s=Q.substitute(s,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float computedZ = (pos.z / pos.w + 1.0) / 2.0;","float iz = floor(computedZ * 65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result),n.Vertex=o,n.Fragment=s,a.replaceShaderValues(n,r,i)},t.setMapperShaderParameters=(n,r,i)=>{n.getCABO().getElementCount()&&(e.VBOBuildTime>n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("orientMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"orientMC",12,n.getCABO().getStride(),e.context.FLOAT,3,!1)||ko("Error setting 'orientMC' in shader VAO.")),n.getProgram().isAttributeUsed("offsetMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"offsetMC",0,n.getCABO().getColorBOStride(),e.context.UNSIGNED_BYTE,3,!0)||ko("Error setting 'offsetMC' in shader VAO.")),n.getProgram().isAttributeUsed("radiusMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"radiusMC",24,n.getCABO().getStride(),e.context.FLOAT,1,!1)||ko("Error setting 'radiusMC' in shader VAO."))),a.setMapperShaderParameters(n,r,i)},t.setCameraShaderParameters=(n,r,i)=>{const o=n.getProgram(),s=r.getActiveCamera(),c=e.openGLCamera.getKeyMatrices(r);if(o.isUniformUsed("VCPCMatrix")&&o.setUniformMatrix("VCPCMatrix",c.vcpc),i.getIsIdentity())o.isUniformUsed("MCVCMatrix")&&o.setUniformMatrix("MCVCMatrix",c.wcvc),o.isUniformUsed("normalMatrix")&&o.setUniformMatrix3x3("normalMatrix",c.normalMatrix);else{const l=e.openGLActor.getKeyMatrices();if(o.isUniformUsed("MCVCMatrix")){const p=new Float64Array(16);Ee(p,c.wcvc,l.mcwc),o.setUniformMatrix("MCVCMatrix",p)}if(o.isUniformUsed("normalMatrix")){const p=new Float64Array(9);Qn(p,c.normalMatrix,l.normalMatrix),o.setUniformMatrix3x3("normalMatrix",p)}}o.isUniformUsed("cameraParallel")&&n.getProgram().setUniformi("cameraParallel",s.getParallelProjection())},t.getOpenGLMode=(n,r)=>e.context.TRIANGLES,t.buildBufferObjects=(n,r)=>{const i=e.currentInput;if(i===null)return;e.renderable.mapScalars(i,1);const o=e.renderable.getColorMapColors(),s=e.primitives[e.primTypes.Tris].getCABO(),c=i.getPointData(),l=i.getPoints(),p=l.getNumberOfPoints(),u=l.getData();let f=3;f+=4;let h=null,d=0;s.setColorBOStride(4),s.getColorBO()||s.setColorBO(On.newInstance()),s.getColorBO().setOpenGLRenderWindow(e._openGLRenderWindow),o&&(d=o.getNumberOfComponents(),s.setColorOffset(4),h=o.getData(),s.setColorBOStride(8)),s.setColorComponents(d),s.setStride(f*4);const v=new Float32Array(f*p*12),m=new Uint8Array(12*p*(h?8:4));let x=null,y=null;e.renderable.getScaleArray()!=null&&c.hasArray(e.renderable.getScaleArray())&&(x=c.getArray(e.renderable.getScaleArray()).getData()),e.renderable.getOrientationArray()!=null&&c.hasArray(e.renderable.getOrientationArray())?y=c.getArray(e.renderable.getOrientationArray()).getData():ko([`Error setting orientationArray. -`,"You have to specify the stick orientation"]);const g=[0,1,3,0,3,2,2,3,5,2,5,4];let C=0,S=0,T=0,w=0;for(let _=0;_=4?255:0,m[w++]=g[O]>=2?255:0,m[w++]=255,S=_*d,h&&(m[w++]=h[S],m[w++]=h[S+1],m[w++]=h[S+2],m[w++]=h[S+3])}s.setElementCount(T/f),s.upload(v,Dn.ARRAY_BUFFER),s.getColorBO().upload(m,Dn.ARRAY_BUFFER),e.VBOBuildTime.modified()}}const Fx={};function kx(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Fx,a),Do.extend(t,e,a),Lx(t,e)}const Vx=Je(kx,"vtkOpenGLStickMapper");st("vtkStickMapper",Vx);var _t=Uint8Array,Nr=Uint16Array,Hh=Uint32Array,Kh=new _t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xh=new _t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ax=new _t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qh=function(t,e){for(var a=new Nr(31),n=0;n<31;++n)a[n]=e+=1<>>1|(nt&21845)<<1;Hn=(Hn&52428)>>>2|(Hn&13107)<<2,Hn=(Hn&61680)>>>4|(Hn&3855)<<4,Z0[nt]=((Hn&65280)>>>8|(Hn&255)<<8)>>>1}for(var Ya=function(t,e,a){for(var n=t.length,r=0,i=new Nr(e);r>>c]=l}else for(s=new Nr(n),r=0;r>>15-t[r]);return s},Ja=new _t(288),nt=0;nt<144;++nt)Ja[nt]=8;for(var nt=144;nt<256;++nt)Ja[nt]=9;for(var nt=256;nt<280;++nt)Ja[nt]=7;for(var nt=280;nt<288;++nt)Ja[nt]=8;for(var Zh=new _t(32),nt=0;nt<32;++nt)Zh[nt]=5;var Ix=Ya(Ja,9,1),Px=Ya(Zh,5,1),Q0=function(t){for(var e=t[0],a=1;ae&&(e=t[a]);return e},en=function(t,e,a){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&a},ec=function(t,e){var a=e/8|0;return(t[a]|t[a+1]<<8|t[a+2]<<16)>>(e&7)},zx=function(t){return(t+7)/8|0},Vo=function(t,e,a){(e==null||e<0)&&(e=0),(a==null||a>t.length)&&(a=t.length);var n=new(t.BYTES_PER_ELEMENT==2?Nr:t.BYTES_PER_ELEMENT==4?Hh:_t)(a-e);return n.set(t.subarray(e,a)),n},jx=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rt=function(t,e,a){var n=new Error(e||jx[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Rt),!a)throw n;return n},tc=function(t,e,a){var n=t.length;if(!n||a&&a.f&&!a.l)return e||new _t(0);var r=!e||a,i=!a||a.i;a||(a={}),e||(e=new _t(n*3));var o=function(Z){var re=e.length;if(Z>re){var ae=new _t(Math.max(re*2,Z));ae.set(e),e=ae}},s=a.f||0,c=a.p||0,l=a.b||0,p=a.l,u=a.d,f=a.m,h=a.n,d=n*8;do{if(!p){s=en(t,c,1);var v=en(t,c+1,3);if(c+=3,v)if(v==1)p=Ix,u=Px,f=9,h=5;else if(v==2){var g=en(t,c,31)+257,C=en(t,c+10,15)+4,S=g+en(t,c+5,31)+1;c+=14;for(var T=new _t(S),w=new _t(19),_=0;_>>4;if(m<16)T[_++]=m;else{var N=0,R=0;for(m==16?(R=3+en(t,c,3),c+=2,N=T[_-1]):m==17?(R=3+en(t,c,7),c+=3):m==18&&(R=11+en(t,c,127),c+=7);R--;)T[_++]=N}}var B=T.subarray(0,g),I=T.subarray(g);f=Q0(B),h=Q0(I),p=Ya(B,f,1),u=Ya(I,h,1)}else Rt(1);else{var m=zx(c)+4,x=t[m-4]|t[m-3]<<8,y=m+x;if(y>n){i&&Rt(0);break}r&&o(l+x),e.set(t.subarray(m,y),l),a.b=l+=x,a.p=c=y*8,a.f=s;continue}if(c>d){i&&Rt(0);break}}r&&o(l+131072);for(var P=(1<>>4;if(c+=N&15,c>d){i&&Rt(0);break}if(N||Rt(2),A<256)e[l++]=A;else if(A==256){k=c,p=null;break}else{var j=A-254;if(A>264){var _=A-257,H=Kh[_];j=en(t,c,(1<>>4;K||Rt(3),c+=K&15;var I=Gx[Y];if(Y>3){var H=Xh[Y];I+=ec(t,c)&(1<d){i&&Rt(0);break}r&&o(l+131072);for(var q=l+j;l>>0},nc=function(t,e){return tn(t,e)+tn(t,e+4)*4294967296},$x=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Rt(6,"invalid gzip data");var e=t[3],a=10;e&4&&(a+=t[10]|(t[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[a++]);return a+(e&2)},Hx=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Kx=function(t){((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Rt(6,"invalid zlib data"),t[1]&32&&Rt(6,"invalid zlib data: preset dictionaries not supported")};function Qh(t,e){return tc(t,e)}function Xx(t,e){return tc(t.subarray($x(t),-8),e||new _t(Hx(t)))}function qx(t,e){return tc((Kx(t),t.subarray(2,-4)),e)}function nn(t,e){return t[0]==31&&t[1]==139&&t[2]==8?Xx(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?Qh(t,e):qx(t,e)}var e1=typeof TextEncoder<"u"&&new TextEncoder,rc=typeof TextDecoder<"u"&&new TextDecoder,Yx=0;try{rc.decode(Wx,{stream:!0}),Yx=1}catch{}var Jx=function(t){for(var e="",a=0;;){var n=t[a++],r=(n>127)+(n>223)+(n>239);if(a+r>t.length)return[e,Vo(t,a-1)];r?r==3?(n=((n&15)<<18|(t[a++]&63)<<12|(t[a++]&63)<<6|t[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):r&1?e+=String.fromCharCode((n&31)<<6|t[a++]&63):e+=String.fromCharCode((n&15)<<12|(t[a++]&63)<<6|t[a++]&63):e+=String.fromCharCode(n)}};function Zx(t,e){if(e){for(var a=new _t(t.length),n=0;n>1)),o=0,s=function(p){i[o++]=p},n=0;ni.length){var c=new _t(o+8+(r-n<<1));c.set(i),i=c}var l=t.charCodeAt(n);l<128||e?s(l):l<2048?(s(192|l>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1023<<10)|t.charCodeAt(++n)&1023,s(240|l>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|l&63)):(s(224|l>>12),s(128|l>>6&63),s(128|l&63))}return Vo(i,0,o)}function rn(t,e){if(e){for(var a="",n=0;n65558)&&Rt(13);var r=xn(t,n+8);if(!r)return{};var i=tn(t,n+16),o=i==4294967295;o&&(n=tn(t,n-12),tn(t,n)!=101075792&&Rt(13),r=tn(t,n+32),i=tn(t,n+48));for(var s=e&&e.filter,c=0;c0&&arguments[0]!==void 0?arguments[0]:"http",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ac[t](e)}function Ao(t,e){ac[t]=e}var aa={get:a7,has:r1,registerType:Ao};const{vtkErrorMacro:Za,vtkDebugMacro:i7}=V;let ia=0;function Bo(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=new XMLHttpRequest;return n.open(t,e,!0),a.headers&&Object.entries(a.headers).forEach(r=>{let[i,o]=r;return n.setRequestHeader(i,o)}),a.progressCallback&&n.addEventListener("progress",a.progressCallback),n}function o7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e&&e.compression&&e.compression!=="gz"&&(Za("Supported algorithms are: [gz]"),Za(`Unkown compression algorithm: ${e.compression}`)),new Promise((a,n)=>{const r=Bo("GET",t,e);r.onreadystatechange=i=>{r.readyState===4&&(r.status===200||r.status===0?e.compression?a(nn(new Uint8Array(r.response)).buffer):a(r.response):n({xhr:r,e:i}))},r.responseType="arraybuffer",r.send()})}function s7(t,e,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return a.ref&&!a.ref.pending?new Promise((r,i)=>{let o=null;a.ref.url?o=a.ref.url:o=[e,a.ref.basepath,n.compression?`${a.ref.id}.gz`:a.ref.id].join("/");const s=Bo("GET",o,n);s.onreadystatechange=c=>{s.readyState===1&&(a.ref.pending=!0,++ia===1&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!0)),s.readyState===4&&(a.ref.pending=!1,s.status===200||s.status===0?(a.buffer=s.response,n.compression&&(a.dataType==="string"||a.dataType==="JSON"?a.buffer=rn(nn(new Uint8Array(a.buffer))):a.buffer=nn(new Uint8Array(a.buffer)).buffer),a.ref.encode==="JSON"?a.values=JSON.parse(a.buffer):(Nn.ENDIANNESS!==a.ref.encode&&Nn.ENDIANNESS&&(i7(`Swap bytes of ${a.name}`),Nn.swapBytes(a.buffer,lo[a.dataType])),a.values=V.newTypedArray(a.dataType,a.buffer)),a.values.length!==a.size&&Za(`Error in FetchArray: ${a.name}, does not have the proper array size. Got ${a.values.length}, instead of ${a.size}`),delete a.ref,--ia===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),t!=null&&t.modified&&t.modified(),r(a)):i({xhr:s,e:c}))},s.responseType=n.compression||a.dataType!=="string"?"arraybuffer":"text",s.send()}):Promise.resolve(a)}function c7(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise((n,r)=>{const i=Bo("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++ia===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--ia===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?a.compression?n(JSON.parse(rn(nn(new Uint8Array(i.response))))):n(JSON.parse(i.responseText)):r({xhr:i,e:o}))},i.responseType=a.compression?"arraybuffer":"text",i.send()})}function u7(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return a&&a.compression&&a.compression!=="gz"&&(Za("Supported algorithms are: [gz]"),Za(`Unkown compression algorithm: ${a.compression}`)),new Promise((n,r)=>{const i=Bo("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++ia===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--ia===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?a.compression?n(rn(nn(new Uint8Array(i.response)))):n(i.responseText):r({xhr:i,e:o}))},i.responseType=a.compression?"arraybuffer":"text",i.send()})}function l7(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise((n,r)=>{const i=new Image;a.crossOrigin&&(i.crossOrigin=a.crossOrigin),i.onload=()=>n(i),i.onerror=r,i.src=e})}const f7={fetchArray:s7,fetchJSON:c7,fetchText:u7,fetchBinary:o7,fetchImage:l7};Ao("http",t=>f7);const Ut=[];Ut["-".charCodeAt(0)]=62,Ut["_".charCodeAt(0)]=63;const oa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0;t>16&255,n[p++]=l>>8&255,n[p++]=l&255}switch(o){case 3:for(;!Cn(t[c]);)c++;for(l=Ut[t.charCodeAt(c++)]<<10;!Cn(t[c]);)c++;for(l|=Ut[t.charCodeAt(c++)]<<4;!Cn(t[c]);)c++;l|=Ut[t.charCodeAt(c++)]>>2,n[p++]=l>>8&255,n[p++]=l&255;break;case 2:for(;!Cn(t[c]);)c++;for(l=Ut[t.charCodeAt(c++)]<<2;!Cn(t[c]);)c++;l|=Ut[t.charCodeAt(c++)]>>4,n[p++]=l&255;break;case 1:throw new Error("BASE64: remain 1 should not happen")}return p}function g7(t){const e=p7(t),a=e[e.length-1].end+1,n=(4-a%4)%4,r=(a+n)*3/4-n,i=new ArrayBuffer(r),o=new Uint8Array(i);let s=0;for(let c=0;c>18]+oa[n>>12&63]+oa[n>>6&63]+oa[n&63]}function i1(t){const e=new Uint8Array(t),a=t.byteLength%3,n=t.byteLength-a,r=Array(n/3);for(let i=0;i0){const i=a1(e[n],e[n+1]||0,e[n+2]||0);a===1?r.push(`${i.substr(0,2)}==`):a===2&&r.push(`${i.substr(0,3)}=`)}return r.join("")}var Rr={toArrayBuffer:g7,fromArrayBuffer:i1};const{vtkErrorMacro:sa,vtkDebugMacro:d7}=V;function v7(t){const e=t.split(".").pop().toLowerCase();return e==="jpg"?"jpeg":e}function y7(t,e,a){return n=>{t.buffer=new ArrayBuffer(n.length),new Uint8Array(t.buffer).set(n),e&&(t.dataType==="string"||t.dataType==="JSON"?t.buffer=rn(nn(new Uint8Array(t.buffer))):t.buffer=nn(new Uint8Array(t.buffer)).buffer),t.ref.encode==="JSON"?t.values=JSON.parse(t.buffer):(Nn.ENDIANNESS!==t.ref.encode&&Nn.ENDIANNESS&&(d7(`Swap bytes of ${t.name}`),Nn.swapBytes(t.buffer,lo[t.dataType])),t.values=V.newTypedArray(t.dataType,t.buffer)),t.values.length!==t.size&&sa(`Error in FetchArray: ${t.name} does not have the proper array size. Got ${t.values.length}, instead of ${t.size}`),a()}}function m7(t,e,a){return n=>{e?t.values=JSON.parse(rn(nn(n))):t.values=JSON.parse(n),a()}}function x7(t){return t[0]==="/"?t.substr(1):t}function C7(t){return new URL(t,"http://any").pathname}function Qa(t){return x7(C7(t))}function S7(t){return new Promise((e,a)=>{typeof t=="string"?e(Zx(t)):t instanceof Blob?e(t.arrayBuffer().then(n=>new Uint8Array(n))):t instanceof ArrayBuffer?e(new Uint8Array(t)):(t==null?void 0:t.buffer)instanceof ArrayBuffer?e(new Uint8Array(t.buffer)):a(new Error("Invalid datatype to unpack."))})}function T7(t){let e=!1,a=0,n=null,r="";return S7(t.zipContent).then(i=>{n=t1(i),e=!0;const o=[];Object.keys(n).forEach(s=>{s.endsWith("index.json")&&o.push(s)}),o.sort((s,c)=>s.length-c.length),r=o[0].replace(/index\.json$/,""),t.callback&&t.callback(n)}),{fetchArray(i,o,s){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return new Promise((l,p)=>{e||sa("ERROR!!! zip not ready...");const u=Qa([o,s.ref.basepath,c.compression?`${s.ref.id}.gz`:s.ref.id].join("/"));++a===1&&(i!=null&&i.invokeBusy)&&i.invokeBusy(!0);function f(){delete s.ref,--a===0&&(i!=null&&i.invokeBusy)&&i.invokeBusy(!1),i!=null&&i.modified&&i.modified(),l(s)}const h=n[`${r}${u}`];s.dataType==="string"&&!c.compression?m7(s,c.compression,f)(rn(h)):y7(s,c.compression,f)(h)})},fetchJSON(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const c=Qa(o);e||sa("ERROR!!! zip not ready...");const l=n[`${r}${c}`];if(s.compression){if(s.compression==="gz"){const p=rn(nn(l));return Promise.resolve(JSON.parse(p))}return Promise.reject(new Error("Invalid compression"))}return Promise.resolve(JSON.parse(rn(l)))},fetchText(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const c=Qa(o);e||sa("ERROR!!! zip not ready...");const l=n[`${r}${c}`];return s.compression?s.compression==="gz"?Promise.resolve(rn(t1(l))):Promise.reject(new Error("Invalid compression")):Promise.resolve(rn(l))},fetchImage(i,o){const s=Qa(o);e||sa("ERROR!!! zip not ready...");const c=n[`${r}${s}`];return new Promise((l,p)=>{const u=new Image;u.onload=()=>l(u),u.onerror=p;const f=i1(c.buffer);u.src=`data:image/${v7(s)};base64,${f}`})},fetchBinary(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const c=Qa(o);e||sa("ERROR!!! zip not ready...");const l=n[`${r}${c}`];return s.compression?s.compression==="gz"?Promise.resolve(nn(l).buffer):Promise.reject(new Error("Invalid compression")):Promise.resolve(l.buffer)}}}const w7={create:T7};Ao("zip",t=>w7.create(t));function _7(t,e){e.classHierarchy.push("vtkConcentricCylinderSource");function a(){for(;e.cellFields.length{e.radius=[],e.cellFields=[],t.modified()},t.addRadius=(n,r)=>{e.radius.push(n),r!==void 0&&e.cellFields.push(r),a(),t.modified()},t.getNumberOfRadius=()=>e.radius.length,t.getRadius=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.radius[n]},t.setRadius=(n,r)=>{e.radius[n]=r,t.modified()},t.setCellField=(n,r)=>{e.cellFields[n]=r,t.modified()},t.removeMask=()=>{e.mask=null,t.modified()},t.setMaskLayer=(n,r)=>{let i=!1;!e.mask&&r&&(i=!0,e.mask=[]),e.mask&&(!e.mask[n]!=!r&&(i=!0),e.mask[n]=r),i&&t.modified()},t.getMaskLayer=n=>n===void 0?e.mask:e.mask[n],t.requestData=(n,r)=>{var w;if(!e.radius.length){V.vtkErrorMacro("No radius defined");return}a();const i=e.radius.length,o=e.height/2;let s=0,c=0,l=e.startThetae.startTheta?e.endTheta:e.startTheta;p*=Math.PI/180;let u=e.resolution,f=!1;p>=l+2*Math.PI?p=l+2*Math.PI:(++u,f=!0);const h=(p-l)/e.resolution,d=u*i*2+2;if(!e.skipInnerFaces&&!e.mask)s=2*(u+1)+5*u+(i-1)*u*20+(f?10*i:0),c=2+u+(i-1)*4*u+(f?2*i:0);else if(!e.skipInnerFaces&&e.mask){e.mask[0]||(s+=2*(u+1)+5*u+(f?10:0),c+=2+u+(f?2:0));for(let _=1;_2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,E7,a),V.obj(t,e),V.setGet(t,e,["height","resolution","startTheta","endTheta","skipInnerFaces"]),V.setGetArray(t,e,["center","direction"],3),V.getArray(t,e,["cellFields"]),V.algo(t,e,0,1),_7(t,e)}V.newInstance(D7,"vtkConcentricCylinderSource");function O7(t,e){e.classHierarchy.push("vtkConeSource"),t.requestData=(a,n)=>{var h;const r=2*Math.PI/e.resolution,i=-e.height/2,o=e.resolution+1,s=4*e.resolution+1+e.resolution;let c=0;const l=V.newTypedArray(e.pointType,o*3);let p=0;const u=new Uint32Array(s);l[0]=e.height/2,l[1]=0,l[2]=0,e.capping&&(u[p++]=e.resolution);for(let d=0;de.resolution?1:d+2;bt.buildFromRadian().translate(...e.center).rotateFromDirections([1,0,0],e.direction).apply(l);const f=((h=n[0])==null?void 0:h.initialize())||Xe.newInstance();f.getPoints().setData(l,3),f.getPolys().setData(u,1),n[0]=f}}const b7={height:1,radius:.5,resolution:6,center:[0,0,0],direction:[1,0,0],capping:!0,pointType:"Float64Array"};function o1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,b7,a),V.obj(t,e),V.setGet(t,e,["height","radius","resolution","capping"]),V.setGetArray(t,e,["center","direction"],3),V.algo(t,e,0,1),O7(t,e)}var M7={newInstance:V.newInstance(o1,"vtkConeSource"),extend:o1};function N7(t,e){e.classHierarchy.push("vtkCylinderSource"),t.requestData=(a,n)=>{var T;const r=2*Math.PI/e.resolution;let i=2*e.resolution,o=5*e.resolution;e.capping&&(i=4*e.resolution,o=7*e.resolution+2);const s=V.newTypedArray(e.pointType,i*3);let c=0;const l=new Uint32Array(o),p=new Float32Array(i*3),u=pe.newInstance({numberOfComponents:3,values:p,name:"Normals"}),f=new Float32Array(i*2),h=pe.newInstance({numberOfComponents:2,values:f,name:"TCoords"}),d=[0,0,0],v=[0,0,0],m=[0,0,0],x=[0,0,0],y=[0,0],g=[0,0],C=e.otherRadius==null?e.radius:e.otherRadius;for(let w=0;ww*-1)).apply(s);const S=((T=n[0])==null?void 0:T.initialize())||Xe.newInstance();S.getPoints().setData(s,3),S.getPolys().setData(l,1),S.getPointData().setNormals(u),S.getPointData().setTCoords(h),n[0]=S}}const R7={height:1,initAngle:0,radius:1,resolution:6,center:[0,0,0],direction:[0,1,0],capping:!0,pointType:"Float64Array"};function s1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,R7,a),V.obj(t,e),V.setGet(t,e,["height","initAngle","otherRadius","radius","resolution","capping"]),V.setGetArray(t,e,["center","direction"],3),V.algo(t,e,0,1),N7(t,e)}var L7={newInstance:V.newInstance(s1,"vtkCylinderSource"),extend:s1};const{vtkWarningMacro:F7}=V;function k7(t,e){e.classHierarchy.push("vtkLineSource"),t.requestData=(a,n)=>{const r=n[0],i=r?r.getPoints().getDataType():e.pointType,o=(r==null?void 0:r.initialize())||Xe.newInstance(),s=[];if(He(e.point2,e.point1,s),St(s)<=0){F7("Zero-length line definition");return}const c=e.resolution,l=c+1,p=V.newTypedArray(i,l*3);o.getPoints().setData(p,3);const u=new Uint32Array(l+1);o.getLines().setData(u,1);let f=0,h=0;for(let d=0;d2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,V7,a),V.obj(t,e),V.setGet(t,e,["resolution"]),V.setGetArray(t,e,["point1","point2"],3),V.algo(t,e,0,1),k7(t,e)}var A7={newInstance:V.newInstance(c1,"vtkLineSource"),extend:c1};const{vtkWarningMacro:B7}=V,U7=1e-6;function G7(t,e){e.classHierarchy.push("vtkPlaneSource"),t.requestData=(a,n)=>{const r=n[0],i=r?r.getPoints().getDataType():e.pointType,o=(r==null?void 0:r.initialize())||Xe.newInstance(),s=[],c=[];if(He(e.point1,e.origin,s),He(e.point2,e.origin,c),!t.updatePlane(s,c)){B7("Bad plane definition");return}const l=e.xResolution,p=e.yResolution,u=(l+1)*(p+1),f=l*p,h=V.newTypedArray(i,u*3);o.getPoints().setData(h,3);const d=new Uint32Array(5*f);o.getPolys().setData(d,1);const v=new Float32Array(u*3),m=pe.newInstance({numberOfComponents:3,values:v,name:"Normals"});o.getPointData().setNormals(m);const x=new Float32Array(u*2),y=pe.newInstance({numberOfComponents:2,values:x,name:"TextureCoordinates"});o.getPointData().setTCoords(y);const g=new Float32Array(2);let C=0;for(let S=0;S{if(Math.abs(a){for(let r=0;r<3;r++)e.center[r]=e.origin[r]+.5*(a[r]+n[r]);return et(a,n,e.normal),Ke(e.normal)!==0}}const I7={xResolution:10,yResolution:10,origin:[0,0,0],point1:[1,0,0],point2:[0,1,0],pointType:"Float64Array"};function P7(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,I7,a),e.normal=[0,0,1],e.center=[0,0,0],V.obj(t,e),V.setGet(t,e,["xResolution","yResolution"]),V.setGetArray(t,e,["origin"],3),V.getArray(t,e,["point1","point2","normal","center"],3),V.algo(t,e,0,1),G7(t,e),t.setPoint1(e.point1),t.setPoint2(e.point2)}V.newInstance(P7,"vtkPlaneSource");function z7(t,e){e.classHierarchy.push("vtkPointSource"),t.requestData=(a,n)=>{const r=n[0],i=r?r.getPoints().getDataType():e.pointType,o=(r==null?void 0:r.initialize())||Xe.newInstance(),s=e.numberOfPoints,c=V.newTypedArray(i,s*3);o.getPoints().setData(c,3);const l=new Uint32Array(s+1);o.getVerts().setData(l,1);let p,u,f,h,d;for(let v=0;v2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,j7,a),V.obj(t,e),V.setGet(t,e,["numberOfPoints","radius"]),V.setGetArray(t,e,["center"],3),V.algo(t,e,0,1),z7(t,e)}V.newInstance(W7,"vtkPointSource");function $7(t,e){e.classHierarchy.push("vtkSphereSource"),t.requestData=(a,n)=>{let r=n[0];const i=r?r.getPoints().getDataType():e.pointType;r=(r==null?void 0:r.initialize())||Xe.newInstance();let o=0,{thetaResolution:s}=e,c=e.startThetae.startTheta?e.endTheta:e.startTheta;l*=Math.PI/180;let p=e.startPhie.startPhi?e.endPhi:e.startPhi;u*=Math.PI/180,Math.abs(c-l)<2*Math.PI&&++s;const f=(l-c)/e.thetaResolution,h=e.startPhi<=0?1:0,d=e.phiResolution+(e.endPhi>=180?-1:0),v=e.phiResolution*s+2,m=e.phiResolution*2*e.thetaResolution;let x=0,y=V.newTypedArray(i,v*3),g=new Float32Array(v*3),C=0,S=new Uint32Array(m*5);e.startPhi<=0&&(y[x*3+0]=e.center[0],y[x*3+1]=e.center[1],y[x*3+2]=e.center[2]+e.radius,g[x*3+0]=0,g[x*3+1]=0,g[x*3+2]=1,x++,o++),e.endPhi>=180&&(y[x*3+0]=e.center[0],y[x*3+1]=e.center[1],y[x*3+2]=e.center[2]-e.radius,g[x*3+0]=0,g[x*3+1]=0,g[x*3+2]=-1,x++,o++);const T=e.phiResolution-o,w=(u-p)/(e.phiResolution-1);for(let D=0;D=180){const D=T-1+o;for(let O=0;O2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,H7,a),V.obj(t,e),V.setGet(t,e,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),V.setGetArray(t,e,["center"],3),V.algo(t,e,0,1),$7(t,e)}V.newInstance(K7,"vtkSphereSource");const{vtkDebugMacro:Uo,vtkErrorMacro:X7}=V;function q7(t,e){e.classHierarchy.push("vtkWarpScalar"),t.requestData=(a,n)=>{const r=a[0];if(!r)return X7("Invalid or missing input"),1;const i=r.getPoints(),s=r.getPointData().getNormals(),c=t.getInputArrayToProcess(0);if(!i||!c)return Uo("No data to warp",!!i,!!c),n[0]=a[0],1;const l=i.getNumberOfPoints();let p=null;const u=[0,0,1];s&&!e.useNormal?(p=(S,T)=>[T.getData()[S*3],T.getData()[S*3+1],T.getData()[S*3+2]],Uo("Using data normals")):t.getXyPlane()?(p=(S,T)=>u,Uo("Using x-y plane normal")):(p=(S,T)=>e.normal,Uo("Using Normal instance variable"));const f=new Float32Array(l*3),h=i.getData();let d=0,v=[0,0,1],m=1;const x=c.getData(),y=c.getNumberOfComponents();for(let S=0;S2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Y7,a),V.obj(t,e),V.algo(t,e,1,1),V.setGet(t,e,["scaleFactor","useNormal","xyPlane"]),V.setGetArray(t,e,["normal"],3),q7(t,e)}V.newInstance(J7,"vtkWarpScalar");var Z7={VaryRadius:{VARY_RADIUS_OFF:0,VARY_RADIUS_BY_SCALAR:1,VARY_RADIUS_BY_VECTOR:2,VARY_RADIUS_BY_ABSOLUTE_SCALAR:3},GenerateTCoords:{TCOORDS_OFF:0,TCOORDS_FROM_NORMALIZED_LENGTH:1,TCOORDS_FROM_LENGTH:2,TCOORDS_FROM_SCALARS:3}};const{VaryRadius:ei,GenerateTCoords:Lr}=Z7,{vtkDebugMacro:Q7,vtkErrorMacro:eC,vtkWarningMacro:ti}=V;function tC(t,e){e.classHierarchy.push("vtkTubeFilter");function a(c,l){let p=c;return e.sidesShareVertices?p+=e.numberOfSides*l:p+=2*e.numberOfSides*l,e.capping&&(p+=2*e.numberOfSides),p}function n(c,l,p){const u=l[p],f=c.slice(3*u,3*(u+1));let h=p+1;for(;h3&&arguments[3]!==void 0?arguments[3]:null,f=[0,0,1];const h=l;let d=h[0];for(let v=0;v1){let m=0,x=[0,0,0];const y=[0,0,0],g=h.slice(v+1,v+1+d);if(m=n(c,g,0),m!==d){let C=g[m],S=c.slice(3*C,3*(C+1)),T=g[m+1],w=c.slice(3*T,3*(T+1));if(x=w.map((E,D)=>E-S[D]),Ke(x),u)f=u;else{for(;++m.001){f=E,x=y;break}}if(m>=d){for(let E=0;E<3;++E)if(x[E]!==0){f[(E+2)%3]=0,f[(E+1)%3]=1,f[E]=-x[(E+1)%3]/x[E];break}}}Ke(f);let _=0;for(;++m0?M=Math.sqrt(M):M=0;const N=[0,0,0];for(let R=0;R<3;++R)N[R]=y[R]+x[R];Ke(N),et(N,D,E),et(x,D,N),xe(f,N)*xe(E,N)<0&&(M*=-1);for(let R=_;Re.radiusFactor&&(P=e.radiusFactor);else if(m&&e.varyRadius===ei.VARY_RADIUS_BY_ABSOLUTE_SCALAR&&(P=m.getComponent(p[A],0),P<0))return ti("Scalar value less than zero, skipping line"),0;if(e.sidesShareVertices)for(let j=0;j{var b;const p=((b=l[0])==null?void 0:b.initialize())||Xe.newInstance();l[0]=p;const u=c[0];if(!u){eC("Invalid or missing input");return}const f=u.getPoints();if(!f)return;const h=f.getNumberOfPoints();if(h<1)return;const d=u.getLines();if(!d||d.getNumberOfCells()<1)return;let m=0,x=0;const y=d.getData();let g=y[0];for(let G=0;G{const z=U%3;return e.defaultNormal[z]}):R=!0);const B=u.getPointData().getNumberOfArrays();let I=null,P=null;for(let G=0;G1&&R){const z=y.slice(G,G+g+1);r(f.getData(),z,M)}i(ee,g,U,f.getData(),S.getData(),u.getPointData(),Z,w,A,H,K,Y,N,ae)?(O=o(ee,g,F,O,u.getCellData(),q,D),re&&s(ee,g,U,f.getData(),A,re.getData())):ti("Could not generate points"),ee=a(ee,g),F++}p.setPoints(S),p.setStrips(D),p.setPointData(Z),Z.setNormals(_)}}const nC={outputPointsPrecision:hr.DEFAULT,radius:.5,varyRadius:ei.VARY_RADIUS_OFF,numberOfSides:3,radiusFactor:10,defaultNormal:[0,0,1],useDefaultNormal:!1,sidesShareVertices:!0,capping:!1,onRatio:1,offset:0,generateTCoords:Lr.TCOORDS_OFF,textureLength:1};function rC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,nC,a),V.setGet(t,e,["outputPointsPrecision","radius","varyRadius","numberOfSides","radiusFactor","defaultNormal","useDefaultNormal","sidesShareVertices","capping","onRatio","offset","generateTCoords","textureLength"]),V.obj(t,e),V.algo(t,e,1,1),tC(t,e)}V.newInstance(rC,"vtkTubeFilter");function u1(t){return new TextDecoder("latin1").decode(t)}function aC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const n=u1(t),r=e.exec(n);if(!r)return{text:n};const i=r.index+r[0].length,o=n.substring(0,i);let s=null;const c=a?a.exec(n):null;if(c){const l=n.substr(c.index);s={text:o+l,binaryBuffer:t.slice(i,c.index)}}else s={text:o,binaryBuffer:t.slice(i)};return s}var ni={arrayBufferToString:u1,extractBinary:aC};const{vtkErrorMacro:l1,vtkDebugMacro:iC}=V,ic=()=>(l1("LiteHttpDataAccessHelper does not support compression. Need to register HttpDataAccessHelper instead."),Promise.reject(new Error("LiteHttpDataAccessHelper does not support compression. Need to register HttpDataAccessHelper instead.")));let ca=0;function Go(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=new XMLHttpRequest;return n.open(t,e,!0),a.headers&&Object.entries(a.headers).forEach(r=>{let[i,o]=r;return n.setRequestHeader(i,o)}),a.progressCallback&&n.addEventListener("progress",a.progressCallback),n}function oC(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise((a,n)=>{const r=Go("GET",t,e);r.onreadystatechange=i=>{r.readyState===4&&(r.status===200||r.status===0?a(r.response):n({xhr:r,e:i}))},r.responseType="arraybuffer",r.send()})}function sC(t,e,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n&&n.compression?ic():a.ref&&!a.ref.pending?new Promise((r,i)=>{const o=[e,a.ref.basepath,a.ref.id].join("/"),s=Go("GET",o,n);s.onreadystatechange=c=>{s.readyState===1&&(a.ref.pending=!0,++ca===1&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!0)),s.readyState===4&&(a.ref.pending=!1,s.status===200||s.status===0?(a.buffer=s.response,a.ref.encode==="JSON"?a.values=JSON.parse(a.buffer):(Nn.ENDIANNESS!==a.ref.encode&&Nn.ENDIANNESS&&(iC(`Swap bytes of ${a.name}`),Nn.swapBytes(a.buffer,lo[a.dataType])),a.values=V.newTypedArray(a.dataType,a.buffer)),a.values.length!==a.size&&l1(`Error in FetchArray: ${a.name}, does not have the proper array size. Got ${a.values.length}, instead of ${a.size}`),delete a.ref,--ca===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),t!=null&&t.modified&&t.modified(),r(a)):i({xhr:s,e:c}))},s.responseType=a.dataType!=="string"?"arraybuffer":"text",s.send()}):Promise.resolve(a)}function cC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return a&&a.compression?ic():new Promise((n,r)=>{const i=Go("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++ca===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--ca===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?n(JSON.parse(i.responseText)):r({xhr:i,e:o}))},i.responseType="text",i.send()})}function uC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return a&&a.compression?ic():new Promise((n,r)=>{const i=Go("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++ca===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--ca===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?n(i.responseText):r({xhr:i,e:o}))},i.responseType="text",i.send()})}function lC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise((n,r)=>{const i=new Image;a.crossOrigin&&(i.crossOrigin=a.crossOrigin),i.onload=()=>n(i),i.onerror=r,i.src=e})}const fC={fetchArray:sC,fetchJSON:cC,fetchText:uC,fetchBinary:oC,fetchImage:lC};r1("http")||Ao("http",t=>fC);const oc={ASCII:"ascii",BINARY_BIG_ENDIAN:"binary_big_endian",BINARY_LITTLE_ENDIAN:"binary_little_endian"},f1={diffuse_red:"red",diffuse_green:"green",diffuse_blue:"blue"},p1={patternHeader:/ply([\s\S]*)end_header\r?\n/,patternBody:/end_header\s([\s\S]*)$/};function h1(t){let e="",a=0;const n=p1.patternHeader.exec(t);n!==null&&(e=n[1],a=n[0].length);const r={comments:[],elements:[],headerLength:a},i=e.split(` -`);let o,s,c;for(let l=0;lg.name==="vertex"),i=e.find(g=>g.name==="face");let o=0,s=0;r&&(o=r.count),i&&(s=i.count);let c=new Float32Array(o*3),l=new Uint8Array(o*3),p=new Float32Array(o*2),u=new Float32Array(o*3);const f=t.colors.length>0,h=t.uvs.length>0,d=t.normals.length>0,v=t.faceVertexUvs.length>0,m=new Map;let x=o;for(let g=0;g0){let g=0,C=0;if(n){const S=[],T=[],w=[],_=[];for(let E=0;Ea||Math.abs(B[1]-R[1])>a){const P=`${R[0]},${R[1]}`;let L=-1;if(m.has(P)){const k=m.get(P);for(let A=0,j=k.length;A0){const E=o+S.length/3,D=new Float32Array(E*3),O=new Float32Array(E*2),M=f?new Uint8Array(E*3):null,N=d?new Float32Array(E*3):null;D.set(c),O.set(p),f&&M&&M.set(l),d&&N&&N.set(u),D.set(S,o*3),O.set(_,o*2),f&&M&&M.set(T,o*3),d&&N&&N.set(w,o*3),c=D,p=O,f&&(l=M),d&&(u=N)}}else for(let S=0;S0)y.getPolys().setData(Uint32Array.from(t.indices));else{const g=new Uint32Array(o*2);for(let C=0;C0&&(t.indices.push(n.length),n.forEach((i,o)=>{t.indices.push(i)})),t.faceVertexUvs.push(r)}}function cc(t,e,a,n){let r;switch(a){case"int8":case"char":r=[t.getInt8(e),1];break;case"uint8":case"uchar":r=[t.getUint8(e),1];break;case"int16":case"short":r=[t.getInt16(e,n),2];break;case"uint16":case"ushort":r=[t.getUint16(e,n),2];break;case"int32":case"int":r=[t.getInt32(e,n),4];break;case"uint32":case"uint":r=[t.getUint32(e,n),4];break;case"float32":case"float":r=[t.getFloat32(e,n),4];break;case"float64":case"double":r=[t.getFloat64(e,n),8];break;default:console.log("Unsupported type");break}return r}function hC(t,e,a,n){const r={};let i,o=0;for(let s=0;s1&&arguments[1]!==void 0?arguments[1]:{};const{compression:i,progressCallback:o}=e;return r.binary?e.dataAccessHelper.fetchBinary(n,{compression:i,progressCallback:o}):e.dataAccessHelper.fetchText(t,n,{compression:i,progressCallback:o})}t.setUrl=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{binary:!0};e.url=n;const i=n.split("/");return i.pop(),e.baseURL=i.join("/"),e.compression=r.compression,t.loadData({progressCallback:r.progressCallback,binary:!!r.binary})},t.loadData=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=a(e.url,n);return r.then(t.parse),r},t.parse=n=>{typeof n=="string"?t.parseAsText(n):t.parseAsArrayBuffer(n)},t.parseAsArrayBuffer=n=>{if(!n)return;if(n!==e.parseData)t.modified();else return;let r=n;n instanceof ArrayBuffer&&(r=ni.arrayBufferToString(n));const i=h1(r);if(!(i.format!==oc.ASCII)){t.parseAsText(r);return}e.parseData=n;const s={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},c=i.format===oc.BINARY_LITTLE_ENDIAN,l=n instanceof ArrayBuffer?n:n.buffer,p=new DataView(l,i.headerLength);let u,f=0;for(let d=0;d{if(!n)return;if(n!==e.parseData)t.modified();else return;e.parseData=n;let r=n;n instanceof ArrayBuffer&&(r=ni.arrayBufferToString(n));const i=h1(r);if(i.format!==oc.ASCII){t.parseAsArrayBuffer(n);return}const s={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},c=p1.patternBody.exec(r);let l="";c!==null&&(l=c[1]);const p=l.split(` -`);let u=0,f=0;for(let d=0;d=i.elements[u].count&&(u++,f=0);const m=pC(i.elements[u].properties,v);d1(s,i.elements[u].name,m),f++}}const h=g1(s,i.elements,e.faceTextureTolerance,e.duplicatePointsForFaceTexture);e.output[0]=h},t.requestData=(n,r)=>{t.parse(e.parseData)}}const dC={faceTextureTolerance:1e-6,duplicatePointsForFaceTexture:!0};function vC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,dC,a),V.obj(t,e),V.get(t,e,["url","baseURL","duplicatePointsForFaceTexture","faceTextureTolerance"]),V.setGet(t,e,["dataAccessHelper"]),V.algo(t,e,0,1),gC(t,e),e.compression||(e.compression=null),e.progressCallback||(e.progressCallback=null)}V.newInstance(vC,"vtkPLYReader");const{vtkErrorMacro:uc}=V;function yC(t){const a=t.split(" ").filter(r=>r.indexOf("=")>-1),n={};for(let r=0;rp).slice(-3).map(Number);for(v1(l,r);t[e+s].indexOf("vertex")!==-1;){const u=t[e+s].split(/[ \t]+/).filter(f=>f).slice(-3).map(Number);v1(u,a),o++,s++}n.push(o);for(let p=0;p1&&arguments[1]!==void 0?arguments[1]:{};const o=i.compression!==void 0?i.compression:e.compression,s=i.progressCallback!==void 0?i.progressCallback:e.progressCallback;return i.binary?e.dataAccessHelper.fetchBinary(r,{compression:o,progressCallback:s}):e.dataAccessHelper.fetchText(t,r,{compression:o,progressCallback:s})}function n(r){const i=e.output[0],o=i.getPoints().getData(),s=i.getPolys().getData();if(!o||!s){console.warn("No valid polydata.");return}const c=new Map,l=new Map;let p=0,u=!1;for(let f=0;f+g*10**-r);f[x]=y[0],f[x+1]=y[1],f[x+2]=y[2]}const d=new Int32Array(s.length);for(let v=0;v1&&arguments[1]!==void 0?arguments[1]:{binary:!0};e.url=r;const o=r.split("/");return o.pop(),e.baseURL=o.join("/"),t.loadData(i)},t.loadData=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const i=a(e.url,r);return i.then(t.parse),i},t.parse=r=>{typeof r=="string"?t.parseAsText(r):t.parseAsArrayBuffer(r)},t.parseAsArrayBuffer=r=>{if(!r)return;if(r!==e.parseData)t.modified();else return;e.parseData=r;let i=!1;if(i=84+new DataView(r,0,80+4).getUint32(80,!0)*50===r.byteLength,!i){t.parseAsText(ni.arrayBufferToString(r));return}const c=r.slice(0,80),l=ni.arrayBufferToString(c),p=yC(l),u=new DataView(r,84),f=(r.byteLength-84)/50,h=new Float32Array(f*9),d=new Float32Array(f*3),v=new Uint32Array(f*4),m=new Uint16Array(f);let x=0;for(let C=0;C=0&&n(e.removeDuplicateVertices)},t.parseAsText=r=>{if(!r)return;if(r!==e.parseData)t.modified();else return;e.parseData=r;const i=r.split(` -`);let o=1;const s=[],c=[],l=[];for(;o!==-1;)o=mC(i,o,s,c,l);const p=Xe.newInstance();p.getPoints().setData(Float32Array.from(s),3),p.getPolys().setData(Uint32Array.from(c)),p.getCellData().setNormals(pe.newInstance({name:"Normals",values:Float32Array.from(l),numberOfComponents:3})),e.output[0]=p,e.removeDuplicateVertices>=0&&n(e.removeDuplicateVertices)},t.requestData=(r,i)=>{t.parse(e.parseData)}}const CC={removeDuplicateVertices:-1};function SC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,CC,a),V.obj(t,e),V.get(t,e,["url","baseURL"]),V.setGet(t,e,["dataAccessHelper","removeDuplicateVertices"]),V.algo(t,e,0,1),xC(t,e),e.compression||(e.compression=null),e.progressCallback||(e.progressCallback=null)}V.newInstance(SC,"vtkSTLReader");function TC(t,e){e.classHierarchy.push("vtkElevationReader"),e.dataAccessHelper||(e.dataAccessHelper=aa.get("http"));function a(n,r){return e.dataAccessHelper.fetchText(t,n,r)}t.setUrl=(n,r)=>(e.url=n,t.loadData(r)),t.loadData=n=>a(e.url,n).then(r=>(t.parseAsText(r),!0)),t.parseAsText=n=>{e.csv=n,e.elevation=[],e.csv.split(` -`).forEach((i,o)=>{e.elevation.push(i.split(",").map(s=>Number(s)))}),t.modified()},t.requestData=(n,r)=>{const i=Xe.newInstance();if(i.getPoints().setData(new Float32Array(0,0,0,1,1,1),3),e.elevation){const o=e.elevation.length,s=e.elevation[0].length,c=i.getPoints();c.setNumberOfPoints(s*o,3);const l=c.getData(),p=jn.newInstance({size:5*(s-1)*(o-1)});i.setPolys(p);const u=p.getData();let f=0;const h=new Float32Array(s*o*2),d=pe.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(d);for(let v=0;v0&&v>0&&(u[f++]=4,u[f++]=x,u[f++]=x-1,u[f++]=x-1-s,u[f++]=x-s)}}e.output[0]=i},t.isBusy=()=>!!e.requestCount}const wC={origin:[0,0,0],xSpacing:1,ySpacing:1,zScaling:1,xDirection:1,yDirection:-1,requestCount:0};function _C(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,wC,a),V.obj(t,e),V.get(t,e,["url"]),V.setGet(t,e,["dataAccessHelper","xSpacing","ySpacing","zScaling","xDirection","yDirection"]),V.algo(t,e,0,1),V.event(t,e,"busy"),TC(t,e)}V.newInstance(_C,"vtkElevationReader");const Me={};function lc(t,e,a,n,r){for(let i=0;iNumber(i));let a=e[0]-1;a=a<0?a+1+Me.v.length/3:a;let n=e[1]?e[1]-1:a;n=n<0?n+1+Me.vt.length/2:n;let r=e[2]?e[2]-1:a;return r=r<0?r+1+Me.vn.length/3:r,[a,n,r]}function OC(t){if(t[0]==="#")return;const e=t.split(/[ \t]+/);if(e[0]===Me.splitOn)e.shift(),Me.pieces.push(e.join(" ").trim()),Me.f.push([]),Me.size++;else if(e[0]==="v")Me.v.push(Number(e[1])),Me.v.push(Number(e[2])),Me.v.push(Number(e[3]));else if(e[0]==="vt")Me.vt.push(Number(e[1])),Me.vt.push(Number(e[2]));else if(e[0]==="vn")Me.vn.push(Number(e[1])),Me.vn.push(Number(e[2])),Me.vn.push(Number(e[3]));else if(e[0]==="f"){Me.size===0&&Me.size++;const a=Me.f[Me.size-1];e.shift();const n=e.filter(i=>i.length>0&&i!=="\r"),r=n.length;a.push(r);for(let i=0;i1?o+y:g;for(let S=1;S1&&arguments[1]!==void 0?arguments[1]:{};return e.dataAccessHelper.fetchText(t,n,r)}t.setUrl=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n.indexOf(".obj")===-1&&!r.fullpath)e.baseURL=n,e.url=`${n}/index.obj`;else{e.url=n;const i=n.split("/");i.pop(),e.baseURL=i.join("/")}return t.loadData(r)},t.loadData=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return a(e.url,n).then(r=>t.isDeleted()?!1:t.parseAsText(r))},t.parseAsText=n=>(n&&(n!==e.parseData&&t.modified(),e.parseData=n,e.numberOfOutputs=0,EC(e.splitMode),n.split(` -`).forEach(OC),bC(e)),!0),t.requestData=(n,r)=>{t.parseAsText(e.parseData)},t.isBusy=()=>!!e.requestCount,t.getNumberOfOutputPorts=()=>e.numberOfOutputs}const NC={numberOfOutputs:1,requestCount:0,splitMode:null,trackDuplicates:!1};function RC(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,NC,a),V.obj(t,e),V.get(t,e,["url","baseURL"]),V.setGet(t,e,["dataAccessHelper","splitMode","trackDuplicates"]),V.algo(t,e,0,1),V.event(t,e,"busy"),MC(t,e)}V.newInstance(RC,"vtkOBJReader");const LC=["chemical json","name","inchi","formula","atoms","bonds","properties"];function FC(t,e){e.classHierarchy.push("vtkMolecule")}const kC={"chemical json":0,name:"",inchi:"",formula:"",atoms:null,bonds:null,properties:null};function y1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,kC,a),V.obj(t,e),e.atoms||(e.atoms={}),e.bonds||(e.bonds={}),e.properties||(e.properties={}),V.setGet(t,e,LC),FC(t,e)}var VC={newInstance:V.newInstance(y1,"vtkMolecule"),extend:y1},AC=[1],BC=[2],UC=[3],GC=[4],IC=[5],PC=[6],zC=[7],jC=[8],WC=[9],$C=[10],HC=[11],KC=[12],XC=[13],qC=[14],YC=[15],JC=[16],ZC=[17],QC=[18],eS=[19],tS=[20],nS=[21],rS=[22],aS=[23],iS=[24],oS=[25],sS=[26],cS=[27],uS=[28],lS=[29],fS=[30],pS=[31],hS=[32],gS=[33],dS=[34],vS=[35],yS=[36],mS=[37],xS=[38],CS=[39],SS=[40],TS=[41],wS=[42],_S=[43],ES=[44],DS=[45],OS=[46],bS=[47],MS=[48],NS=[49],RS=[50],LS=[51],FS=[52],kS=[53],VS=[54],AS=[55],BS=[56],US=[57],GS=[58],IS=[59],PS=[60],zS=[61],jS=[62],WS=[63],$S=[64],HS=[65],KS=[66],XS=[67],qS=[68],YS=[69],JS=[70],ZS=[71],QS=[72],eT=[73],tT=[74],nT=[75],rT=[76],aT=[77],iT=[78],oT=[79],sT=[80],cT=[81],uT=[82],lT=[83],fT=[84],pT=[85],hT=[86],gT=[87],dT=[88],vT=[89],yT=[90],mT=[91],xT=[92],CT=[93],ST=[94],TT=[95],wT=[96],_T=[97],ET=[98],DT=[99],OT=[100],bT=[101],MT=[102],NT=[103],RT=[104],LT=[105],FT=[106],kT=[107],VT=[108],AT=[109],BT=[110],UT=[111],GT=[112],IT=[113],PT=[114],zT=[115],jT=[116],WT=[117],$T=[118],HT={H:AC,He:BC,Li:UC,Be:GC,B:IC,C:PC,N:zC,O:jC,F:WC,Ne:$C,Na:HC,Mg:KC,Al:XC,Si:qC,P:YC,S:JC,Cl:ZC,Ar:QC,K:eS,Ca:tS,Sc:nS,Ti:rS,V:aS,Cr:iS,Mn:oS,Fe:sS,Co:cS,Ni:uS,Cu:lS,Zn:fS,Ga:pS,Ge:hS,As:gS,Se:dS,Br:vS,Kr:yS,Rb:mS,Sr:xS,Y:CS,Zr:SS,Nb:TS,Mo:wS,Tc:_S,Ru:ES,Rh:DS,Pd:OS,Ag:bS,Cd:MS,In:NS,Sn:RS,Sb:LS,Te:FS,I:kS,Xe:VS,Cs:AS,Ba:BS,La:US,Ce:GS,Pr:IS,Nd:PS,Pm:zS,Sm:jS,Eu:WS,Gd:$S,Tb:HS,Dy:KS,Ho:XS,Er:qS,Tm:YS,Yb:JS,Lu:ZS,Hf:QS,Ta:eT,W:tT,Re:nT,Os:rT,Ir:aT,Pt:iT,Au:oT,Hg:sT,Tl:cT,Pb:uT,Bi:lT,Po:fT,At:pT,Rn:hT,Fr:gT,Ra:dT,Ac:vT,Th:yT,Pa:mT,U:xT,Np:CT,Pu:ST,Am:TT,Cm:wT,Bk:_T,Cf:ET,Es:DT,Fm:OT,Md:bT,No:MT,Lr:NT,Rf:RT,Db:LT,Sg:FT,Bh:kT,Hs:VT,Mt:AT,Ds:BT,Rg:UT,Cn:GT,Uut:IT,Uuq:PT,Uup:zT,Uuh:jT,Uus:WT,Uuo:$T};function KT(t,e){e.classHierarchy.push("vtkPDBReader"),e.dataAccessHelper||(e.dataAccessHelper=aa.get("http"));function a(n,r){return e.dataAccessHelper.fetchText(t,n,r)}t.setUrl=(n,r)=>{if(n.indexOf(".pdb")===-1)e.baseURL=n,e.url=`${n}`;else{e.url=n;const i=n.split("/");i.pop(),e.baseURL=i.join("/")}return t.loadData(r)},t.loadData=n=>a(e.url,n).then(t.parseAsText),t.parseAsText=n=>(e.pdb=n,e.molecule=[],e.molecule=e.pdb.split(` -`),t.modified(),!0),t.requestData=(n,r)=>{const i=VC.newInstance();if(e.molecule){const o=e.molecule.length,s=[],c=[];e.numberOfAtoms=0;let l=0;for(;l=78&&(x=u.substr(76,2).replace(/\s+/g,"")),x===""&&(x=h.substr(0,2).replace(/\d/g,"")),s.push(d),s.push(v),s.push(m);const[y]=HT[x];c.push(y),e.numberOfAtoms++}l++}i.getAtoms().elements={},i.getAtoms().elements.number=Int8Array.from(c),i.getAtoms().coords={},i.getAtoms().coords["3d"]=Float32Array.from(s)}e.output[0]=i},t.isBusy=()=>!!e.requestCount}const XT={numberOfAtoms:0,requestCount:0};function qT(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,XT,a),V.obj(t,e),V.get(t,e,["url","baseURL","numberOfAtoms","requestCount"]),V.setGet(t,e,["dataAccessHelper"]),V.algo(t,e,0,1),V.event(t,e,"busy"),KT(t,e)}V.newInstance(qT,"vtkPDBReader");var fc={},YT={get exports(){return fc},set exports(t){fc=t}};(function(t,e){(function(a,n){t.exports=n()})(Vt,function(){return function(a){var n={};function r(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return a[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=a,r.c=n,r.d=function(i,o,s){r.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:s})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,o){if(1&o&&(i=r(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var c in i)r.d(s,c,function(l){return i[l]}.bind(null,c));return s},r.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(o,"a",o),o},r.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},r.p="",r(r.s=184)}([function(a,n,r){function i(o){for(var s in o)n.hasOwnProperty(s)||(n[s]=o[s])}Object.defineProperty(n,"__esModule",{value:!0}),i(r(240)),i(r(251)),i(r(175)),i(r(107)),i(r(29)),i(r(73)),i(r(106)),i(r(30)),i(r(252)),i(r(52)),i(r(97)),i(r(253)),i(r(37)),i(r(51)),i(r(173)),i(r(176)),i(r(172)),i(r(108)),i(r(254)),i(r(255)),i(r(256)),i(r(72)),i(r(177)),i(r(105)),i(r(17)),i(r(257)),i(r(12)),i(r(174))},function(a,n,r){var i=this&&this.__values||function(g){var C=typeof Symbol=="function"&&Symbol.iterator,S=C&&g[C],T=0;if(S)return S.call(g);if(g&&typeof g.length=="number")return{next:function(){return g&&T>=g.length&&(g=void 0),{value:g&&g[T++],done:!g}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(212);n.FixedSizeSet=o.FixedSizeSet;var s=r(213);n.ObjectCache=s.ObjectCache;var c=r(214);n.CompareCache=c.CompareCache;var l=r(215);n.Lazy=l.Lazy;var p=r(216);function u(g,C,S){if(x(g))g.forEach(function(w,_){return C.call(S,_,w)});else for(var T in g)g.hasOwnProperty(T)&&C.call(S,T,g[T])}function f(g){var C,S;if(h(g))return g;if(v(g)){var T=[];try{for(var w=i(g),_=w.next();!_.done;_=w.next()){var E=_.value;T.push(f(E))}}catch(M){C={error:M}}finally{try{_&&!_.done&&(S=w.return)&&S.call(w)}finally{if(C)throw C.error}}return T}if(d(g)){T={};for(var D in g)if(g.hasOwnProperty(D)){var O=g[D];T[D]=f(O)}return T}return g}function h(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"}function d(g){var C=typeof g;return!!g&&(C==="function"||C==="object")}function v(g){return Array.isArray(g)}function m(g){return g instanceof Set}function x(g){return g instanceof Map}function y(g){if(d(g)){var C=Object.getPrototypeOf(g),S=C.constructor;return C&&S&&typeof S=="function"&&S instanceof S&&Function.prototype.toString.call(S)===Function.prototype.toString.call(Object)}return!1}n.StringWalker=p.StringWalker,n.applyMixin=function(g,C){for(var S=[],T=2;T>6|192;else{if(w>55295&&w<56320){if(++T>=g.length)throw new Error("Incomplete surrogate pair.");var _=g.charCodeAt(T);if(_<56320||_>57343)throw new Error("Invalid surrogate character.");w=65536+((1023&w)<<10)+(1023&_),C[S++]=w>>18|240,C[S++]=w>>12&63|128}else C[S++]=w>>12|224;C[S++]=w>>6&63|128}C[S++]=63&w|128}}return C.subarray(0,S)},n.utf8Decode=function(g){for(var C="",S=0;S127)if(T>191&&T<224){if(S>=g.length)throw new Error("Incomplete 2-byte sequence.");T=(31&T)<<6|63&g[S++]}else if(T>223&&T<240){if(S+1>=g.length)throw new Error("Incomplete 3-byte sequence.");T=(15&T)<<12|(63&g[S++])<<6|63&g[S++]}else{if(!(T>239&&T<248))throw new Error("Unknown multi-byte start.");if(S+2>=g.length)throw new Error("Incomplete 4-byte sequence.");T=(7&T)<<18|(63&g[S++])<<12|(63&g[S++])<<6|63&g[S++]}if(T<=65535)C+=String.fromCharCode(T);else{if(!(T<=1114111))throw new Error("Code point exceeds UTF-16 limit.");T-=65536,C+=String.fromCharCode(T>>10|55296),C+=String.fromCharCode(1023&T|56320)}}return C}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),function(i){i[i.Before=0]="Before",i[i.Equal=1]="Equal",i[i.After=2]="After"}(n.BoundaryPosition||(n.BoundaryPosition={})),function(i){i[i.None=0]="None",i[i.Capturing=1]="Capturing",i[i.AtTarget=2]="AtTarget",i[i.Bubbling=3]="Bubbling"}(n.EventPhase||(n.EventPhase={})),function(i){i[i.Element=1]="Element",i[i.Attribute=2]="Attribute",i[i.Text=3]="Text",i[i.CData=4]="CData",i[i.EntityReference=5]="EntityReference",i[i.Entity=6]="Entity",i[i.ProcessingInstruction=7]="ProcessingInstruction",i[i.Comment=8]="Comment",i[i.Document=9]="Document",i[i.DocumentType=10]="DocumentType",i[i.DocumentFragment=11]="DocumentFragment",i[i.Notation=12]="Notation"}(n.NodeType||(n.NodeType={})),function(i){i[i.Disconnected=1]="Disconnected",i[i.Preceding=2]="Preceding",i[i.Following=4]="Following",i[i.Contains=8]="Contains",i[i.ContainedBy=16]="ContainedBy",i[i.ImplementationSpecific=32]="ImplementationSpecific"}(n.Position||(n.Position={})),function(i){i[i.Accept=1]="Accept",i[i.Reject=2]="Reject",i[i.Skip=3]="Skip"}(n.FilterResult||(n.FilterResult={})),function(i){i[i.All=4294967295]="All",i[i.Element=1]="Element",i[i.Attribute=2]="Attribute",i[i.Text=4]="Text",i[i.CDataSection=8]="CDataSection",i[i.EntityReference=16]="EntityReference",i[i.Entity=32]="Entity",i[i.ProcessingInstruction=64]="ProcessingInstruction",i[i.Comment=128]="Comment",i[i.Document=256]="Document",i[i.DocumentType=512]="DocumentType",i[i.DocumentFragment=1024]="DocumentFragment",i[i.Notation=2048]="Notation"}(n.WhatToShow||(n.WhatToShow={})),function(i){i[i.StartToStart=0]="StartToStart",i[i.StartToEnd=1]="StartToEnd",i[i.EndToEnd=2]="EndToEnd",i[i.EndToStart=3]="EndToStart"}(n.HowToCompare||(n.HowToCompare={}))},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(241);n.Cast=i.Cast;var o=r(150);n.Guard=o.Guard;var s=r(242);n.EmptySet=s.EmptySet},function(a,n,r){var i=r(11),o=r(55).f,s=r(21),c=r(25),l=r(80),p=r(119),u=r(123);a.exports=function(f,h){var d,v,m,x,y,g=f.target,C=f.global,S=f.stat;if(d=C?i:S?i[g]||l(g,{}):(i[g]||{}).prototype)for(v in h){if(x=h[v],m=f.noTargetGet?(y=o(d,v))&&y.value:d[v],!u(C?v:g+(S?".":"#")+v,f.forced)&&m!==void 0){if(typeof x==typeof m)continue;p(x,m)}(f.sham||m&&m.sham)&&s(x,"sham",!0),c(d,v,x,f)}}},function(a,n,r){var i=r(11),o=r(81),s=r(14),c=r(58),l=r(86),p=r(124),u=o("wks"),f=i.Symbol,h=p?f:f&&f.withoutSetter||c;a.exports=function(d){return s(u,d)||(l&&s(f,d)?u[d]=f[d]:u[d]=h("Symbol."+d)),u[d]}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=r(29),s=function(){function c(){this._features={mutationObservers:!0,customElements:!0,slots:!0,steps:!0},this._window=null,this._compareCache=new i.CompareCache,this._rangeList=new i.FixedSizeSet}return c.prototype.setFeatures=function(l){if(l===void 0&&(l=!0),i.isObject(l))for(var p in l)this._features[p]=l[p]||!1;else for(var p in this._features)this._features[p]=l},Object.defineProperty(c.prototype,"features",{get:function(){return this._features},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"window",{get:function(){return this._window===null&&(this._window=o.create_window()),this._window},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"compareCache",{get:function(){return this._compareCache},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"rangeList",{get:function(){return this._rangeList},enumerable:!0,configurable:!0}),Object.defineProperty(c,"instance",{get:function(){return c._instance||(c._instance=new c),c._instance},enumerable:!0,configurable:!0}),c}();n.dom=s.instance},function(a,n,r){var i=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var g={};if(y!=null)for(var C in y)Object.hasOwnProperty.call(y,C)&&(g[C]=y[C]);return g.default=y,g};Object.defineProperty(n,"__esModule",{value:!0});var o=i(r(228));n.base64=o;var s=i(r(146));n.byte=s;var c=i(r(147));n.byteSequence=c;var l=i(r(96));n.codePoint=l;var p=i(r(232));n.json=p;var u=i(r(233));n.list=u;var f=i(r(234));n.map=f;var h=i(r(235));n.namespace=h;var d=i(r(236));n.queue=d;var v=i(r(237));n.set=v;var m=i(r(238));n.stack=m;var x=i(r(239));n.string=x},function(a,n){a.exports=function(r){try{return!!r()}catch{return!0}}},function(a,n,r){var i,o=this&&this.__extends||(i=function(L,k){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,j){A.__proto__=j}||function(A,j){for(var H in j)j.hasOwnProperty(H)&&(A[H]=j[H])})(L,k)},function(L,k){function A(){this.constructor=L}i(L,k),L.prototype=k===null?Object.create(k):(A.prototype=k.prototype,new A)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(L){function k(A,j){j===void 0&&(j="");var H=L.call(this,j)||this;return H.name=A,H}return o(k,L),k}(Error);n.DOMException=s;var c=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"DOMStringSizeError",A)||this}return o(k,L),k}(s);n.DOMStringSizeError=c;var l=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"WrongDocumentError","The object is in the wrong document. "+A)||this}return o(k,L),k}(s);n.WrongDocumentError=l;var p=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NoDataAllowedError",A)||this}return o(k,L),k}(s);n.NoDataAllowedError=p;var u=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NoModificationAllowedError","The object can not be modified. "+A)||this}return o(k,L),k}(s);n.NoModificationAllowedError=u;var f=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NotSupportedError","The operation is not supported. "+A)||this}return o(k,L),k}(s);n.NotSupportedError=f;var h=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"InUseAttributeError",A)||this}return o(k,L),k}(s);n.InUseAttributeError=h;var d=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"InvalidStateError","The object is in an invalid state. "+A)||this}return o(k,L),k}(s);n.InvalidStateError=d;var v=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"InvalidModificationError","The object can not be modified in this way. "+A)||this}return o(k,L),k}(s);n.InvalidModificationError=v;var m=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NamespaceError","The operation is not allowed by Namespaces in XML. [XMLNS] "+A)||this}return o(k,L),k}(s);n.NamespaceError=m;var x=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"InvalidAccessError","The object does not support the operation or argument. "+A)||this}return o(k,L),k}(s);n.InvalidAccessError=x;var y=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"ValidationError",A)||this}return o(k,L),k}(s);n.ValidationError=y;var g=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"TypeMismatchError",A)||this}return o(k,L),k}(s);n.TypeMismatchError=g;var C=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"SecurityError","The operation is insecure. "+A)||this}return o(k,L),k}(s);n.SecurityError=C;var S=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NetworkError","A network error occurred. "+A)||this}return o(k,L),k}(s);n.NetworkError=S;var T=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"AbortError","The operation was aborted. "+A)||this}return o(k,L),k}(s);n.AbortError=T;var w=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"URLMismatchError","The given URL does not match another URL. "+A)||this}return o(k,L),k}(s);n.URLMismatchError=w;var _=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"QuotaExceededError","The quota has been exceeded. "+A)||this}return o(k,L),k}(s);n.QuotaExceededError=_;var E=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"TimeoutError","The operation timed out. "+A)||this}return o(k,L),k}(s);n.TimeoutError=E;var D=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"InvalidNodeTypeError","The supplied node is incorrect or has an incorrect ancestor for this operation. "+A)||this}return o(k,L),k}(s);n.InvalidNodeTypeError=D;var O=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"DataCloneError","The object can not be cloned. "+A)||this}return o(k,L),k}(s);n.DataCloneError=O;var M=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NotImplementedError","The DOM method is not implemented by this module. "+A)||this}return o(k,L),k}(s);n.NotImplementedError=M;var N=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"HierarchyRequestError","The operation would yield an incorrect node tree. "+A)||this}return o(k,L),k}(s);n.HierarchyRequestError=N;var R=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"NotFoundError","The object can not be found here. "+A)||this}return o(k,L),k}(s);n.NotFoundError=R;var B=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"IndexSizeError","The index is not in the allowed range. "+A)||this}return o(k,L),k}(s);n.IndexSizeError=B;var I=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"SyntaxError","The string did not match the expected pattern. "+A)||this}return o(k,L),k}(s);n.SyntaxError=I;var P=function(L){function k(A){return A===void 0&&(A=""),L.call(this,"InvalidCharacterError","The string contains invalid characters. "+A)||this}return o(k,L),k}(s);n.InvalidCharacterError=P},function(a,n,r){var i=r(53),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];a.exports=function(c,l){var p,u;if(l=l||{},Object.keys(l).forEach(function(f){if(o.indexOf(f)===-1)throw new i('Unknown option "'+f+'" is met in definition of "'+c+'" YAML type.')}),this.tag=c,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(f){return f},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.defaultStyle=l.defaultStyle||null,this.styleAliases=(p=l.styleAliases||null,u={},p!==null&&Object.keys(p).forEach(function(f){p[f].forEach(function(h){u[String(h)]=f})}),u),s.indexOf(this.kind)===-1)throw new i('Unknown kind "'+this.kind+'" is specified for "'+c+'" YAML type.')}},function(a,n,r){(function(i){var o=function(s){return s&&s.Math==Math&&s};a.exports=o(typeof globalThis=="object"&&globalThis)||o(typeof window=="object"&&window)||o(typeof self=="object"&&self)||o(typeof i=="object"&&i)||Function("return this")()}).call(this,r(78))},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),n.idl_defineConst=function(i,o,s){Object.defineProperty(i,o,{writable:!1,enumerable:!0,configurable:!1,value:s})}},function(a,n){a.exports=function(r){return typeof r=="object"?r!==null:typeof r=="function"}},function(a,n){var r={}.hasOwnProperty;a.exports=function(i,o){return r.call(i,o)}},function(a,n,r){var i=r(16),o=r(115),s=r(18),c=r(56),l=Object.defineProperty;n.f=i?l:function(p,u,f){if(s(p),u=c(u,!0),s(f),o)try{return l(p,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported");return"value"in f&&(p[u]=f.value),p}},function(a,n,r){var i=r(8);a.exports=!i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},function(a,n,r){var i=this&&this.__values||function(g){var C=typeof Symbol=="function"&&Symbol.iterator,S=C&&g[C],T=0;if(S)return S.call(g);if(g&&typeof g.length=="number")return{next:function(){return g&&T>=g.length&&(g=void 0),{value:g&&g[T++],done:!g}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(3),s=r(2);function c(g,C,S){if(S===void 0&&(S=!1),S&&o.Guard.isElementNode(C)&&o.Guard.isShadowRoot(C.shadowRoot)&&C.shadowRoot._firstChild)return C.shadowRoot._firstChild;if(C._firstChild)return C._firstChild;if(C===g)return null;if(C._nextSibling)return C._nextSibling;for(var T=C._parent;T&&T!==g;){if(T._nextSibling)return T._nextSibling;T=T._parent}return null}function l(){var g;return(g={})[Symbol.iterator]=function(){return{next:function(){return{done:!0,value:null}}}},g}function p(g,C,S,T){C===void 0&&(C=!1),S===void 0&&(S=!1);for(var w=C?g:c(g,g,S);w&&T&&!T(w);)w=c(g,w,S);return w}function u(g,C,S,T,w){T===void 0&&(T=!1);for(var _=c(g,C,T);_&&w&&!w(_);)_=c(g,_,T);return _}function f(g,C,S,T){var w;return C===void 0&&(C=!1),S===void 0&&(S=!1),C||g._children.size!==0?((w={})[Symbol.iterator]=function(){var _=C?g:c(g,g,S);return{next:function(){for(;_&&T&&!T(_);)_=c(g,_,S);if(_===null)return{done:!0,value:null};var E={done:!1,value:_};return _=c(g,_,S),E}}},w):l()}function h(g,C,S){C===void 0&&(C=!1);for(var T=C?g:g._parent;T&&S&&!S(T);)T=T._parent;return T}function d(g,C,S,T){for(var w=C._parent;w&&T&&!T(w);)w=w._parent;return w}function v(g){return o.Guard.isDocumentTypeNode(g)?0:o.Guard.isCharacterDataNode(g)?g._data.length:g._children.size}function m(g,C){if(C===void 0&&(C=!1),C){var S=m(g,!1);return o.Guard.isShadowRoot(S)?m(S._host,!0):S}return g._parent?m(g._parent):g}function x(g,C,S,T){S===void 0&&(S=!1),T===void 0&&(T=!1);for(var w=S?g:T&&o.Guard.isShadowRoot(g)?g._host:g._parent;w!==null;){if(w===C)return!0;w=T&&o.Guard.isShadowRoot(w)?w._host:w._parent}return!1}function y(g){for(var C=m(g),S=0,T=p(C);T!==null;){if(S++,T===g)return S;T=u(C,T)}return-1}n.tree_getFirstDescendantNode=p,n.tree_getNextDescendantNode=u,n.tree_getDescendantNodes=f,n.tree_getDescendantElements=function(g,C,S,T){var w;return C===void 0&&(C=!1),S===void 0&&(S=!1),C||g._children.size!==0?((w={})[Symbol.iterator]=function(){var _=f(g,C,S,function(D){return o.Guard.isElementNode(D)})[Symbol.iterator](),E=_.next().value;return{next:function(){for(;E&&T&&!T(E);)E=_.next().value;if(E===null)return{done:!0,value:null};var D={done:!1,value:E};return E=_.next().value,D}}},w):l()},n.tree_getSiblingNodes=function(g,C,S){var T;return C===void 0&&(C=!1),g._parent&&g._parent._children.size!==0?((T={})[Symbol.iterator]=function(){var w=g._parent?g._parent._firstChild:null;return{next:function(){for(;w&&(S&&!S(w)||!C&&w===g);)w=w._nextSibling;if(w===null)return{done:!0,value:null};var _={done:!1,value:w};return w=w._nextSibling,_}}},T):l()},n.tree_getFirstAncestorNode=h,n.tree_getNextAncestorNode=d,n.tree_getAncestorNodes=function(g,C,S){var T;return C===void 0&&(C=!1),C||g._parent?((T={})[Symbol.iterator]=function(){var w=h(g,C,S);return{next:function(){if(w===null)return{done:!0,value:null};var _={done:!1,value:w};return w=d(0,w,C,S),_}}},T):l()},n.tree_getCommonAncestor=function(g,C){if(g===C)return g._parent;for(var S=[],T=[],w=h(g,!0);w!==null;)S.push(w),w=d(0,w);for(var _=h(C,!0);_!==null;)T.push(_),_=d(0,_);for(var E=S.length,D=T.length,O=null,M=Math.min(E,D);M>0;M--){var N=S[--E];if(N!==T[--D])break;O=N}return O},n.tree_getFollowingNode=function(g,C){if(C._firstChild)return C._firstChild;if(C._nextSibling)return C._nextSibling;for(;;){var S=C._parent;if(S===null||S===g)return null;if(S._nextSibling)return S._nextSibling;C=S}},n.tree_getPrecedingNode=function(g,C){return C===g?null:C._previousSibling?(C=C._previousSibling)._lastChild?C._lastChild:C:C._parent},n.tree_isConstrained=function g(C){var S,T,w,_,E,D;switch(C._nodeType){case s.NodeType.Document:var O=!1,M=!1;try{for(var N=i(C._children),R=N.next();!R.done;R=N.next())switch(R.value._nodeType){case s.NodeType.ProcessingInstruction:case s.NodeType.Comment:break;case s.NodeType.DocumentType:if(O||M)return!1;O=!0;break;case s.NodeType.Element:if(M)return!1;M=!0;break;default:return!1}}catch(k){S={error:k}}finally{try{R&&!R.done&&(T=N.return)&&T.call(N)}finally{if(S)throw S.error}}break;case s.NodeType.DocumentFragment:case s.NodeType.Element:try{for(var B=i(C._children),I=B.next();!I.done;I=B.next())switch(I.value._nodeType){case s.NodeType.Element:case s.NodeType.Text:case s.NodeType.ProcessingInstruction:case s.NodeType.CData:case s.NodeType.Comment:break;default:return!1}}catch(k){w={error:k}}finally{try{I&&!I.done&&(_=B.return)&&_.call(B)}finally{if(w)throw w.error}}break;case s.NodeType.DocumentType:case s.NodeType.Text:case s.NodeType.ProcessingInstruction:case s.NodeType.CData:case s.NodeType.Comment:return!C.hasChildNodes()}try{for(var P=i(C._children),L=P.next();!L.done;L=P.next())if(!g(L.value))return!1}catch(k){E={error:k}}finally{try{L&&!L.done&&(D=P.return)&&D.call(P)}finally{if(E)throw E.error}}return!0},n.tree_nodeLength=v,n.tree_isEmpty=function(g){return v(g)===0},n.tree_rootNode=m,n.tree_isDescendantOf=function(g,C,S,T){S===void 0&&(S=!1),T===void 0&&(T=!1);for(var w=p(g,S,T);w!==null;){if(w===C)return!0;w=u(g,w,S,T)}return!1},n.tree_isAncestorOf=x,n.tree_isHostIncludingAncestorOf=function g(C,S,T){if(T===void 0&&(T=!1),x(C,S,T))return!0;var w=m(C);return!(!o.Guard.isDocumentFragmentNode(w)||w._host===null||!g(w._host,S,T))},n.tree_isSiblingOf=function(g,C,S){return S===void 0&&(S=!1),g!==C?g._parent!==null&&g._parent===C._parent:!!S},n.tree_isPreceding=function(g,C){var S=y(g),T=y(C);return S!==-1&&T!==-1&&m(g)===m(C)&&TS},n.tree_isParentOf=function(g,C){return g._parent===C},n.tree_isChildOf=function(g,C){return C._parent===g},n.tree_previousSibling=function(g){return g._previousSibling},n.tree_nextSibling=function(g){return g._nextSibling},n.tree_firstChild=function(g){return g._firstChild},n.tree_lastChild=function(g){return g._lastChild},n.tree_treePosition=y,n.tree_index=function(g){for(var C=0;g._previousSibling!==null;)C++,g=g._previousSibling;return C},n.tree_retarget=function(g,C){for(;;){if(!g||!o.Guard.isNode(g))return g;var S=m(g);if(!o.Guard.isShadowRoot(S)||C&&o.Guard.isNode(C)&&x(S,C,!0,!0))return g;g=S.host}}},function(a,n,r){var i=r(13);a.exports=function(o){if(!i(o))throw TypeError(String(o)+" is not an object");return o}},function(a,n,r){var i=r(24),o=r(130),s=r(49),c=r(43),l=r(88),p=c.set,u=c.getterFor("Array Iterator");a.exports=l(Array,"Array",function(f,h){p(this,{type:"Array Iterator",target:i(f),index:0,kind:h})},function(){var f=u(this),h=f.target,d=f.kind,v=f.index++;return!h||v>=h.length?(f.target=void 0,{value:void 0,done:!0}):d=="keys"?{value:v,done:!1}:d=="values"?{value:h[v],done:!1}:{value:[v,h[v]],done:!1}},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(a,n,r){var i=r(90),o=r(25),s=r(202);i||o(Object.prototype,"toString",s,{unsafe:!0})},function(a,n,r){var i=r(16),o=r(15),s=r(40);a.exports=i?function(c,l,p){return o.f(c,l,s(1,p))}:function(c,l,p){return c[l]=p,c}},function(a,n,r){var i=r(137).charAt,o=r(43),s=r(88),c=o.set,l=o.getterFor("String Iterator");s(String,"String",function(p){c(this,{type:"String Iterator",string:String(p),index:0})},function(){var p,u=l(this),f=u.string,h=u.index;return h>=f.length?{value:void 0,done:!0}:(p=i(f,h),u.index+=p.length,{value:p,done:!1})})},function(a,n,r){var i=r(11),o=r(203),s=r(19),c=r(21),l=r(5),p=l("iterator"),u=l("toStringTag"),f=s.values;for(var h in o){var d=i[h],v=d&&d.prototype;if(v){if(v[p]!==f)try{c(v,p,f)}catch{v[p]=f}if(v[u]||c(v,u,h),o[h]){for(var m in s)if(v[m]!==s[m])try{c(v,m,s[m])}catch{v[m]=s[m]}}}}},function(a,n,r){var i=r(41),o=r(35);a.exports=function(s){return i(o(s))}},function(a,n,r){var i=r(11),o=r(21),s=r(14),c=r(80),l=r(117),p=r(43),u=p.get,f=p.enforce,h=String(String).split("String");(a.exports=function(d,v,m,x){var y=!!x&&!!x.unsafe,g=!!x&&!!x.enumerable,C=!!x&&!!x.noTargetGet;typeof m=="function"&&(typeof v!="string"||s(m,"name")||o(m,"name",v),f(m).source=h.join(typeof v=="string"?v:"")),d!==i?(y?!C&&d[v]&&(g=!0):delete d[v],g?d[v]=m:o(d,v,m)):g?d[v]=m:c(v,m)})(Function.prototype,"toString",function(){return typeof this=="function"&&u(this).source||l(this)})},function(a,n,r){var i=r(47),o=Math.min;a.exports=function(s){return s>0?o(i(s),9007199254740991):0}},function(a,n,r){var i=r(35);a.exports=function(o){return Object(i(o))}},function(a,n,r){var i=r(16),o=r(8),s=r(14),c=Object.defineProperty,l={},p=function(u){throw u};a.exports=function(u,f){if(s(l,u))return l[u];f||(f={});var h=[][u],d=!!s(f,"ACCESSORS")&&f.ACCESSORS,v=s(f,0)?f[0]:p,m=s(f,1)?f[1]:void 0;return l[u]=!!h&&!o(function(){if(d&&!i)return!0;var x={length:-1};d?c(x,1,{enumerable:!0,get:p}):x[1]=1,h.call(x,v,m)})}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(148),o=r(149),s=r(151),c=r(98),l=r(153),p=r(154),u=r(155),f=r(99),h=r(100),d=r(156),v=r(157),m=r(101),x=r(158),y=r(159),g=r(160),C=r(161),S=r(162),T=r(163),w=r(164),_=r(165),E=r(166),D=r(167),O=r(168),M=r(169),N=r(170);n.create_domImplementation=function(R){return i.DOMImplementationImpl._create(R)},n.create_window=function(){return o.WindowImpl._create()},n.create_xmlDocument=function(){return new s.XMLDocumentImpl},n.create_document=function(){return new c.DocumentImpl},n.create_abortController=function(){return new l.AbortControllerImpl},n.create_abortSignal=function(){return p.AbortSignalImpl._create()},n.create_documentType=function(R,B,I,P){return u.DocumentTypeImpl._create(R,B,I,P)},n.create_element=function(R,B,I,P){return f.ElementImpl._create(R,B,I,P)},n.create_htmlElement=function(R,B,I,P){return f.ElementImpl._create(R,B,I,P)},n.create_htmlUnknownElement=function(R,B,I,P){return f.ElementImpl._create(R,B,I,P)},n.create_documentFragment=function(R){return h.DocumentFragmentImpl._create(R)},n.create_shadowRoot=function(R,B){return d.ShadowRootImpl._create(R,B)},n.create_attr=function(R,B){return v.AttrImpl._create(R,B)},n.create_text=function(R,B){return m.TextImpl._create(R,B)},n.create_cdataSection=function(R,B){return x.CDATASectionImpl._create(R,B)},n.create_comment=function(R,B){return y.CommentImpl._create(R,B)},n.create_processingInstruction=function(R,B,I){return g.ProcessingInstructionImpl._create(R,B,I)},n.create_htmlCollection=function(R,B){return B===void 0&&(B=function(){return!0}),C.HTMLCollectionImpl._create(R,B)},n.create_nodeList=function(R){return S.NodeListImpl._create(R)},n.create_nodeListStatic=function(R,B){return T.NodeListStaticImpl._create(R,B)},n.create_namedNodeMap=function(R){return w.NamedNodeMapImpl._create(R)},n.create_range=function(R,B){return _.RangeImpl._create(R,B)},n.create_nodeIterator=function(R,B,I){return E.NodeIteratorImpl._create(R,B,I)},n.create_treeWalker=function(R,B){return D.TreeWalkerImpl._create(R,B)},n.create_nodeFilter=function(){return O.NodeFilterImpl._create()},n.create_mutationRecord=function(R,B,I,P,L,k,A,j,H){return M.MutationRecordImpl._create(R,B,I,P,L,k,A,j,H)},n.create_domTokenList=function(R,B){return N.DOMTokenListImpl._create(R,B)}},function(a,n,r){var i=this&&this.__values||function(v){var m=typeof Symbol=="function"&&Symbol.iterator,x=m&&v[m],y=0;if(x)return x.call(v);if(v&&typeof v.length=="number")return{next:function(){return v&&y>=v.length&&(v=void 0),{value:v&&v[y++],done:!v}}};throw new TypeError(m?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(17),c=r(3),l=r(72),p=new Map;function u(v,m){if(m!==v._root&&s.tree_isAncestorOf(v._reference,m,!0)){if(v._pointerBeforeReference)for(;;){var x=s.tree_getFollowingNode(v._root,m);if(x!==null&&s.tree_isDescendantOf(v._root,x,!0)&&!s.tree_isDescendantOf(m,x,!0))return void(v._reference=x);if(x===null)return void(v._pointerBeforeReference=!1)}if(m._previousSibling===null)m._parent!==null&&(v._reference=m._parent);else{for(var y=m._previousSibling,g=s.tree_getFirstDescendantNode(m._previousSibling,!0,!1);g!==null;)g!==null&&(y=g),g=s.tree_getNextDescendantNode(m._previousSibling,g,!0,!1);v._reference=y}}}function f(v,m,x,y,g){if(c.Guard.isSlot(v)&&m==="name"&&g===null){if(y===x||y===null&&x===""||y===""&&x===null)return;v._name=y===null||y===""?"":y,l.shadowTree_assignSlotablesForATree(s.tree_rootNode(v))}}function h(v,m,x,y,g){if(c.Guard.isSlotable(v)&&m==="slot"&&g===null){if(y===x||y===null&&x===""||y===""&&x===null)return;v._name=y===null||y===""?"":y,l.shadowTree_isAssigned(v)&&l.shadowTree_assignSlotables(v._assignedSlot),l.shadowTree_assignASlot(v)}}function d(v,m,x,y){m==="id"&&y===null&&(v._uniqueIdentifier=x||void 0)}n.dom_runRemovingSteps=function(v,m){},n.dom_runCloningSteps=function(v,m,x,y){},n.dom_runAdoptingSteps=function(v,m){},n.dom_runAttributeChangeSteps=function(v,m,x,y,g){var C,S;o.dom.features.slots&&(h.call(v,v,m,x,y,g),f.call(v,v,m,x,y,g)),d.call(v,v,m,y,g);try{for(var T=i(v._attributeChangeSteps),w=T.next();!w.done;w=T.next())w.value.call(v,v,m,x,y,g)}catch(_){C={error:_}}finally{try{w&&!w.done&&(S=T.return)&&S.call(T)}finally{if(C)throw C.error}}},n.dom_runInsertionSteps=function(v){},n.dom_runNodeIteratorPreRemovingSteps=function(v,m){u.call(v,v,m)},n.dom_hasSupportedTokens=function(v){return p.has(v)},n.dom_getSupportedTokens=function(v){return p.get(v)||new Set},n.dom_runEventConstructingSteps=function(v){},n.dom_runChildTextContentChangeSteps=function(v){}},function(a,n,r){var i=r(4),o=r(11),s=r(46),c=r(44),l=r(16),p=r(86),u=r(124),f=r(8),h=r(14),d=r(59),v=r(13),m=r(18),x=r(27),y=r(24),g=r(56),C=r(40),S=r(60),T=r(61),w=r(82),_=r(190),E=r(85),D=r(55),O=r(15),M=r(79),N=r(21),R=r(25),B=r(81),I=r(57),P=r(45),L=r(58),k=r(5),A=r(125),j=r(126),H=r(62),K=r(43),Y=r(36).forEach,q=I("hidden"),Z=k("toPrimitive"),re=K.set,ae=K.getterFor("Symbol"),ee=Object.prototype,F=o.Symbol,b=s("JSON","stringify"),G=D.f,U=O.f,z=_.f,W=M.f,$=B("symbols"),J=B("op-symbols"),ne=B("string-to-symbol-registry"),oe=B("symbol-to-string-registry"),ue=B("wks"),Ce=o.QObject,ye=!Ce||!Ce.prototype||!Ce.prototype.findChild,je=l&&f(function(){return S(U({},"a",{get:function(){return U(this,"a",{value:7}).a}})).a!=7})?function(ce,he,fe){var ve=G(ee,he);ve&&delete ee[he],U(ce,he,fe),ve&&ce!==ee&&U(ee,he,ve)}:U,Le=function(ce,he){var fe=$[ce]=S(F.prototype);return re(fe,{type:"Symbol",tag:ce,description:he}),l||(fe.description=he),fe},ge=u?function(ce){return typeof ce=="symbol"}:function(ce){return Object(ce)instanceof F},tt=function(ce,he,fe){ce===ee&&tt(J,he,fe),m(ce);var ve=g(he,!0);return m(fe),h($,ve)?(fe.enumerable?(h(ce,q)&&ce[q][ve]&&(ce[q][ve]=!1),fe=S(fe,{enumerable:C(0,!1)})):(h(ce,q)||U(ce,q,C(1,{})),ce[q][ve]=!0),je(ce,ve,fe)):U(ce,ve,fe)},X=function(ce,he){m(ce);var fe=y(he),ve=T(fe).concat(te(fe));return Y(ve,function(Ae){l&&!De.call(fe,Ae)||tt(ce,Ae,fe[Ae])}),ce},De=function(ce){var he=g(ce,!0),fe=W.call(this,he);return!(this===ee&&h($,he)&&!h(J,he))&&(!(fe||!h(this,he)||!h($,he)||h(this,q)&&this[q][he])||fe)},Oe=function(ce,he){var fe=y(ce),ve=g(he,!0);if(fe!==ee||!h($,ve)||h(J,ve)){var Ae=G(fe,ve);return!Ae||!h($,ve)||h(fe,q)&&fe[q][ve]||(Ae.enumerable=!0),Ae}},de=function(ce){var he=z(y(ce)),fe=[];return Y(he,function(ve){h($,ve)||h(P,ve)||fe.push(ve)}),fe},te=function(ce){var he=ce===ee,fe=z(he?J:y(ce)),ve=[];return Y(fe,function(Ae){!h($,Ae)||he&&!h(ee,Ae)||ve.push($[Ae])}),ve};p||(R((F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor");var ce=arguments.length&&arguments[0]!==void 0?String(arguments[0]):void 0,he=L(ce),fe=function(ve){this===ee&&fe.call(J,ve),h(this,q)&&h(this[q],he)&&(this[q][he]=!1),je(this,he,C(1,ve))};return l&&ye&&je(ee,he,{configurable:!0,set:fe}),Le(he,ce)}).prototype,"toString",function(){return ae(this).tag}),R(F,"withoutSetter",function(ce){return Le(L(ce),ce)}),M.f=De,O.f=tt,D.f=Oe,w.f=_.f=de,E.f=te,A.f=function(ce){return Le(k(ce),ce)},l&&(U(F.prototype,"description",{configurable:!0,get:function(){return ae(this).description}}),c||R(ee,"propertyIsEnumerable",De,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!p,sham:!p},{Symbol:F}),Y(T(ue),function(ce){j(ce)}),i({target:"Symbol",stat:!0,forced:!p},{for:function(ce){var he=String(ce);if(h(ne,he))return ne[he];var fe=F(he);return ne[he]=fe,oe[fe]=he,fe},keyFor:function(ce){if(!ge(ce))throw TypeError(ce+" is not a symbol");if(h(oe,ce))return oe[ce]},useSetter:function(){ye=!0},useSimple:function(){ye=!1}}),i({target:"Object",stat:!0,forced:!p,sham:!l},{create:function(ce,he){return he===void 0?S(ce):X(S(ce),he)},defineProperty:tt,defineProperties:X,getOwnPropertyDescriptor:Oe}),i({target:"Object",stat:!0,forced:!p},{getOwnPropertyNames:de,getOwnPropertySymbols:te}),i({target:"Object",stat:!0,forced:f(function(){E.f(1)})},{getOwnPropertySymbols:function(ce){return E.f(x(ce))}}),b&&i({target:"JSON",stat:!0,forced:!p||f(function(){var ce=F();return b([ce])!="[null]"||b({a:ce})!="{}"||b(Object(ce))!="{}"})},{stringify:function(ce,he,fe){for(var ve,Ae=[ce],Se=1;arguments.length>Se;)Ae.push(arguments[Se++]);if(ve=he,(v(he)||ce!==void 0)&&!ge(ce))return d(he)||(he=function(Be,Ie){if(typeof ve=="function"&&(Ie=ve.call(this,Be,Ie)),!ge(Ie))return Ie}),Ae[1]=he,b.apply(null,Ae)}}),F.prototype[Z]||N(F.prototype,Z,F.prototype.valueOf),H(F,"Symbol"),P[q]=!0},function(a,n,r){var i=r(4),o=r(16),s=r(11),c=r(14),l=r(13),p=r(15).f,u=r(119),f=s.Symbol;if(o&&typeof f=="function"&&(!("description"in f.prototype)||f().description!==void 0)){var h={},d=function(){var g=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),C=this instanceof d?new f(g):g===void 0?f():f(g);return g===""&&(h[C]=!0),C};u(d,f);var v=d.prototype=f.prototype;v.constructor=d;var m=v.toString,x=String(f("test"))=="Symbol(test)",y=/^Symbol\((.*)\)[^)]+$/;p(v,"description",{configurable:!0,get:function(){var g=l(this)?this.valueOf():this,C=m.call(g);if(c(h,g))return"";var S=x?C.slice(7,-1):C.replace(y,"$1");return S===""?void 0:S}}),i({global:!0,forced:!0},{Symbol:d})}},function(a,n,r){r(126)("iterator")},function(a,n,r){var i,o=this&&this.__extends||(i=function(x,y){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,C){g.__proto__=C}||function(g,C){for(var S in C)C.hasOwnProperty(S)&&(g[S]=C[S])})(x,y)},function(x,y){function g(){this.constructor=x}i(x,y),x.prototype=y===null?Object.create(y):(g.prototype=y.prototype,new g)}),s=this&&this.__values||function(x){var y=typeof Symbol=="function"&&Symbol.iterator,g=y&&x[y],C=0;if(g)return g.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&C>=x.length&&(x=void 0),{value:x&&x[C++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(6),l=r(2),p=r(70),u=r(3),f=r(9),h=r(0),d=r(152),v=r(12),m=function(x){function y(){var g=x.call(this)||this;return g._parent=null,g._firstChild=null,g._lastChild=null,g._previousSibling=null,g._nextSibling=null,g}return o(y,x),Object.defineProperty(y.prototype,"_childNodes",{get:function(){return this.__childNodes||(this.__childNodes=h.create_nodeList(this))},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"_nodeDocument",{get:function(){return this._nodeDocumentOverride||c.dom.window._associatedDocument},set:function(g){this._nodeDocumentOverride=g},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"_registeredObserverList",{get:function(){return this.__registeredObserverList||(this.__registeredObserverList=[])},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"nodeType",{get:function(){return this._nodeType},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"nodeName",{get:function(){return u.Guard.isElementNode(this)?this._htmlUppercasedQualifiedName:u.Guard.isAttrNode(this)?this._qualifiedName:u.Guard.isExclusiveTextNode(this)?"#text":u.Guard.isCDATASectionNode(this)?"#cdata-section":u.Guard.isProcessingInstructionNode(this)?this._target:u.Guard.isCommentNode(this)?"#comment":u.Guard.isDocumentNode(this)?"#document":u.Guard.isDocumentTypeNode(this)?this._name:u.Guard.isDocumentFragmentNode(this)?"#document-fragment":""},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"baseURI",{get:function(){return d.urlSerializer(this._nodeDocument._URL)},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"isConnected",{get:function(){return u.Guard.isElementNode(this)&&h.shadowTree_isConnected(this)},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"ownerDocument",{get:function(){return this._nodeType===l.NodeType.Document?null:this._nodeDocument},enumerable:!0,configurable:!0}),y.prototype.getRootNode=function(g){return h.tree_rootNode(this,!!g&&g.composed)},Object.defineProperty(y.prototype,"parentNode",{get:function(){return this._nodeType===l.NodeType.Attribute?null:this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"parentElement",{get:function(){return this._parent&&u.Guard.isElementNode(this._parent)?this._parent:null},enumerable:!0,configurable:!0}),y.prototype.hasChildNodes=function(){return this._firstChild!==null},Object.defineProperty(y.prototype,"childNodes",{get:function(){return this._childNodes},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"firstChild",{get:function(){return this._firstChild},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"lastChild",{get:function(){return this._lastChild},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"previousSibling",{get:function(){return this._previousSibling},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"nextSibling",{get:function(){return this._nextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"nodeValue",{get:function(){return u.Guard.isAttrNode(this)?this._value:u.Guard.isCharacterDataNode(this)?this._data:null},set:function(g){g===null&&(g=""),u.Guard.isAttrNode(this)?h.attr_setAnExistingAttributeValue(this,g):u.Guard.isCharacterDataNode(this)&&h.characterData_replaceData(this,0,this._data.length,g)},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"textContent",{get:function(){return u.Guard.isDocumentFragmentNode(this)||u.Guard.isElementNode(this)?h.text_descendantTextContent(this):u.Guard.isAttrNode(this)?this._value:u.Guard.isCharacterDataNode(this)?this._data:null},set:function(g){g===null&&(g=""),u.Guard.isDocumentFragmentNode(this)||u.Guard.isElementNode(this)?h.node_stringReplaceAll(g,this):u.Guard.isAttrNode(this)?h.attr_setAnExistingAttributeValue(this,g):u.Guard.isCharacterDataNode(this)&&h.characterData_replaceData(this,0,h.tree_nodeLength(this),g)},enumerable:!0,configurable:!0}),y.prototype.normalize=function(){for(var g,C,S,T,w=[],_=h.tree_getFirstDescendantNode(this,!1,!1,function(Y){return u.Guard.isExclusiveTextNode(Y)});_!==null;)w.push(_),_=h.tree_getNextDescendantNode(this,_,!1,!1,function(Y){return u.Guard.isExclusiveTextNode(Y)});for(var E=0;EN;N++)if((y||N in D)&&(_=O(w=D[N],N,E),f)){if(h)B[N]=_;else if(_)switch(f){case 3:return!0;case 5:return w;case 6:return N;case 2:p.call(B,w)}else if(m)return!1}return x?-1:v||m?m:B}};a.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6)}},function(a,n,r){var i=this&&this.__values||function(E){var D=typeof Symbol=="function"&&Symbol.iterator,O=D&&E[D],M=0;if(O)return O.call(E);if(E&&typeof E.length=="number")return{next:function(){return E&&M>=E.length&&(E=void 0),{value:E&&E[M++],done:!E}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(E,D){var O=typeof Symbol=="function"&&E[Symbol.iterator];if(!O)return E;var M,N,R=O.call(E),B=[];try{for(;(D===void 0||D-- >0)&&!(M=R.next()).done;)B.push(M.value)}catch(I){N={error:I}}finally{try{M&&!M.done&&(O=R.return)&&O.call(R)}finally{if(N)throw N.error}}return B},s=this&&this.__spread||function(){for(var E=[],D=0;D1)throw new l.HierarchyRequestError("A document node can only have one document element node. Document fragment to be inserted has "+K+" element nodes.");if(K===1){try{for(var re=i(D._children),ae=re.next();!ae.done;ae=re.next())if(ae.value._nodeType===p.NodeType.Element)throw new l.HierarchyRequestError("The document node already has a document element node.")}catch(W){R={error:W}}finally{try{ae&&!ae.done&&(B=re.return)&&B.call(re)}finally{if(R)throw R.error}}if(O){if(H===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Cannot insert an element node before a document type node.");for(var ee=O._nextSibling;ee;){if(ee._nodeType===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Cannot insert an element node before a document type node.");ee=ee._nextSibling}}}}else if(j===p.NodeType.Element){try{for(var F=i(D._children),b=F.next();!b.done;b=F.next())if(b.value._nodeType===p.NodeType.Element)throw new l.HierarchyRequestError("Document already has a document element node. Node is "+E.nodeName+".")}catch(W){I={error:W}}finally{try{b&&!b.done&&(P=F.return)&&P.call(F)}finally{if(I)throw I.error}}if(O){if(H===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+E.nodeName+".");for(ee=O._nextSibling;ee;){if(ee._nodeType===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+E.nodeName+".");ee=ee._nextSibling}}}else if(j===p.NodeType.DocumentType){try{for(var G=i(D._children),U=G.next();!U.done;U=G.next())if(U.value._nodeType===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Document already has a document type node. Node is "+E.nodeName+".")}catch(W){L={error:W}}finally{try{U&&!U.done&&(k=G.return)&&k.call(G)}finally{if(L)throw L.error}}if(O)for(var z=O._previousSibling;z;){if(z._nodeType===p.NodeType.Element)throw new l.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+E.nodeName+".");z=z._previousSibling}else for(z=D._firstChild;z;){if(z._nodeType===p.NodeType.Element)throw new l.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+E.nodeName+".");z=z._nextSibling}}}}function T(E,D,O){S(E,D,O);var M=O;return M===E&&(M=E._nextSibling),C.document_adopt(E,D._nodeDocument),w(E,D,M),E}function w(E,D,O,M){var N,R;if(O!==null||E._nodeType===p.NodeType.DocumentFragment){var B=E._nodeType===p.NodeType.DocumentFragment?E._children.size:1;if(O!==null&&c.dom.rangeList.size!==0){var I=v.tree_index(O);try{for(var P=i(c.dom.rangeList),L=P.next();!L.done;L=P.next()){var k=L.value;k._start[0]===D&&k._start[1]>I&&(k._start[1]+=B),k._end[0]===D&&k._end[1]>I&&(k._end[1]+=B)}}catch(ae){N={error:ae}}finally{try{L&&!L.done&&(R=P.return)&&R.call(P)}finally{if(N)throw N.error}}}var A=E._nodeType===p.NodeType.DocumentFragment?new(Array.bind.apply(Array,s([void 0],E._children))):[E];if(E._nodeType===p.NodeType.DocumentFragment)for(;E._firstChild;)_(E._firstChild,E,!0);c.dom.features.mutationObservers&&E._nodeType===p.NodeType.DocumentFragment&&y.observer_queueTreeMutationRecord(E,[],A,null,null);for(var j=O?O._previousSibling:D._lastChild,H=O===null?-1:v.tree_index(O),K=0;KA&&K._start[1]--,K._end[0]===D&&K._end[1]>A&&K._end[1]--}}catch(ne){M={error:ne}}finally{try{H&&!H.done&&(N=j.return)&&N.call(j)}finally{if(M)throw M.error}}try{for(var Y=i(c.dom.rangeList),q=Y.next();!q.done;q=Y.next())(K=q.value)._start[0]===D&&K._start[1]>A&&(K._start[1]-=1),K._end[0]===D&&K._end[1]>A&&(K._end[1]-=1)}catch(ne){R={error:ne}}finally{try{q&&!q.done&&(B=Y.return)&&B.call(Y)}finally{if(R)throw R.error}}}if(c.dom.features.steps)try{for(var Z=i(m.nodeIterator_iteratorList()),re=Z.next();!re.done;re=Z.next()){var ae=re.value;ae._root._nodeDocument===E._nodeDocument&&g.dom_runNodeIteratorPreRemovingSteps(ae,E)}}catch(ne){I={error:ne}}finally{try{re&&!re.done&&(P=Z.return)&&P.call(Z)}finally{if(I)throw I.error}}var ee=E._previousSibling,F=E._nextSibling;u.Guard.isDocumentNode(D)&&u.Guard.isElementNode(E)&&(D._documentElement=null),E._parent=null,D._children.delete(E);var b=E._previousSibling,G=E._nextSibling;E._previousSibling=null,E._nextSibling=null,b&&(b._nextSibling=G),G&&(G._previousSibling=b),b||(D._firstChild=G),G||(D._lastChild=b),c.dom.features.slots&&u.Guard.isSlotable(E)&&E._assignedSlot!==null&&x.shadowTree_isAssigned(E)&&x.shadowTree_assignSlotables(E._assignedSlot),c.dom.features.slots&&u.Guard.isShadowRoot(v.tree_rootNode(D))&&u.Guard.isSlot(D)&&f.isEmpty(D._assignedNodes)&&x.shadowTree_signalASlotChange(D),c.dom.features.slots&&v.tree_getFirstDescendantNode(E,!0,!1,function(ne){return u.Guard.isSlot(ne)})!==null&&(x.shadowTree_assignSlotablesForATree(v.tree_rootNode(D)),x.shadowTree_assignSlotablesForATree(E)),c.dom.features.steps&&g.dom_runRemovingSteps(E,D),c.dom.features.customElements&&u.Guard.isCustomElementNode(E)&&d.customElement_enqueueACustomElementCallbackReaction(E,"disconnectedCallback",[]);for(var U=v.tree_getFirstDescendantNode(E,!1,!0);U!==null;)c.dom.features.steps&&g.dom_runRemovingSteps(U,E),c.dom.features.customElements&&u.Guard.isCustomElementNode(U)&&d.customElement_enqueueACustomElementCallbackReaction(U,"disconnectedCallback",[]),U=v.tree_getNextDescendantNode(E,U,!1,!0);if(c.dom.features.mutationObservers)for(var z=v.tree_getFirstAncestorNode(D,!0);z!==null;){try{for(var W=(L=void 0,i(z._registeredObserverList)),$=W.next();!$.done;$=W.next()){var J=$.value;J.options.subtree&&E._registeredObserverList.push({observer:J.observer,options:J.options,source:J})}}catch(ne){L={error:ne}}finally{try{$&&!$.done&&(k=W.return)&&k.call(W)}finally{if(L)throw L.error}}z=v.tree_getNextAncestorNode(D,z,!0)}c.dom.features.mutationObservers&&(O||y.observer_queueTreeMutationRecord(D,[],[E],ee,F)),c.dom.features.steps&&u.Guard.isTextNode(E)&&g.dom_runChildTextContentChangeSteps(D)}n.mutation_ensurePreInsertionValidity=S,n.mutation_preInsert=T,n.mutation_insert=w,n.mutation_append=function(E,D){return T(E,D,null)},n.mutation_replace=function(E,D,O){var M,N,R,B,I,P,L,k;if(O._nodeType!==p.NodeType.Document&&O._nodeType!==p.NodeType.DocumentFragment&&O._nodeType!==p.NodeType.Element)throw new l.HierarchyRequestError("Only document, document fragment and element nodes can contain child nodes. Parent node is "+O.nodeName+".");if(v.tree_isHostIncludingAncestorOf(O,D,!0))throw new l.HierarchyRequestError("The node to be inserted cannot be an ancestor of parent node. Node is "+D.nodeName+", parent node is "+O.nodeName+".");if(E._parent!==O)throw new l.NotFoundError("The reference child node cannot be found under parent node. Child node is "+E.nodeName+", parent node is "+O.nodeName+".");if(D._nodeType!==p.NodeType.DocumentFragment&&D._nodeType!==p.NodeType.DocumentType&&D._nodeType!==p.NodeType.Element&&D._nodeType!==p.NodeType.Text&&D._nodeType!==p.NodeType.ProcessingInstruction&&D._nodeType!==p.NodeType.CData&&D._nodeType!==p.NodeType.Comment)throw new l.HierarchyRequestError("Only document fragment, document type, element, text, processing instruction, cdata section or comment nodes can be inserted. Node is "+D.nodeName+".");if(D._nodeType===p.NodeType.Text&&O._nodeType===p.NodeType.Document)throw new l.HierarchyRequestError("Cannot insert a text node as a child of a document node. Node is "+D.nodeName+".");if(D._nodeType===p.NodeType.DocumentType&&O._nodeType!==p.NodeType.Document)throw new l.HierarchyRequestError("A document type node can only be inserted under a document node. Parent node is "+O.nodeName+".");if(O._nodeType===p.NodeType.Document){if(D._nodeType===p.NodeType.DocumentFragment){var A=0;try{for(var j=i(D._children),H=j.next();!H.done;H=j.next()){var K=H.value;if(K._nodeType===p.NodeType.Element)A++;else if(K._nodeType===p.NodeType.Text)throw new l.HierarchyRequestError("Cannot insert text a node as a child of a document node. Node is "+K.nodeName+".")}}catch(J){M={error:J}}finally{try{H&&!H.done&&(N=j.return)&&N.call(j)}finally{if(M)throw M.error}}if(A>1)throw new l.HierarchyRequestError("A document node can only have one document element node. Document fragment to be inserted has "+A+" element nodes.");if(A===1){try{for(var Y=i(O._children),q=Y.next();!q.done;q=Y.next())if((b=q.value)._nodeType===p.NodeType.Element&&b!==E)throw new l.HierarchyRequestError("The document node already has a document element node.")}catch(J){R={error:J}}finally{try{q&&!q.done&&(B=Y.return)&&B.call(Y)}finally{if(R)throw R.error}}for(var Z=E._nextSibling;Z;){if(Z._nodeType===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Cannot insert an element node before a document type node.");Z=Z._nextSibling}}}else if(D._nodeType===p.NodeType.Element){try{for(var re=i(O._children),ae=re.next();!ae.done;ae=re.next())if((b=ae.value)._nodeType===p.NodeType.Element&&b!==E)throw new l.HierarchyRequestError("Document already has a document element node. Node is "+D.nodeName+".")}catch(J){I={error:J}}finally{try{ae&&!ae.done&&(P=re.return)&&P.call(re)}finally{if(I)throw I.error}}for(Z=E._nextSibling;Z;){if(Z._nodeType===p.NodeType.DocumentType)throw new l.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+D.nodeName+".");Z=Z._nextSibling}}else if(D._nodeType===p.NodeType.DocumentType){try{for(var ee=i(O._children),F=ee.next();!F.done;F=ee.next()){var b;if((b=F.value)._nodeType===p.NodeType.DocumentType&&b!==E)throw new l.HierarchyRequestError("Document already has a document type node. Node is "+D.nodeName+".")}}catch(J){L={error:J}}finally{try{F&&!F.done&&(k=ee.return)&&k.call(ee)}finally{if(L)throw L.error}}for(var G=E._previousSibling;G;){if(G._nodeType===p.NodeType.Element)throw new l.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+D.nodeName+".");G=G._previousSibling}}}var U=E._nextSibling;U===D&&(U=D._nextSibling);var z=E._previousSibling;C.document_adopt(D,O._nodeDocument);var W=[];E._parent!==null&&(W.push(E),_(E,E._parent,!0));var $=[];return D._nodeType===p.NodeType.DocumentFragment?$=Array.from(D._children):$.push(D),w(D,O,U,!0),c.dom.features.mutationObservers&&y.observer_queueTreeMutationRecord(O,$,W,z,U),E},n.mutation_replaceAll=function(E,D){var O,M;E!==null&&C.document_adopt(E,D._nodeDocument);var N=Array.from(D._children),R=[];E&&E._nodeType===p.NodeType.DocumentFragment?R=Array.from(E._children):E!==null&&R.push(E);try{for(var B=i(N),I=B.next();!I.done;I=B.next())_(I.value,D,!0)}catch(P){O={error:P}}finally{try{I&&!I.done&&(M=B.return)&&M.call(B)}finally{if(O)throw O.error}}E!==null&&w(E,D,null,!0),c.dom.features.mutationObservers&&y.observer_queueTreeMutationRecord(D,R,N,null,null)},n.mutation_preRemove=function(E,D){if(E._parent!==D)throw new l.NotFoundError("The child node cannot be found under parent node. Child node is "+E.nodeName+", parent node is "+D.nodeName+".");return _(E,D),E},n.mutation_remove=_},function(a,n,r){function i(o){return o==null}a.exports.isNothing=i,a.exports.isObject=function(o){return typeof o=="object"&&o!==null},a.exports.toArray=function(o){return Array.isArray(o)?o:i(o)?[]:[o]},a.exports.repeat=function(o,s){var c,l="";for(c=0;c0?i:r)(o)}},function(a,n,r){var i=r(8);a.exports=function(o,s){var c=[][o];return!!c&&i(function(){c.call(null,s||function(){throw 1},1)})}},function(a,n){a.exports={}},function(a,n,r){r(31),r(32),r(33),r(220),r(64),r(19),r(65),r(20),r(68),r(66),r(92),r(144),r(22),r(94),r(23);var i=this&&this.__values||function(d){var v=typeof Symbol=="function"&&Symbol.iterator,m=v&&d[v],x=0;if(m)return m.call(d);if(d&&typeof d.length=="number")return{next:function(){return d&&x>=d.length&&(d=void 0),{value:d&&d[x++],done:!d}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(d,v){var m=typeof Symbol=="function"&&d[Symbol.iterator];if(!m)return d;var x,y,g=m.call(d),C=[];try{for(;(v===void 0||v-- >0)&&!(x=g.next()).done;)C.push(x.value)}catch(S){y={error:S}}finally{try{x&&!x.done&&(m=g.return)&&m.call(g)}finally{if(y)throw y.error}}return C},s=this&&this.__spread||function(){for(var d=[],v=0;v/g,">");this.text(x)},d.prototype._serializeDocumentFragmentNS=function(v,m,x,y,g){var C,S;try{for(var T=i(v.childNodes),w=T.next();!w.done;w=T.next()){var _=w.value;this._serializeNodeNS(_,m,x,y,g)}}catch(E){C={error:E}}finally{try{w&&!w.done&&(S=T.return)&&S.call(T)}finally{if(C)throw C.error}}},d.prototype._serializeDocumentFragment=function(v,m){var x,y;try{for(var g=i(v._children),C=g.next();!C.done;C=g.next()){var S=C.value;this._serializeNode(S,m)}}catch(T){x={error:T}}finally{try{C&&!C.done&&(y=g.return)&&y.call(g)}finally{if(x)throw x.error}}},d.prototype._serializeDocumentType=function(v,m){if(m&&!f.xml_isPubidChar(v.publicId))throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");if(m&&(!f.xml_isLegalChar(v.systemId)||v.systemId.indexOf('"')!==-1&&v.systemId.indexOf("'")!==-1))throw new Error("DocType system identifier contains invalid characters (well-formed required).");this.docType(v.name,v.publicId,v.systemId)},d.prototype._serializeProcessingInstruction=function(v,m){if(m&&(v.target.indexOf(":")!==-1||/^xml$/i.test(v.target)))throw new Error("Processing instruction target contains invalid characters (well-formed required).");if(m&&(!f.xml_isLegalChar(v.data)||v.data.indexOf("?>")!==-1))throw new Error("Processing instruction data contains invalid characters (well-formed required).");this.instruction(v.target,v.data)},d.prototype._serializeCData=function(v,m){if(m&&v.data.indexOf("]]>")!==-1)throw new Error("CDATA contains invalid characters (well-formed required).");this.cdata(v.data)},d.prototype._serializeAttributesNS=function(v,m,x,y,g,C){var S,T,w=[],_=C?new l.LocalNameSet:void 0;try{for(var E=i(v.attributes),D=E.next();!D.done;D=E.next()){var O=D.value;if(C||g||O.namespaceURI!==null){if(C&&_&&_.has(O.namespaceURI,O.localName))throw new Error("Element contains duplicate attributes (well-formed required).");C&&_&&_.set(O.namespaceURI,O.localName);var M=O.namespaceURI,N=null;if(M!==null)if(N=m.get(O.prefix,M),M===u.namespace.XMLNS){if(O.value===u.namespace.XML||O.prefix===null&&g||O.prefix!==null&&(!(O.localName in y)||y[O.localName]!==O.value)&&m.has(O.localName,O.value))continue;if(C&&O.value===u.namespace.XMLNS)throw new Error("XMLNS namespace is reserved (well-formed required).");if(C&&O.value==="")throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");O.prefix==="xmlns"&&(N="xmlns")}else N===null&&(N=O.prefix===null||m.hasPrefix(O.prefix)&&!m.has(O.prefix,M)?this._generatePrefix(M,m,x):O.prefix,w.push([null,"xmlns",N,this._serializeAttributeValue(M,C)]));if(C&&(O.localName.indexOf(":")!==-1||!f.xml_isName(O.localName)||O.localName==="xmlns"&&M===null))throw new Error("Attribute local name contains invalid characters (well-formed required).");w.push([M,N,O.localName,this._serializeAttributeValue(O.value,C)])}else w.push([null,null,O.localName,this._serializeAttributeValue(O.value,C)])}}catch(R){S={error:R}}finally{try{D&&!D.done&&(T=E.return)&&T.call(E)}finally{if(S)throw S.error}}return w},d.prototype._serializeAttributes=function(v,m){var x,y,g=[],C=m?{}:void 0;try{for(var S=i(v.attributes),T=S.next();!T.done;T=S.next()){var w=T.value;if(m){if(m&&C&&w.localName in C)throw new Error("Element contains duplicate attributes (well-formed required).");if(m&&C&&(C[w.localName]=!0),m&&(w.localName.indexOf(":")!==-1||!f.xml_isName(w.localName)))throw new Error("Attribute local name contains invalid characters (well-formed required).");g.push([null,null,w.localName,this._serializeAttributeValue(w.value,m)])}else g.push([null,null,w.localName,this._serializeAttributeValue(w.value,m)])}}catch(_){x={error:_}}finally{try{T&&!T.done&&(y=S.return)&&y.call(S)}finally{if(x)throw x.error}}return g},d.prototype._recordNamespaceInformation=function(v,m,x){var y,g,C=null;try{for(var S=i(v.attributes),T=S.next();!T.done;T=S.next()){var w=T.value,_=w.namespaceURI,E=w.prefix;if(_===u.namespace.XMLNS){if(E===null){C=w.value;continue}var D=w.localName,O=w.value;if(O===u.namespace.XML||(O===""&&(O=null),m.has(D,O)))continue;m.set(D,O),x[D]=O||""}}}catch(M){y={error:M}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(y)throw y.error}}return C},d.prototype._generatePrefix=function(v,m,x){var y="ns"+x.value.toString();return x.value++,m.set(y,v),y},d.prototype._serializeAttributeValue=function(v,m){if(m&&v!==null&&!f.xml_isLegalChar(v))throw new Error("Invalid characters in attribute value.");return v===null?"":v.replace(/(?!&([^&;]*);)&/g,"&").replace(//g,">").replace(/"/g,""")},d._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),d}();n.BaseWriter=h},function(a,n,r){var i=this&&this.__values||function(m){var x=typeof Symbol=="function"&&Symbol.iterator,y=x&&m[x],g=0;if(y)return y.call(m);if(m&&typeof m.length=="number")return{next:function(){return m&&g>=m.length&&(m=void 0),{value:m&&m[g++],done:!m}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(m,x){var y=typeof Symbol=="function"&&m[Symbol.iterator];if(!y)return m;var g,C,S=y.call(m),T=[];try{for(;(x===void 0||x-- >0)&&!(g=S.next()).done;)T.push(g.value)}catch(w){C={error:w}}finally{try{g&&!g.done&&(y=S.return)&&y.call(S)}finally{if(C)throw C.error}}return T};Object.defineProperty(n,"__esModule",{value:!0});var s=r(6),c=r(3),l=r(7),p=r(29),u=r(17),f=r(97);function h(){var m=s.dom.window;m._mutationObserverMicrotaskQueued||(m._mutationObserverMicrotaskQueued=!0,Promise.resolve().then(function(){d()}))}function d(){var m,x,y,g,C=s.dom.window;C._mutationObserverMicrotaskQueued=!1;var S=l.set.clone(C._mutationObservers),T=l.set.clone(C._signalSlots);l.set.empty(C._signalSlots);var w=function(N){var R=l.list.clone(N._recordQueue);l.list.empty(N._recordQueue);for(var B=0;B"+x+"<\/script>"},m=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch{}var x,y;m=i?function(C){C.write(v("")),C.close();var S=C.parentWindow.Object;return C=null,S}(i):((y=u("iframe")).style.display="none",p.appendChild(y),y.src=String("javascript:"),(x=y.contentWindow.document).open(),x.write(v("document.F=Object")),x.close(),x.F);for(var g=c.length;g--;)delete m.prototype[c[g]];return m()};l[h]=!0,a.exports=Object.create||function(x,y){var g;return x!==null?(d.prototype=o(x),g=new d,d.prototype=null,g[h]=x):g=m(),y===void 0?g:s(g,y)}},function(a,n,r){var i=r(121),o=r(84);a.exports=Object.keys||function(s){return i(s,o)}},function(a,n,r){var i=r(15).f,o=r(14),s=r(5)("toStringTag");a.exports=function(c,l,p){c&&!o(c=p?c:c.prototype,s)&&i(c,s,{configurable:!0,value:l})}},function(a,n,r){var i=r(8),o=r(5),s=r(129),c=o("species");a.exports=function(l){return s>=51||!i(function(){var p=[];return(p.constructor={})[c]=function(){return{foo:1}},p[l](Boolean).foo!==1})}},function(a,n,r){var i=r(4),o=r(122).indexOf,s=r(48),c=r(28),l=[].indexOf,p=!!l&&1/[1].indexOf(1,-0)<0,u=s("indexOf"),f=c("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:p||!u||!f},{indexOf:function(h){return p?l.apply(this,arguments)||0:o(this,h,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(16),o=r(15).f,s=Function.prototype,c=s.toString,l=/^\s*function ([^ (]*)/;i&&!("name"in s)&&o(s,"name",{configurable:!0,get:function(){try{return c.call(this).match(l)[1]}catch{return""}}})},function(a,n,r){var i=r(25),o=r(18),s=r(8),c=r(136),l=RegExp.prototype,p=l.toString,u=s(function(){return p.call({source:"a",flags:"b"})!="/a/b"}),f=p.name!="toString";(u||f)&&i(RegExp.prototype,"toString",function(){var h=o(this),d=String(h.source),v=h.flags;return"/"+d+"/"+String(v===void 0&&h instanceof RegExp&&!("flags"in l)?c.call(h):v)},{unsafe:!0})},function(a,n,r){r(31),r(32),r(33),r(19),r(138),r(20),r(66),r(22),r(23);var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),s=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&u[f],d=0;if(h)return h.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&d>=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(1),l=r(2),p=function(u){function f(h,d){var v=u.call(this,h)||this;return v._writerOptions=c.applyDefaults(d,{format:"object",wellFormed:!1,group:!1,verbose:!1}),v}return o(f,u),f.prototype.serialize=function(h){return this._currentList=[],this._currentIndex=0,this._listRegister=[this._currentList],this.serializeNode(h,this._writerOptions.wellFormed),this._process(this._currentList,this._writerOptions)},f.prototype._process=function(h,d){var v,m,x,y,g,C,S;if(h.length===0)return{};for(var T={},w=!1,_=0,E=0,D=0,O=0,M=0;M2)try{for(var S=s(h),T=S.next();!T.done;T=S.next()){var w=T.value;d[m+(y++).toString()]=w}}catch(_){g={error:_}}finally{try{T&&!T.done&&(C=S.return)&&C.call(S)}finally{if(g)throw g.error}}else d[x>1?m+(y++).toString():m]=h;return y},f.prototype.beginElement=function(h){var d,v,m=[];if(this._currentList.length===0)this._currentList.push(((d={})[h]=m,d));else{var x=this._currentList[this._currentList.length-1];this._isElementNode(x,h)?x[h].length!==0&&c.isArray(x[h][0])?x[h].push(m):x[h]=[x[h],m]:this._currentList.push(((v={})[h]=m,v))}this._currentIndex++,this._listRegister.length>this._currentIndex?this._listRegister[this._currentIndex]=m:this._listRegister.push(m),this._currentList=m},f.prototype.endElement=function(){this._currentList=this._listRegister[--this._currentIndex]},f.prototype.attribute=function(h,d){var v,m;if(this._currentList.length===0)this._currentList.push({"@":(v={},v[h]=d,v)});else{var x=this._currentList[this._currentList.length-1];this._isAttrNode(x)?x["@"][h]=d:this._currentList.push({"@":(m={},m[h]=d,m)})}},f.prototype.comment=function(h){if(this._currentList.length===0)this._currentList.push({"!":h});else{var d=this._currentList[this._currentList.length-1];this._isCommentNode(d)?c.isArray(d["!"])?d["!"].push(h):d["!"]=[d["!"],h]:this._currentList.push({"!":h})}},f.prototype.text=function(h){if(this._currentList.length===0)this._currentList.push({"#":h});else{var d=this._currentList[this._currentList.length-1];this._isTextNode(d)?c.isArray(d["#"])?d["#"].push(h):d["#"]=[d["#"],h]:this._currentList.push({"#":h})}},f.prototype.instruction=function(h,d){var v=d===""?h:h+" "+d;if(this._currentList.length===0)this._currentList.push({"?":v});else{var m=this._currentList[this._currentList.length-1];this._isInstructionNode(m)?c.isArray(m["?"])?m["?"].push(v):m["?"]=[m["?"],v]:this._currentList.push({"?":v})}},f.prototype.cdata=function(h){if(this._currentList.length===0)this._currentList.push({$:h});else{var d=this._currentList[this._currentList.length-1];this._isCDATANode(d)?c.isArray(d.$)?d.$.push(h):d.$=[d.$,h]:this._currentList.push({$:h})}},f.prototype._isAttrNode=function(h){return"@"in h},f.prototype._isTextNode=function(h){return"#"in h},f.prototype._isCommentNode=function(h){return"!"in h},f.prototype._isInstructionNode=function(h){return"?"in h},f.prototype._isCDATANode=function(h){return"$"in h},f.prototype._isElementNode=function(h,d){return d in h},f.prototype._getAttrKey=function(){return this._builderOptions.convert.att},f.prototype._getNodeKey=function(h){switch(h){case l.NodeType.Comment:return this._builderOptions.convert.comment;case l.NodeType.Text:return this._builderOptions.convert.text;case l.NodeType.ProcessingInstruction:return this._builderOptions.convert.ins;case l.NodeType.CData:return this._builderOptions.convert.cdata;default:throw new Error("Invalid node type.")}},f}(r(50).BaseWriter);n.ObjectWriter=p},function(a,n,r){var i=r(4),o=r(93);i({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this._items={},this._nullItems={}}return o.prototype.set=function(s,c){s===null?this._nullItems[c]=!0:(this._items[s]||(this._items[s]={}),this._items[s][c]=!0)},o.prototype.has=function(s,c){return s===null?this._nullItems[c]===!0:!!this._items[s]&&this._items[s][c]===!0},o}();n.LocalNameSet=i},function(a,n,r){var i=this&&this.__read||function(p,u){var f=typeof Symbol=="function"&&p[Symbol.iterator];if(!f)return p;var h,d,v=f.call(p),m=[];try{for(;(u===void 0||u-- >0)&&!(h=v.next()).done;)m.push(h.value)}catch(x){d={error:x}}finally{try{h&&!h.done&&(f=v.return)&&f.call(v)}finally{if(d)throw d.error}}return m};Object.defineProperty(n,"__esModule",{value:!0});var o=r(9),s=r(3),c=r(0),l=function(){function p(){}return Object.defineProperty(p.prototype,"_eventListenerList",{get:function(){return this.__eventListenerList||(this.__eventListenerList=[])},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"_eventHandlerMap",{get:function(){return this.__eventHandlerMap||(this.__eventHandlerMap={})},enumerable:!0,configurable:!0}),p.prototype.addEventListener=function(u,f,h){h===void 0&&(h={passive:!1,once:!1,capture:!1});var d,v=i(c.eventTarget_flattenMore(h),3),m=v[0],x=v[1],y=v[2];f&&(d=s.Guard.isEventListener(f)?f:{handleEvent:f},c.eventTarget_addEventListener(this,{type:u,callback:d,capture:m,passive:x,once:y,removed:!1}))},p.prototype.removeEventListener=function(u,f,h){h===void 0&&(h={capture:!1});var d=c.eventTarget_flatten(h);if(f)for(var v=0;v=x.length&&(x=void 0),{value:x&&x[C++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(x,y){var g=typeof Symbol=="function"&&x[Symbol.iterator];if(!g)return x;var C,S,T=g.call(x),w=[];try{for(;(y===void 0||y-- >0)&&!(C=T.next()).done;)w.push(C.value)}catch(_){S={error:_}}finally{try{C&&!C.done&&(g=T.return)&&g.call(T)}finally{if(S)throw S.error}}return w},s=this&&this.__spread||function(){for(var x=[],y=0;y",amp:"&",quot:'"',apos:"'"},s}();n.BaseReader=o},function(a,n,r){var i=r(39);a.exports=i.DEFAULT=new i({include:[r(54)],explicit:[r(299),r(300),r(301)]})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(185);n.XMLBuilderImpl=i.XMLBuilderImpl;var o=r(304);n.XMLBuilderCBImpl=o.XMLBuilderCBImpl;var s=r(183);n.builder=s.builder,n.create=s.create,n.fragment=s.fragment,n.convert=s.convert;var c=r(309);n.createCB=c.createCB,n.fragmentCB=c.fragmentCB},function(a,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}a.exports=r},function(a,n,r){var i={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,s=o&&!i.call({1:2},1);n.f=s?function(c){var l=o(this,c);return!!l&&l.enumerable}:i},function(a,n,r){var i=r(11),o=r(21);a.exports=function(s,c){try{o(i,s,c)}catch{i[s]=c}return c}},function(a,n,r){var i=r(44),o=r(118);(a.exports=function(s,c){return o[s]||(o[s]=c!==void 0?c:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(a,n,r){var i=r(121),o=r(84).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(s){return i(s,o)}},function(a,n,r){var i=r(47),o=Math.max,s=Math.min;a.exports=function(c,l){var p=i(c);return p<0?o(p+l,0):s(p,l)}},function(a,n){a.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(a,n){n.f=Object.getOwnPropertySymbols},function(a,n,r){var i=r(8);a.exports=!!Object.getOwnPropertySymbols&&!i(function(){return!String(Symbol())})},function(a,n,r){var i=r(127);a.exports=function(o,s,c){if(i(o),s===void 0)return o;switch(c){case 0:return function(){return o.call(s)};case 1:return function(l){return o.call(s,l)};case 2:return function(l,p){return o.call(s,l,p)};case 3:return function(l,p,u){return o.call(s,l,p,u)}}return function(){return o.apply(s,arguments)}}},function(a,n,r){var i=r(4),o=r(195),s=r(132),c=r(133),l=r(62),p=r(21),u=r(25),f=r(5),h=r(44),d=r(49),v=r(131),m=v.IteratorPrototype,x=v.BUGGY_SAFARI_ITERATORS,y=f("iterator"),g=function(){return this};a.exports=function(C,S,T,w,_,E,D){o(T,S,w);var O,M,N,R=function(j){if(j===_&&k)return k;if(!x&&j in P)return P[j];switch(j){case"keys":case"values":case"entries":return function(){return new T(this,j)}}return function(){return new T(this)}},B=S+" Iterator",I=!1,P=C.prototype,L=P[y]||P["@@iterator"]||_&&P[_],k=!x&&L||R(_),A=S=="Array"&&P.entries||L;if(A&&(O=s(A.call(new C)),m!==Object.prototype&&O.next&&(h||s(O)===m||(c?c(O,m):typeof O[y]!="function"&&p(O,y,g)),l(O,B,!0,!0),h&&(d[B]=g))),_=="values"&&L&&L.name!=="values"&&(I=!0,k=function(){return L.call(this)}),h&&!D||P[y]===k||p(P,y,k),d[S]=k,_)if(M={values:R("values"),keys:E?k:R("keys"),entries:R("entries")},D)for(N in M)(x||I||!(N in P))&&u(P,N,M[N]);else i({target:S,proto:!0,forced:x||I},M);return M}},function(a,n,r){var i=r(4),o=r(13),s=r(59),c=r(83),l=r(26),p=r(24),u=r(134),f=r(5),h=r(63),d=r(28),v=h("slice"),m=d("slice",{ACCESSORS:!0,0:0,1:2}),x=f("species"),y=[].slice,g=Math.max;i({target:"Array",proto:!0,forced:!v||!m},{slice:function(C,S){var T,w,_,E=p(this),D=l(E.length),O=c(C,D),M=c(S===void 0?D:S,D);if(s(E)&&(typeof(T=E.constructor)!="function"||T!==Array&&!s(T.prototype)?o(T)&&(T=T[x])===null&&(T=void 0):T=void 0,T===Array||T===void 0))return y.call(E,O,M);for(w=new(T===void 0?Array:T)(g(M-O,0)),_=0;O0&&(!C.multiline||C.multiline&&v[C.lastIndex-1]!==` -`)&&(w="(?: "+w+")",E=" "+E,_++),x=new RegExp("^(?:"+w+")",T)),d&&(x=new RegExp("^"+w+"$(?!\\s)",T)),f&&(m=C.lastIndex),y=l.call(S?x:C,E),S?y?(y.input=y.input.slice(_),y[0]=y[0].slice(_),y.index=C.lastIndex,C.lastIndex+=y[0].length):C.lastIndex=0:f&&y&&(C.lastIndex=C.global?y.index+y[0].length:m),d&&y&&y.length>1&&p.call(y[0],x,function(){for(g=1;g]*>)/g,x=/\$([$&'`]|\d\d?)/g;i("replace",2,function(y,g,C,S){var T=S.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=S.REPLACE_KEEPS_$0,_=T?"$":"$0";return[function(D,O){var M=p(this),N=D==null?void 0:D[y];return N!==void 0?N.call(D,M,O):g.call(String(M),D,O)},function(D,O){if(!T&&w||typeof O=="string"&&O.indexOf(_)===-1){var M=C(g,D,this,O);if(M.done)return M.value}var N=o(D),R=String(this),B=typeof O=="function";B||(O=String(O));var I=N.global;if(I){var P=N.unicode;N.lastIndex=0}for(var L=[];;){var k=f(N,R);if(k===null||(L.push(k),!I))break;String(k[0])===""&&(N.lastIndex=u(R,c(N.lastIndex),P))}for(var A,j="",H=0,K=0;K=H&&(j+=R.slice(H,q)+F,H=q+Y.length)}return j+R.slice(H)}];function E(D,O,M,N,R,B){var I=M+D.length,P=N.length,L=x;return R!==void 0&&(R=s(R),L=m),g.call(B,L,function(k,A){var j;switch(A.charAt(0)){case"$":return"$";case"&":return D;case"`":return O.slice(0,M);case"'":return O.slice(I);case"<":j=R[A.slice(1,-1)];break;default:var H=+A;if(H===0)return k;if(H>P){var K=v(H/10);return K===0?k:K<=P?N[K-1]===void 0?A.charAt(1):N[K-1]+A.charAt(1):k}j=N[H-1]}return j===void 0?"":j})}})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this._items={},this._nullItems=[]}return o.prototype.copy=function(){var s=new o;for(var c in this._items)s._items[c]=this._items[c].slice(0);return s._nullItems=this._nullItems.slice(0),s},o.prototype.get=function(s,c){var l=c===null?this._nullItems:this._items[c]||null;if(l===null)return null;for(var p=null,u=0;u=O.length&&(O=void 0),{value:O&&O[R++],done:!O}}};throw new TypeError(M?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(O,M){var N=typeof Symbol=="function"&&O[Symbol.iterator];if(!N)return O;var R,B,I=N.call(O),P=[];try{for(;(M===void 0||M-- >0)&&!(R=I.next()).done;)P.push(R.value)}catch(L){B={error:L}}finally{try{R&&!R.done&&(N=I.return)&&N.call(I)}finally{if(B)throw B.error}}return P},s=this&&this.__spread||function(){for(var O=[],M=0;M=0;J--)if((oe=$[J]).shadowAdjustedTarget!==null){W=oe;break}if(W!==null)if(p.Guard.isNode(W.shadowAdjustedTarget)&&p.Guard.isShadowRoot(d.tree_rootNode(W.shadowAdjustedTarget,!0)))k=!0;else if(p.Guard.isNode(W.relatedTarget)&&p.Guard.isShadowRoot(d.tree_rootNode(W.relatedTarget,!0)))k=!0;else for(var ne=0;ne=0;J--)(oe=$[J]).shadowAdjustedTarget!==null?O._eventPhase=l.EventPhase.AtTarget:O._eventPhase=l.EventPhase.Capturing,S(oe,O,"capturing",R);for(J=0;J<$.length;J++){if((oe=$[J]).shadowAdjustedTarget!==null)O._eventPhase=l.EventPhase.AtTarget;else{if(!O._bubbles)continue;O._eventPhase=l.EventPhase.Bubbling}S(oe,O,"bubbling",R)}}return O._eventPhase=l.EventPhase.None,O._currentTarget=null,O._path=[],O._dispatchFlag=!1,O._stopPropagationFlag=!1,O._stopImmediatePropagationFlag=!1,k&&(O._target=null,O._relatedTarget=null,O._touchTargetList=[]),H!==null&&(O._canceledFlag||H._activationBehavior===void 0?H._legacyCanceledActivationBehavior!==void 0&&H._legacyCanceledActivationBehavior(O):H._activationBehavior(O)),!O._canceledFlag}function C(O,M,N,R,B,I){var P=!1;p.Guard.isNode(M)&&p.Guard.isShadowRoot(d.tree_rootNode(M))&&(P=!0);var L=!1;p.Guard.isShadowRoot(M)&&M._mode==="closed"&&(L=!0),O._path.push({invocationTarget:M,invocationTargetInShadowTree:P,shadowAdjustedTarget:N,relatedTarget:R,touchTargetList:B,rootOfClosedTree:L,slotInClosedTree:I})}function S(O,M,N,R){R===void 0&&(R={value:!1});for(var B=M._path,I=-1,P=0;P0&&(L=B[I-1]).shadowAdjustedTarget!==null)&&(M._target=L.shadowAdjustedTarget)}if(M._relatedTarget=O.relatedTarget,M._touchTargetList=O.touchTargetList,!M._stopPropagationFlag){M._currentTarget=O.invocationTarget;var k=M._currentTarget._eventListenerList,A=new(Array.bind.apply(Array,s([void 0],k)));if(!T(M,A,N,O,R)&&M._isTrusted){var j=M._type;j==="animationend"?M._type="webkitAnimationEnd":j==="animationiteration"?M._type="webkitAnimationIteration":j==="animationstart"?M._type="webkitAnimationStart":j==="transitionend"&&(M._type="webkitTransitionEnd"),T(M,A,N,O,R),M._type=j}}}function T(O,M,N,R,B){B===void 0&&(B={value:!1});for(var I=!1,P=0;P=C.length&&(C=void 0),{value:C&&C[w++],done:!C}}};throw new TypeError(S?"Object is not iterable.":"Symbol.iterator is not defined.")},c=this&&this.__read||function(C,S){var T=typeof Symbol=="function"&&C[Symbol.iterator];if(!T)return C;var w,_,E=T.call(C),D=[];try{for(;(S===void 0||S-- >0)&&!(w=E.next()).done;)D.push(w.value)}catch(O){_={error:O}}finally{try{w&&!w.done&&(T=E.return)&&T.call(E)}finally{if(_)throw _.error}}return D};Object.defineProperty(n,"__esModule",{value:!0});var l=r(6),p=r(2),u=r(9),f=r(34),h=r(3),d=r(1),v=r(7),m=r(152),x=r(0),y=r(12),g=function(C){function S(){var T=C.call(this)||this;return T._children=new Set,T._encoding={name:"UTF-8",labels:["unicode-1-1-utf-8","utf-8","utf8"]},T._contentType="application/xml",T._URL={scheme:"about",username:"",password:"",host:null,port:null,path:["blank"],query:null,fragment:null,_cannotBeABaseURLFlag:!0,_blobURLEntry:null},T._origin=null,T._type="xml",T._mode="no-quirks",T._documentElement=null,T._hasNamespaces=!1,T._nodeDocumentOverwrite=null,T}return o(S,C),Object.defineProperty(S.prototype,"_nodeDocument",{get:function(){return this._nodeDocumentOverwrite||this},set:function(T){this._nodeDocumentOverwrite=T},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"implementation",{get:function(){return this._implementation||(this._implementation=x.create_domImplementation(this))},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"URL",{get:function(){return m.urlSerializer(this._URL)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"documentURI",{get:function(){return this.URL},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"origin",{get:function(){return"null"},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"compatMode",{get:function(){return this._mode==="quirks"?"BackCompat":"CSS1Compat"},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"characterSet",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"charset",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"inputEncoding",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"contentType",{get:function(){return this._contentType},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"doctype",{get:function(){var T,w;try{for(var _=s(this._children),E=_.next();!E.done;E=_.next()){var D=E.value;if(h.Guard.isDocumentTypeNode(D))return D}}catch(O){T={error:O}}finally{try{E&&!E.done&&(w=_.return)&&w.call(_)}finally{if(T)throw T.error}}return null},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"documentElement",{get:function(){return this._documentElement},enumerable:!0,configurable:!0}),S.prototype.getElementsByTagName=function(T){return x.node_listOfElementsWithQualifiedName(T,this)},S.prototype.getElementsByTagNameNS=function(T,w){return x.node_listOfElementsWithNamespace(T,w,this)},S.prototype.getElementsByClassName=function(T){return x.node_listOfElementsWithClassNames(T,this)},S.prototype.createElement=function(T,w){if(!x.xml_isName(T))throw new u.InvalidCharacterError;this._type==="html"&&(T=T.toLowerCase());var _=null;w!==void 0&&(_=d.isString(w)?w:w.is);var E=this._type==="html"||this._contentType==="application/xhtml+xml"?v.namespace.HTML:null;return x.element_createAnElement(this,T,E,null,_,!0)},S.prototype.createElementNS=function(T,w,_){return x.document_internalCreateElementNS(this,T,w,_)},S.prototype.createDocumentFragment=function(){return x.create_documentFragment(this)},S.prototype.createTextNode=function(T){return x.create_text(this,T)},S.prototype.createCDATASection=function(T){if(this._type==="html")throw new u.NotSupportedError;if(T.indexOf("]]>")!==-1)throw new u.InvalidCharacterError;return x.create_cdataSection(this,T)},S.prototype.createComment=function(T){return x.create_comment(this,T)},S.prototype.createProcessingInstruction=function(T,w){if(!x.xml_isName(T))throw new u.InvalidCharacterError;if(w.indexOf("?>")!==-1)throw new u.InvalidCharacterError;return x.create_processingInstruction(this,T,w)},S.prototype.importNode=function(T,w){if(w===void 0&&(w=!1),h.Guard.isDocumentNode(T)||h.Guard.isShadowRoot(T))throw new u.NotSupportedError;return x.node_clone(T,this,w)},S.prototype.adoptNode=function(T){if(h.Guard.isDocumentNode(T))throw new u.NotSupportedError;if(h.Guard.isShadowRoot(T))throw new u.HierarchyRequestError;return x.document_adopt(T,this),T},S.prototype.createAttribute=function(T){if(!x.xml_isName(T))throw new u.InvalidCharacterError;return this._type==="html"&&(T=T.toLowerCase()),x.create_attr(this,T)},S.prototype.createAttributeNS=function(T,w){var _=c(x.namespace_validateAndExtract(T,w),3),E=_[0],D=_[1],O=_[2],M=x.create_attr(this,O);return M._namespace=E,M._namespacePrefix=D,M},S.prototype.createEvent=function(T){return x.event_createLegacyEvent(T)},S.prototype.createRange=function(){var T=x.create_range();return T._start=[this,0],T._end=[this,0],T},S.prototype.createNodeIterator=function(T,w,_){w===void 0&&(w=p.WhatToShow.All),_===void 0&&(_=null);var E=x.create_nodeIterator(T,T,!0);return E._whatToShow=w,E._iteratorCollection=x.create_nodeList(T),d.isFunction(_)?(E._filter=x.create_nodeFilter(),E._filter.acceptNode=_):E._filter=_,E},S.prototype.createTreeWalker=function(T,w,_){w===void 0&&(w=p.WhatToShow.All),_===void 0&&(_=null);var E=x.create_treeWalker(T,T);return E._whatToShow=w,d.isFunction(_)?(E._filter=x.create_nodeFilter(),E._filter.acceptNode=_):E._filter=_,E},S.prototype._getTheParent=function(T){return T._type==="load"?null:l.dom.window},S.prototype.getElementById=function(T){throw new Error("Mixin: NonElementParentNode not implemented.")},Object.defineProperty(S.prototype,"children",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"firstElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"lastElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"childElementCount",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),S.prototype.prepend=function(){for(var T=[],w=0;w=m.length&&(m=void 0),{value:m&&m[g++],done:!m}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")},c=this&&this.__read||function(m,x){var y=typeof Symbol=="function"&&m[Symbol.iterator];if(!y)return m;var g,C,S=y.call(m),T=[];try{for(;(x===void 0||x-- >0)&&!(g=S.next()).done;)T.push(g.value)}catch(w){C={error:w}}finally{try{g&&!g.done&&(y=S.return)&&y.call(S)}finally{if(C)throw C.error}}return T};Object.defineProperty(n,"__esModule",{value:!0});var l=r(2),p=r(34),u=r(9),f=r(7),h=r(0),d=r(12),v=function(m){function x(){var y=m.call(this)||this;return y._children=new Set,y._namespace=null,y._namespacePrefix=null,y._localName="",y._customElementState="undefined",y._customElementDefinition=null,y._is=null,y._shadowRoot=null,y._attributeList=h.create_namedNodeMap(y),y._attributeChangeSteps=[],y._name="",y._assignedSlot=null,y}return o(x,m),Object.defineProperty(x.prototype,"namespaceURI",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"prefix",{get:function(){return this._namespacePrefix},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"localName",{get:function(){return this._localName},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"tagName",{get:function(){return this._htmlUppercasedQualifiedName},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"id",{get:function(){return h.element_getAnAttributeValue(this,"id")},set:function(y){h.element_setAnAttributeValue(this,"id",y)},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"className",{get:function(){return h.element_getAnAttributeValue(this,"class")},set:function(y){h.element_setAnAttributeValue(this,"class",y)},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"classList",{get:function(){var y=h.element_getAnAttributeByName("class",this);return y===null&&(y=h.create_attr(this._nodeDocument,"class")),h.create_domTokenList(this,y)},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"slot",{get:function(){return h.element_getAnAttributeValue(this,"slot")},set:function(y){h.element_setAnAttributeValue(this,"slot",y)},enumerable:!0,configurable:!0}),x.prototype.hasAttributes=function(){return this._attributeList.length!==0},Object.defineProperty(x.prototype,"attributes",{get:function(){return this._attributeList},enumerable:!0,configurable:!0}),x.prototype.getAttributeNames=function(){var y,g,C=[];try{for(var S=s(this._attributeList),T=S.next();!T.done;T=S.next()){var w=T.value;C.push(w._qualifiedName)}}catch(_){y={error:_}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(y)throw y.error}}return C},x.prototype.getAttribute=function(y){var g=h.element_getAnAttributeByName(y,this);return g?g._value:null},x.prototype.getAttributeNS=function(y,g){var C=h.element_getAnAttributeByNamespaceAndLocalName(y,g,this);return C?C._value:null},x.prototype.setAttribute=function(y,g){if(!h.xml_isName(y))throw new u.InvalidCharacterError;this._namespace===f.namespace.HTML&&this._nodeDocument._type==="html"&&(y=y.toLowerCase());for(var C=null,S=0;S=h.length&&(h=void 0),{value:h&&h[m++],done:!h}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(2),l=r(71),p=r(0),u=r(12),f=function(h){function d(v){v===void 0&&(v="");var m=h.call(this,v)||this;return m._name="",m._assignedSlot=null,m}return o(d,h),Object.defineProperty(d.prototype,"wholeText",{get:function(){var v,m,x="";try{for(var y=s(p.text_contiguousTextNodes(this,!0)),g=y.next();!g.done;g=y.next())x+=g.value._data}catch(C){v={error:C}}finally{try{g&&!g.done&&(m=y.return)&&m.call(y)}finally{if(v)throw v.error}}return x},enumerable:!0,configurable:!0}),d.prototype.splitText=function(v){return p.text_split(this,v)},Object.defineProperty(d.prototype,"assignedSlot",{get:function(){throw new Error("Mixin: Slotable not implemented.")},enumerable:!0,configurable:!0}),d._create=function(v,m){m===void 0&&(m="");var x=new d(m);return x._nodeDocument=v,x},d}(l.CharacterDataImpl);n.TextImpl=f,u.idl_defineConst(f.prototype,"_nodeType",c.NodeType.Text)},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){}return Object.defineProperty(o.prototype,"_startNode",{get:function(){return this._start[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_startOffset",{get:function(){return this._start[1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_endNode",{get:function(){return this._end[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_endOffset",{get:function(){return this._end[1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_collapsed",{get:function(){return this._start[0]===this._end[0]&&this._start[1]===this._end[1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"startContainer",{get:function(){return this._startNode},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"startOffset",{get:function(){return this._startOffset},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"endContainer",{get:function(){return this._endNode},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"endOffset",{get:function(){return this._endOffset},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"collapsed",{get:function(){return this._collapsed},enumerable:!0,configurable:!0}),o}();n.AbstractRangeImpl=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=function(){function s(c){this._activeFlag=!1,this._root=c,this._whatToShow=i.WhatToShow.All,this._filter=null}return Object.defineProperty(s.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"whatToShow",{get:function(){return this._whatToShow},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"filter",{get:function(){return this._filter},enumerable:!0,configurable:!0}),s}();n.TraverserImpl=o},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=r(0),s=r(12),c=function(){function l(p,u){this._target=null,this._relatedTarget=null,this._touchTargetList=[],this._path=[],this._currentTarget=null,this._eventPhase=i.EventPhase.None,this._stopPropagationFlag=!1,this._stopImmediatePropagationFlag=!1,this._canceledFlag=!1,this._inPassiveListenerFlag=!1,this._composedFlag=!1,this._initializedFlag=!1,this._dispatchFlag=!1,this._isTrusted=!1,this._bubbles=!1,this._cancelable=!1,this._type=p,u&&(this._bubbles=u.bubbles||!1,this._cancelable=u.cancelable||!1,this._composedFlag=u.composed||!1),this._initializedFlag=!0,this._timeStamp=new Date().getTime()}return Object.defineProperty(l.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"srcElement",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"currentTarget",{get:function(){return this._currentTarget},enumerable:!0,configurable:!0}),l.prototype.composedPath=function(){var p=[],u=this._path;if(u.length===0)return p;var f=this._currentTarget;if(f===null)throw new Error("Event currentTarget is null.");p.push(f);for(var h=0,d=0,v=u.length-1;v>=0;){if(u[v].rootOfClosedTree&&d++,u[v].invocationTarget===f){h=v;break}u[v].slotInClosedTree&&d--,v--}var m=d,x=d;for(v=h-1;v>=0;)u[v].rootOfClosedTree&&m++,m<=x&&p.unshift(u[v].invocationTarget),u[v].slotInClosedTree&&--m0)&&!(C=T.next()).done;)w.push(C.value)}catch(_){S={error:_}}finally{try{C&&!C.done&&(g=T.return)&&g.call(T)}finally{if(S)throw S.error}}return w},o=this&&this.__values||function(x){var y=typeof Symbol=="function"&&Symbol.iterator,g=y&&x[y],C=0;if(g)return g.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&C>=x.length&&(x=void 0),{value:x&&x[C++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=r(6),c=r(3),l=r(1),p=r(99),u=r(73),f=r(17),h=r(173),d=r(30),v=r(52),m=r(37);n.document_elementInterface=function(x,y){return p.ElementImpl},n.document_internalCreateElementNS=function(x,y,g,C){var S=i(h.namespace_validateAndExtract(y,g),3),T=S[0],w=S[1],_=S[2],E=null;return C!==void 0&&(E=l.isString(C)?C:C.is),v.element_createAnElement(x,_,T,w,E,!0)},n.document_adopt=function(x,y){var g,C;if(x._nodeDocument!==y||x._parent!==null){var S=x._nodeDocument;if(x._parent&&m.mutation_remove(x,x._parent),y!==S)for(var T=f.tree_getFirstDescendantNode(x,!0,!0);T!==null;){if(T._nodeDocument=y,c.Guard.isElementNode(T))try{for(var w=(g=void 0,o(T._attributeList._asArray())),_=w.next();!_.done;_=w.next())_.value._nodeDocument=y}catch(E){g={error:E}}finally{try{_&&!_.done&&(C=w.return)&&C.call(w)}finally{if(g)throw g.error}}s.dom.features.customElements&&c.Guard.isElementNode(T)&&T._customElementState==="custom"&&u.customElement_enqueueACustomElementCallbackReaction(T,"adoptedCallback",[S,y]),s.dom.features.steps&&d.dom_runAdoptingSteps(T,S),T=f.tree_getNextDescendantNode(x,T,!0,!0)}}}},function(a,n,r){var i=this&&this.__values||function(f){var h=typeof Symbol=="function"&&Symbol.iterator,d=h&&f[h],v=0;if(d)return d.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&v>=f.length&&(f=void 0),{value:f&&f[v++],done:!f}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),c=r(9),l=r(17),p=r(51),u=r(30);n.characterData_replaceData=function(f,h,d,v){var m,x,y=l.tree_nodeLength(f);if(h>y)throw new c.IndexSizeError("Offset exceeds character data length. Offset: "+h+", Length: "+y+", Node is "+f.nodeName+".");h+d>y&&(d=y-h),o.dom.features.mutationObservers&&p.observer_queueMutationRecord("characterData",f,null,null,f._data,[],[],null,null);var g=f._data.substring(0,h)+v+f._data.substring(h+d);f._data=g;try{for(var C=i(o.dom.rangeList),S=C.next();!S.done;S=C.next()){var T=S.value;T._start[0]===f&&T._start[1]>h&&T._start[1]<=h+d&&(T._start[1]=h),T._end[0]===f&&T._end[1]>h&&T._end[1]<=h+d&&(T._end[1]=h),T._start[0]===f&&T._start[1]>h+d&&(T._start[1]+=v.length-d),T._end[0]===f&&T._end[1]>h+d&&(T._end[1]+=v.length-d)}}catch(w){m={error:w}}finally{try{S&&!S.done&&(x=C.return)&&x.call(C)}finally{if(m)throw m.error}}o.dom.features.steps&&s.Guard.isTextNode(f)&&f._parent!==null&&u.dom_runChildTextContentChangeSteps(f._parent)},n.characterData_substringData=function(f,h,d){var v=l.tree_nodeLength(f);if(h>v)throw new c.IndexSizeError("Offset exceeds character data length. Offset: "+h+", Length: "+v+", Node is "+f.nodeName+".");return h+d>v?f._data.substr(h):f._data.substr(h,d)}},function(a,n,r){var i=this&&this.__read||function(u,f){var h=typeof Symbol=="function"&&u[Symbol.iterator];if(!h)return u;var d,v,m=h.call(u),x=[];try{for(;(f===void 0||f-- >0)&&!(d=m.next()).done;)x.push(d.value)}catch(y){v={error:y}}finally{try{d&&!d.done&&(h=m.return)&&h.call(m)}finally{if(v)throw v.error}}return x},o=this&&this.__spread||function(){for(var u=[],f=0;f=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(7);function l(u){var f=c.string.splitAStringOnASCIIWhitespace(u);return new Set(f)}function p(u){return o(u).join(" ")}n.orderedSet_parse=l,n.orderedSet_serialize=p,n.orderedSet_sanitize=function(u){return p(l(u))},n.orderedSet_contains=function(u,f,h){var d,v,m,x;try{for(var y=s(f),g=y.next();!g.done;g=y.next()){var C=g.value,S=!1;try{for(var T=(m=void 0,s(u)),w=T.next();!w.done;w=T.next()){var _=w.value;if(h){if(_===C){S=!0;break}}else if(_.toUpperCase()===C.toUpperCase()){S=!0;break}}}catch(E){m={error:E}}finally{try{w&&!w.done&&(x=T.return)&&x.call(T)}finally{if(m)throw m.error}}if(!S)return!1}}catch(E){d={error:E}}finally{try{g&&!g.done&&(v=y.return)&&v.call(y)}finally{if(d)throw d.error}}return!0}},function(a,n,r){r(179),Object.defineProperty(n,"__esModule",{value:!0});var i=r(262),o=r(110),s=r(1);o.dom.setFeatures(!1),n.createDocument=function(){var c=new i.DOMImplementation().createDocument(null,"root",null);return c.documentElement&&c.removeChild(c.documentElement),c},n.sanitizeInput=function(c,l){if(c==null)return c;if(l===void 0)return c+"";var p="";c+="";for(var u=0;u=32&&f<=55295||f>=57344&&f<=65533)p+=c.charAt(u);else if(f>=55296&&f<=56319&&u=56320&&h<=57343?(f=1024*(f-55296)+h-56320+65536,p+=String.fromCodePoint(f),u++):p+=s.isString(l)?l:l(c.charAt(u),u,c)}else p+=s.isString(l)?l:l(c.charAt(u),u,c)}return p}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=r(153);n.AbortController=o.AbortControllerImpl;var s=r(154);n.AbortSignal=s.AbortSignalImpl;var c=r(102);n.AbstractRange=c.AbstractRangeImpl;var l=r(157);n.Attr=l.AttrImpl;var p=r(158);n.CDATASection=p.CDATASectionImpl;var u=r(71);n.CharacterData=u.CharacterDataImpl;var f=r(263),h=r(159);n.Comment=h.CommentImpl;var d=r(171);n.CustomEvent=d.CustomEventImpl;var v=r(100);n.DocumentFragment=v.DocumentFragmentImpl;var m=r(98);n.Document=m.DocumentImpl;var x=r(264),y=r(155);n.DocumentType=y.DocumentTypeImpl;var g=r(6);n.dom=g.dom;var C=r(148);n.DOMImplementation=C.DOMImplementationImpl;var S=r(170);n.DOMTokenList=S.DOMTokenListImpl;var T=r(99);n.Element=T.ElementImpl;var w=r(104);n.Event=w.EventImpl;var _=r(70);n.EventTarget=_.EventTargetImpl;var E=r(161);n.HTMLCollection=E.HTMLCollectionImpl;var D=r(265);n.MutationObserver=D.MutationObserverImpl;var O=r(169);n.MutationRecord=O.MutationRecordImpl;var M=r(164);n.NamedNodeMap=M.NamedNodeMapImpl;var N=r(168);n.NodeFilter=N.NodeFilterImpl;var R=r(34);n.Node=R.NodeImpl;var B=r(166);n.NodeIterator=B.NodeIteratorImpl;var I=r(162);n.NodeList=I.NodeListImpl;var P=r(163);n.NodeListStatic=P.NodeListStaticImpl;var L=r(266),k=r(267),A=r(268),j=r(160);n.ProcessingInstruction=j.ProcessingInstructionImpl;var H=r(165);n.Range=H.RangeImpl;var K=r(156);n.ShadowRoot=K.ShadowRootImpl;var Y=r(269),q=r(270);n.StaticRange=q.StaticRangeImpl;var Z=r(101);n.Text=Z.TextImpl;var re=r(103);n.Traverser=re.TraverserImpl;var ae=r(167);n.TreeWalker=ae.TreeWalkerImpl;var ee=r(149);n.Window=ee.WindowImpl;var F=r(151);n.XMLDocument=F.XMLDocumentImpl,i.applyMixin(T.ElementImpl,f.ChildNodeImpl),i.applyMixin(u.CharacterDataImpl,f.ChildNodeImpl),i.applyMixin(y.DocumentTypeImpl,f.ChildNodeImpl),i.applyMixin(m.DocumentImpl,x.DocumentOrShadowRootImpl),i.applyMixin(K.ShadowRootImpl,x.DocumentOrShadowRootImpl),i.applyMixin(T.ElementImpl,L.NonDocumentTypeChildNodeImpl),i.applyMixin(u.CharacterDataImpl,L.NonDocumentTypeChildNodeImpl),i.applyMixin(m.DocumentImpl,k.NonElementParentNodeImpl),i.applyMixin(v.DocumentFragmentImpl,k.NonElementParentNodeImpl),i.applyMixin(m.DocumentImpl,A.ParentNodeImpl),i.applyMixin(v.DocumentFragmentImpl,A.ParentNodeImpl),i.applyMixin(T.ElementImpl,A.ParentNodeImpl),i.applyMixin(Z.TextImpl,Y.SlotableImpl),i.applyMixin(T.ElementImpl,Y.SlotableImpl)},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),function(i){i[i.EOF=0]="EOF",i[i.Declaration=1]="Declaration",i[i.DocType=2]="DocType",i[i.Element=3]="Element",i[i.Text=4]="Text",i[i.CDATA=5]="CDATA",i[i.PI=6]="PI",i[i.Comment=7]="Comment",i[i.ClosingTag=8]="ClosingTag"}(n.TokenType||(n.TokenType={}))},function(a,n,r){r(64),r(20),r(66);var i,o=this&&this.__extends||(i=function(l,p){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var h in f)f.hasOwnProperty(h)&&(u[h]=f[h])})(l,p)},function(l,p){function u(){this.constructor=l}i(l,p),l.prototype=p===null?Object.create(p):(u.prototype=p.prototype,new u)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(1),c=function(l){function p(){return l!==null&&l.apply(this,arguments)||this}return o(p,l),p.prototype._parse=function(u,f){var h=this,d=this._builderOptions,v=null;return s.isFunction(f)?v=this.parse(u,f.apply(this)):s.isArray(f)||s.isSet(f)?s.forEachArray(f,function(m){return v=h.parse(u,m)},this):s.isMap(f)||s.isObject(f)?s.forEachObject(f,function(m,x){if(s.isFunction(x)&&(x=x.apply(h)),d.ignoreConverters||m.indexOf(d.convert.att)!==0)if(d.ignoreConverters||m.indexOf(d.convert.text)!==0)if(d.ignoreConverters||m.indexOf(d.convert.cdata)!==0)if(d.ignoreConverters||m.indexOf(d.convert.comment)!==0)if(d.ignoreConverters||m.indexOf(d.convert.ins)!==0){if(!((s.isArray(x)||s.isSet(x))&&s.isEmpty(x))){if((s.isMap(x)||s.isObject(x))&&s.isEmpty(x))v=h.element(u,void 0,h.sanitize(m))||v;else if(d.keepNullNodes||x!=null)if(s.isArray(x)||s.isSet(x))s.forEachArray(x,function(T){var w={};w[m]=T,v=h.parse(u,w)},h);else if(s.isMap(x)||s.isObject(x))(y=h.element(u,void 0,h.sanitize(m)))&&(v=y,h.parse(y,x));else if(x!=null&&x!==""){var y;(y=h.element(u,void 0,h.sanitize(m)))&&(v=y,h.text(y,h._decodeText(h.sanitize(x))))}else v=h.element(u,void 0,h.sanitize(m))||v}}else if(s.isString(x)){var g=x.indexOf(" "),C=g===-1?x:x.substr(0,g),S=g===-1?"":x.substr(g+1);v=h.instruction(u,h.sanitize(C),h.sanitize(S))||v}else s.isArray(x)||s.isSet(x)?s.forEachArray(x,function(T){var w=T.indexOf(" "),_=w===-1?T:T.substr(0,w),E=w===-1?"":T.substr(w+1);v=h.instruction(u,h.sanitize(_),h.sanitize(E))||v},h):s.forEachObject(x,function(T,w){return v=h.instruction(u,h.sanitize(T),h.sanitize(w))||v},h);else s.isArray(x)||s.isSet(x)?s.forEachArray(x,function(T){return v=h.comment(u,h.sanitize(T))||v},h):v=h.comment(u,h.sanitize(x))||v;else s.isArray(x)||s.isSet(x)?s.forEachArray(x,function(T){return v=h.cdata(u,h.sanitize(T))||v},h):v=h.cdata(u,h.sanitize(x))||v;else v=s.isMap(x)||s.isObject(x)?h.parse(u,x):h.text(u,h._decodeText(h.sanitize(x)))||v;else if(m===d.convert.att){if(s.isArray(x)||s.isSet(x))throw new Error("Invalid attribute: "+x.toString()+". "+u._debugInfo());s.forEachObject(x,function(T,w){v=h.attribute(u,void 0,h.sanitize(T),h._decodeAttributeValue(h.sanitize(w)))||v})}else v=h.attribute(u,void 0,h.sanitize(m.substr(d.convert.att.length)),h._decodeAttributeValue(h.sanitize(x)))||v},this):(d.keepNullNodes||f!=null)&&(v=this.text(u,this._decodeText(this.sanitize(f)))||v),v||u},p}(r(75).BaseReader);n.ObjectReader=c},function(a,n,r){var i=r(39);a.exports=new i({explicit:[r(286),r(287),r(288)]})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(o){this.level=0,this._builderOptions=o,this._writerOptions=o};n.BaseCBWriter=i},function(a,n,r){var i=r(16),o=r(8),s=r(116);a.exports=!i&&!o(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7})},function(a,n,r){var i=r(11),o=r(13),s=i.document,c=o(s)&&o(s.createElement);a.exports=function(l){return c?s.createElement(l):{}}},function(a,n,r){var i=r(118),o=Function.toString;typeof i.inspectSource!="function"&&(i.inspectSource=function(s){return o.call(s)}),a.exports=i.inspectSource},function(a,n,r){var i=r(11),o=r(80),s=i["__core-js_shared__"]||o("__core-js_shared__",{});a.exports=s},function(a,n,r){var i=r(14),o=r(187),s=r(55),c=r(15);a.exports=function(l,p){for(var u=o(p),f=c.f,h=s.f,d=0;dh;)i(f,u=p[h++])&&(~s(d,u)||d.push(u));return d}},function(a,n,r){var i=r(24),o=r(26),s=r(83),c=function(l){return function(p,u,f){var h,d=i(p),v=o(d.length),m=s(f,v);if(l&&u!=u){for(;v>m;)if((h=d[m++])!=h)return!0}else for(;v>m;m++)if((l||m in d)&&d[m]===u)return l||m||0;return!l&&-1}};a.exports={includes:c(!0),indexOf:c(!1)}},function(a,n,r){var i=r(8),o=/#|\.prototype\./,s=function(f,h){var d=l[c(f)];return d==u||d!=p&&(typeof h=="function"?i(h):!!h)},c=s.normalize=function(f){return String(f).replace(o,".").toLowerCase()},l=s.data={},p=s.NATIVE="N",u=s.POLYFILL="P";a.exports=s},function(a,n,r){var i=r(86);a.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(a,n,r){var i=r(5);n.f=i},function(a,n,r){var i=r(120),o=r(14),s=r(125),c=r(15).f;a.exports=function(l){var p=i.Symbol||(i.Symbol={});o(p,l)||c(p,l,{value:s.f(l)})}},function(a,n){a.exports=function(r){if(typeof r!="function")throw TypeError(String(r)+" is not a function");return r}},function(a,n,r){var i=r(13),o=r(59),s=r(5)("species");a.exports=function(c,l){var p;return o(c)&&(typeof(p=c.constructor)!="function"||p!==Array&&!o(p.prototype)?i(p)&&(p=p[s])===null&&(p=void 0):p=void 0),new(p===void 0?Array:p)(l===0?0:l)}},function(a,n,r){var i,o,s=r(11),c=r(193),l=s.process,p=l&&l.versions,u=p&&p.v8;u?o=(i=u.split("."))[0]+i[1]:c&&(!(i=c.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=c.match(/Chrome\/(\d+)/))&&(o=i[1]),a.exports=o&&+o},function(a,n,r){var i=r(5),o=r(60),s=r(15),c=i("unscopables"),l=Array.prototype;l[c]==null&&s.f(l,c,{configurable:!0,value:o(null)}),a.exports=function(p){l[c][p]=!0}},function(a,n,r){var i,o,s,c=r(132),l=r(21),p=r(14),u=r(5),f=r(44),h=u("iterator"),d=!1;[].keys&&("next"in(s=[].keys())?(o=c(c(s)))!==Object.prototype&&(i=o):d=!0),i==null&&(i={}),f||p(i,h)||l(i,h,function(){return this}),a.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:d}},function(a,n,r){var i=r(14),o=r(27),s=r(57),c=r(196),l=s("IE_PROTO"),p=Object.prototype;a.exports=c?Object.getPrototypeOf:function(u){return u=o(u),i(u,l)?u[l]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?p:null}},function(a,n,r){var i=r(18),o=r(197);a.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var s,c=!1,l={};try{(s=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(l,[]),c=l instanceof Array}catch{}return function(p,u){return i(p),o(u),c?s.call(p,u):p.__proto__=u,p}}():void 0)},function(a,n,r){var i=r(56),o=r(15),s=r(40);a.exports=function(c,l,p){var u=i(l);u in c?o.f(c,u,s(0,p)):c[u]=p}},function(a,n,r){var i=r(90),o=r(42),s=r(5)("toStringTag"),c=o(function(){return arguments}())=="Arguments";a.exports=i?o:function(l){var p,u,f;return l===void 0?"Undefined":l===null?"Null":typeof(u=function(h,d){try{return h[d]}catch{}}(p=Object(l),s))=="string"?u:c?o(p):(f=o(p))=="Object"&&typeof p.callee=="function"?"Arguments":f}},function(a,n,r){var i=r(18);a.exports=function(){var o=i(this),s="";return o.global&&(s+="g"),o.ignoreCase&&(s+="i"),o.multiline&&(s+="m"),o.dotAll&&(s+="s"),o.unicode&&(s+="u"),o.sticky&&(s+="y"),s}},function(a,n,r){var i=r(47),o=r(35),s=function(c){return function(l,p){var u,f,h=String(o(l)),d=i(p),v=h.length;return d<0||d>=v?c?"":void 0:(u=h.charCodeAt(d))<55296||u>56319||d+1===v||(f=h.charCodeAt(d+1))<56320||f>57343?c?h.charAt(d):u:c?h.slice(d,d+2):f-56320+(u-55296<<10)+65536}};a.exports={codeAt:s(!1),charAt:s(!0)}},function(a,n,r){var i=r(4),o=r(27),s=r(61);i({target:"Object",stat:!0,forced:r(8)(function(){s(1)})},{keys:function(c){return s(o(c))}})},function(a,n,r){var i=r(4),o=r(11),s=r(123),c=r(25),l=r(140),p=r(141),u=r(142),f=r(13),h=r(8),d=r(208),v=r(62),m=r(209);a.exports=function(x,y,g){var C=x.indexOf("Map")!==-1,S=x.indexOf("Weak")!==-1,T=C?"set":"add",w=o[x],_=w&&w.prototype,E=w,D={},O=function(P){var L=_[P];c(_,P,P=="add"?function(k){return L.call(this,k===0?0:k),this}:P=="delete"?function(k){return!(S&&!f(k))&&L.call(this,k===0?0:k)}:P=="get"?function(k){return S&&!f(k)?void 0:L.call(this,k===0?0:k)}:P=="has"?function(k){return!(S&&!f(k))&&L.call(this,k===0?0:k)}:function(k,A){return L.call(this,k===0?0:k,A),this})};if(s(x,typeof w!="function"||!(S||_.forEach&&!h(function(){new w().entries().next()}))))E=g.getConstructor(y,x,C,T),l.REQUIRED=!0;else if(s(x,!0)){var M=new E,N=M[T](S?{}:-0,1)!=M,R=h(function(){M.has(1)}),B=d(function(P){new w(P)}),I=!S&&h(function(){for(var P=new w,L=5;L--;)P[T](L,L);return!P.has(-0)});B||((E=y(function(P,L){u(P,E,x);var k=m(new w,P,E);return L!=null&&p(L,k[T],k,C),k})).prototype=_,_.constructor=E),(R||I)&&(O("delete"),O("has"),C&&O("get")),(I||N)&&O(T),S&&_.clear&&delete _.clear}return D[x]=E,i({global:!0,forced:E!=w},D),v(E,x),S||g.setStrong(E,x,C),E}},function(a,n,r){var i=r(45),o=r(13),s=r(14),c=r(15).f,l=r(58),p=r(204),u=l("meta"),f=0,h=Object.isExtensible||function(){return!0},d=function(m){c(m,u,{value:{objectID:"O"+ ++f,weakData:{}}})},v=a.exports={REQUIRED:!1,fastKey:function(m,x){if(!o(m))return typeof m=="symbol"?m:(typeof m=="string"?"S":"P")+m;if(!s(m,u)){if(!h(m))return"F";if(!x)return"E";d(m)}return m[u].objectID},getWeakData:function(m,x){if(!s(m,u)){if(!h(m))return!0;if(!x)return!1;d(m)}return m[u].weakData},onFreeze:function(m){return p&&v.REQUIRED&&h(m)&&!s(m,u)&&d(m),m}};i[u]=!0},function(a,n,r){var i=r(18),o=r(205),s=r(26),c=r(87),l=r(206),p=r(207),u=function(f,h){this.stopped=f,this.result=h};(a.exports=function(f,h,d,v,m){var x,y,g,C,S,T,w,_=c(h,d,v?2:1);if(m)x=f;else{if(typeof(y=l(f))!="function")throw TypeError("Target is not iterable");if(o(y)){for(g=0,C=s(f.length);C>g;g++)if((S=v?_(i(w=f[g])[0],w[1]):_(f[g]))&&S instanceof u)return S;return new u(!1)}x=y.call(f)}for(T=x.next;!(w=T.call(x)).done;)if(typeof(S=p(x,_,w.value,v))=="object"&&S&&S instanceof u)return S;return new u(!1)}).stop=function(f){return new u(!0,f)}},function(a,n){a.exports=function(r,i,o){if(!(r instanceof i))throw TypeError("Incorrect "+(o?o+" ":"")+"invocation");return r}},function(a,n,r){var i=r(15).f,o=r(60),s=r(210),c=r(87),l=r(142),p=r(141),u=r(88),f=r(211),h=r(16),d=r(140).fastKey,v=r(43),m=v.set,x=v.getterFor;a.exports={getConstructor:function(y,g,C,S){var T=y(function(D,O){l(D,T,g),m(D,{type:g,index:o(null),first:void 0,last:void 0,size:0}),h||(D.size=0),O!=null&&p(O,D[S],D,C)}),w=x(g),_=function(D,O,M){var N,R,B=w(D),I=E(D,O);return I?I.value=M:(B.last=I={index:R=d(O,!0),key:O,value:M,previous:N=B.last,next:void 0,removed:!1},B.first||(B.first=I),N&&(N.next=I),h?B.size++:D.size++,R!=="F"&&(B.index[R]=I)),D},E=function(D,O){var M,N=w(D),R=d(O);if(R!=="F")return N.index[R];for(M=N.first;M;M=M.next)if(M.key==O)return M};return s(T.prototype,{clear:function(){for(var D=w(this),O=D.index,M=D.first;M;)M.removed=!0,M.previous&&(M.previous=M.previous.next=void 0),delete O[M.index],M=M.next;D.first=D.last=void 0,h?D.size=0:this.size=0},delete:function(D){var O=w(this),M=E(this,D);if(M){var N=M.next,R=M.previous;delete O.index[M.index],M.removed=!0,R&&(R.next=N),N&&(N.previous=R),O.first==M&&(O.first=N),O.last==M&&(O.last=R),h?O.size--:this.size--}return!!M},forEach:function(D){for(var O,M=w(this),N=c(D,arguments.length>1?arguments[1]:void 0,3);O=O?O.next:M.first;)for(N(O.value,O.key,this);O&&O.removed;)O=O.previous},has:function(D){return!!E(this,D)}}),s(T.prototype,C?{get:function(D){var O=E(this,D);return O&&O.value},set:function(D,O){return _(this,D===0?0:D,O)}}:{add:function(D){return _(this,D=D===0?0:D,D)}}),h&&i(T.prototype,"size",{get:function(){return w(this).size}}),T},setStrong:function(y,g,C){var S=g+" Iterator",T=x(g),w=x(S);u(y,g,function(_,E){m(this,{type:S,target:_,state:T(_),kind:E,last:void 0})},function(){for(var _=w(this),E=_.kind,D=_.last;D&&D.removed;)D=D.previous;return _.target&&(_.last=D=D?D.next:_.state.first)?E=="keys"?{value:D.key,done:!1}:E=="values"?{value:D.value,done:!1}:{value:[D.key,D.value],done:!1}:(_.target=void 0,{value:void 0,done:!0})},C?"entries":"values",!C,!0),f(g)}}},function(a,n,r){var i,o=r(4),s=r(55).f,c=r(26),l=r(222),p=r(35),u=r(224),f=r(44),h="".endsWith,d=Math.min,v=u("endsWith");o({target:"String",proto:!0,forced:!!(f||v||(i=s(String.prototype,"endsWith"),!i||i.writable))&&!v},{endsWith:function(m){var x=String(p(this));l(m);var y=arguments.length>1?arguments[1]:void 0,g=c(x.length),C=y===void 0?g:d(c(y),g),S=String(m);return h?h.call(x,S,C):x.slice(C-S.length,C)===S}})},function(a,n,r){(function(i){/*! +`,{Representation:pC}=yr;function hC(t){const e=jt.newInstance();e.setOpenGLRenderWindow(t);const a=new Float32Array(12);for(let u=0;u<4;u++)a[u*3]=u%2*2-1,a[u*3+1]=u>1?1:-1,a[u*3+2]=0;const n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array(8);r[0]=3,r[1]=0,r[2]=1,r[3]=3,r[4]=3,r[5]=0,r[6]=3,r[7]=2;const i=pe.newInstance({numberOfComponents:3,values:a});i.setName("points");const o=pe.newInstance({numberOfComponents:1,values:r}),s=pe.newInstance({numberOfComponents:2,values:n});return e.getCABO().createVBO(o,"polys",pC.SURFACE,{points:i,cellOffset:0,tcoords:s}),e}function gC(t,e){e.classHierarchy.push("vtkOpenGLSurfaceLICInterface"),t.renderQuad=(r,i)=>{const o=e.licQuad,s=e.context;let u=e.licQuadVAO;u||(u=$a.newInstance(),u.setOpenGLRenderWindow(e._openGLRenderWindow),e.licQuadVAO=u),e.previousProgramHash!==i.getMd5Hash()&&(u.shaderProgramChanged(),o.getCABO().bind(),u.addAttributeArray(i,o.getCABO(),"vertexDC",o.getCABO().getVertexOffset(),o.getCABO().getStride(),e.context.FLOAT,3,e.context.FALSE),u.addAttributeArray(i,o.getCABO(),"tcoordDC",o.getCABO().getTCoordOffset(),o.getCABO().getStride(),e.context.FLOAT,2,e.context.FALSE),e.previousProgramHash=i.getMd5Hash()),s.drawArrays(s.TRIANGLES,0,o.getCABO().getElementCount()),u.release()};function a(r,i,o,s,u,c){const l=Math.max(0,Math.min(1,o)),f=Float32Array.from({length:r*r},()=>{let g=0;if(l===1||Math.random()>1-l)for(let C=0;C<2048;++C)g+=Math.random();return g});let h=0,v=2048+1;f.forEach(g=>{l===1?v=g0?g:v,h=g>h?g:h});let m=h-v;m===0&&(v=0,h===0?m=1:m=h);const x=i-1,y=x!==0?1/x:0,d=c-u;return f.map(g=>{const C=gx?x:S;return g>=v?i===1?c:u+T*y*d:s})}function n([r,i],o,s,u){const c=u-s;return Float32Array.from({length:r*i},()=>{let p=Math.random();return p=Math.floor(p*o)/o,p=p*c+s,p>1?1:p<0?0:p})}t.generateNoiseTexture=r=>{if(!e.noiseTexture||e.licInterface.getRebuildNoiseTexture()){e.licInterface.setRebuildNoiseTexture(!1),e.noiseTexture&&e.noiseTexture.releaseGraphicsResources(),ju(e.noiseGeneratorSeed,{global:!0});let i=[];const{noiseTextureType:o,noiseGrainSize:s,numberOfNoiseLevels:u,noiseImpulseProbability:c,noiseImpulseBackgroundValue:p,minNoiseValue:l,maxNoiseValue:f}=e.licInterface.get("noiseTextureType","noiseGrainSize","numberOfNoiseLevels","noiseImpulseProbability","noiseImpulseBackgroundValue","minNoiseValue","maxNoiseValue");switch(o){case ic.GAUSSIAN:i=a(Math.floor(r/s),u,c,p,l,f);break;case ic.UNIFORM:default:i=n([Math.ceil(r/s),Math.ceil(r/s)],u,l,f)}const h=1/s,v=Float32Array.from({length:r*r*4},(x,y)=>{const d=y/4;if(y%4===0){const g=Math.floor(d%r*h),C=Math.floor(d/r*h);return i[C*(r/s)+g]}return y%4===1||y%4===3?1:0}),m=Ne.newInstance({wrapS:Ne.Wrap.REPEAT,wrapT:Ne.Wrap.REPEAT,minificationFilter:Ne.Filter.NEAREST,magnificationFilter:Ne.Filter.NEAREST,generateMipMap:!1,openGLDataType:e.context.FLOAT,baseLevel:0,maxLevel:0,autoParameters:!1});m.setOpenGLRenderWindow(e._openGLRenderWindow),m.create2DFromRaw({width:r,height:r,numComps:4,dataType:"Float32Array",data:v}),m.activate(),m.sendParameters(),m.deactivate(),e.noiseTexture=m}},t.buildAShader=r=>e._openGLRenderWindow.getShaderCache().readyShaderProgramArray(Q1,r,""),t.allocateTextures=()=>{const r=Ne.Filter.NEAREST,i=Ne.Filter.LINEAR,o=e._openGLRenderWindow;e.geometryImage||(e.geometryImage=t.allocateTexture(o,r)),e.vectorImage||(e.vectorImage=t.allocateTexture(o,i)),e.maskVectorImage||(e.maskVectorImage=t.allocateTexture(o,i)),e.LICImage||(e.LICImage=t.allocateTexture(o,r)),e.RGBColorImage||(e.RGBColorImage=t.allocateTexture(o,r)),e.HSLColorImage||(e.HSLColorImage=t.allocateTexture(o,r)),e.depthTexture||(e.depthTexture=t.allocateDepthTexture(o))},t.allocateTexture=(r,i)=>{const o=e.context,s=Ne.newInstance({wrapS:Ne.Wrap.CLAMP_TO_EDGE,wrapT:Ne.Wrap.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:i,generateMipmap:!1,openGLDataType:o.FLOAT,baseLevel:0,maxLevel:0,autoParameters:!1});return s.setOpenGLRenderWindow(r),s.setInternalFormat(o.RGBA32F),s.create2DFromRaw({width:e.size[0],height:e.size[1],numComps:4,dataType:"Float32Array",data:null}),s.activate(),s.sendParameters(),s.deactivate(),s},t.allocateDepthTexture=r=>{const i=e.context,o=Ne.newInstance({generateMipmap:!1,openGLDataType:i.FLOAT,autoParameters:!1});return o.setOpenGLRenderWindow(r),o.createDepthFromRaw({width:e.size[0],height:e.size[1],dataType:"Float32Array",data:null}),o.activate(),o.sendParameters(),o.deactivate(),o},t.createFBO=()=>{if(!e.framebuffer){e.licHelper=null;const r=Or.newInstance();r.setOpenGLRenderWindow(e._openGLRenderWindow),r.saveCurrentBindingsAndBuffers(),r.create(...e.size),r.populateFramebuffer(),e.framebuffer=r,r.restorePreviousBindingsAndBuffers()}},t.completedGeometry=()=>{const r=e.context,i=e.framebuffer;i.removeColorBuffer(0),i.removeColorBuffer(1),i.removeColorBuffer(2),i.removeDepthBuffer(),r.drawBuffers([r.NONE]),i.restorePreviousBindingsAndBuffers()},t.buildAllShaders=()=>{e.shadersNeedBuilding&&(e.licColorPass=t.buildAShader(uC),e.licCopyPass=t.buildAShader(lC),e.enhanceContrastPass=t.buildAShader(fC),e.shadersNeedBuilding=!1)},t.initializeResources=()=>{t.createFBO(),t.generateNoiseTexture(e.licInterface.getNoiseTextureSize()),t.allocateTextures(),t.buildAllShaders(),e.licQuad||(e.licQuad=hC(e._openGLRenderWindow)),e.licHelper||(e.licHelper=cC.newInstance())},t.prepareForGeometry=()=>{const r=e.framebuffer;r.saveCurrentBindingsAndBuffers(),r.bind(),e.geometryImage.activate(),e.vectorImage.activate(),e.maskVectorImage.activate(),r.removeColorBuffer(0),r.removeColorBuffer(2),r.removeColorBuffer(3),r.setColorBuffer(e.geometryImage,0),r.setColorBuffer(e.vectorImage,2),r.setColorBuffer(e.maskVectorImage,3),r.setDepthBuffer(e.depthTexture);const i=e.context;i.drawBuffers([i.COLOR_ATTACHMENT0,i.NONE,i.COLOR_ATTACHMENT2,i.COLOR_ATTACHMENT3]),i.viewport(0,0,...e.size),i.scissor(0,0,...e.size),i.disable(i.BLEND),i.disable(i.DEPTH_TEST),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.DEPTH_BUFFER_BIT|i.COLOR_BUFFER_BIT)},t.copyToScreen=r=>{e.RGBColorImage.activate(),e.depthTexture.activate(),e.licCopyPass||t.initializeResources();const i=e.licCopyPass;e._openGLRenderWindow.getShaderCache().readyShaderProgram(i);const o=e.context;o.viewport(0,0,...r),o.scissor(0,0,...r),o.disable(o.BLEND),o.enable(o.DEPTH_TEST),o.disable(o.SCISSOR_TEST),i.setUniformi("texDepth",e.depthTexture.getTextureUnit()),i.setUniformi("texRGBColors",e.RGBColorImage.getTextureUnit()),t.renderQuad(r,i),e.RGBColorImage.deactivate(),e.depthTexture.deactivate()},t.combineColorsAndLIC=()=>{const r=e.context,i=e.framebuffer;i.saveCurrentBindingsAndBuffers(),i.bind(),i.create(...e.size),i.removeColorBuffer(0),i.removeColorBuffer(1),i.setColorBuffer(e.RGBColorImage,0),i.setColorBuffer(e.HSLColorImage,1),r.drawBuffers([r.COLOR_ATTACHMENT0,r.COLOR_ATTACHMENT1]),r.disable(r.DEPTH_TEST),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),e.vectorImage.activate(),e.geometryImage.activate(),e.LICImage.activate(),e.licColorPass||t.initializeResources();const o=e.licColorPass;e._openGLRenderWindow.getShaderCache().readyShaderProgram(o),o.setUniformi("texVectors",e.vectorImage.getTextureUnit()),o.setUniformi("texGeomColors",e.geometryImage.getTextureUnit());const{colorMode:s,LICIntensity:u,mapModeBias:c,maskIntensity:p,maskColor:l,enhanceContrast:f,lowColorContrastEnhancementFactor:h,highColorContrastEnhancementFactor:v}=e.licInterface.get("colorMode","LICIntensity","mapModeBias","maskIntensity","maskColor","enhanceContrast","lowColorContrastEnhancementFactor","highColorContrastEnhancementFactor");if(o.setUniformi("texLIC",e.LICImage.getTextureUnit()),o.setUniformi("uScalarColorMode",s),o.setUniformf("uLICIntensity",u),o.setUniformf("uMapBias",c),o.setUniformf("uMaskIntensity",p),o.setUniform3f("uMaskColor",...l),t.renderQuad(e.size,o),e.vectorImage.deactivate(),e.geometryImage.deactivate(),e.LICImage.deactivate(),i.removeColorBuffer(0),i.removeColorBuffer(1),r.drawBuffers([r.NONE]),f===Rr.COLOR||f===Rr.BOTH){let m=0,x=1,y=x-m;m+=y*h,x-=y*v,y=x-m,i.setColorBuffer(e.RGBColorImage),r.drawBuffers([r.COLOR_ATTACHMENT0]),e.geometryImage.activate(),e.HSLColorImage.activate(),e.LICImage.activate(),e.enhanceContrastPass||t.initializeResources();const{enhanceContrastPass:d}=e;e._openGLRenderWindow.getShaderCache().readyShaderProgram(d),d.setUniformi("texGeomColors",e.geometryImage.getTextureUnit()),d.setUniformi("texHSLColors",e.HSLColorImage.getTextureUnit()),d.setUniformi("texLIC",e.LICImage.getTextureUnit()),d.setUniformf("uLMin",m),d.setUniformf("uLMaxMinDiff",y),t.renderQuad(e.size,d),e.geometryImage.deactivate(),e.HSLColorImage.deactivate(),e.LICImage.deactivate(),i.removeColorBuffer(0),r.drawBuffers([r.NONE])}i.restorePreviousBindingsAndBuffers()},t.applyLIC=()=>{const r=e.licInterface.get("stepSize","numberOfSteps","enhancedLIC","enhanceContrast","lowLICContrastEnhancementFactor","highLICContrastEnhancementFactor","antiAlias","normalizeVectors","maskThreshold","transformVectors"),i=e.licHelper.executeLIC(e.size,e.vectorImage,e.maskVectorImage,e.noiseTexture,e._openGLRenderWindow,r);if(!i){console.error("Failed to compute image LIC"),e.LICImage=null;return}e.LICImage=i},t.setSize=r=>{Array.isArray(r)&&r.length===2&&(!e.size||e.size[0]!==r[0]||e.size[1]!==r[1])&&(e.size=r,t.releaseGraphicsResources())},t.releaseGraphicsResources=()=>{e.geometryImage&&(e.geometryImage.releaseGraphicsResources(),e.geometryImage=null),e.vectorImage&&(e.vectorImage.releaseGraphicsResources(),e.vectorImage=null),e.maskVectorImage&&(e.maskVectorImage.releaseGraphicsResources(),e.maskVectorImage=null),e.LICImage&&(e.LICImage.releaseGraphicsResources(),e.LICImage=null),e.RGBColorImage&&(e.RGBColorImage.releaseGraphicsResources(),e.RGBColorImage=null),e.HSLColorImage&&(e.HSLColorImage.releaseGraphicsResources(),e.HSLColorImage=null),e.depthTexture&&(e.depthTexture.releaseGraphicsResources(),e.depthTexture=null),e.framebuffer&&(e.framebuffer.releaseGraphicsResources(),e.framebuffer=null)}}var dC={context:null,shadersNeedBuilding:!0,reallocateTextures:!0,size:null,licInterface:null};function nh(t,e,a={}){Object.assign(e,dC,a),Z1.extend(t,e,a),A.obj(t,e),A.setGet(t,e,["context","_openGLRenderWindow","reallocateTextures","licInterface","size"]),A.moveToProtected(t,e,["openGLRenderWindow"]),gC(t,e)}var vC=A.newInstance(nh,"vtkSurfaceLICInterface"),yC={newInstance:vC,extend:nh},{vtkErrorMacro:Io}=bt;function mC(t,e){e.classHierarchy.push("vtkOpenGLSurfaceLICMapper");const a={...t};t.getNeedToRebuildShaders=(n,r,i)=>e.rebuildLICShaders||a.getNeedToRebuildShaders(n,r,i),t.replaceShaderValues=(n,r,i)=>{const o=e.lastBoundBO.getReferenceByName("lastLightComplexity");let s=n.Vertex,u=n.Fragment;const c=e.renderable.getInputArrayToProcess(0);if(c&&e.canDrawLIC){u=Z.substitute(u,"//VTK::Output::Dec",["//VTK::Output::Dec","layout(location = 2) out vec4 vectorTexture;","layout(location = 3) out vec4 maskVectorTexture;"]).result;const p=`${c.getName()}MC`;o===0&&e.lastBoundBO.set({lastLightComplexity:1},!0),s=Z.substitute(s,"//VTK::TCoord::Dec",[`attribute vec3 ${p};`,"out vec3 licOutput;","//VTK::TCoord::Dec"]).result,s=Z.substitute(s,"//VTK::TCoord::Impl",[`licOutput = ${p};`,"//VTK::TCoord::Impl"]).result,u=Z.substitute(u,"//VTK::TCoord::Dec",["uniform int uMaskOnSurface;","uniform mat3 normalMatrix;","in vec3 licOutput;","//VTK::TCoord::Dec"]).result,u=Z.substitute(u,"//VTK::TCoord::Impl",["// projected vectors"," vec3 tcoordLIC = normalMatrix * licOutput;"," vec3 normN = normalize(normalVCVSOutput);"," float k = dot(tcoordLIC, normN);"," vec3 projected = (tcoordLIC - k*normN);"," vectorTexture = vec4(projected.x, projected.y, 0.0 , 1.0);","// vectors for fragment masking"," if (uMaskOnSurface == 0)"," {"," maskVectorTexture = vec4(licOutput, 1.0);"," }"," else"," {"," maskVectorTexture = vec4(projected.x, projected.y, 0.0 , 1.0);"," }","//VTK::TCoord::Impl"],!1).result,n.Vertex=s}e.rebuildLICShaders=!1,n.Fragment=u,a.replaceShaderValues(n,r,i),o>0&&e.lastBoundBO.set({lastLightComplexity:o},!0)},t.setMapperShaderParameters=(n,r,i)=>{a.setMapperShaderParameters(n,r,i),e.canDrawLIC&&n.getProgram().setUniformi("uMaskOnSurface",e.maskOnSurface)},t.getNeedToRebuildBufferObjects=(n,r)=>e.rebuildLICBuffers||a.getNeedToRebuildBufferObjects(n,r),t.buildBufferObjects=(n,r)=>{if(e.canDrawLIC){const i=e.renderable.getInputArrayToProcess(0);i&&i.getNumberOfComponents()>1&&e.renderable.setCustomShaderAttributes([i.getName()])}e.rebuildLICBuffers=!1,a.buildBufferObjects(n,r)},t.pushState=n=>{e.stateCache={[n.BLEND]:n.isEnabled(n.BLEND),[n.DEPTH_TEST]:n.isEnabled(n.DEPTH_TEST),[n.SCISSOR_TEST]:n.isEnabled(n.SCISSOR_TEST),[n.CULL_FACE]:n.isEnabled(n.CULL_FACE)}},t.popState=n=>{const r=i=>e.stateCache[i]?n.enable(i):n.disable(i);r(n.BLEND),r(n.DEPTH_TEST),r(n.SCISSOR_TEST),e.stateCache[n.CULL_FACE]?e._openGLRenderWindow.enableCullFace():e._openGLRenderWindow.disableCullFace()},t.renderPiece=(n,r)=>{let i=!0;e._openGLRenderWindow.getWebgl2()||(Io("SurfaceLICMapper Requires WebGL 2"),i=!1),(!e.context.getExtension("EXT_color_buffer_float")||!e.context.getExtension("OES_texture_float_linear"))&&(Io("SurfaceLICMapper requires the EXT_color_buffer_float and OES_texture_float_linear WebGL2 extensions."),i=!1),e.currentInput=e.renderable.getInputData(),e.currentInput||(Io("No input"),i=!1);let o=e.renderable.getLicInterface();o||(o=Z1.newInstance(),e.renderable.setLicInterface(o)),e.openGLLicInterface||(e.openGLLicInterface=yC.newInstance()),o!==e.openGLLicInterface.getLicInterface()&&e.openGLLicInterface.setLicInterface(o);const s=e.renderable.getInputArrayToProcess(0);if(o.getEnableLIC()&&(!s||s.getNumberOfComponents()<2)&&(Io("No vector input array"),i=!1),o.getEnableLIC()||(i=!1),e.canDrawLIC!==i&&(e.rebuildLICShaders=!0,e.rebuildLICBuffers=!0),e.canDrawLIC=i,!i||!o.getEnableLIC()){a.renderPiece(n,r);return}const u=e.context,c=r.getProperty().getBackfaceCulling(),p=r.getProperty().getFrontfaceCulling();!c&&!p?e._openGLRenderWindow.disableCullFace():p?(e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(u.FRONT)):(e._openGLRenderWindow.enableCullFace(),e._openGLRenderWindow.setCullFaceMode(u.BACK));const l=e._openGLRenderWindow.getSize(),f=l.map(h=>Math.round(h*o.getViewPortScale()));e.openGLLicInterface.setSize(f),e.openGLLicInterface.setOpenGLRenderWindow(e._openGLRenderWindow),e.openGLLicInterface.setContext(e.context),t.pushState(e.context),e.openGLLicInterface.initializeResources(),e.openGLLicInterface.prepareForGeometry(),t.popState(e.context),a.renderPieceStart(n,r),a.renderPieceDraw(n,r),a.renderPieceFinish(n,r),t.pushState(e.context),e.VBOBuildTime.modified(),e.openGLLicInterface.completedGeometry(),e._openGLRenderWindow.disableCullFace(),e.openGLLicInterface.applyLIC(),e.openGLLicInterface.combineColorsAndLIC(),e.openGLLicInterface.copyToScreen(l),t.popState(e.context)}}var xC={canDrawLIC:!1,rebuildLICShaders:!1,rebuildLICBuffers:!1,openGLLicInterface:null};function CC(t,e,a={}){Object.assign(e,xC,a),Lo.extend(t,e,a),mC(t,e),ht(t,e,["openGLLicInterface"])}var SC=qe(CC,"vtkOpenGLSurfaceLICMapper");ct("vtkSurfaceLICMapper",SC);function rh(){const t=new ArrayBuffer(4),e=new Uint8Array(t),a=new Uint32Array(t);return e[0]=161,e[1]=178,e[2]=195,e[3]=212,a[0]===3569595041?"LittleEndian":a[0]===2712847316?"BigEndian":null}var TC=rh();function wC(t,e){if(e<2)return;const a=new Int8Array(t),n=a.length,r=[];for(let i=0;i>>1|(rt&21845)<<1;Xn=(Xn&52428)>>>2|(Xn&13107)<<2,Xn=(Xn&61680)>>>4|(Xn&3855)<<4,cc[rt]=((Xn&65280)>>>8|(Xn&255)<<8)>>>1}for(var Qa=function(t,e,a){for(var n=t.length,r=0,i=new Lr(e);r>>u]=c}else for(s=new Lr(n),r=0;r>>15-t[r]);return s},ei=new Ot(288),rt=0;rt<144;++rt)ei[rt]=8;for(var rt=144;rt<256;++rt)ei[rt]=9;for(var rt=256;rt<280;++rt)ei[rt]=7;for(var rt=280;rt<288;++rt)ei[rt]=8;for(var fh=new Ot(32),rt=0;rt<32;++rt)fh[rt]=5;var MC=Qa(ei,9,1),NC=Qa(fh,5,1),uc=function(t){for(var e=t[0],a=1;ae&&(e=t[a]);return e},tn=function(t,e,a){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&a},lc=function(t,e){var a=e/8|0;return(t[a]|t[a+1]<<8|t[a+2]<<16)>>(e&7)},RC=function(t){return(t+7)/8|0},zo=function(t,e,a){(e==null||e<0)&&(e=0),(a==null||a>t.length)&&(a=t.length);var n=new(t.BYTES_PER_ELEMENT==2?Lr:t.BYTES_PER_ELEMENT==4?ih:Ot)(a-e);return n.set(t.subarray(e,a)),n},LC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rt=function(t,e,a){var n=new Error(e||LC[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Rt),!a)throw n;return n},fc=function(t,e,a){var n=t.length;if(!n||a&&a.f&&!a.l)return e||new Ot(0);var r=!e||a,i=!a||a.i;a||(a={}),e||(e=new Ot(n*3));var o=function(Q){var ae=e.length;if(Q>ae){var ne=new Ot(Math.max(ae*2,Q));ne.set(e),e=ne}},s=a.f||0,u=a.p||0,c=a.b||0,p=a.l,l=a.d,f=a.m,h=a.n,v=n*8;do{if(!p){s=tn(t,u,1);var m=tn(t,u+1,3);if(u+=3,m)if(m==1)p=MC,l=NC,f=9,h=5;else if(m==2){var g=tn(t,u,31)+257,C=tn(t,u+10,15)+4,S=g+tn(t,u+5,31)+1;u+=14;for(var T=new Ot(S),w=new Ot(19),_=0;_>>4;if(x<16)T[_++]=x;else{var R=0,N=0;for(x==16?(N=3+tn(t,u,3),u+=2,R=T[_-1]):x==17?(N=3+tn(t,u,7),u+=3):x==18&&(N=11+tn(t,u,127),u+=7);N--;)T[_++]=R}}var L=T.subarray(0,g),B=T.subarray(g);f=uc(L),h=uc(B),p=Qa(L,f,1),l=Qa(B,h,1)}else Rt(1);else{var x=RC(u)+4,y=t[x-4]|t[x-3]<<8,d=x+y;if(d>n){i&&Rt(0);break}r&&o(c+y),e.set(t.subarray(x,d),c),a.b=c+=y,a.p=u=d*8,a.f=s;continue}if(u>v){i&&Rt(0);break}}r&&o(c+131072);for(var P=(1<>>4;if(u+=R&15,u>v){i&&Rt(0);break}if(R||Rt(2),G<256)e[c++]=G;else if(G==256){k=u,p=null;break}else{var W=G-254;if(G>264){var _=G-257,H=oh[_];W=tn(t,u,(1<>>4;X||Rt(3),u+=X&15;var B=bC[Y];if(Y>3){var H=sh[Y];B+=lc(t,u)&(1<v){i&&Rt(0);break}r&&o(c+131072);for(var q=c+W;c>>0},pc=function(t,e){return nn(t,e)+nn(t,e+4)*4294967296},kC=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Rt(6,"invalid gzip data");var e=t[3],a=10;e&4&&(a+=t[10]|(t[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[a++]);return a+(e&2)},AC=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},VC=function(t){((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Rt(6,"invalid zlib data"),t[1]&32&&Rt(6,"invalid zlib data: preset dictionaries not supported")};function ph(t,e){return fc(t,e)}function BC(t,e){return fc(t.subarray(kC(t),-8),e||new Ot(AC(t)))}function UC(t,e){return fc((VC(t),t.subarray(2,-4)),e)}function rn(t,e){return t[0]==31&&t[1]==139&&t[2]==8?BC(t,e):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?ph(t,e):UC(t,e)}var hh=typeof TextEncoder<"u"&&new TextEncoder,hc=typeof TextDecoder<"u"&&new TextDecoder,GC=0;try{hc.decode(FC,{stream:!0}),GC=1}catch{}var IC=function(t){for(var e="",a=0;;){var n=t[a++],r=(n>127)+(n>223)+(n>239);if(a+r>t.length)return[e,zo(t,a-1)];r?r==3?(n=((n&15)<<18|(t[a++]&63)<<12|(t[a++]&63)<<6|t[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):r&1?e+=String.fromCharCode((n&31)<<6|t[a++]&63):e+=String.fromCharCode((n&15)<<12|(t[a++]&63)<<6|t[a++]&63):e+=String.fromCharCode(n)}};function PC(t,e){if(e){for(var a=new Ot(t.length),n=0;n>1)),o=0,s=function(p){i[o++]=p},n=0;ni.length){var u=new Ot(o+8+(r-n<<1));u.set(i),i=u}var c=t.charCodeAt(n);c<128||e?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1023<<10)|t.charCodeAt(++n)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return zo(i,0,o)}function an(t,e){if(e){for(var a="",n=0;n65558)&&Rt(13);var r=Tn(t,n+8);if(!r)return{};var i=nn(t,n+16),o=i==4294967295;o&&(n=nn(t,n-12),nn(t,n)!=101075792&&Rt(13),r=nn(t,n+32),i=nn(t,n+48));for(var s=e&&e.filter,u=0;un.setRequestHeader(r,i)),a.progressCallback&&n.addEventListener("progress",a.progressCallback),n}function HC(t,e={}){return e&&e.compression&&e.compression!=="gz"&&(ti("Supported algorithms are: [gz]"),ti(`Unkown compression algorithm: ${e.compression}`)),new Promise((a,n)=>{const r=Wo("GET",t,e);r.onreadystatechange=i=>{r.readyState===4&&(r.status===200||r.status===0?e.compression?a(rn(new Uint8Array(r.response)).buffer):a(r.response):n({xhr:r,e:i}))},r.responseType="arraybuffer",r.send()})}function KC(t,e,a,n={}){return a.ref&&!a.ref.pending?new Promise((r,i)=>{let o=null;a.ref.url?o=a.ref.url:o=[e,a.ref.basepath,n.compression?`${a.ref.id}.gz`:a.ref.id].join("/");const s=Wo("GET",o,n);s.onreadystatechange=u=>{s.readyState===1&&(a.ref.pending=!0,++sa===1&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!0)),s.readyState===4&&(a.ref.pending=!1,s.status===200||s.status===0?(a.buffer=s.response,n.compression&&(a.dataType==="string"||a.dataType==="JSON"?a.buffer=an(rn(new Uint8Array(a.buffer))):a.buffer=rn(new Uint8Array(a.buffer)).buffer),a.ref.encode==="JSON"?a.values=JSON.parse(a.buffer):(kn.ENDIANNESS!==a.ref.encode&&kn.ENDIANNESS&&($C(`Swap bytes of ${a.name}`),kn.swapBytes(a.buffer,Bi[a.dataType])),a.values=A.newTypedArray(a.dataType,a.buffer)),a.values.length!==a.size&&ti(`Error in FetchArray: ${a.name}, does not have the proper array size. Got ${a.values.length}, instead of ${a.size}`),delete a.ref,--sa===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),t!=null&&t.modified&&t.modified(),r(a)):i({xhr:s,e:u}))},s.responseType=n.compression||a.dataType!=="string"?"arraybuffer":"text",s.send()}):Promise.resolve(a)}function XC(t,e,a={}){return new Promise((n,r)=>{const i=Wo("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++sa===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--sa===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?a.compression?n(JSON.parse(an(rn(new Uint8Array(i.response))))):n(JSON.parse(i.responseText)):r({xhr:i,e:o}))},i.responseType=a.compression?"arraybuffer":"text",i.send()})}function qC(t,e,a={}){return a&&a.compression&&a.compression!=="gz"&&(ti("Supported algorithms are: [gz]"),ti(`Unkown compression algorithm: ${a.compression}`)),new Promise((n,r)=>{const i=Wo("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++sa===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--sa===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?a.compression?n(an(rn(new Uint8Array(i.response)))):n(i.responseText):r({xhr:i,e:o}))},i.responseType=a.compression?"arraybuffer":"text",i.send()})}function YC(t,e,a={}){return new Promise((n,r)=>{const i=new Image;a.crossOrigin&&(i.crossOrigin=a.crossOrigin),i.onload=()=>n(i),i.onerror=r,i.src=e})}var JC={fetchArray:KC,fetchJSON:XC,fetchText:qC,fetchBinary:HC,fetchImage:YC};Po("http",t=>JC);var Gt=[];Gt["-".charCodeAt(0)]=62,Gt["_".charCodeAt(0)]=63;var ni="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0;t<64;t++)Gt[ni.charCodeAt(t)]=t;function wn(t){return Gt[t.charCodeAt(0)]!==void 0}function ZC(t){const e=t.length,a=[];let n=null;for(let r=0;r>16&255,n[p++]=c>>8&255,n[p++]=c&255}switch(o){case 3:for(;!wn(t[u]);)u++;for(c=Gt[t.charCodeAt(u++)]<<10;!wn(t[u]);)u++;for(c|=Gt[t.charCodeAt(u++)]<<4;!wn(t[u]);)u++;c|=Gt[t.charCodeAt(u++)]>>2,n[p++]=c>>8&255,n[p++]=c&255;break;case 2:for(;!wn(t[u]);)u++;for(c=Gt[t.charCodeAt(u++)]<<2;!wn(t[u]);)u++;c|=Gt[t.charCodeAt(u++)]>>4,n[p++]=c&255;break;case 1:throw new Error("BASE64: remain 1 should not happen")}return p}function eS(t){const e=ZC(t),a=e[e.length-1].end+1,n=(4-a%4)%4,r=(a+n)*3/4-n,i=new ArrayBuffer(r),o=new Uint8Array(i);let s=0;for(let u=0;u>18]+ni[n>>12&63]+ni[n>>6&63]+ni[n&63]}function vh(t){const e=new Uint8Array(t),a=t.byteLength%3,n=t.byteLength-a,r=Array(n/3);for(let i=0;i0){const i=dh(e[n],e[n+1]||0,e[n+2]||0);a===1?r.push(`${i.substr(0,2)}==`):a===2&&r.push(`${i.substr(0,3)}=`)}return r.join("")}var Fr={toArrayBuffer:eS,fromArrayBuffer:vh},{vtkErrorMacro:ca,vtkDebugMacro:tS}=A;function nS(t){const e=t.split(".").pop().toLowerCase();return e==="jpg"?"jpeg":e}function rS(t,e,a){return n=>{t.buffer=new ArrayBuffer(n.length),new Uint8Array(t.buffer).set(n),e&&(t.dataType==="string"||t.dataType==="JSON"?t.buffer=an(rn(new Uint8Array(t.buffer))):t.buffer=rn(new Uint8Array(t.buffer)).buffer),t.ref.encode==="JSON"?t.values=JSON.parse(t.buffer):(kn.ENDIANNESS!==t.ref.encode&&kn.ENDIANNESS&&(tS(`Swap bytes of ${t.name}`),kn.swapBytes(t.buffer,Bi[t.dataType])),t.values=A.newTypedArray(t.dataType,t.buffer)),t.values.length!==t.size&&ca(`Error in FetchArray: ${t.name} does not have the proper array size. Got ${t.values.length}, instead of ${t.size}`),a()}}function aS(t,e,a){return n=>{e?t.values=JSON.parse(an(rn(n))):t.values=JSON.parse(n),a()}}function iS(t){return t[0]==="/"?t.substr(1):t}function oS(t){return new URL(t,"http://any").pathname}function ri(t){return iS(oS(t))}function sS(t){return new Promise((e,a)=>{typeof t=="string"?e(PC(t)):t instanceof Blob?e(t.arrayBuffer().then(n=>new Uint8Array(n))):t instanceof ArrayBuffer?e(new Uint8Array(t)):(t==null?void 0:t.buffer)instanceof ArrayBuffer?e(new Uint8Array(t.buffer)):a(new Error("Invalid datatype to unpack."))})}function cS(t){let e=!1,a=0,n=null,r="";return sS(t.zipContent).then(i=>{n=gh(i),e=!0;const o=[];Object.keys(n).forEach(s=>{s.endsWith("index.json")&&o.push(s)}),o.sort((s,u)=>s.length-u.length),r=o[0].replace(/index\.json$/,""),t.callback&&t.callback(n)}),{fetchArray(i,o,s,u={}){return new Promise((c,p)=>{e||ca("ERROR!!! zip not ready...");const l=ri([o,s.ref.basepath,u.compression?`${s.ref.id}.gz`:s.ref.id].join("/"));++a===1&&(i!=null&&i.invokeBusy)&&i.invokeBusy(!0);function f(){delete s.ref,--a===0&&(i!=null&&i.invokeBusy)&&i.invokeBusy(!1),i!=null&&i.modified&&i.modified(),c(s)}const h=n[`${r}${l}`];s.dataType==="string"&&!u.compression?aS(s,u.compression,f)(an(h)):rS(s,u.compression,f)(h)})},fetchJSON(i,o,s={}){const u=ri(o);e||ca("ERROR!!! zip not ready...");const c=n[`${r}${u}`];if(s.compression){if(s.compression==="gz"){const p=an(rn(c));return Promise.resolve(JSON.parse(p))}return Promise.reject(new Error("Invalid compression"))}return Promise.resolve(JSON.parse(an(c)))},fetchText(i,o,s={}){const u=ri(o);e||ca("ERROR!!! zip not ready...");const c=n[`${r}${u}`];return s.compression?s.compression==="gz"?Promise.resolve(an(gh(c))):Promise.reject(new Error("Invalid compression")):Promise.resolve(an(c))},fetchImage(i,o,s={}){const u=ri(o);e||ca("ERROR!!! zip not ready...");const c=n[`${r}${u}`];return new Promise((p,l)=>{const f=new Image;f.onload=()=>p(f),f.onerror=l;const h=vh(c.buffer);f.src=`data:image/${nS(u)};base64,${h}`})},fetchBinary(i,o,s={}){const u=ri(o);e||ca("ERROR!!! zip not ready...");const c=n[`${r}${u}`];return s.compression?s.compression==="gz"?Promise.resolve(rn(c).buffer):Promise.reject(new Error("Invalid compression")):Promise.resolve(c.buffer)}}}var uS={create:cS};Po("zip",t=>uS.create(t));function lS(t,e){e.classHierarchy.push("vtkConcentricCylinderSource");function a(){for(;e.cellFields.length{e.radius=[],e.cellFields=[],t.modified()},t.addRadius=(n,r)=>{e.radius.push(n),r!==void 0&&e.cellFields.push(r),a(),t.modified()},t.getNumberOfRadius=()=>e.radius.length,t.getRadius=(n=0)=>e.radius[n],t.setRadius=(n,r)=>{e.radius[n]=r,t.modified()},t.setCellField=(n,r)=>{e.cellFields[n]=r,t.modified()},t.removeMask=()=>{e.mask=null,t.modified()},t.setMaskLayer=(n,r)=>{let i=!1;!e.mask&&r&&(i=!0,e.mask=[]),e.mask&&(!e.mask[n]!=!r&&(i=!0),e.mask[n]=r),i&&t.modified()},t.getMaskLayer=n=>n===void 0?e.mask:e.mask[n],t.requestData=(n,r)=>{var w;if(!e.radius.length){A.vtkErrorMacro("No radius defined");return}a();const i=e.radius.length,o=e.height/2;let s=0,u=0,c=e.startThetae.startTheta?e.endTheta:e.startTheta;p*=Math.PI/180;let l=e.resolution,f=!1;p>=c+2*Math.PI?p=c+2*Math.PI:(++l,f=!0);const h=(p-c)/e.resolution,v=l*i*2+2;if(!e.skipInnerFaces&&!e.mask)s=2*(l+1)+5*l+(i-1)*l*20+(f?10*i:0),u=2+l+(i-1)*4*l+(f?2*i:0);else if(!e.skipInnerFaces&&e.mask){e.mask[0]||(s+=2*(l+1)+5*l+(f?10:0),u+=2+l+(f?2:0));for(let _=1;_{var h;const r=2*Math.PI/e.resolution,i=-e.height/2,o=e.resolution+1,s=4*e.resolution+1+e.resolution;let u=0;const c=A.newTypedArray(e.pointType,o*3);let p=0;const l=new Uint32Array(s);c[0]=e.height/2,c[1]=0,c[2]=0,e.capping&&(l[p++]=e.resolution);for(let v=0;ve.resolution?1:v+2;Dt.buildFromRadian().translate(...e.center).rotateFromDirections([1,0,0],e.direction).apply(c);const f=((h=n[0])==null?void 0:h.initialize())||Je.newInstance();f.getPoints().setData(c,3),f.getPolys().setData(l,1),n[0]=f}}var gS={height:1,radius:.5,resolution:6,center:[0,0,0],direction:[1,0,0],capping:!0,pointType:"Float64Array"};function yh(t,e,a={}){Object.assign(e,gS,a),A.obj(t,e),A.setGet(t,e,["height","radius","resolution","capping"]),A.setGetArray(t,e,["center","direction"],3),A.algo(t,e,0,1),hS(t,e)}var dS=A.newInstance(yh,"vtkConeSource"),vS={newInstance:dS,extend:yh};function yS(t,e){e.classHierarchy.push("vtkCylinderSource"),t.requestData=(a,n)=>{var T;const r=2*Math.PI/e.resolution;let i=2*e.resolution,o=5*e.resolution;e.capping&&(i=4*e.resolution,o=7*e.resolution+2);const s=A.newTypedArray(e.pointType,i*3);let u=0;const c=new Uint32Array(o),p=new Float32Array(i*3),l=pe.newInstance({numberOfComponents:3,values:p,name:"Normals"}),f=new Float32Array(i*2),h=pe.newInstance({numberOfComponents:2,values:f,name:"TCoords"}),v=[0,0,0],m=[0,0,0],x=[0,0,0],y=[0,0,0],d=[0,0],g=[0,0],C=e.otherRadius==null?e.radius:e.otherRadius;for(let w=0;ww*-1)).apply(s),Dt.buildFromRadian().rotateFromDirections([0,1,0],e.direction).apply(p);const S=((T=n[0])==null?void 0:T.initialize())||Je.newInstance();S.getPoints().setData(s,3),S.getPolys().setData(c,1),S.getPointData().setNormals(l),S.getPointData().setTCoords(h),n[0]=S}}var mS={height:1,initAngle:0,radius:1,resolution:6,center:[0,0,0],direction:[0,1,0],capping:!0,pointType:"Float64Array"};function mh(t,e,a={}){Object.assign(e,mS,a),A.obj(t,e),A.setGet(t,e,["height","initAngle","otherRadius","radius","resolution","capping"]),A.setGetArray(t,e,["center","direction"],3),A.algo(t,e,0,1),yS(t,e)}var xS=A.newInstance(mh,"vtkCylinderSource"),CS={newInstance:xS,extend:mh},{vtkWarningMacro:SS}=A;function TS(t,e){e.classHierarchy.push("vtkLineSource"),t.requestData=(a,n)=>{const r=n[0],i=r?r.getPoints().getDataType():e.pointType,o=(r==null?void 0:r.initialize())||Je.newInstance(),s=[];if($e(e.point2,e.point1,s),xt(s)<=0){SS("Zero-length line definition");return}const u=e.resolution,c=u+1,p=A.newTypedArray(i,c*3);o.getPoints().setData(p,3);const l=new Uint32Array(c+1);o.getLines().setData(l,1);let f=0,h=0;for(let v=0;v{const r=n[0],i=r?r.getPoints().getDataType():e.pointType,o=(r==null?void 0:r.initialize())||Je.newInstance(),s=[],u=[];if($e(e.point1,e.origin,s),$e(e.point2,e.origin,u),!t.updatePlane(s,u)){DS("Bad plane definition");return}const c=e.xResolution,p=e.yResolution,l=(c+1)*(p+1),f=c*p,h=A.newTypedArray(i,l*3);o.getPoints().setData(h,3);const v=new Uint32Array(5*f);o.getPolys().setData(v,1);const m=new Float32Array(l*3),x=pe.newInstance({numberOfComponents:3,values:m,name:"Normals"});o.getPointData().setNormals(x);const y=new Float32Array(l*2),d=pe.newInstance({numberOfComponents:2,values:y,name:"TextureCoordinates"});o.getPointData().setTCoords(d);const g=new Float32Array(2);let C=0;for(let S=0;S{let n=[];if(a.length===1||Array.isArray(a[0])?n=[...a[0]]:a.length===3&&(n=[a[0],a[1],a[2]]),He(n)!==0){const r=xe(e.normal,n);let i=0;const o=[];r<1&&(r<=-1?(i=et(180),$e(e.point1,e.origin,o)):(tt(e.normal,n,o),i=Math.acos(r)),t.rotate(i,o))}},t.rotate=(a,n)=>{if(Math.abs(a){let n=[];if(a.length===1||Array.isArray(a[0])?n=[...a[0]]:a.length===3&&(n=[a[0],a[1],a[2]]),!Fa(n,e.center)){const r=[];$e(e.point1,e.origin,r);const i=[];$e(e.point2,e.origin,i);for(let o=0;o<3;o++)e.center[o]=n[o],e.origin[o]=e.center[o]-.5*(r[o]+i[o]),e.point1[o]=e.origin[o]+r[o],e.point2[o]=e.origin[o]+i[o];t.modified()}},t.setPoint1=(...a)=>{let n=[];if(a.length===1||Array.isArray(a[0])?n=[...a[0]]:a.length===3&&(n=[a[0],a[1],a[2]]),!Fa(n,e.point1)){const r=[],i=[];e.point1=[...n],$e(e.point1,e.origin,r),$e(e.point2,e.origin,i),t.updatePlane(r,i),t.modified()}},t.setPoint2=(...a)=>{let n=[];if(a.length===1||Array.isArray(a[0])?n=[...a[0]]:a.length===3&&(n=[a[0],a[1],a[2]]),!Fa(n,e.point2)){const r=[],i=[];e.point2=[...n],$e(e.point1,e.origin,r),$e(e.point2,e.origin,i),t.updatePlane(r,i),t.modified()}},t.updatePlane=(a,n)=>{for(let r=0;r<3;r++)e.center[r]=e.origin[r]+.5*(a[r]+n[r]);return tt(a,n,e.normal),He(e.normal)!==0}}var MS={xResolution:10,yResolution:10,origin:[0,0,0],point1:[1,0,0],point2:[0,1,0],pointType:"Float64Array"};function NS(t,e,a={}){Object.assign(e,MS,a),e.normal=[0,0,1],e.center=[0,0,0],A.obj(t,e),A.setGet(t,e,["xResolution","yResolution"]),A.setGetArray(t,e,["origin"],3),A.getArray(t,e,["point1","point2","normal","center"],3),A.algo(t,e,0,1),bS(t,e),t.setPoint1(e.point1),t.setPoint2(e.point2)}A.newInstance(NS,"vtkPlaneSource");function RS(t,e){e.classHierarchy.push("vtkPointSource"),t.requestData=(a,n)=>{const r=n[0],i=r?r.getPoints().getDataType():e.pointType,o=(r==null?void 0:r.initialize())||Je.newInstance(),s=e.numberOfPoints,u=A.newTypedArray(i,s*3);o.getPoints().setData(u,3);const c=new Uint32Array(s+1);o.getVerts().setData(c,1);let p,l,f,h,v;for(let m=0;m{let r=n[0];const i=r?r.getPoints().getDataType():e.pointType;r=(r==null?void 0:r.initialize())||Je.newInstance();let o=0,{thetaResolution:s}=e,u=e.startThetae.startTheta?e.endTheta:e.startTheta;c*=Math.PI/180;let p=e.startPhie.startPhi?e.endPhi:e.startPhi;l*=Math.PI/180,Math.abs(u-c)<2*Math.PI&&++s;const f=(c-u)/e.thetaResolution,h=e.startPhi<=0?1:0,v=e.phiResolution+(e.endPhi>=180?-1:0),m=e.phiResolution*s+2,x=e.phiResolution*2*e.thetaResolution;let y=0,d=A.newTypedArray(i,m*3),g=new Float32Array(m*3),C=0,S=new Uint32Array(x*5);e.startPhi<=0&&(d[y*3+0]=e.center[0],d[y*3+1]=e.center[1],d[y*3+2]=e.center[2]+e.radius,g[y*3+0]=0,g[y*3+1]=0,g[y*3+2]=1,y++,o++),e.endPhi>=180&&(d[y*3+0]=e.center[0],d[y*3+1]=e.center[1],d[y*3+2]=e.center[2]-e.radius,g[y*3+0]=0,g[y*3+1]=0,g[y*3+2]=-1,y++,o++);const T=e.phiResolution-o,w=(l-p)/(e.phiResolution-1);for(let D=0;D=180){const D=T-1+o;for(let O=0;O{const r=a[0];if(!r)return BS("Invalid or missing input"),1;const i=r.getPoints(),o=r.getPointData().getNormals(),s=t.getInputArrayToProcess(0);if(!i||!s)return jo("No data to warp",!!i,!!s),n[0]=a[0],1;const u=i.getNumberOfPoints();let c=null;const p=[0,0,1];o&&!e.useNormal?(c=(C,S)=>[S.getData()[C*3],S.getData()[C*3+1],S.getData()[C*3+2]],jo("Using data normals")):t.getXyPlane()?(c=(C,S)=>p,jo("Using x-y plane normal")):(c=(C,S)=>e.normal,jo("Using Normal instance variable"));const l=new Float32Array(u*3),f=i.getData();let h=0,v=[0,0,1],m=1;const x=s.getData(),y=s.getNumberOfComponents();for(let C=0;C1){let x=0,y=[0,0,0];const d=[0,0,0],g=h.slice(m+1,m+1+v);if(x=n(u,g,0),x!==v){let C=g[x],S=u.slice(3*C,3*(C+1)),T=g[x+1],w=u.slice(3*T,3*(T+1));if(y=w.map((E,D)=>E-S[D]),He(y),l)f=l;else{for(;++x.001){f=E,y=d;break}}if(x>=v){for(let E=0;E<3;++E)if(y[E]!==0){f[(E+2)%3]=0,f[(E+1)%3]=1,f[E]=-y[(E+1)%3]/y[E];break}}}He(f);let _=0;for(;++x0?b=Math.sqrt(b):b=0;const R=[0,0,0];for(let N=0;N<3;++N)R[N]=d[N]+y[N];He(R),tt(R,D,E),tt(y,D,R),xe(f,R)*xe(E,R)<0&&(b*=-1);for(let N=_;Ne.radiusFactor&&(P=e.radiusFactor);else if(x&&e.varyRadius===ai.VARY_RADIUS_BY_ABSOLUTE_SCALAR&&(P=x.getComponent(p[G],0),P<0))return ii("Scalar value less than zero, skipping line"),0;if(e.sidesShareVertices)for(let W=0;W{var V;const p=((V=c[0])==null?void 0:V.initialize())||Je.newInstance();c[0]=p;const l=u[0];if(!l){$S("Invalid or missing input");return}const f=l.getPoints();if(!f)return;const h=f.getNumberOfPoints();if(h<1)return;const v=l.getLines();if(!v||v.getNumberOfCells()<1)return;let m=0,x=0;const y=v.getData();let d=y[0];for(let M=0;M{const U=I%3;return e.defaultNormal[U]}):R=!0);const N=l.getPointData().getNumberOfArrays();let L=null,B=null;for(let M=0;M1&&R){const U=y.slice(M,M+d+1);r(f.getData(),U,O)}i(ne,d,I,f.getData(),C.getData(),l.getPointData(),q,T,k,W,H,X,b,ae)?(D=o(ne,d,ee,D,l.getCellData(),Y,E),Q&&s(ne,d,I,f.getData(),k,Q.getData())):ii("Could not generate points"),ne=a(ne,d),ee++}p.setPoints(C),p.setStrips(E),p.setPointData(q),q.setNormals(w)}}var KS={outputPointsPrecision:hr.DEFAULT,radius:.5,varyRadius:ai.VARY_RADIUS_OFF,numberOfSides:3,radiusFactor:10,defaultNormal:[0,0,1],useDefaultNormal:!1,sidesShareVertices:!0,capping:!1,onRatio:1,offset:0,generateTCoords:kr.TCOORDS_OFF,textureLength:1};function XS(t,e,a={}){Object.assign(e,KS,a),A.setGet(t,e,["outputPointsPrecision","radius","varyRadius","numberOfSides","radiusFactor","defaultNormal","useDefaultNormal","sidesShareVertices","capping","onRatio","offset","generateTCoords","textureLength"]),A.obj(t,e),A.algo(t,e,1,1),HS(t,e)}A.newInstance(XS,"vtkTubeFilter");var{vtkErrorMacro:Ch,vtkDebugMacro:qS}=A,gc=()=>(Ch("LiteHttpDataAccessHelper does not support compression. Need to register HttpDataAccessHelper instead."),Promise.reject(new Error("LiteHttpDataAccessHelper does not support compression. Need to register HttpDataAccessHelper instead."))),ua=0;function $o(t,e,a={}){const n=new XMLHttpRequest;return n.open(t,e,!0),a.headers&&Object.entries(a.headers).forEach(([r,i])=>n.setRequestHeader(r,i)),a.progressCallback&&n.addEventListener("progress",a.progressCallback),n}function YS(t,e={}){return new Promise((a,n)=>{const r=$o("GET",t,e);r.onreadystatechange=i=>{r.readyState===4&&(r.status===200||r.status===0?a(r.response):n({xhr:r,e:i}))},r.responseType="arraybuffer",r.send()})}function JS(t,e,a,n={}){return n&&n.compression?gc():a.ref&&!a.ref.pending?new Promise((r,i)=>{const o=$o("GET",[e,a.ref.basepath,a.ref.id].join("/"),n);o.onreadystatechange=s=>{o.readyState===1&&(a.ref.pending=!0,++ua===1&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!0)),o.readyState===4&&(a.ref.pending=!1,o.status===200||o.status===0?(a.buffer=o.response,a.ref.encode==="JSON"?a.values=JSON.parse(a.buffer):(kn.ENDIANNESS!==a.ref.encode&&kn.ENDIANNESS&&(qS(`Swap bytes of ${a.name}`),kn.swapBytes(a.buffer,Bi[a.dataType])),a.values=A.newTypedArray(a.dataType,a.buffer)),a.values.length!==a.size&&Ch(`Error in FetchArray: ${a.name}, does not have the proper array size. Got ${a.values.length}, instead of ${a.size}`),delete a.ref,--ua===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),t!=null&&t.modified&&t.modified(),r(a)):i({xhr:o,e:s}))},o.responseType=a.dataType!=="string"?"arraybuffer":"text",o.send()}):Promise.resolve(a)}function ZS(t,e,a={}){return a&&a.compression?gc():new Promise((n,r)=>{const i=$o("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++ua===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--ua===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?n(JSON.parse(i.responseText)):r({xhr:i,e:o}))},i.responseType="text",i.send()})}function QS(t,e,a={}){return a&&a.compression?gc():new Promise((n,r)=>{const i=$o("GET",e,a);i.onreadystatechange=o=>{i.readyState===1&&++ua===1&&t!=null&&t.invokeBusy&&t.invokeBusy(!0),i.readyState===4&&(--ua===0&&(t!=null&&t.invokeBusy)&&t.invokeBusy(!1),i.status===200||i.status===0?n(i.responseText):r({xhr:i,e:o}))},i.responseType="text",i.send()})}function eT(t,e,a={}){return new Promise((n,r)=>{const i=new Image;a.crossOrigin&&(i.crossOrigin=a.crossOrigin),i.onload=()=>n(i),i.onerror=r,i.src=e})}var tT={fetchArray:JS,fetchJSON:ZS,fetchText:QS,fetchBinary:YS,fetchImage:eT};ah("http")||Po("http",t=>tT);function Sh(t){return new TextDecoder("latin1").decode(t)}function nT(t,e,a=null){const n=Sh(t),r=e.exec(n);if(!r)return{text:n};const i=r.index+r[0].length,o=n.substring(0,i);let s=null;const u=a?a.exec(n):null;return u?s={text:o+n.substr(u.index),binaryBuffer:t.slice(i,u.index)}:s={text:o,binaryBuffer:t.slice(i)},s}var oi={arrayBufferToString:Sh,extractBinary:nT},dc={ASCII:"ascii",BINARY_BIG_ENDIAN:"binary_big_endian",BINARY_LITTLE_ENDIAN:"binary_little_endian"},Th={diffuse_red:"red",diffuse_green:"green",diffuse_blue:"blue"},wh={patternHeader:/ply([\s\S]*)end_header\r?\n/,patternBody:/end_header\s([\s\S]*)$/};function _h(t){let e="",a=0;const n=wh.patternHeader.exec(t);n!==null&&(e=n[1],a=n[0].length);const r={comments:[],elements:[],headerLength:a},i=e.split(` +`);let o,s,u;for(let c=0;cg.name==="vertex"),i=e.find(g=>g.name==="face");let o=0,s=0;r&&(o=r.count),i&&(s=i.count);let u=new Float32Array(o*3),c=new Uint8Array(o*3),p=new Float32Array(o*2),l=new Float32Array(o*3);const f=t.colors.length>0,h=t.uvs.length>0,v=t.normals.length>0,m=t.faceVertexUvs.length>0,x=new Map;let y=o;for(let g=0;g0){let g=0,C=0;if(n){const S=[],T=[],w=[],_=[];for(let E=0;Ea||Math.abs(L[1]-N[1])>a){const B=`${N[0]},${N[1]}`;let P=-1;if(x.has(B)){const F=x.get(B);for(let k=0,G=F.length;k0){const E=o+S.length/3,D=new Float32Array(E*3),O=new Float32Array(E*2),b=f?new Uint8Array(E*3):null,R=v?new Float32Array(E*3):null;D.set(u),O.set(p),f&&b&&b.set(c),v&&R&&R.set(l),D.set(S,o*3),O.set(_,o*2),f&&b&&b.set(T,o*3),v&&R&&R.set(w,o*3),u=D,p=O,f&&(c=b),v&&(l=R)}}else for(let S=0;S0)d.getPolys().setData(Uint32Array.from(t.indices));else{const g=new Uint32Array(o*2);for(let C=0;C0&&(t.indices.push(n.length),n.forEach((i,o)=>{t.indices.push(i)})),t.faceVertexUvs.push(r)}}function yc(t,e,a,n){let r;switch(a){case"int8":case"char":r=[t.getInt8(e),1];break;case"uint8":case"uchar":r=[t.getUint8(e),1];break;case"int16":case"short":r=[t.getInt16(e,n),2];break;case"uint16":case"ushort":r=[t.getUint16(e,n),2];break;case"int32":case"int":r=[t.getInt32(e,n),4];break;case"uint32":case"uint":r=[t.getUint32(e,n),4];break;case"float32":case"float":r=[t.getFloat32(e,n),4];break;case"float64":case"double":r=[t.getFloat64(e,n),8];break;default:console.log("Unsupported type");break}return r}function aT(t,e,a,n){const r={};let i,o=0;for(let s=0;s{e.url=n;const i=n.split("/");return i.pop(),e.baseURL=i.join("/"),e.compression=r.compression,t.loadData({progressCallback:r.progressCallback,binary:!!r.binary})},t.loadData=(n={})=>a(e.url,n).then(t.parse),t.parse=n=>{typeof n=="string"?t.parseAsText(n):t.parseAsArrayBuffer(n)},t.parseAsArrayBuffer=n=>{if(!n)return;if(n!==e.parseData)t.modified();else return;let r=n;n instanceof ArrayBuffer&&(r=oi.arrayBufferToString(n));const i=_h(r);if(i.format===dc.ASCII){t.parseAsText(r);return}e.parseData=n;const o={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},s=i.format===dc.BINARY_LITTLE_ENDIAN,u=n instanceof ArrayBuffer?n:n.buffer,c=new DataView(u,i.headerLength);let p,l=0;for(let h=0;h{if(!n)return;if(n!==e.parseData)t.modified();else return;e.parseData=n;let r=n;n instanceof ArrayBuffer&&(r=oi.arrayBufferToString(n));const i=_h(r);if(i.format!==dc.ASCII){t.parseAsArrayBuffer(n);return}const o={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},s=wh.patternBody.exec(r);let u="";s!==null&&(u=s[1]);const c=u.split(` +`);let p=0,l=0;for(let h=0;h=i.elements[p].count&&(p++,l=0);const m=rT(i.elements[p].properties,v);Dh(o,i.elements[p].name,m),l++}}const f=Eh(o,i.elements,e.faceTextureTolerance,e.duplicatePointsForFaceTexture);e.output[0]=f},t.requestData=(n,r)=>{t.parse(e.parseData)}}var oT={faceTextureTolerance:1e-6,duplicatePointsForFaceTexture:!0};function sT(t,e,a={}){Object.assign(e,oT,a),A.obj(t,e),A.get(t,e,["url","baseURL","duplicatePointsForFaceTexture","faceTextureTolerance"]),A.setGet(t,e,["dataAccessHelper"]),A.algo(t,e,0,1),iT(t,e),e.compression||(e.compression=null),e.progressCallback||(e.progressCallback=null)}A.newInstance(sT,"vtkPLYReader");function cT(t,e){e.classHierarchy.push("vtkLocator")}var uT={dataSet:null,maxLevel:8,level:8,automatic:!1,tolerance:0,useExistingSearchStructure:!1};function lT(t,e,a={}){Object.assign(e,uT,a),A.obj(t,e),A.get(t,e,["level"]),A.setGet(t,e,["dataSet","maxLevel","automatic","tolerance","useExistingSearchStructure"]),cT(t,e)}var fT={extend:lT};function pT(t,e){e.classHierarchy.push("vtkAbstractPointLocator")}function hT(t){return{bounds:null,numberOfBuckets:0,...t}}function gT(t,e,a={}){fT.extend(t,e,hT(a)),A.obj(t,e),A.get(t,e,["numberOfBuckets"]),A.setGetArray(t,e,["bounds"],6),pT(t,e)}var dT={extend:gT},{vtkErrorMacro:Ho}=A;function vT(t,e){e.classHierarchy.push("vtkPointLocator");function a(o,s){const u=[s[0]*e.HX+e.BX,(s[0]+1)*e.HX+e.BX,s[1]*e.HY+e.BY,(s[1]+1)*e.HY+e.BY,s[2]*e.HZ+e.BZ,(s[2]+1)*e.HZ+e.BZ];return de.distance2ToBounds(o,u)}function n(o,s,u){const c=[];if(u===0)return c.push([...o]),c;const p=[],l=[];for(let f=0;f<3;f++){const h=o[f]-u,v=o[f]+u;p[f]=h>0?h:0,l[f]=v{const s=Math.floor((o[0]-e.BX)*e.FX),u=Math.floor((o[1]-e.BY)*e.FY),c=Math.floor((o[2]-e.BZ)*e.FZ),p=[];return p[0]=Math.max(0,Math.min(s,e.XD-1)),p[1]=Math.max(0,Math.min(u,e.YD-1)),p[2]=Math.max(0,Math.min(c,e.ZD-1)),p},t.getBucketIndex=o=>i(t.getBucketIndices(o)),t.buildLocator=()=>{e.level=1;const o=e.dataSet.getBounds(),s=e.dataSet.getNumberOfPoints();let u=Math.ceil(s/e.numberOfPointsPerBucket);const c=[0,0,0],p=de.newInstance();if(p.setBounds(o),e.automatic)p.computeDivisions(u,c,e.bounds);else{e.bounds=p.inflate();for(let l=0;l<3;l++)c[l]=Math.max(1,e.divisions[l])}e.divisions=c,u=c[0]*c[1]*c[2],e.numberOfBuckets=u;for(let l=0;l<3;++l)e.H[l]=(e.bounds[2*l+1]-e.bounds[2*l])/c[l];e.hashTable.clear(),t.computePerformanceFactors();for(let l=0;l{e.points=null,t.freeSearchStructure()},t.initPointInsertion=(o,s,u=0)=>{if(o==null)return Ho("A valid vtkPoints object is required for point insertion"),!1;if(!s||s.length!==6)return Ho("A valid bounds array of length 6 is required"),!1;if(!o)return Ho("A valid vtkPoints is required for point insertion"),!1;t.freeSearchStructure(),e.insertionPointId=0,e.points=o,e.points.setNumberOfComponents(3),e.points.initialize();let c=0;const p=[0,0,0],l=de.newInstance();if(l.setBounds(s),e.automatic&&u>0)c=Math.ceil(u/e.numberOfPointsPerBucket),l.computeDivisions(c,p,e.bounds);else{e.bounds=l.inflate();for(let v=0;v<3;v++)p[v]=Math.max(1,e.divisions[v])}e.divisions=p,c=p[0]*p[1]*p[2],e.numberOfBuckets=c;for(let v=0;v<3;++v)e.H[v]=(e.bounds[2*v+1]-e.bounds[2*v])/p[v];e.insertionTol2=e.tolerance*e.tolerance;let f=0,h=Number.MAX_VALUE;for(let v=0;v<3;v++)h=e.H[v]e.divisions[v]?f:e.divisions[v];return e.insertionLevel=Math.ceil(e.tolerance/h),e.insertionLevel=e.insertionLevel>f?f:e.insertionLevel,t.computePerformanceFactors(),!0},t.insertPoint=(o,s)=>{const u=t.getBucketIndex(s);return e.hashTable.has(u)||e.hashTable.set(u,[]),e.hashTable.get(u).push(o),e.points.insertPoint(o,s),{inserted:!0,id:o}},t.insertNextPoint=o=>{const s=t.getBucketIndex(o);return e.hashTable.has(s)||e.hashTable.set(s,[]),e.hashTable.get(s).push(e.insertionPointId),e.points.insertPoint(e.insertionPointId,o),{inserted:!0,id:e.insertionPointId++}},t.insertUniquePoint=o=>{const s=t.isInsertedPoint(o);return s>-1?{inserted:!1,id:s}:t.insertNextPoint(o)},t.isInsertedPoint=o=>{const s=t.getBucketIndices(o),u=e.insertionLevel??1,c=e.divisions;for(let p=0;p<=u;p++){const l=n(s,c,p);for(let f=0;f{t.buildLocator();const s=t.getBucketIndices(o),u=e.divisions;let c=Number.MAX_VALUE,p=-1;const l=Math.max(...u);for(let f=0;f{t.buildLocator();let c=-1;const p=o*o;let l=1.01*p,f=-1;const h=t.getBucketIndices(s),v=i(h),m=e.hashTable.get(v);if(m)for(let C=0;CS&&(x=S,y=S*S)}const d=[0,0,0];for(let C=0;C<3;C++)d[C]=Math.floor(x/e.H[C]),d[C]>e.divisions[C]/2&&(d[C]=Math.floor(e.divisions[C]/2));let g=Math.max(...d);g===0&&(g=1);for(let C=g;C>=1;C--){const S=x,T=r(s,h,x/C,C);for(let w=0;w2&&(C=Math.floor(C*(x/S))+1,C<2&&(C=2))}return c!==-1&&l<=o*o?f=l:c=-1,{id:c,dist2:f}},t.findClosestInsertedPoint=o=>{for(let m=0;m<3;m++)if(o[m]e.bounds[2*m+1])return-1;const s=t.getBucketIndices(o),u=e.divisions;let c=-1,p=Number.MAX_VALUE,l=0;const f=Math.max(u[0],u[1],u[2]),h=e.points;for(;c===-1&&lx[d]?x[d]+1:x[d],C=e.bounds[2*d]+g*e.H[d]-o[d];y+=C*C}if(y{t.buildLocator();const s=t.getBucketIndex(o),u=e.hashTable.get(s);return u||[]},t.freeSearchStructure=()=>{e.hashTable.clear(),e.points=kt.newInstance(),e.divisions=[50,50,50],Ze.uninitializeBounds(e.bounds)},t.computePerformanceFactors=()=>{e.HX=e.H[0],e.HY=e.H[1],e.HZ=e.H[2],e.FX=1/e.H[0],e.FY=1/e.H[1],e.FZ=1/e.H[2],e.BX=e.bounds[0],e.BY=e.bounds[2],e.BZ=e.bounds[4],e.XD=e.divisions[0],e.YD=e.divisions[1],e.ZD=e.divisions[2],e.sliceSize=e.divisions[0]*e.divisions[1]},t.generateRepresentation=o=>{if(!e.hashTable||e.hashTable.size===0){Ho("Can't build representation, no data provided!");return}const s=[];s.length=4;function u(v,m,x,y,d,g){const C=e.bounds[0]+m*e.HX,S=e.bounds[2]+x*e.HY,T=e.bounds[4]+y*e.HZ,w=C+e.HX,_=S+e.HY,E=T+e.HZ;v===0?(s[0]=[C,S,T],s[1]=[C,_,T],s[2]=[C,_,E],s[3]=[C,S,E]):v===1?(s[0]=[C,S,T],s[1]=[w,S,T],s[2]=[w,S,E],s[3]=[C,S,E]):v===2&&(s[0]=[C,S,T],s[1]=[w,S,T],s[2]=[w,_,T],s[3]=[C,_,T]);const D=s.map(O=>d.insertNextPoint(...O));g.insertNextCell([D[0],D[1],D[2],D[3]])}const c=kt.newInstance();c.allocate(5e3);const p=Mn.newInstance();p.allocate(2048);const l=e.divisions,f=l[0]*l[1];function h(v,m,x){if(v<0||v>=l[0]||m<0||m>=l[1]||x<0||x>=l[2])return!1;const y=v+m*l[0]+x*f;return e.hashTable.has(y)}for(let v=0;v=l[0]&&d&&u(0,x+1,m,v,c,p),m+1>=l[1]&&d&&u(1,x,m+1,v,c,p),v+1>=l[2]&&d&&u(2,x,m,v+1,c,p)}o.setPoints(c),o.setPolys(p)}}function yT(t){return{divisions:[50,50,50],numberOfPointsPerBucket:3,bounds:[0,0,0,0,0,0],tolerance:.001,automatic:!0,...t}}function Oh(t,e,a={}){dT.extend(t,e,yT(a)),A.setGet(t,e,["numberOfPointsPerBucket","points"]),A.setGetArray(t,e,["divisions"],3),Ze.uninitializeBounds(e.bounds),e.points=e.points||kt.newInstance(),e.hashTable=new Map,e.H=[0,0,0],e.insertionPointId=0,e.insertionTol2=1e-4,e.insertionLevel=0,vT(t,e)}var mT=A.newInstance(Oh,"vtkPointLocator"),xT={newInstance:mT,extend:Oh},{vtkErrorMacro:CT}=A;function bh(t,e,a){const n=e.getData();for(let r=0;r{const n=t.getBucketIndex(a),r=e.hashTable.get(n);return r?bh(r,e.points,a):-1},t.insertUniquePoint=a=>{if(!a||a.length!==3)return CT("Point must be a Vector3."),{inserted:!1,id:-1};const n=t.getBucketIndex(a);let r=e.hashTable.get(n),i=null;if(r!==void 0){const o=bh(r,e.points,a);if(o!==-1)return i=o,{inserted:!1,id:i}}else r=[],e.hashTable.set(n,r);return r.push(e.insertionPointId),e.points.insertNextPoint(...a),i=e.insertionPointId++,{inserted:!0,id:i}}}function TT(t){return{...t}}function Mh(t,e,a={}){xT.extend(t,e,TT(a)),A.obj(t,e),ST(t,e)}var wT=A.newInstance(Mh,"vtkMergePoints"),_T={newInstance:wT,extend:Mh},{vtkErrorMacro:mc,vtkWarningMacro:ET}=A;function DT(t){const e=t.split(" ").filter(n=>n.indexOf("=")>-1),a={};for(let n=0;nc).slice(-3).map(Number),r);t[e+s].indexOf("vertex")!==-1;)Nh(t[e+s].split(/[ \t]+/).filter(c=>c).slice(-3).map(Number),a),o++,s++;n.push(o);for(let c=0;c=0&&l.setTolerance(10**-r),l.initPointInsertion(p,i.getBounds(),Math.floor(o.length/3/2));const f=[],h=[];for(let m=0,x=0;m{e.url=r;const o=r.split("/");return o.pop(),e.baseURL=o.join("/"),t.loadData(i)},t.loadData=(r={})=>a(e.url,r).then(t.parse),t.parse=r=>{typeof r=="string"?t.parseAsText(r):t.parseAsArrayBuffer(r)},t.parseAsArrayBuffer=r=>{if(!r)return;if(r!==e.parseData)t.modified();else return;e.parseData=r;let i=!1;if(i=84+new DataView(r,0,84).getUint32(80,!0)*50===r.byteLength,!i){t.parseAsText(oi.arrayBufferToString(r));return}const o=r.slice(0,80),s=DT(oi.arrayBufferToString(o)),u=new DataView(r,84),c=(r.byteLength-84)/50,p=new Float32Array(c*9),l=new Float32Array(c*3),f=new Uint32Array(c*4),h=new Uint16Array(c);let v=0;for(let y=0;y=0&&n(e.removeDuplicateVertices)},t.parseAsText=r=>{if(!r)return;if(r!==e.parseData)t.modified();else return;e.parseData=r;const i=r.split(` +`);let o=1;const s=[],u=[],c=[];for(;o!==-1;)o=OT(i,o,s,u,c);const p=Je.newInstance();p.getPoints().setData(Float32Array.from(s),3),p.getPolys().setData(Uint32Array.from(u)),p.getCellData().setNormals(pe.newInstance({name:"Normals",values:Float32Array.from(c),numberOfComponents:3})),e.output[0]=p,e.merging&&e.removeDuplicateVertices>=0&&n(e.removeDuplicateVertices)},t.requestData=(r,i)=>{t.parse(e.parseData)}}var MT={merging:!0,removeDuplicateVertices:-1};function NT(t,e,a={}){Object.assign(e,MT,a),A.obj(t,e),A.get(t,e,["url","baseURL"]),A.setGet(t,e,["dataAccessHelper","locator","merging","removeDuplicateVertices"]),A.algo(t,e,0,1),bT(t,e),e.compression||(e.compression=null),e.progressCallback||(e.progressCallback=null)}A.newInstance(NT,"vtkSTLReader");function RT(t,e){e.classHierarchy.push("vtkElevationReader"),e.dataAccessHelper||(e.dataAccessHelper=oa.get("http"));function a(n,r){return e.dataAccessHelper.fetchText(t,n,r)}t.setUrl=(n,r)=>(e.url=n,t.loadData(r)),t.loadData=n=>a(e.url,n).then(r=>(t.parseAsText(r),!0)),t.parseAsText=n=>{e.csv=n,e.elevation=[],e.csv.split(` +`).forEach((r,i)=>{e.elevation.push(r.split(",").map(o=>Number(o)))}),t.modified()},t.requestData=(n,r)=>{const i=Je.newInstance();if(i.getPoints().setData(new Float32Array(0,0,0,1,1,1),3),e.elevation){const o=e.elevation.length,s=e.elevation[0].length,u=i.getPoints();u.setNumberOfPoints(s*o,3);const c=u.getData(),p=Mn.newInstance({size:5*(s-1)*(o-1)});i.setPolys(p);const l=p.getData();let f=0;const h=new Float32Array(s*o*2),v=pe.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(v);for(let m=0;m0&&m>0&&(l[f++]=4,l[f++]=y,l[f++]=y-1,l[f++]=y-1-s,l[f++]=y-s)}}e.output[0]=i},t.isBusy=()=>!!e.requestCount}var LT={origin:[0,0,0],xSpacing:1,ySpacing:1,zScaling:1,xDirection:1,yDirection:-1,requestCount:0};function FT(t,e,a={}){Object.assign(e,LT,a),A.obj(t,e),A.get(t,e,["url"]),A.setGet(t,e,["dataAccessHelper","xSpacing","ySpacing","zScaling","xDirection","yDirection"]),A.algo(t,e,0,1),A.event(t,e,"busy"),RT(t,e)}A.newInstance(FT,"vtkElevationReader");var Re={};function xc(t,e,a,n,r){for(let i=0;iNumber(i));let a=e[0]-1;a=a<0?a+1+Re.v.length/3:a;let n=e[1]?e[1]-1:a;n=n<0?n+1+Re.vt.length/2:n;let r=e[2]?e[2]-1:a;return r=r<0?r+1+Re.vn.length/3:r,[a,n,r]}function VT(t){if(t[0]==="#")return;const e=t.split(/[ \t]+/);if(e[0]===Re.splitOn)e.shift(),Re.pieces.push(e.join(" ").trim()),Re.f.push([]),Re.size++;else if(e[0]==="v")Re.v.push(Number(e[1])),Re.v.push(Number(e[2])),Re.v.push(Number(e[3]));else if(e[0]==="vt")Re.vt.push(Number(e[1])),Re.vt.push(Number(e[2]));else if(e[0]==="vn")Re.vn.push(Number(e[1])),Re.vn.push(Number(e[2])),Re.vn.push(Number(e[3]));else if(e[0]==="f"){Re.size===0&&Re.size++;const a=Re.f[Re.size-1];e.shift();const n=e.filter(i=>i.length>0&&i!=="\r"),r=n.length;a.push(r);for(let i=0;i1?o+d:g;for(let S=1;S{if(n.indexOf(".obj")===-1&&!r.fullpath)e.baseURL=n,e.url=`${n}/index.obj`;else{e.url=n;const i=n.split("/");i.pop(),e.baseURL=i.join("/")}return t.loadData(r)},t.loadData=(n={})=>a(e.url,n).then(r=>t.isDeleted()?!1:t.parseAsText(r)),t.parseAsText=n=>(n&&(n!==e.parseData&&t.modified(),e.parseData=n,e.numberOfOutputs=0,kT(e.splitMode),n.split(` +`).forEach(VT),BT(e)),!0),t.requestData=(n,r)=>{t.parseAsText(e.parseData)},t.isBusy=()=>!!e.requestCount,t.getNumberOfOutputPorts=()=>e.numberOfOutputs}var GT={numberOfOutputs:1,requestCount:0,splitMode:null,trackDuplicates:!1};function IT(t,e,a={}){Object.assign(e,GT,a),A.obj(t,e),A.get(t,e,["url","baseURL"]),A.setGet(t,e,["dataAccessHelper","splitMode","trackDuplicates"]),A.algo(t,e,0,1),A.event(t,e,"busy"),UT(t,e)}A.newInstance(IT,"vtkOBJReader");var PT=["chemical json","name","inchi","formula","atoms","bonds","properties"];function zT(t,e){e.classHierarchy.push("vtkMolecule")}var WT={"chemical json":0,name:"",inchi:"",formula:"",atoms:null,bonds:null,properties:null};function Rh(t,e,a={}){Object.assign(e,WT,a),A.obj(t,e),e.atoms||(e.atoms={}),e.bonds||(e.bonds={}),e.properties||(e.properties={}),A.setGet(t,e,PT),zT(t,e)}var jT=A.newInstance(Rh,"vtkMolecule"),$T={newInstance:jT,extend:Rh},HT={H:[1],He:[2],Li:[3],Be:[4],B:[5],C:[6],N:[7],O:[8],F:[9],Ne:[10],Na:[11],Mg:[12],Al:[13],Si:[14],P:[15],S:[16],Cl:[17],Ar:[18],K:[19],Ca:[20],Sc:[21],Ti:[22],V:[23],Cr:[24],Mn:[25],Fe:[26],Co:[27],Ni:[28],Cu:[29],Zn:[30],Ga:[31],Ge:[32],As:[33],Se:[34],Br:[35],Kr:[36],Rb:[37],Sr:[38],Y:[39],Zr:[40],Nb:[41],Mo:[42],Tc:[43],Ru:[44],Rh:[45],Pd:[46],Ag:[47],Cd:[48],In:[49],Sn:[50],Sb:[51],Te:[52],I:[53],Xe:[54],Cs:[55],Ba:[56],La:[57],Ce:[58],Pr:[59],Nd:[60],Pm:[61],Sm:[62],Eu:[63],Gd:[64],Tb:[65],Dy:[66],Ho:[67],Er:[68],Tm:[69],Yb:[70],Lu:[71],Hf:[72],Ta:[73],W:[74],Re:[75],Os:[76],Ir:[77],Pt:[78],Au:[79],Hg:[80],Tl:[81],Pb:[82],Bi:[83],Po:[84],At:[85],Rn:[86],Fr:[87],Ra:[88],Ac:[89],Th:[90],Pa:[91],U:[92],Np:[93],Pu:[94],Am:[95],Cm:[96],Bk:[97],Cf:[98],Es:[99],Fm:[100],Md:[101],No:[102],Lr:[103],Rf:[104],Db:[105],Sg:[106],Bh:[107],Hs:[108],Mt:[109],Ds:[110],Rg:[111],Cn:[112],Uut:[113],Uuq:[114],Uup:[115],Uuh:[116],Uus:[117],Uuo:[118]};function KT(t,e){e.classHierarchy.push("vtkPDBReader"),e.dataAccessHelper||(e.dataAccessHelper=oa.get("http"));function a(n,r){return e.dataAccessHelper.fetchText(t,n,r)}t.setUrl=(n,r)=>{if(n.indexOf(".pdb")===-1)e.baseURL=n,e.url=`${n}`;else{e.url=n;const i=n.split("/");i.pop(),e.baseURL=i.join("/")}return t.loadData(r)},t.loadData=n=>a(e.url,n).then(t.parseAsText),t.parseAsText=n=>(e.pdb=n,e.molecule=[],e.molecule=e.pdb.split(` +`),t.modified(),!0),t.requestData=(n,r)=>{const i=$T.newInstance();if(e.molecule){const o=e.molecule.length,s=[],u=[];e.numberOfAtoms=0;let c=0;for(;c=78&&(y=l.substr(76,2).replace(/\s+/g,"")),y===""&&(y=h.substr(0,2).replace(/\d/g,"")),s.push(v),s.push(m),s.push(x);const[d]=HT[y];u.push(d),e.numberOfAtoms++}c++}i.getAtoms().elements={},i.getAtoms().elements.number=Int8Array.from(u),i.getAtoms().coords={},i.getAtoms().coords["3d"]=Float32Array.from(s)}e.output[0]=i},t.isBusy=()=>!!e.requestCount}var XT={numberOfAtoms:0,requestCount:0};function qT(t,e,a={}){Object.assign(e,XT,a),A.obj(t,e),A.get(t,e,["url","baseURL","numberOfAtoms","requestCount"]),A.setGet(t,e,["dataAccessHelper"]),A.algo(t,e,0,1),A.event(t,e,"busy"),KT(t,e)}A.newInstance(qT,"vtkPDBReader");function YT(t,e){e.classHierarchy.push("vtkStringArray"),t.getComponent=(a,n=0)=>e.values[a*e.numberOfComponents+n],t.setComponent=(a,n,r)=>{r!==e.values[a*e.numberOfComponents+n]&&(e.values[a*e.numberOfComponents+n]=r,t.modified())},t.getData=()=>e.values,t.getTuple=(a,n=[])=>{const r=e.numberOfComponents||1;n.length&&(n.length=r);const i=a*r;for(let o=0;oa*e.numberOfComponents,t.getNumberOfComponents=()=>e.numberOfComponents,t.getNumberOfValues=()=>e.values.length,t.getNumberOfTuples=()=>e.values.length/e.numberOfComponents,t.getDataType=()=>e.dataType,t.newClone=()=>Fh({name:e.name,numberOfComponents:e.numberOfComponents,empty:!0}),t.getName=()=>(e.name||t.setName(`vtkStringArray${t.getMTime()}`),e.name),t.setData=(a,n)=>{e.values=a,e.size=a.length,n&&(e.numberOfComponents=n),e.size%e.numberOfComponents!==0&&(e.numberOfComponents=1),t.modified()}}var JT={name:"",numberOfComponents:1,size:0,dataType:"string"};function Lh(t,e,a={}){if(Object.assign(e,JT,a),!e.empty&&!e.values&&!e.size)throw new TypeError("Cannot create vtkStringArray object without: size > 0, values");e.values?Array.isArray(e.values)&&(e.values=[...e.values]):e.values=[],e.values&&(e.size=e.values.length),A.obj(t,e),A.set(t,e,["name"]),YT(t,e)}var Fh=A.newInstance(Lh,"vtkStringArray"),ZT={newInstance:Fh,extend:Lh},Cc={},QT={get exports(){return Cc},set exports(t){Cc=t}};(function(t,e){(function(a,n){t.exports=n()})(Vt,function(){return function(a){var n={};function r(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return a[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=a,r.c=n,r.d=function(i,o,s){r.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:s})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,o){if(1&o&&(i=r(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var u in i)r.d(s,u,function(c){return i[c]}.bind(null,u));return s},r.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(o,"a",o),o},r.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},r.p="",r(r.s=184)}([function(a,n,r){function i(o){for(var s in o)n.hasOwnProperty(s)||(n[s]=o[s])}Object.defineProperty(n,"__esModule",{value:!0}),i(r(240)),i(r(251)),i(r(175)),i(r(107)),i(r(29)),i(r(73)),i(r(106)),i(r(30)),i(r(252)),i(r(52)),i(r(97)),i(r(253)),i(r(37)),i(r(51)),i(r(173)),i(r(176)),i(r(172)),i(r(108)),i(r(254)),i(r(255)),i(r(256)),i(r(72)),i(r(177)),i(r(105)),i(r(17)),i(r(257)),i(r(12)),i(r(174))},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),function(i){i[i.Before=0]="Before",i[i.Equal=1]="Equal",i[i.After=2]="After"}(n.BoundaryPosition||(n.BoundaryPosition={})),function(i){i[i.None=0]="None",i[i.Capturing=1]="Capturing",i[i.AtTarget=2]="AtTarget",i[i.Bubbling=3]="Bubbling"}(n.EventPhase||(n.EventPhase={})),function(i){i[i.Element=1]="Element",i[i.Attribute=2]="Attribute",i[i.Text=3]="Text",i[i.CData=4]="CData",i[i.EntityReference=5]="EntityReference",i[i.Entity=6]="Entity",i[i.ProcessingInstruction=7]="ProcessingInstruction",i[i.Comment=8]="Comment",i[i.Document=9]="Document",i[i.DocumentType=10]="DocumentType",i[i.DocumentFragment=11]="DocumentFragment",i[i.Notation=12]="Notation"}(n.NodeType||(n.NodeType={})),function(i){i[i.Disconnected=1]="Disconnected",i[i.Preceding=2]="Preceding",i[i.Following=4]="Following",i[i.Contains=8]="Contains",i[i.ContainedBy=16]="ContainedBy",i[i.ImplementationSpecific=32]="ImplementationSpecific"}(n.Position||(n.Position={})),function(i){i[i.Accept=1]="Accept",i[i.Reject=2]="Reject",i[i.Skip=3]="Skip"}(n.FilterResult||(n.FilterResult={})),function(i){i[i.All=4294967295]="All",i[i.Element=1]="Element",i[i.Attribute=2]="Attribute",i[i.Text=4]="Text",i[i.CDataSection=8]="CDataSection",i[i.EntityReference=16]="EntityReference",i[i.Entity=32]="Entity",i[i.ProcessingInstruction=64]="ProcessingInstruction",i[i.Comment=128]="Comment",i[i.Document=256]="Document",i[i.DocumentType=512]="DocumentType",i[i.DocumentFragment=1024]="DocumentFragment",i[i.Notation=2048]="Notation"}(n.WhatToShow||(n.WhatToShow={})),function(i){i[i.StartToStart=0]="StartToStart",i[i.StartToEnd=1]="StartToEnd",i[i.EndToEnd=2]="EndToEnd",i[i.EndToStart=3]="EndToStart"}(n.HowToCompare||(n.HowToCompare={}))},function(a,n,r){var i=this&&this.__values||function(g){var C=typeof Symbol=="function"&&Symbol.iterator,S=C&&g[C],T=0;if(S)return S.call(g);if(g&&typeof g.length=="number")return{next:function(){return g&&T>=g.length&&(g=void 0),{value:g&&g[T++],done:!g}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(212);n.FixedSizeSet=o.FixedSizeSet;var s=r(213);n.ObjectCache=s.ObjectCache;var u=r(214);n.CompareCache=u.CompareCache;var c=r(215);n.Lazy=c.Lazy;var p=r(216);function l(g,C,S){if(y(g))g.forEach(function(w,_){return C.call(S,_,w)});else for(var T in g)g.hasOwnProperty(T)&&C.call(S,T,g[T])}function f(g){var C,S;if(h(g))return g;if(m(g)){var T=[];try{for(var w=i(g),_=w.next();!_.done;_=w.next()){var E=_.value;T.push(f(E))}}catch(b){C={error:b}}finally{try{_&&!_.done&&(S=w.return)&&S.call(w)}finally{if(C)throw C.error}}return T}if(v(g)){T={};for(var D in g)if(g.hasOwnProperty(D)){var O=g[D];T[D]=f(O)}return T}return g}function h(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"}function v(g){var C=typeof g;return!!g&&(C==="function"||C==="object")}function m(g){return Array.isArray(g)}function x(g){return g instanceof Set}function y(g){return g instanceof Map}function d(g){if(v(g)){var C=Object.getPrototypeOf(g),S=C.constructor;return C&&S&&typeof S=="function"&&S instanceof S&&Function.prototype.toString.call(S)===Function.prototype.toString.call(Object)}return!1}n.StringWalker=p.StringWalker,n.applyMixin=function(g,C){for(var S=[],T=2;T>6|192;else{if(w>55295&&w<56320){if(++T>=g.length)throw new Error("Incomplete surrogate pair.");var _=g.charCodeAt(T);if(_<56320||_>57343)throw new Error("Invalid surrogate character.");w=65536+((1023&w)<<10)+(1023&_),C[S++]=w>>18|240,C[S++]=w>>12&63|128}else C[S++]=w>>12|224;C[S++]=w>>6&63|128}C[S++]=63&w|128}}return C.subarray(0,S)},n.utf8Decode=function(g){for(var C="",S=0;S127)if(T>191&&T<224){if(S>=g.length)throw new Error("Incomplete 2-byte sequence.");T=(31&T)<<6|63&g[S++]}else if(T>223&&T<240){if(S+1>=g.length)throw new Error("Incomplete 3-byte sequence.");T=(15&T)<<12|(63&g[S++])<<6|63&g[S++]}else{if(!(T>239&&T<248))throw new Error("Unknown multi-byte start.");if(S+2>=g.length)throw new Error("Incomplete 4-byte sequence.");T=(7&T)<<18|(63&g[S++])<<12|(63&g[S++])<<6|63&g[S++]}if(T<=65535)C+=String.fromCharCode(T);else{if(!(T<=1114111))throw new Error("Code point exceeds UTF-16 limit.");T-=65536,C+=String.fromCharCode(T>>10|55296),C+=String.fromCharCode(1023&T|56320)}}return C}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(241);n.Cast=i.Cast;var o=r(150);n.Guard=o.Guard;var s=r(242);n.EmptySet=s.EmptySet},function(a,n,r){var i=r(11),o=r(55).f,s=r(21),u=r(25),c=r(80),p=r(119),l=r(123);a.exports=function(f,h){var v,m,x,y,d,g=f.target,C=f.global,S=f.stat;if(v=C?i:S?i[g]||c(g,{}):(i[g]||{}).prototype)for(m in h){if(y=h[m],x=f.noTargetGet?(d=o(v,m))&&d.value:v[m],!l(C?m:g+(S?".":"#")+m,f.forced)&&x!==void 0){if(typeof y==typeof x)continue;p(y,x)}(f.sham||x&&x.sham)&&s(y,"sham",!0),u(v,m,y,f)}}},function(a,n,r){var i=r(11),o=r(81),s=r(14),u=r(58),c=r(86),p=r(124),l=o("wks"),f=i.Symbol,h=p?f:f&&f.withoutSetter||u;a.exports=function(v){return s(l,v)||(c&&s(f,v)?l[v]=f[v]:l[v]=h("Symbol."+v)),l[v]}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=r(29),s=function(){function u(){this._features={mutationObservers:!0,customElements:!0,slots:!0,steps:!0},this._window=null,this._compareCache=new i.CompareCache,this._rangeList=new i.FixedSizeSet}return u.prototype.setFeatures=function(c){if(c===void 0&&(c=!0),i.isObject(c))for(var p in c)this._features[p]=c[p]||!1;else for(var p in this._features)this._features[p]=c},Object.defineProperty(u.prototype,"features",{get:function(){return this._features},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"window",{get:function(){return this._window===null&&(this._window=o.create_window()),this._window},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"compareCache",{get:function(){return this._compareCache},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"rangeList",{get:function(){return this._rangeList},enumerable:!0,configurable:!0}),Object.defineProperty(u,"instance",{get:function(){return u._instance||(u._instance=new u),u._instance},enumerable:!0,configurable:!0}),u}();n.dom=s.instance},function(a,n,r){var i=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var C in d)Object.hasOwnProperty.call(d,C)&&(g[C]=d[C]);return g.default=d,g};Object.defineProperty(n,"__esModule",{value:!0});var o=i(r(228));n.base64=o;var s=i(r(146));n.byte=s;var u=i(r(147));n.byteSequence=u;var c=i(r(96));n.codePoint=c;var p=i(r(232));n.json=p;var l=i(r(233));n.list=l;var f=i(r(234));n.map=f;var h=i(r(235));n.namespace=h;var v=i(r(236));n.queue=v;var m=i(r(237));n.set=m;var x=i(r(238));n.stack=x;var y=i(r(239));n.string=y},function(a,n){a.exports=function(r){try{return!!r()}catch{return!0}}},function(a,n,r){var i,o=this&&this.__extends||(i=function(F,k){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,W){G.__proto__=W}||function(G,W){for(var H in W)W.hasOwnProperty(H)&&(G[H]=W[H])})(F,k)},function(F,k){function G(){this.constructor=F}i(F,k),F.prototype=k===null?Object.create(k):(G.prototype=k.prototype,new G)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(F){function k(G,W){W===void 0&&(W="");var H=F.call(this,W)||this;return H.name=G,H}return o(k,F),k}(Error);n.DOMException=s;var u=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"DOMStringSizeError",G)||this}return o(k,F),k}(s);n.DOMStringSizeError=u;var c=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"WrongDocumentError","The object is in the wrong document. "+G)||this}return o(k,F),k}(s);n.WrongDocumentError=c;var p=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NoDataAllowedError",G)||this}return o(k,F),k}(s);n.NoDataAllowedError=p;var l=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NoModificationAllowedError","The object can not be modified. "+G)||this}return o(k,F),k}(s);n.NoModificationAllowedError=l;var f=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NotSupportedError","The operation is not supported. "+G)||this}return o(k,F),k}(s);n.NotSupportedError=f;var h=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"InUseAttributeError",G)||this}return o(k,F),k}(s);n.InUseAttributeError=h;var v=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"InvalidStateError","The object is in an invalid state. "+G)||this}return o(k,F),k}(s);n.InvalidStateError=v;var m=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"InvalidModificationError","The object can not be modified in this way. "+G)||this}return o(k,F),k}(s);n.InvalidModificationError=m;var x=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NamespaceError","The operation is not allowed by Namespaces in XML. [XMLNS] "+G)||this}return o(k,F),k}(s);n.NamespaceError=x;var y=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"InvalidAccessError","The object does not support the operation or argument. "+G)||this}return o(k,F),k}(s);n.InvalidAccessError=y;var d=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"ValidationError",G)||this}return o(k,F),k}(s);n.ValidationError=d;var g=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"TypeMismatchError",G)||this}return o(k,F),k}(s);n.TypeMismatchError=g;var C=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"SecurityError","The operation is insecure. "+G)||this}return o(k,F),k}(s);n.SecurityError=C;var S=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NetworkError","A network error occurred. "+G)||this}return o(k,F),k}(s);n.NetworkError=S;var T=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"AbortError","The operation was aborted. "+G)||this}return o(k,F),k}(s);n.AbortError=T;var w=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"URLMismatchError","The given URL does not match another URL. "+G)||this}return o(k,F),k}(s);n.URLMismatchError=w;var _=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"QuotaExceededError","The quota has been exceeded. "+G)||this}return o(k,F),k}(s);n.QuotaExceededError=_;var E=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"TimeoutError","The operation timed out. "+G)||this}return o(k,F),k}(s);n.TimeoutError=E;var D=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"InvalidNodeTypeError","The supplied node is incorrect or has an incorrect ancestor for this operation. "+G)||this}return o(k,F),k}(s);n.InvalidNodeTypeError=D;var O=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"DataCloneError","The object can not be cloned. "+G)||this}return o(k,F),k}(s);n.DataCloneError=O;var b=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NotImplementedError","The DOM method is not implemented by this module. "+G)||this}return o(k,F),k}(s);n.NotImplementedError=b;var R=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"HierarchyRequestError","The operation would yield an incorrect node tree. "+G)||this}return o(k,F),k}(s);n.HierarchyRequestError=R;var N=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"NotFoundError","The object can not be found here. "+G)||this}return o(k,F),k}(s);n.NotFoundError=N;var L=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"IndexSizeError","The index is not in the allowed range. "+G)||this}return o(k,F),k}(s);n.IndexSizeError=L;var B=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"SyntaxError","The string did not match the expected pattern. "+G)||this}return o(k,F),k}(s);n.SyntaxError=B;var P=function(F){function k(G){return G===void 0&&(G=""),F.call(this,"InvalidCharacterError","The string contains invalid characters. "+G)||this}return o(k,F),k}(s);n.InvalidCharacterError=P},function(a,n,r){var i=r(53),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];a.exports=function(u,c){var p,l;if(c=c||{},Object.keys(c).forEach(function(f){if(o.indexOf(f)===-1)throw new i('Unknown option "'+f+'" is met in definition of "'+u+'" YAML type.')}),this.tag=u,this.kind=c.kind||null,this.resolve=c.resolve||function(){return!0},this.construct=c.construct||function(f){return f},this.instanceOf=c.instanceOf||null,this.predicate=c.predicate||null,this.represent=c.represent||null,this.defaultStyle=c.defaultStyle||null,this.styleAliases=(p=c.styleAliases||null,l={},p!==null&&Object.keys(p).forEach(function(f){p[f].forEach(function(h){l[String(h)]=f})}),l),s.indexOf(this.kind)===-1)throw new i('Unknown kind "'+this.kind+'" is specified for "'+u+'" YAML type.')}},function(a,n,r){(function(i){var o=function(s){return s&&s.Math==Math&&s};a.exports=o(typeof globalThis=="object"&&globalThis)||o(typeof window=="object"&&window)||o(typeof self=="object"&&self)||o(typeof i=="object"&&i)||Function("return this")()}).call(this,r(78))},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),n.idl_defineConst=function(i,o,s){Object.defineProperty(i,o,{writable:!1,enumerable:!0,configurable:!1,value:s})}},function(a,n){a.exports=function(r){return typeof r=="object"?r!==null:typeof r=="function"}},function(a,n){var r={}.hasOwnProperty;a.exports=function(i,o){return r.call(i,o)}},function(a,n,r){var i=r(16),o=r(115),s=r(18),u=r(56),c=Object.defineProperty;n.f=i?c:function(p,l,f){if(s(p),l=u(l,!0),s(f),o)try{return c(p,l,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported");return"value"in f&&(p[l]=f.value),p}},function(a,n,r){var i=r(8);a.exports=!i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},function(a,n,r){var i=this&&this.__values||function(g){var C=typeof Symbol=="function"&&Symbol.iterator,S=C&&g[C],T=0;if(S)return S.call(g);if(g&&typeof g.length=="number")return{next:function(){return g&&T>=g.length&&(g=void 0),{value:g&&g[T++],done:!g}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(3),s=r(1);function u(g,C,S){if(S===void 0&&(S=!1),S&&o.Guard.isElementNode(C)&&o.Guard.isShadowRoot(C.shadowRoot)&&C.shadowRoot._firstChild)return C.shadowRoot._firstChild;if(C._firstChild)return C._firstChild;if(C===g)return null;if(C._nextSibling)return C._nextSibling;for(var T=C._parent;T&&T!==g;){if(T._nextSibling)return T._nextSibling;T=T._parent}return null}function c(){var g;return(g={})[Symbol.iterator]=function(){return{next:function(){return{done:!0,value:null}}}},g}function p(g,C,S,T){C===void 0&&(C=!1),S===void 0&&(S=!1);for(var w=C?g:u(g,g,S);w&&T&&!T(w);)w=u(g,w,S);return w}function l(g,C,S,T,w){T===void 0&&(T=!1);for(var _=u(g,C,T);_&&w&&!w(_);)_=u(g,_,T);return _}function f(g,C,S,T){var w;return C===void 0&&(C=!1),S===void 0&&(S=!1),C||g._children.size!==0?((w={})[Symbol.iterator]=function(){var _=C?g:u(g,g,S);return{next:function(){for(;_&&T&&!T(_);)_=u(g,_,S);if(_===null)return{done:!0,value:null};var E={done:!1,value:_};return _=u(g,_,S),E}}},w):c()}function h(g,C,S){C===void 0&&(C=!1);for(var T=C?g:g._parent;T&&S&&!S(T);)T=T._parent;return T}function v(g,C,S,T){for(var w=C._parent;w&&T&&!T(w);)w=w._parent;return w}function m(g){return o.Guard.isDocumentTypeNode(g)?0:o.Guard.isCharacterDataNode(g)?g._data.length:g._children.size}function x(g,C){if(C===void 0&&(C=!1),C){var S=x(g,!1);return o.Guard.isShadowRoot(S)?x(S._host,!0):S}return g._parent?x(g._parent):g}function y(g,C,S,T){S===void 0&&(S=!1),T===void 0&&(T=!1);for(var w=S?g:T&&o.Guard.isShadowRoot(g)?g._host:g._parent;w!==null;){if(w===C)return!0;w=T&&o.Guard.isShadowRoot(w)?w._host:w._parent}return!1}function d(g){for(var C=x(g),S=0,T=p(C);T!==null;){if(S++,T===g)return S;T=l(C,T)}return-1}n.tree_getFirstDescendantNode=p,n.tree_getNextDescendantNode=l,n.tree_getDescendantNodes=f,n.tree_getDescendantElements=function(g,C,S,T){var w;return C===void 0&&(C=!1),S===void 0&&(S=!1),C||g._children.size!==0?((w={})[Symbol.iterator]=function(){var _=f(g,C,S,function(D){return o.Guard.isElementNode(D)})[Symbol.iterator](),E=_.next().value;return{next:function(){for(;E&&T&&!T(E);)E=_.next().value;if(E===null)return{done:!0,value:null};var D={done:!1,value:E};return E=_.next().value,D}}},w):c()},n.tree_getSiblingNodes=function(g,C,S){var T;return C===void 0&&(C=!1),g._parent&&g._parent._children.size!==0?((T={})[Symbol.iterator]=function(){var w=g._parent?g._parent._firstChild:null;return{next:function(){for(;w&&(S&&!S(w)||!C&&w===g);)w=w._nextSibling;if(w===null)return{done:!0,value:null};var _={done:!1,value:w};return w=w._nextSibling,_}}},T):c()},n.tree_getFirstAncestorNode=h,n.tree_getNextAncestorNode=v,n.tree_getAncestorNodes=function(g,C,S){var T;return C===void 0&&(C=!1),C||g._parent?((T={})[Symbol.iterator]=function(){var w=h(g,C,S);return{next:function(){if(w===null)return{done:!0,value:null};var _={done:!1,value:w};return w=v(0,w,C,S),_}}},T):c()},n.tree_getCommonAncestor=function(g,C){if(g===C)return g._parent;for(var S=[],T=[],w=h(g,!0);w!==null;)S.push(w),w=v(0,w);for(var _=h(C,!0);_!==null;)T.push(_),_=v(0,_);for(var E=S.length,D=T.length,O=null,b=Math.min(E,D);b>0;b--){var R=S[--E];if(R!==T[--D])break;O=R}return O},n.tree_getFollowingNode=function(g,C){if(C._firstChild)return C._firstChild;if(C._nextSibling)return C._nextSibling;for(;;){var S=C._parent;if(S===null||S===g)return null;if(S._nextSibling)return S._nextSibling;C=S}},n.tree_getPrecedingNode=function(g,C){return C===g?null:C._previousSibling?(C=C._previousSibling)._lastChild?C._lastChild:C:C._parent},n.tree_isConstrained=function g(C){var S,T,w,_,E,D;switch(C._nodeType){case s.NodeType.Document:var O=!1,b=!1;try{for(var R=i(C._children),N=R.next();!N.done;N=R.next())switch(N.value._nodeType){case s.NodeType.ProcessingInstruction:case s.NodeType.Comment:break;case s.NodeType.DocumentType:if(O||b)return!1;O=!0;break;case s.NodeType.Element:if(b)return!1;b=!0;break;default:return!1}}catch(k){S={error:k}}finally{try{N&&!N.done&&(T=R.return)&&T.call(R)}finally{if(S)throw S.error}}break;case s.NodeType.DocumentFragment:case s.NodeType.Element:try{for(var L=i(C._children),B=L.next();!B.done;B=L.next())switch(B.value._nodeType){case s.NodeType.Element:case s.NodeType.Text:case s.NodeType.ProcessingInstruction:case s.NodeType.CData:case s.NodeType.Comment:break;default:return!1}}catch(k){w={error:k}}finally{try{B&&!B.done&&(_=L.return)&&_.call(L)}finally{if(w)throw w.error}}break;case s.NodeType.DocumentType:case s.NodeType.Text:case s.NodeType.ProcessingInstruction:case s.NodeType.CData:case s.NodeType.Comment:return!C.hasChildNodes()}try{for(var P=i(C._children),F=P.next();!F.done;F=P.next())if(!g(F.value))return!1}catch(k){E={error:k}}finally{try{F&&!F.done&&(D=P.return)&&D.call(P)}finally{if(E)throw E.error}}return!0},n.tree_nodeLength=m,n.tree_isEmpty=function(g){return m(g)===0},n.tree_rootNode=x,n.tree_isDescendantOf=function(g,C,S,T){S===void 0&&(S=!1),T===void 0&&(T=!1);for(var w=p(g,S,T);w!==null;){if(w===C)return!0;w=l(g,w,S,T)}return!1},n.tree_isAncestorOf=y,n.tree_isHostIncludingAncestorOf=function g(C,S,T){if(T===void 0&&(T=!1),y(C,S,T))return!0;var w=x(C);return!(!o.Guard.isDocumentFragmentNode(w)||w._host===null||!g(w._host,S,T))},n.tree_isSiblingOf=function(g,C,S){return S===void 0&&(S=!1),g!==C?g._parent!==null&&g._parent===C._parent:!!S},n.tree_isPreceding=function(g,C){var S=d(g),T=d(C);return S!==-1&&T!==-1&&x(g)===x(C)&&TS},n.tree_isParentOf=function(g,C){return g._parent===C},n.tree_isChildOf=function(g,C){return C._parent===g},n.tree_previousSibling=function(g){return g._previousSibling},n.tree_nextSibling=function(g){return g._nextSibling},n.tree_firstChild=function(g){return g._firstChild},n.tree_lastChild=function(g){return g._lastChild},n.tree_treePosition=d,n.tree_index=function(g){for(var C=0;g._previousSibling!==null;)C++,g=g._previousSibling;return C},n.tree_retarget=function(g,C){for(;;){if(!g||!o.Guard.isNode(g))return g;var S=x(g);if(!o.Guard.isShadowRoot(S)||C&&o.Guard.isNode(C)&&y(S,C,!0,!0))return g;g=S.host}}},function(a,n,r){var i=r(13);a.exports=function(o){if(!i(o))throw TypeError(String(o)+" is not an object");return o}},function(a,n,r){var i=r(24),o=r(130),s=r(49),u=r(43),c=r(88),p=u.set,l=u.getterFor("Array Iterator");a.exports=c(Array,"Array",function(f,h){p(this,{type:"Array Iterator",target:i(f),index:0,kind:h})},function(){var f=l(this),h=f.target,v=f.kind,m=f.index++;return!h||m>=h.length?(f.target=void 0,{value:void 0,done:!0}):v=="keys"?{value:m,done:!1}:v=="values"?{value:h[m],done:!1}:{value:[m,h[m]],done:!1}},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(a,n,r){var i=r(90),o=r(25),s=r(202);i||o(Object.prototype,"toString",s,{unsafe:!0})},function(a,n,r){var i=r(16),o=r(15),s=r(40);a.exports=i?function(u,c,p){return o.f(u,c,s(1,p))}:function(u,c,p){return u[c]=p,u}},function(a,n,r){var i=r(137).charAt,o=r(43),s=r(88),u=o.set,c=o.getterFor("String Iterator");s(String,"String",function(p){u(this,{type:"String Iterator",string:String(p),index:0})},function(){var p,l=c(this),f=l.string,h=l.index;return h>=f.length?{value:void 0,done:!0}:(p=i(f,h),l.index+=p.length,{value:p,done:!1})})},function(a,n,r){var i=r(11),o=r(203),s=r(19),u=r(21),c=r(5),p=c("iterator"),l=c("toStringTag"),f=s.values;for(var h in o){var v=i[h],m=v&&v.prototype;if(m){if(m[p]!==f)try{u(m,p,f)}catch{m[p]=f}if(m[l]||u(m,l,h),o[h]){for(var x in s)if(m[x]!==s[x])try{u(m,x,s[x])}catch{m[x]=s[x]}}}}},function(a,n,r){var i=r(41),o=r(35);a.exports=function(s){return i(o(s))}},function(a,n,r){var i=r(11),o=r(21),s=r(14),u=r(80),c=r(117),p=r(43),l=p.get,f=p.enforce,h=String(String).split("String");(a.exports=function(v,m,x,y){var d=!!y&&!!y.unsafe,g=!!y&&!!y.enumerable,C=!!y&&!!y.noTargetGet;typeof x=="function"&&(typeof m!="string"||s(x,"name")||o(x,"name",m),f(x).source=h.join(typeof m=="string"?m:"")),v!==i?(d?!C&&v[m]&&(g=!0):delete v[m],g?v[m]=x:o(v,m,x)):g?v[m]=x:u(m,x)})(Function.prototype,"toString",function(){return typeof this=="function"&&l(this).source||c(this)})},function(a,n,r){var i=r(47),o=Math.min;a.exports=function(s){return s>0?o(i(s),9007199254740991):0}},function(a,n,r){var i=r(35);a.exports=function(o){return Object(i(o))}},function(a,n,r){var i=r(16),o=r(8),s=r(14),u=Object.defineProperty,c={},p=function(l){throw l};a.exports=function(l,f){if(s(c,l))return c[l];f||(f={});var h=[][l],v=!!s(f,"ACCESSORS")&&f.ACCESSORS,m=s(f,0)?f[0]:p,x=s(f,1)?f[1]:void 0;return c[l]=!!h&&!o(function(){if(v&&!i)return!0;var y={length:-1};v?u(y,1,{enumerable:!0,get:p}):y[1]=1,h.call(y,m,x)})}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(148),o=r(149),s=r(151),u=r(98),c=r(153),p=r(154),l=r(155),f=r(99),h=r(100),v=r(156),m=r(157),x=r(101),y=r(158),d=r(159),g=r(160),C=r(161),S=r(162),T=r(163),w=r(164),_=r(165),E=r(166),D=r(167),O=r(168),b=r(169),R=r(170);n.create_domImplementation=function(N){return i.DOMImplementationImpl._create(N)},n.create_window=function(){return o.WindowImpl._create()},n.create_xmlDocument=function(){return new s.XMLDocumentImpl},n.create_document=function(){return new u.DocumentImpl},n.create_abortController=function(){return new c.AbortControllerImpl},n.create_abortSignal=function(){return p.AbortSignalImpl._create()},n.create_documentType=function(N,L,B,P){return l.DocumentTypeImpl._create(N,L,B,P)},n.create_element=function(N,L,B,P){return f.ElementImpl._create(N,L,B,P)},n.create_htmlElement=function(N,L,B,P){return f.ElementImpl._create(N,L,B,P)},n.create_htmlUnknownElement=function(N,L,B,P){return f.ElementImpl._create(N,L,B,P)},n.create_documentFragment=function(N){return h.DocumentFragmentImpl._create(N)},n.create_shadowRoot=function(N,L){return v.ShadowRootImpl._create(N,L)},n.create_attr=function(N,L){return m.AttrImpl._create(N,L)},n.create_text=function(N,L){return x.TextImpl._create(N,L)},n.create_cdataSection=function(N,L){return y.CDATASectionImpl._create(N,L)},n.create_comment=function(N,L){return d.CommentImpl._create(N,L)},n.create_processingInstruction=function(N,L,B){return g.ProcessingInstructionImpl._create(N,L,B)},n.create_htmlCollection=function(N,L){return L===void 0&&(L=function(){return!0}),C.HTMLCollectionImpl._create(N,L)},n.create_nodeList=function(N){return S.NodeListImpl._create(N)},n.create_nodeListStatic=function(N,L){return T.NodeListStaticImpl._create(N,L)},n.create_namedNodeMap=function(N){return w.NamedNodeMapImpl._create(N)},n.create_range=function(N,L){return _.RangeImpl._create(N,L)},n.create_nodeIterator=function(N,L,B){return E.NodeIteratorImpl._create(N,L,B)},n.create_treeWalker=function(N,L){return D.TreeWalkerImpl._create(N,L)},n.create_nodeFilter=function(){return O.NodeFilterImpl._create()},n.create_mutationRecord=function(N,L,B,P,F,k,G,W,H){return b.MutationRecordImpl._create(N,L,B,P,F,k,G,W,H)},n.create_domTokenList=function(N,L){return R.DOMTokenListImpl._create(N,L)}},function(a,n,r){var i=this&&this.__values||function(m){var x=typeof Symbol=="function"&&Symbol.iterator,y=x&&m[x],d=0;if(y)return y.call(m);if(m&&typeof m.length=="number")return{next:function(){return m&&d>=m.length&&(m=void 0),{value:m&&m[d++],done:!m}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(17),u=r(3),c=r(72),p=new Map;function l(m,x){if(x!==m._root&&s.tree_isAncestorOf(m._reference,x,!0)){if(m._pointerBeforeReference)for(;;){var y=s.tree_getFollowingNode(m._root,x);if(y!==null&&s.tree_isDescendantOf(m._root,y,!0)&&!s.tree_isDescendantOf(x,y,!0))return void(m._reference=y);if(y===null)return void(m._pointerBeforeReference=!1)}if(x._previousSibling===null)x._parent!==null&&(m._reference=x._parent);else{for(var d=x._previousSibling,g=s.tree_getFirstDescendantNode(x._previousSibling,!0,!1);g!==null;)g!==null&&(d=g),g=s.tree_getNextDescendantNode(x._previousSibling,g,!0,!1);m._reference=d}}}function f(m,x,y,d,g){if(u.Guard.isSlot(m)&&x==="name"&&g===null){if(d===y||d===null&&y===""||d===""&&y===null)return;m._name=d===null||d===""?"":d,c.shadowTree_assignSlotablesForATree(s.tree_rootNode(m))}}function h(m,x,y,d,g){if(u.Guard.isSlotable(m)&&x==="slot"&&g===null){if(d===y||d===null&&y===""||d===""&&y===null)return;m._name=d===null||d===""?"":d,c.shadowTree_isAssigned(m)&&c.shadowTree_assignSlotables(m._assignedSlot),c.shadowTree_assignASlot(m)}}function v(m,x,y,d){x==="id"&&d===null&&(m._uniqueIdentifier=y||void 0)}n.dom_runRemovingSteps=function(m,x){},n.dom_runCloningSteps=function(m,x,y,d){},n.dom_runAdoptingSteps=function(m,x){},n.dom_runAttributeChangeSteps=function(m,x,y,d,g){var C,S;o.dom.features.slots&&(h.call(m,m,x,y,d,g),f.call(m,m,x,y,d,g)),v.call(m,m,x,d,g);try{for(var T=i(m._attributeChangeSteps),w=T.next();!w.done;w=T.next())w.value.call(m,m,x,y,d,g)}catch(_){C={error:_}}finally{try{w&&!w.done&&(S=T.return)&&S.call(T)}finally{if(C)throw C.error}}},n.dom_runInsertionSteps=function(m){},n.dom_runNodeIteratorPreRemovingSteps=function(m,x){l.call(m,m,x)},n.dom_hasSupportedTokens=function(m){return p.has(m)},n.dom_getSupportedTokens=function(m){return p.get(m)||new Set},n.dom_runEventConstructingSteps=function(m){},n.dom_runChildTextContentChangeSteps=function(m){}},function(a,n,r){var i=r(4),o=r(11),s=r(46),u=r(44),c=r(16),p=r(86),l=r(124),f=r(8),h=r(14),v=r(59),m=r(13),x=r(18),y=r(27),d=r(24),g=r(56),C=r(40),S=r(60),T=r(61),w=r(82),_=r(190),E=r(85),D=r(55),O=r(15),b=r(79),R=r(21),N=r(25),L=r(81),B=r(57),P=r(45),F=r(58),k=r(5),G=r(125),W=r(126),H=r(62),X=r(43),Y=r(36).forEach,q=B("hidden"),Q=k("toPrimitive"),ae=X.set,ne=X.getterFor("Symbol"),ee=Object.prototype,V=o.Symbol,M=s("JSON","stringify"),I=D.f,U=O.f,z=_.f,j=b.f,$=L("symbols"),J=L("op-symbols"),re=L("string-to-symbol-registry"),oe=L("symbol-to-string-registry"),ue=L("wks"),Te=o.QObject,Ce=!Te||!Te.prototype||!Te.prototype.findChild,Xe=c&&f(function(){return S(U({},"a",{get:function(){return U(this,"a",{value:7}).a}})).a!=7})?function(ce,he,fe){var ye=I(ee,he);ye&&delete ee[he],U(ce,he,fe),ye&&ce!==ee&&U(ee,he,ye)}:U,ke=function(ce,he){var fe=$[ce]=S(V.prototype);return ae(fe,{type:"Symbol",tag:ce,description:he}),c||(fe.description=he),fe},ge=l?function(ce){return typeof ce=="symbol"}:function(ce){return Object(ce)instanceof V},nt=function(ce,he,fe){ce===ee&&nt(J,he,fe),x(ce);var ye=g(he,!0);return x(fe),h($,ye)?(fe.enumerable?(h(ce,q)&&ce[q][ye]&&(ce[q][ye]=!1),fe=S(fe,{enumerable:C(0,!1)})):(h(ce,q)||U(ce,q,C(1,{})),ce[q][ye]=!0),Xe(ce,ye,fe)):U(ce,ye,fe)},K=function(ce,he){x(ce);var fe=d(he),ye=T(fe).concat(te(fe));return Y(ye,function(Ve){c&&!De.call(fe,Ve)||nt(ce,Ve,fe[Ve])}),ce},De=function(ce){var he=g(ce,!0),fe=j.call(this,he);return!(this===ee&&h($,he)&&!h(J,he))&&(!(fe||!h(this,he)||!h($,he)||h(this,q)&&this[q][he])||fe)},Oe=function(ce,he){var fe=d(ce),ye=g(he,!0);if(fe!==ee||!h($,ye)||h(J,ye)){var Ve=I(fe,ye);return!Ve||!h($,ye)||h(fe,q)&&fe[q][ye]||(Ve.enumerable=!0),Ve}},ve=function(ce){var he=z(d(ce)),fe=[];return Y(he,function(ye){h($,ye)||h(P,ye)||fe.push(ye)}),fe},te=function(ce){var he=ce===ee,fe=z(he?J:d(ce)),ye=[];return Y(fe,function(Ve){!h($,Ve)||he&&!h(ee,Ve)||ye.push($[Ve])}),ye};p||(N((V=function(){if(this instanceof V)throw TypeError("Symbol is not a constructor");var ce=arguments.length&&arguments[0]!==void 0?String(arguments[0]):void 0,he=F(ce),fe=function(ye){this===ee&&fe.call(J,ye),h(this,q)&&h(this[q],he)&&(this[q][he]=!1),Xe(this,he,C(1,ye))};return c&&Ce&&Xe(ee,he,{configurable:!0,set:fe}),ke(he,ce)}).prototype,"toString",function(){return ne(this).tag}),N(V,"withoutSetter",function(ce){return ke(F(ce),ce)}),b.f=De,O.f=nt,D.f=Oe,w.f=_.f=ve,E.f=te,G.f=function(ce){return ke(k(ce),ce)},c&&(U(V.prototype,"description",{configurable:!0,get:function(){return ne(this).description}}),u||N(ee,"propertyIsEnumerable",De,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!p,sham:!p},{Symbol:V}),Y(T(ue),function(ce){W(ce)}),i({target:"Symbol",stat:!0,forced:!p},{for:function(ce){var he=String(ce);if(h(re,he))return re[he];var fe=V(he);return re[he]=fe,oe[fe]=he,fe},keyFor:function(ce){if(!ge(ce))throw TypeError(ce+" is not a symbol");if(h(oe,ce))return oe[ce]},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),i({target:"Object",stat:!0,forced:!p,sham:!c},{create:function(ce,he){return he===void 0?S(ce):K(S(ce),he)},defineProperty:nt,defineProperties:K,getOwnPropertyDescriptor:Oe}),i({target:"Object",stat:!0,forced:!p},{getOwnPropertyNames:ve,getOwnPropertySymbols:te}),i({target:"Object",stat:!0,forced:f(function(){E.f(1)})},{getOwnPropertySymbols:function(ce){return E.f(y(ce))}}),M&&i({target:"JSON",stat:!0,forced:!p||f(function(){var ce=V();return M([ce])!="[null]"||M({a:ce})!="{}"||M(Object(ce))!="{}"})},{stringify:function(ce,he,fe){for(var ye,Ve=[ce],Se=1;arguments.length>Se;)Ve.push(arguments[Se++]);if(ye=he,(m(he)||ce!==void 0)&&!ge(ce))return v(he)||(he=function(Be,Ie){if(typeof ye=="function"&&(Ie=ye.call(this,Be,Ie)),!ge(Ie))return Ie}),Ve[1]=he,M.apply(null,Ve)}}),V.prototype[Q]||R(V.prototype,Q,V.prototype.valueOf),H(V,"Symbol"),P[q]=!0},function(a,n,r){var i=r(4),o=r(16),s=r(11),u=r(14),c=r(13),p=r(15).f,l=r(119),f=s.Symbol;if(o&&typeof f=="function"&&(!("description"in f.prototype)||f().description!==void 0)){var h={},v=function(){var g=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),C=this instanceof v?new f(g):g===void 0?f():f(g);return g===""&&(h[C]=!0),C};l(v,f);var m=v.prototype=f.prototype;m.constructor=v;var x=m.toString,y=String(f("test"))=="Symbol(test)",d=/^Symbol\((.*)\)[^)]+$/;p(m,"description",{configurable:!0,get:function(){var g=c(this)?this.valueOf():this,C=x.call(g);if(u(h,g))return"";var S=y?C.slice(7,-1):C.replace(d,"$1");return S===""?void 0:S}}),i({global:!0,forced:!0},{Symbol:v})}},function(a,n,r){r(126)("iterator")},function(a,n,r){var i,o=this&&this.__extends||(i=function(y,d){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,C){g.__proto__=C}||function(g,C){for(var S in C)C.hasOwnProperty(S)&&(g[S]=C[S])})(y,d)},function(y,d){function g(){this.constructor=y}i(y,d),y.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}),s=this&&this.__values||function(y){var d=typeof Symbol=="function"&&Symbol.iterator,g=d&&y[d],C=0;if(g)return g.call(y);if(y&&typeof y.length=="number")return{next:function(){return y&&C>=y.length&&(y=void 0),{value:y&&y[C++],done:!y}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(6),c=r(1),p=r(70),l=r(3),f=r(9),h=r(0),v=r(152),m=r(12),x=function(y){function d(){var g=y.call(this)||this;return g._parent=null,g._firstChild=null,g._lastChild=null,g._previousSibling=null,g._nextSibling=null,g}return o(d,y),Object.defineProperty(d.prototype,"_childNodes",{get:function(){return this.__childNodes||(this.__childNodes=h.create_nodeList(this))},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"_nodeDocument",{get:function(){return this._nodeDocumentOverride||u.dom.window._associatedDocument},set:function(g){this._nodeDocumentOverride=g},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"_registeredObserverList",{get:function(){return this.__registeredObserverList||(this.__registeredObserverList=[])},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"nodeType",{get:function(){return this._nodeType},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"nodeName",{get:function(){return l.Guard.isElementNode(this)?this._htmlUppercasedQualifiedName:l.Guard.isAttrNode(this)?this._qualifiedName:l.Guard.isExclusiveTextNode(this)?"#text":l.Guard.isCDATASectionNode(this)?"#cdata-section":l.Guard.isProcessingInstructionNode(this)?this._target:l.Guard.isCommentNode(this)?"#comment":l.Guard.isDocumentNode(this)?"#document":l.Guard.isDocumentTypeNode(this)?this._name:l.Guard.isDocumentFragmentNode(this)?"#document-fragment":""},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"baseURI",{get:function(){return v.urlSerializer(this._nodeDocument._URL)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isConnected",{get:function(){return l.Guard.isElementNode(this)&&h.shadowTree_isConnected(this)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"ownerDocument",{get:function(){return this._nodeType===c.NodeType.Document?null:this._nodeDocument},enumerable:!0,configurable:!0}),d.prototype.getRootNode=function(g){return h.tree_rootNode(this,!!g&&g.composed)},Object.defineProperty(d.prototype,"parentNode",{get:function(){return this._nodeType===c.NodeType.Attribute?null:this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"parentElement",{get:function(){return this._parent&&l.Guard.isElementNode(this._parent)?this._parent:null},enumerable:!0,configurable:!0}),d.prototype.hasChildNodes=function(){return this._firstChild!==null},Object.defineProperty(d.prototype,"childNodes",{get:function(){return this._childNodes},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"firstChild",{get:function(){return this._firstChild},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"lastChild",{get:function(){return this._lastChild},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"previousSibling",{get:function(){return this._previousSibling},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"nextSibling",{get:function(){return this._nextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"nodeValue",{get:function(){return l.Guard.isAttrNode(this)?this._value:l.Guard.isCharacterDataNode(this)?this._data:null},set:function(g){g===null&&(g=""),l.Guard.isAttrNode(this)?h.attr_setAnExistingAttributeValue(this,g):l.Guard.isCharacterDataNode(this)&&h.characterData_replaceData(this,0,this._data.length,g)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"textContent",{get:function(){return l.Guard.isDocumentFragmentNode(this)||l.Guard.isElementNode(this)?h.text_descendantTextContent(this):l.Guard.isAttrNode(this)?this._value:l.Guard.isCharacterDataNode(this)?this._data:null},set:function(g){g===null&&(g=""),l.Guard.isDocumentFragmentNode(this)||l.Guard.isElementNode(this)?h.node_stringReplaceAll(g,this):l.Guard.isAttrNode(this)?h.attr_setAnExistingAttributeValue(this,g):l.Guard.isCharacterDataNode(this)&&h.characterData_replaceData(this,0,h.tree_nodeLength(this),g)},enumerable:!0,configurable:!0}),d.prototype.normalize=function(){for(var g,C,S,T,w=[],_=h.tree_getFirstDescendantNode(this,!1,!1,function(Y){return l.Guard.isExclusiveTextNode(Y)});_!==null;)w.push(_),_=h.tree_getNextDescendantNode(this,_,!1,!1,function(Y){return l.Guard.isExclusiveTextNode(Y)});for(var E=0;ER;R++)if((d||R in D)&&(_=O(w=D[R],R,E),f)){if(h)L[R]=_;else if(_)switch(f){case 3:return!0;case 5:return w;case 6:return R;case 2:p.call(L,w)}else if(x)return!1}return y?-1:m||x?x:L}};a.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},function(a,n,r){var i=this&&this.__values||function(E){var D=typeof Symbol=="function"&&Symbol.iterator,O=D&&E[D],b=0;if(O)return O.call(E);if(E&&typeof E.length=="number")return{next:function(){return E&&b>=E.length&&(E=void 0),{value:E&&E[b++],done:!E}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(E,D){var O=typeof Symbol=="function"&&E[Symbol.iterator];if(!O)return E;var b,R,N=O.call(E),L=[];try{for(;(D===void 0||D-- >0)&&!(b=N.next()).done;)L.push(b.value)}catch(B){R={error:B}}finally{try{b&&!b.done&&(O=N.return)&&O.call(N)}finally{if(R)throw R.error}}return L},s=this&&this.__spread||function(){for(var E=[],D=0;D1)throw new c.HierarchyRequestError("A document node can only have one document element node. Document fragment to be inserted has "+X+" element nodes.");if(X===1){try{for(var ae=i(D._children),ne=ae.next();!ne.done;ne=ae.next())if(ne.value._nodeType===p.NodeType.Element)throw new c.HierarchyRequestError("The document node already has a document element node.")}catch(j){N={error:j}}finally{try{ne&&!ne.done&&(L=ae.return)&&L.call(ae)}finally{if(N)throw N.error}}if(O){if(H===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Cannot insert an element node before a document type node.");for(var ee=O._nextSibling;ee;){if(ee._nodeType===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Cannot insert an element node before a document type node.");ee=ee._nextSibling}}}}else if(W===p.NodeType.Element){try{for(var V=i(D._children),M=V.next();!M.done;M=V.next())if(M.value._nodeType===p.NodeType.Element)throw new c.HierarchyRequestError("Document already has a document element node. Node is "+E.nodeName+".")}catch(j){B={error:j}}finally{try{M&&!M.done&&(P=V.return)&&P.call(V)}finally{if(B)throw B.error}}if(O){if(H===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+E.nodeName+".");for(ee=O._nextSibling;ee;){if(ee._nodeType===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+E.nodeName+".");ee=ee._nextSibling}}}else if(W===p.NodeType.DocumentType){try{for(var I=i(D._children),U=I.next();!U.done;U=I.next())if(U.value._nodeType===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Document already has a document type node. Node is "+E.nodeName+".")}catch(j){F={error:j}}finally{try{U&&!U.done&&(k=I.return)&&k.call(I)}finally{if(F)throw F.error}}if(O)for(var z=O._previousSibling;z;){if(z._nodeType===p.NodeType.Element)throw new c.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+E.nodeName+".");z=z._previousSibling}else for(z=D._firstChild;z;){if(z._nodeType===p.NodeType.Element)throw new c.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+E.nodeName+".");z=z._nextSibling}}}}function T(E,D,O){S(E,D,O);var b=O;return b===E&&(b=E._nextSibling),C.document_adopt(E,D._nodeDocument),w(E,D,b),E}function w(E,D,O,b){var R,N;if(O!==null||E._nodeType===p.NodeType.DocumentFragment){var L=E._nodeType===p.NodeType.DocumentFragment?E._children.size:1;if(O!==null&&u.dom.rangeList.size!==0){var B=m.tree_index(O);try{for(var P=i(u.dom.rangeList),F=P.next();!F.done;F=P.next()){var k=F.value;k._start[0]===D&&k._start[1]>B&&(k._start[1]+=L),k._end[0]===D&&k._end[1]>B&&(k._end[1]+=L)}}catch(ne){R={error:ne}}finally{try{F&&!F.done&&(N=P.return)&&N.call(P)}finally{if(R)throw R.error}}}var G=E._nodeType===p.NodeType.DocumentFragment?new(Array.bind.apply(Array,s([void 0],E._children))):[E];if(E._nodeType===p.NodeType.DocumentFragment)for(;E._firstChild;)_(E._firstChild,E,!0);u.dom.features.mutationObservers&&E._nodeType===p.NodeType.DocumentFragment&&d.observer_queueTreeMutationRecord(E,[],G,null,null);for(var W=O?O._previousSibling:D._lastChild,H=O===null?-1:m.tree_index(O),X=0;XG&&X._start[1]--,X._end[0]===D&&X._end[1]>G&&X._end[1]--}}catch(re){b={error:re}}finally{try{H&&!H.done&&(R=W.return)&&R.call(W)}finally{if(b)throw b.error}}try{for(var Y=i(u.dom.rangeList),q=Y.next();!q.done;q=Y.next())(X=q.value)._start[0]===D&&X._start[1]>G&&(X._start[1]-=1),X._end[0]===D&&X._end[1]>G&&(X._end[1]-=1)}catch(re){N={error:re}}finally{try{q&&!q.done&&(L=Y.return)&&L.call(Y)}finally{if(N)throw N.error}}}if(u.dom.features.steps)try{for(var Q=i(x.nodeIterator_iteratorList()),ae=Q.next();!ae.done;ae=Q.next()){var ne=ae.value;ne._root._nodeDocument===E._nodeDocument&&g.dom_runNodeIteratorPreRemovingSteps(ne,E)}}catch(re){B={error:re}}finally{try{ae&&!ae.done&&(P=Q.return)&&P.call(Q)}finally{if(B)throw B.error}}var ee=E._previousSibling,V=E._nextSibling;l.Guard.isDocumentNode(D)&&l.Guard.isElementNode(E)&&(D._documentElement=null),E._parent=null,D._children.delete(E);var M=E._previousSibling,I=E._nextSibling;E._previousSibling=null,E._nextSibling=null,M&&(M._nextSibling=I),I&&(I._previousSibling=M),M||(D._firstChild=I),I||(D._lastChild=M),u.dom.features.slots&&l.Guard.isSlotable(E)&&E._assignedSlot!==null&&y.shadowTree_isAssigned(E)&&y.shadowTree_assignSlotables(E._assignedSlot),u.dom.features.slots&&l.Guard.isShadowRoot(m.tree_rootNode(D))&&l.Guard.isSlot(D)&&f.isEmpty(D._assignedNodes)&&y.shadowTree_signalASlotChange(D),u.dom.features.slots&&m.tree_getFirstDescendantNode(E,!0,!1,function(re){return l.Guard.isSlot(re)})!==null&&(y.shadowTree_assignSlotablesForATree(m.tree_rootNode(D)),y.shadowTree_assignSlotablesForATree(E)),u.dom.features.steps&&g.dom_runRemovingSteps(E,D),u.dom.features.customElements&&l.Guard.isCustomElementNode(E)&&v.customElement_enqueueACustomElementCallbackReaction(E,"disconnectedCallback",[]);for(var U=m.tree_getFirstDescendantNode(E,!1,!0);U!==null;)u.dom.features.steps&&g.dom_runRemovingSteps(U,E),u.dom.features.customElements&&l.Guard.isCustomElementNode(U)&&v.customElement_enqueueACustomElementCallbackReaction(U,"disconnectedCallback",[]),U=m.tree_getNextDescendantNode(E,U,!1,!0);if(u.dom.features.mutationObservers)for(var z=m.tree_getFirstAncestorNode(D,!0);z!==null;){try{for(var j=(F=void 0,i(z._registeredObserverList)),$=j.next();!$.done;$=j.next()){var J=$.value;J.options.subtree&&E._registeredObserverList.push({observer:J.observer,options:J.options,source:J})}}catch(re){F={error:re}}finally{try{$&&!$.done&&(k=j.return)&&k.call(j)}finally{if(F)throw F.error}}z=m.tree_getNextAncestorNode(D,z,!0)}u.dom.features.mutationObservers&&(O||d.observer_queueTreeMutationRecord(D,[],[E],ee,V)),u.dom.features.steps&&l.Guard.isTextNode(E)&&g.dom_runChildTextContentChangeSteps(D)}n.mutation_ensurePreInsertionValidity=S,n.mutation_preInsert=T,n.mutation_insert=w,n.mutation_append=function(E,D){return T(E,D,null)},n.mutation_replace=function(E,D,O){var b,R,N,L,B,P,F,k;if(O._nodeType!==p.NodeType.Document&&O._nodeType!==p.NodeType.DocumentFragment&&O._nodeType!==p.NodeType.Element)throw new c.HierarchyRequestError("Only document, document fragment and element nodes can contain child nodes. Parent node is "+O.nodeName+".");if(m.tree_isHostIncludingAncestorOf(O,D,!0))throw new c.HierarchyRequestError("The node to be inserted cannot be an ancestor of parent node. Node is "+D.nodeName+", parent node is "+O.nodeName+".");if(E._parent!==O)throw new c.NotFoundError("The reference child node cannot be found under parent node. Child node is "+E.nodeName+", parent node is "+O.nodeName+".");if(D._nodeType!==p.NodeType.DocumentFragment&&D._nodeType!==p.NodeType.DocumentType&&D._nodeType!==p.NodeType.Element&&D._nodeType!==p.NodeType.Text&&D._nodeType!==p.NodeType.ProcessingInstruction&&D._nodeType!==p.NodeType.CData&&D._nodeType!==p.NodeType.Comment)throw new c.HierarchyRequestError("Only document fragment, document type, element, text, processing instruction, cdata section or comment nodes can be inserted. Node is "+D.nodeName+".");if(D._nodeType===p.NodeType.Text&&O._nodeType===p.NodeType.Document)throw new c.HierarchyRequestError("Cannot insert a text node as a child of a document node. Node is "+D.nodeName+".");if(D._nodeType===p.NodeType.DocumentType&&O._nodeType!==p.NodeType.Document)throw new c.HierarchyRequestError("A document type node can only be inserted under a document node. Parent node is "+O.nodeName+".");if(O._nodeType===p.NodeType.Document){if(D._nodeType===p.NodeType.DocumentFragment){var G=0;try{for(var W=i(D._children),H=W.next();!H.done;H=W.next()){var X=H.value;if(X._nodeType===p.NodeType.Element)G++;else if(X._nodeType===p.NodeType.Text)throw new c.HierarchyRequestError("Cannot insert text a node as a child of a document node. Node is "+X.nodeName+".")}}catch(J){b={error:J}}finally{try{H&&!H.done&&(R=W.return)&&R.call(W)}finally{if(b)throw b.error}}if(G>1)throw new c.HierarchyRequestError("A document node can only have one document element node. Document fragment to be inserted has "+G+" element nodes.");if(G===1){try{for(var Y=i(O._children),q=Y.next();!q.done;q=Y.next())if((M=q.value)._nodeType===p.NodeType.Element&&M!==E)throw new c.HierarchyRequestError("The document node already has a document element node.")}catch(J){N={error:J}}finally{try{q&&!q.done&&(L=Y.return)&&L.call(Y)}finally{if(N)throw N.error}}for(var Q=E._nextSibling;Q;){if(Q._nodeType===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Cannot insert an element node before a document type node.");Q=Q._nextSibling}}}else if(D._nodeType===p.NodeType.Element){try{for(var ae=i(O._children),ne=ae.next();!ne.done;ne=ae.next())if((M=ne.value)._nodeType===p.NodeType.Element&&M!==E)throw new c.HierarchyRequestError("Document already has a document element node. Node is "+D.nodeName+".")}catch(J){B={error:J}}finally{try{ne&&!ne.done&&(P=ae.return)&&P.call(ae)}finally{if(B)throw B.error}}for(Q=E._nextSibling;Q;){if(Q._nodeType===p.NodeType.DocumentType)throw new c.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+D.nodeName+".");Q=Q._nextSibling}}else if(D._nodeType===p.NodeType.DocumentType){try{for(var ee=i(O._children),V=ee.next();!V.done;V=ee.next()){var M;if((M=V.value)._nodeType===p.NodeType.DocumentType&&M!==E)throw new c.HierarchyRequestError("Document already has a document type node. Node is "+D.nodeName+".")}}catch(J){F={error:J}}finally{try{V&&!V.done&&(k=ee.return)&&k.call(ee)}finally{if(F)throw F.error}}for(var I=E._previousSibling;I;){if(I._nodeType===p.NodeType.Element)throw new c.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+D.nodeName+".");I=I._previousSibling}}}var U=E._nextSibling;U===D&&(U=D._nextSibling);var z=E._previousSibling;C.document_adopt(D,O._nodeDocument);var j=[];E._parent!==null&&(j.push(E),_(E,E._parent,!0));var $=[];return D._nodeType===p.NodeType.DocumentFragment?$=Array.from(D._children):$.push(D),w(D,O,U,!0),u.dom.features.mutationObservers&&d.observer_queueTreeMutationRecord(O,$,j,z,U),E},n.mutation_replaceAll=function(E,D){var O,b;E!==null&&C.document_adopt(E,D._nodeDocument);var R=Array.from(D._children),N=[];E&&E._nodeType===p.NodeType.DocumentFragment?N=Array.from(E._children):E!==null&&N.push(E);try{for(var L=i(R),B=L.next();!B.done;B=L.next())_(B.value,D,!0)}catch(P){O={error:P}}finally{try{B&&!B.done&&(b=L.return)&&b.call(L)}finally{if(O)throw O.error}}E!==null&&w(E,D,null,!0),u.dom.features.mutationObservers&&d.observer_queueTreeMutationRecord(D,N,R,null,null)},n.mutation_preRemove=function(E,D){if(E._parent!==D)throw new c.NotFoundError("The child node cannot be found under parent node. Child node is "+E.nodeName+", parent node is "+D.nodeName+".");return _(E,D),E},n.mutation_remove=_},function(a,n,r){function i(o){return o==null}a.exports.isNothing=i,a.exports.isObject=function(o){return typeof o=="object"&&o!==null},a.exports.toArray=function(o){return Array.isArray(o)?o:i(o)?[]:[o]},a.exports.repeat=function(o,s){var u,c="";for(u=0;u0?i:r)(o)}},function(a,n,r){var i=r(8);a.exports=function(o,s){var u=[][o];return!!u&&i(function(){u.call(null,s||function(){throw 1},1)})}},function(a,n){a.exports={}},function(a,n,r){r(31),r(32),r(33),r(220),r(64),r(19),r(65),r(20),r(68),r(66),r(92),r(144),r(22),r(94),r(23);var i=this&&this.__values||function(m){var x=typeof Symbol=="function"&&Symbol.iterator,y=x&&m[x],d=0;if(y)return y.call(m);if(m&&typeof m.length=="number")return{next:function(){return m&&d>=m.length&&(m=void 0),{value:m&&m[d++],done:!m}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(m,x){var y=typeof Symbol=="function"&&m[Symbol.iterator];if(!y)return m;var d,g,C=y.call(m),S=[];try{for(;(x===void 0||x-- >0)&&!(d=C.next()).done;)S.push(d.value)}catch(T){g={error:T}}finally{try{d&&!d.done&&(y=C.return)&&y.call(C)}finally{if(g)throw g.error}}return S},s=this&&this.__spread||function(){for(var m=[],x=0;x/g,">");this.text(d)},m.prototype._serializeDocumentFragmentNS=function(x,y,d,g,C){var S,T;try{for(var w=i(x.childNodes),_=w.next();!_.done;_=w.next()){var E=_.value;this._serializeNodeNS(E,y,d,g,C)}}catch(D){S={error:D}}finally{try{_&&!_.done&&(T=w.return)&&T.call(w)}finally{if(S)throw S.error}}},m.prototype._serializeDocumentFragment=function(x,y){var d,g;try{for(var C=i(x._children),S=C.next();!S.done;S=C.next()){var T=S.value;this._serializeNode(T,y)}}catch(w){d={error:w}}finally{try{S&&!S.done&&(g=C.return)&&g.call(C)}finally{if(d)throw d.error}}},m.prototype._serializeDocumentType=function(x,y){if(y&&!f.xml_isPubidChar(x.publicId))throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");if(y&&(!f.xml_isLegalChar(x.systemId)||x.systemId.indexOf('"')!==-1&&x.systemId.indexOf("'")!==-1))throw new Error("DocType system identifier contains invalid characters (well-formed required).");this.docType(x.name,x.publicId,x.systemId)},m.prototype._serializeProcessingInstruction=function(x,y){if(y&&(x.target.indexOf(":")!==-1||/^xml$/i.test(x.target)))throw new Error("Processing instruction target contains invalid characters (well-formed required).");if(y&&(!f.xml_isLegalChar(x.data)||x.data.indexOf("?>")!==-1))throw new Error("Processing instruction data contains invalid characters (well-formed required).");this.instruction(x.target,x.data)},m.prototype._serializeCData=function(x,y){if(y&&x.data.indexOf("]]>")!==-1)throw new Error("CDATA contains invalid characters (well-formed required).");this.cdata(x.data)},m.prototype._serializeAttributesNS=function(x,y,d,g,C,S){var T,w,_=[],E=S?new c.LocalNameSet:void 0;try{for(var D=i(x.attributes),O=D.next();!O.done;O=D.next()){var b=O.value;if(S||C||b.namespaceURI!==null){if(S&&E&&E.has(b.namespaceURI,b.localName))throw new Error("Element contains duplicate attributes (well-formed required).");S&&E&&E.set(b.namespaceURI,b.localName);var R=b.namespaceURI,N=null;if(R!==null)if(N=y.get(b.prefix,R),R===l.namespace.XMLNS){if(b.value===l.namespace.XML||b.prefix===null&&C||b.prefix!==null&&(!(b.localName in g)||g[b.localName]!==b.value)&&y.has(b.localName,b.value))continue;if(S&&b.value===l.namespace.XMLNS)throw new Error("XMLNS namespace is reserved (well-formed required).");if(S&&b.value==="")throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");b.prefix==="xmlns"&&(N="xmlns")}else N===null&&(N=b.prefix===null||y.hasPrefix(b.prefix)&&!y.has(b.prefix,R)?this._generatePrefix(R,y,d):b.prefix,_.push([null,"xmlns",N,this._serializeAttributeValue(R,S)]));if(S&&(b.localName.indexOf(":")!==-1||!f.xml_isName(b.localName)||b.localName==="xmlns"&&R===null))throw new Error("Attribute local name contains invalid characters (well-formed required).");_.push([R,N,b.localName,this._serializeAttributeValue(b.value,S)])}else _.push([null,null,b.localName,this._serializeAttributeValue(b.value,S)])}}catch(L){T={error:L}}finally{try{O&&!O.done&&(w=D.return)&&w.call(D)}finally{if(T)throw T.error}}return _},m.prototype._serializeAttributes=function(x,y){var d,g,C=[],S=y?{}:void 0;try{for(var T=i(x.attributes),w=T.next();!w.done;w=T.next()){var _=w.value;if(y){if(y&&S&&_.localName in S)throw new Error("Element contains duplicate attributes (well-formed required).");if(y&&S&&(S[_.localName]=!0),y&&(_.localName.indexOf(":")!==-1||!f.xml_isName(_.localName)))throw new Error("Attribute local name contains invalid characters (well-formed required).");C.push([null,null,_.localName,this._serializeAttributeValue(_.value,y)])}else C.push([null,null,_.localName,this._serializeAttributeValue(_.value,y)])}}catch(E){d={error:E}}finally{try{w&&!w.done&&(g=T.return)&&g.call(T)}finally{if(d)throw d.error}}return C},m.prototype._recordNamespaceInformation=function(x,y,d){var g,C,S=null;try{for(var T=i(x.attributes),w=T.next();!w.done;w=T.next()){var _=w.value,E=_.namespaceURI,D=_.prefix;if(E===l.namespace.XMLNS){if(D===null){S=_.value;continue}var O=_.localName,b=_.value;if(b===l.namespace.XML||(b===""&&(b=null),y.has(O,b)))continue;y.set(O,b),d[O]=b||""}}}catch(R){g={error:R}}finally{try{w&&!w.done&&(C=T.return)&&C.call(T)}finally{if(g)throw g.error}}return S},m.prototype._generatePrefix=function(x,y,d){var g="ns"+d.value.toString();return d.value++,y.set(g,x),g},m.prototype._serializeAttributeValue=function(x,y){if(y&&x!==null&&!f.xml_isLegalChar(x))throw new Error("Invalid characters in attribute value.");return x===null?"":x.replace(h.nonEntityAmpersandRegex,"&").replace(//g,">").replace(/"/g,""")},m._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),m}();n.BaseWriter=v},function(a,n,r){var i=this&&this.__values||function(x){var y=typeof Symbol=="function"&&Symbol.iterator,d=y&&x[y],g=0;if(d)return d.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&g>=x.length&&(x=void 0),{value:x&&x[g++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(x,y){var d=typeof Symbol=="function"&&x[Symbol.iterator];if(!d)return x;var g,C,S=d.call(x),T=[];try{for(;(y===void 0||y-- >0)&&!(g=S.next()).done;)T.push(g.value)}catch(w){C={error:w}}finally{try{g&&!g.done&&(d=S.return)&&d.call(S)}finally{if(C)throw C.error}}return T};Object.defineProperty(n,"__esModule",{value:!0});var s=r(6),u=r(3),c=r(7),p=r(29),l=r(17),f=r(97);function h(){var x=s.dom.window;x._mutationObserverMicrotaskQueued||(x._mutationObserverMicrotaskQueued=!0,Promise.resolve().then(function(){v()}))}function v(){var x,y,d,g,C=s.dom.window;C._mutationObserverMicrotaskQueued=!1;var S=c.set.clone(C._mutationObservers),T=c.set.clone(C._signalSlots);c.set.empty(C._signalSlots);var w=function(R){var N=c.list.clone(R._recordQueue);c.list.empty(R._recordQueue);for(var L=0;L"+y+"<\/script>"},x=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch{}var y,d;x=i?function(C){C.write(m("")),C.close();var S=C.parentWindow.Object;return C=null,S}(i):((d=l("iframe")).style.display="none",p.appendChild(d),d.src=String("javascript:"),(y=d.contentWindow.document).open(),y.write(m("document.F=Object")),y.close(),y.F);for(var g=u.length;g--;)delete x.prototype[u[g]];return x()};c[h]=!0,a.exports=Object.create||function(y,d){var g;return y!==null?(v.prototype=o(y),g=new v,v.prototype=null,g[h]=y):g=x(),d===void 0?g:s(g,d)}},function(a,n,r){var i=r(121),o=r(84);a.exports=Object.keys||function(s){return i(s,o)}},function(a,n,r){var i=r(15).f,o=r(14),s=r(5)("toStringTag");a.exports=function(u,c,p){u&&!o(u=p?u:u.prototype,s)&&i(u,s,{configurable:!0,value:c})}},function(a,n,r){var i=r(8),o=r(5),s=r(129),u=o("species");a.exports=function(c){return s>=51||!i(function(){var p=[];return(p.constructor={})[u]=function(){return{foo:1}},p[c](Boolean).foo!==1})}},function(a,n,r){var i=r(4),o=r(122).indexOf,s=r(48),u=r(28),c=[].indexOf,p=!!c&&1/[1].indexOf(1,-0)<0,l=s("indexOf"),f=u("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:p||!l||!f},{indexOf:function(h){return p?c.apply(this,arguments)||0:o(this,h,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(16),o=r(15).f,s=Function.prototype,u=s.toString,c=/^\s*function ([^ (]*)/;i&&!("name"in s)&&o(s,"name",{configurable:!0,get:function(){try{return u.call(this).match(c)[1]}catch{return""}}})},function(a,n,r){var i=r(25),o=r(18),s=r(8),u=r(136),c=RegExp.prototype,p=c.toString,l=s(function(){return p.call({source:"a",flags:"b"})!="/a/b"}),f=p.name!="toString";(l||f)&&i(RegExp.prototype,"toString",function(){var h=o(this),v=String(h.source),m=h.flags;return"/"+v+"/"+String(m===void 0&&h instanceof RegExp&&!("flags"in c)?u.call(h):m)},{unsafe:!0})},function(a,n,r){r(31),r(32),r(33),r(19),r(138),r(20),r(66),r(22),r(23);var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),s=this&&this.__values||function(l){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&l[f],v=0;if(h)return h.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&v>=l.length&&(l=void 0),{value:l&&l[v++],done:!l}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(2),c=r(1),p=function(l){function f(h,v){var m=l.call(this,h)||this;return m._writerOptions=u.applyDefaults(v,{format:"object",wellFormed:!1,group:!1,verbose:!1}),m}return o(f,l),f.prototype.serialize=function(h){return this._currentList=[],this._currentIndex=0,this._listRegister=[this._currentList],this.serializeNode(h,this._writerOptions.wellFormed),this._process(this._currentList,this._writerOptions)},f.prototype._process=function(h,v){var m,x,y,d,g,C,S;if(h.length===0)return{};for(var T={},w=!1,_=0,E=0,D=0,O=0,b=0;b2)try{for(var S=s(h),T=S.next();!T.done;T=S.next()){var w=T.value;v[x+(d++).toString()]=w}}catch(_){g={error:_}}finally{try{T&&!T.done&&(C=S.return)&&C.call(S)}finally{if(g)throw g.error}}else v[y>1?x+(d++).toString():x]=h;return d},f.prototype.beginElement=function(h){var v,m,x=[];if(this._currentList.length===0)this._currentList.push(((v={})[h]=x,v));else{var y=this._currentList[this._currentList.length-1];this._isElementNode(y,h)?y[h].length!==0&&u.isArray(y[h][0])?y[h].push(x):y[h]=[y[h],x]:this._currentList.push(((m={})[h]=x,m))}this._currentIndex++,this._listRegister.length>this._currentIndex?this._listRegister[this._currentIndex]=x:this._listRegister.push(x),this._currentList=x},f.prototype.endElement=function(){this._currentList=this._listRegister[--this._currentIndex]},f.prototype.attribute=function(h,v){var m,x;if(this._currentList.length===0)this._currentList.push({"@":(m={},m[h]=v,m)});else{var y=this._currentList[this._currentList.length-1];this._isAttrNode(y)?y["@"][h]=v:this._currentList.push({"@":(x={},x[h]=v,x)})}},f.prototype.comment=function(h){if(this._currentList.length===0)this._currentList.push({"!":h});else{var v=this._currentList[this._currentList.length-1];this._isCommentNode(v)?u.isArray(v["!"])?v["!"].push(h):v["!"]=[v["!"],h]:this._currentList.push({"!":h})}},f.prototype.text=function(h){if(this._currentList.length===0)this._currentList.push({"#":h});else{var v=this._currentList[this._currentList.length-1];this._isTextNode(v)?u.isArray(v["#"])?v["#"].push(h):v["#"]=[v["#"],h]:this._currentList.push({"#":h})}},f.prototype.instruction=function(h,v){var m=v===""?h:h+" "+v;if(this._currentList.length===0)this._currentList.push({"?":m});else{var x=this._currentList[this._currentList.length-1];this._isInstructionNode(x)?u.isArray(x["?"])?x["?"].push(m):x["?"]=[x["?"],m]:this._currentList.push({"?":m})}},f.prototype.cdata=function(h){if(this._currentList.length===0)this._currentList.push({$:h});else{var v=this._currentList[this._currentList.length-1];this._isCDATANode(v)?u.isArray(v.$)?v.$.push(h):v.$=[v.$,h]:this._currentList.push({$:h})}},f.prototype._isAttrNode=function(h){return"@"in h},f.prototype._isTextNode=function(h){return"#"in h},f.prototype._isCommentNode=function(h){return"!"in h},f.prototype._isInstructionNode=function(h){return"?"in h},f.prototype._isCDATANode=function(h){return"$"in h},f.prototype._isElementNode=function(h,v){return v in h},f.prototype._getAttrKey=function(){return this._builderOptions.convert.att},f.prototype._getNodeKey=function(h){switch(h){case c.NodeType.Comment:return this._builderOptions.convert.comment;case c.NodeType.Text:return this._builderOptions.convert.text;case c.NodeType.ProcessingInstruction:return this._builderOptions.convert.ins;case c.NodeType.CData:return this._builderOptions.convert.cdata;default:throw new Error("Invalid node type.")}},f}(r(50).BaseWriter);n.ObjectWriter=p},function(a,n,r){var i=r(4),o=r(93);i({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this._items={},this._nullItems={}}return o.prototype.set=function(s,u){s===null?this._nullItems[u]=!0:(this._items[s]||(this._items[s]={}),this._items[s][u]=!0)},o.prototype.has=function(s,u){return s===null?this._nullItems[u]===!0:!!this._items[s]&&this._items[s][u]===!0},o}();n.LocalNameSet=i},function(a,n,r){var i=this&&this.__read||function(p,l){var f=typeof Symbol=="function"&&p[Symbol.iterator];if(!f)return p;var h,v,m=f.call(p),x=[];try{for(;(l===void 0||l-- >0)&&!(h=m.next()).done;)x.push(h.value)}catch(y){v={error:y}}finally{try{h&&!h.done&&(f=m.return)&&f.call(m)}finally{if(v)throw v.error}}return x};Object.defineProperty(n,"__esModule",{value:!0});var o=r(9),s=r(3),u=r(0),c=function(){function p(){}return Object.defineProperty(p.prototype,"_eventListenerList",{get:function(){return this.__eventListenerList||(this.__eventListenerList=[])},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"_eventHandlerMap",{get:function(){return this.__eventHandlerMap||(this.__eventHandlerMap={})},enumerable:!0,configurable:!0}),p.prototype.addEventListener=function(l,f,h){h===void 0&&(h={passive:!1,once:!1,capture:!1});var v,m=i(u.eventTarget_flattenMore(h),3),x=m[0],y=m[1],d=m[2];f&&(v=s.Guard.isEventListener(f)?f:{handleEvent:f},u.eventTarget_addEventListener(this,{type:l,callback:v,capture:x,passive:y,once:d,removed:!1}))},p.prototype.removeEventListener=function(l,f,h){h===void 0&&(h={capture:!1});var v=u.eventTarget_flatten(h);if(f)for(var m=0;m=y.length&&(y=void 0),{value:y&&y[C++],done:!y}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(y,d){var g=typeof Symbol=="function"&&y[Symbol.iterator];if(!g)return y;var C,S,T=g.call(y),w=[];try{for(;(d===void 0||d-- >0)&&!(C=T.next()).done;)w.push(C.value)}catch(_){S={error:_}}finally{try{C&&!C.done&&(g=T.return)&&g.call(T)}finally{if(S)throw S.error}}return w},s=this&&this.__spread||function(){for(var y=[],d=0;d",amp:"&",quot:'"',apos:"'"},s}();n.BaseReader=o},function(a,n,r){var i=r(39);a.exports=i.DEFAULT=new i({include:[r(54)],explicit:[r(300),r(301),r(302)]})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(185);n.XMLBuilderImpl=i.XMLBuilderImpl;var o=r(305);n.XMLBuilderCBImpl=o.XMLBuilderCBImpl;var s=r(183);n.builder=s.builder,n.create=s.create,n.fragment=s.fragment,n.convert=s.convert;var u=r(310);n.createCB=u.createCB,n.fragmentCB=u.fragmentCB},function(a,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}a.exports=r},function(a,n,r){var i={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,s=o&&!i.call({1:2},1);n.f=s?function(u){var c=o(this,u);return!!c&&c.enumerable}:i},function(a,n,r){var i=r(11),o=r(21);a.exports=function(s,u){try{o(i,s,u)}catch{i[s]=u}return u}},function(a,n,r){var i=r(44),o=r(118);(a.exports=function(s,u){return o[s]||(o[s]=u!==void 0?u:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(a,n,r){var i=r(121),o=r(84).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(s){return i(s,o)}},function(a,n,r){var i=r(47),o=Math.max,s=Math.min;a.exports=function(u,c){var p=i(u);return p<0?o(p+c,0):s(p,c)}},function(a,n){a.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(a,n){n.f=Object.getOwnPropertySymbols},function(a,n,r){var i=r(8);a.exports=!!Object.getOwnPropertySymbols&&!i(function(){return!String(Symbol())})},function(a,n,r){var i=r(127);a.exports=function(o,s,u){if(i(o),s===void 0)return o;switch(u){case 0:return function(){return o.call(s)};case 1:return function(c){return o.call(s,c)};case 2:return function(c,p){return o.call(s,c,p)};case 3:return function(c,p,l){return o.call(s,c,p,l)}}return function(){return o.apply(s,arguments)}}},function(a,n,r){var i=r(4),o=r(195),s=r(132),u=r(133),c=r(62),p=r(21),l=r(25),f=r(5),h=r(44),v=r(49),m=r(131),x=m.IteratorPrototype,y=m.BUGGY_SAFARI_ITERATORS,d=f("iterator"),g=function(){return this};a.exports=function(C,S,T,w,_,E,D){o(T,S,w);var O,b,R,N=function(W){if(W===_&&k)return k;if(!y&&W in P)return P[W];switch(W){case"keys":case"values":case"entries":return function(){return new T(this,W)}}return function(){return new T(this)}},L=S+" Iterator",B=!1,P=C.prototype,F=P[d]||P["@@iterator"]||_&&P[_],k=!y&&F||N(_),G=S=="Array"&&P.entries||F;if(G&&(O=s(G.call(new C)),x!==Object.prototype&&O.next&&(h||s(O)===x||(u?u(O,x):typeof O[d]!="function"&&p(O,d,g)),c(O,L,!0,!0),h&&(v[L]=g))),_=="values"&&F&&F.name!=="values"&&(B=!0,k=function(){return F.call(this)}),h&&!D||P[d]===k||p(P,d,k),v[S]=k,_)if(b={values:N("values"),keys:E?k:N("keys"),entries:N("entries")},D)for(R in b)(y||B||!(R in P))&&l(P,R,b[R]);else i({target:S,proto:!0,forced:y||B},b);return b}},function(a,n,r){var i=r(4),o=r(13),s=r(59),u=r(83),c=r(26),p=r(24),l=r(134),f=r(5),h=r(63),v=r(28),m=h("slice"),x=v("slice",{ACCESSORS:!0,0:0,1:2}),y=f("species"),d=[].slice,g=Math.max;i({target:"Array",proto:!0,forced:!m||!x},{slice:function(C,S){var T,w,_,E=p(this),D=c(E.length),O=u(C,D),b=u(S===void 0?D:S,D);if(s(E)&&(typeof(T=E.constructor)!="function"||T!==Array&&!s(T.prototype)?o(T)&&(T=T[y])===null&&(T=void 0):T=void 0,T===Array||T===void 0))return d.call(E,O,b);for(w=new(T===void 0?Array:T)(g(b-O,0)),_=0;O0&&(!C.multiline||C.multiline&&m[C.lastIndex-1]!==` +`)&&(w="(?: "+w+")",E=" "+E,_++),y=new RegExp("^(?:"+w+")",T)),v&&(y=new RegExp("^"+w+"$(?!\\s)",T)),f&&(x=C.lastIndex),d=c.call(S?y:C,E),S?d?(d.input=d.input.slice(_),d[0]=d[0].slice(_),d.index=C.lastIndex,C.lastIndex+=d[0].length):C.lastIndex=0:f&&d&&(C.lastIndex=C.global?d.index+d[0].length:x),v&&d&&d.length>1&&p.call(d[0],y,function(){for(g=1;g]*>)/g,y=/\$([$&'`]|\d\d?)/g;i("replace",2,function(d,g,C,S){var T=S.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=S.REPLACE_KEEPS_$0,_=T?"$":"$0";return[function(D,O){var b=p(this),R=D==null?void 0:D[d];return R!==void 0?R.call(D,b,O):g.call(String(b),D,O)},function(D,O){if(!T&&w||typeof O=="string"&&O.indexOf(_)===-1){var b=C(g,D,this,O);if(b.done)return b.value}var R=o(D),N=String(this),L=typeof O=="function";L||(O=String(O));var B=R.global;if(B){var P=R.unicode;R.lastIndex=0}for(var F=[];;){var k=f(R,N);if(k===null||(F.push(k),!B))break;String(k[0])===""&&(R.lastIndex=l(N,u(R.lastIndex),P))}for(var G,W="",H=0,X=0;X=H&&(W+=N.slice(H,q)+V,H=q+Y.length)}return W+N.slice(H)}];function E(D,O,b,R,N,L){var B=b+D.length,P=R.length,F=y;return N!==void 0&&(N=s(N),F=x),g.call(L,F,function(k,G){var W;switch(G.charAt(0)){case"$":return"$";case"&":return D;case"`":return O.slice(0,b);case"'":return O.slice(B);case"<":W=N[G.slice(1,-1)];break;default:var H=+G;if(H===0)return k;if(H>P){var X=m(H/10);return X===0?k:X<=P?R[X-1]===void 0?G.charAt(1):R[X-1]+G.charAt(1):k}W=R[H-1]}return W===void 0?"":W})}})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this._items={},this._nullItems=[]}return o.prototype.copy=function(){var s=new o;for(var u in this._items)s._items[u]=this._items[u].slice(0);return s._nullItems=this._nullItems.slice(0),s},o.prototype.get=function(s,u){var c=u===null?this._nullItems:this._items[u]||null;if(c===null)return null;for(var p=null,l=0;l=O.length&&(O=void 0),{value:O&&O[N++],done:!O}}};throw new TypeError(b?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(O,b){var R=typeof Symbol=="function"&&O[Symbol.iterator];if(!R)return O;var N,L,B=R.call(O),P=[];try{for(;(b===void 0||b-- >0)&&!(N=B.next()).done;)P.push(N.value)}catch(F){L={error:F}}finally{try{N&&!N.done&&(R=B.return)&&R.call(B)}finally{if(L)throw L.error}}return P},s=this&&this.__spread||function(){for(var O=[],b=0;b=0;J--)if((oe=$[J]).shadowAdjustedTarget!==null){j=oe;break}if(j!==null)if(p.Guard.isNode(j.shadowAdjustedTarget)&&p.Guard.isShadowRoot(v.tree_rootNode(j.shadowAdjustedTarget,!0)))k=!0;else if(p.Guard.isNode(j.relatedTarget)&&p.Guard.isShadowRoot(v.tree_rootNode(j.relatedTarget,!0)))k=!0;else for(var re=0;re=0;J--)(oe=$[J]).shadowAdjustedTarget!==null?O._eventPhase=c.EventPhase.AtTarget:O._eventPhase=c.EventPhase.Capturing,S(oe,O,"capturing",N);for(J=0;J<$.length;J++){if((oe=$[J]).shadowAdjustedTarget!==null)O._eventPhase=c.EventPhase.AtTarget;else{if(!O._bubbles)continue;O._eventPhase=c.EventPhase.Bubbling}S(oe,O,"bubbling",N)}}return O._eventPhase=c.EventPhase.None,O._currentTarget=null,O._path=[],O._dispatchFlag=!1,O._stopPropagationFlag=!1,O._stopImmediatePropagationFlag=!1,k&&(O._target=null,O._relatedTarget=null,O._touchTargetList=[]),H!==null&&(O._canceledFlag||H._activationBehavior===void 0?H._legacyCanceledActivationBehavior!==void 0&&H._legacyCanceledActivationBehavior(O):H._activationBehavior(O)),!O._canceledFlag}function C(O,b,R,N,L,B){var P=!1;p.Guard.isNode(b)&&p.Guard.isShadowRoot(v.tree_rootNode(b))&&(P=!0);var F=!1;p.Guard.isShadowRoot(b)&&b._mode==="closed"&&(F=!0),O._path.push({invocationTarget:b,invocationTargetInShadowTree:P,shadowAdjustedTarget:R,relatedTarget:N,touchTargetList:L,rootOfClosedTree:F,slotInClosedTree:B})}function S(O,b,R,N){N===void 0&&(N={value:!1});for(var L=b._path,B=-1,P=0;P0&&(F=L[B-1]).shadowAdjustedTarget!==null)&&(b._target=F.shadowAdjustedTarget)}if(b._relatedTarget=O.relatedTarget,b._touchTargetList=O.touchTargetList,!b._stopPropagationFlag){b._currentTarget=O.invocationTarget;var k=b._currentTarget._eventListenerList,G=new(Array.bind.apply(Array,s([void 0],k)));if(!T(b,G,R,O,N)&&b._isTrusted){var W=b._type;W==="animationend"?b._type="webkitAnimationEnd":W==="animationiteration"?b._type="webkitAnimationIteration":W==="animationstart"?b._type="webkitAnimationStart":W==="transitionend"&&(b._type="webkitTransitionEnd"),T(b,G,R,O,N),b._type=W}}}function T(O,b,R,N,L){L===void 0&&(L={value:!1});for(var B=!1,P=0;P=C.length&&(C=void 0),{value:C&&C[w++],done:!C}}};throw new TypeError(S?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__read||function(C,S){var T=typeof Symbol=="function"&&C[Symbol.iterator];if(!T)return C;var w,_,E=T.call(C),D=[];try{for(;(S===void 0||S-- >0)&&!(w=E.next()).done;)D.push(w.value)}catch(O){_={error:O}}finally{try{w&&!w.done&&(T=E.return)&&T.call(E)}finally{if(_)throw _.error}}return D};Object.defineProperty(n,"__esModule",{value:!0});var c=r(6),p=r(1),l=r(9),f=r(34),h=r(3),v=r(2),m=r(7),x=r(152),y=r(0),d=r(12),g=function(C){function S(){var T=C.call(this)||this;return T._children=new Set,T._encoding={name:"UTF-8",labels:["unicode-1-1-utf-8","utf-8","utf8"]},T._contentType="application/xml",T._URL={scheme:"about",username:"",password:"",host:null,port:null,path:["blank"],query:null,fragment:null,_cannotBeABaseURLFlag:!0,_blobURLEntry:null},T._origin=null,T._type="xml",T._mode="no-quirks",T._documentElement=null,T._hasNamespaces=!1,T._nodeDocumentOverwrite=null,T}return o(S,C),Object.defineProperty(S.prototype,"_nodeDocument",{get:function(){return this._nodeDocumentOverwrite||this},set:function(T){this._nodeDocumentOverwrite=T},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"implementation",{get:function(){return this._implementation||(this._implementation=y.create_domImplementation(this))},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"URL",{get:function(){return x.urlSerializer(this._URL)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"documentURI",{get:function(){return this.URL},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"origin",{get:function(){return"null"},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"compatMode",{get:function(){return this._mode==="quirks"?"BackCompat":"CSS1Compat"},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"characterSet",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"charset",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"inputEncoding",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"contentType",{get:function(){return this._contentType},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"doctype",{get:function(){var T,w;try{for(var _=s(this._children),E=_.next();!E.done;E=_.next()){var D=E.value;if(h.Guard.isDocumentTypeNode(D))return D}}catch(O){T={error:O}}finally{try{E&&!E.done&&(w=_.return)&&w.call(_)}finally{if(T)throw T.error}}return null},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"documentElement",{get:function(){return this._documentElement},enumerable:!0,configurable:!0}),S.prototype.getElementsByTagName=function(T){return y.node_listOfElementsWithQualifiedName(T,this)},S.prototype.getElementsByTagNameNS=function(T,w){return y.node_listOfElementsWithNamespace(T,w,this)},S.prototype.getElementsByClassName=function(T){return y.node_listOfElementsWithClassNames(T,this)},S.prototype.createElement=function(T,w){if(!y.xml_isName(T))throw new l.InvalidCharacterError;this._type==="html"&&(T=T.toLowerCase());var _=null;w!==void 0&&(_=v.isString(w)?w:w.is);var E=this._type==="html"||this._contentType==="application/xhtml+xml"?m.namespace.HTML:null;return y.element_createAnElement(this,T,E,null,_,!0)},S.prototype.createElementNS=function(T,w,_){return y.document_internalCreateElementNS(this,T,w,_)},S.prototype.createDocumentFragment=function(){return y.create_documentFragment(this)},S.prototype.createTextNode=function(T){return y.create_text(this,T)},S.prototype.createCDATASection=function(T){if(this._type==="html")throw new l.NotSupportedError;if(T.indexOf("]]>")!==-1)throw new l.InvalidCharacterError;return y.create_cdataSection(this,T)},S.prototype.createComment=function(T){return y.create_comment(this,T)},S.prototype.createProcessingInstruction=function(T,w){if(!y.xml_isName(T))throw new l.InvalidCharacterError;if(w.indexOf("?>")!==-1)throw new l.InvalidCharacterError;return y.create_processingInstruction(this,T,w)},S.prototype.importNode=function(T,w){if(w===void 0&&(w=!1),h.Guard.isDocumentNode(T)||h.Guard.isShadowRoot(T))throw new l.NotSupportedError;return y.node_clone(T,this,w)},S.prototype.adoptNode=function(T){if(h.Guard.isDocumentNode(T))throw new l.NotSupportedError;if(h.Guard.isShadowRoot(T))throw new l.HierarchyRequestError;return y.document_adopt(T,this),T},S.prototype.createAttribute=function(T){if(!y.xml_isName(T))throw new l.InvalidCharacterError;return this._type==="html"&&(T=T.toLowerCase()),y.create_attr(this,T)},S.prototype.createAttributeNS=function(T,w){var _=u(y.namespace_validateAndExtract(T,w),3),E=_[0],D=_[1],O=_[2],b=y.create_attr(this,O);return b._namespace=E,b._namespacePrefix=D,b},S.prototype.createEvent=function(T){return y.event_createLegacyEvent(T)},S.prototype.createRange=function(){var T=y.create_range();return T._start=[this,0],T._end=[this,0],T},S.prototype.createNodeIterator=function(T,w,_){w===void 0&&(w=p.WhatToShow.All),_===void 0&&(_=null);var E=y.create_nodeIterator(T,T,!0);return E._whatToShow=w,E._iteratorCollection=y.create_nodeList(T),v.isFunction(_)?(E._filter=y.create_nodeFilter(),E._filter.acceptNode=_):E._filter=_,E},S.prototype.createTreeWalker=function(T,w,_){w===void 0&&(w=p.WhatToShow.All),_===void 0&&(_=null);var E=y.create_treeWalker(T,T);return E._whatToShow=w,v.isFunction(_)?(E._filter=y.create_nodeFilter(),E._filter.acceptNode=_):E._filter=_,E},S.prototype._getTheParent=function(T){return T._type==="load"?null:c.dom.window},S.prototype.getElementById=function(T){throw new Error("Mixin: NonElementParentNode not implemented.")},Object.defineProperty(S.prototype,"children",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"firstElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"lastElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"childElementCount",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),S.prototype.prepend=function(){for(var T=[],w=0;w=x.length&&(x=void 0),{value:x&&x[g++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__read||function(x,y){var d=typeof Symbol=="function"&&x[Symbol.iterator];if(!d)return x;var g,C,S=d.call(x),T=[];try{for(;(y===void 0||y-- >0)&&!(g=S.next()).done;)T.push(g.value)}catch(w){C={error:w}}finally{try{g&&!g.done&&(d=S.return)&&d.call(S)}finally{if(C)throw C.error}}return T};Object.defineProperty(n,"__esModule",{value:!0});var c=r(1),p=r(34),l=r(9),f=r(7),h=r(0),v=r(12),m=function(x){function y(){var d=x.call(this)||this;return d._children=new Set,d._namespace=null,d._namespacePrefix=null,d._localName="",d._customElementState="undefined",d._customElementDefinition=null,d._is=null,d._shadowRoot=null,d._attributeList=h.create_namedNodeMap(d),d._attributeChangeSteps=[],d._name="",d._assignedSlot=null,d}return o(y,x),Object.defineProperty(y.prototype,"namespaceURI",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"prefix",{get:function(){return this._namespacePrefix},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"localName",{get:function(){return this._localName},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"tagName",{get:function(){return this._htmlUppercasedQualifiedName},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"id",{get:function(){return h.element_getAnAttributeValue(this,"id")},set:function(d){h.element_setAnAttributeValue(this,"id",d)},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"className",{get:function(){return h.element_getAnAttributeValue(this,"class")},set:function(d){h.element_setAnAttributeValue(this,"class",d)},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"classList",{get:function(){var d=h.element_getAnAttributeByName("class",this);return d===null&&(d=h.create_attr(this._nodeDocument,"class")),h.create_domTokenList(this,d)},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"slot",{get:function(){return h.element_getAnAttributeValue(this,"slot")},set:function(d){h.element_setAnAttributeValue(this,"slot",d)},enumerable:!0,configurable:!0}),y.prototype.hasAttributes=function(){return this._attributeList.length!==0},Object.defineProperty(y.prototype,"attributes",{get:function(){return this._attributeList},enumerable:!0,configurable:!0}),y.prototype.getAttributeNames=function(){var d,g,C=[];try{for(var S=s(this._attributeList),T=S.next();!T.done;T=S.next()){var w=T.value;C.push(w._qualifiedName)}}catch(_){d={error:_}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(d)throw d.error}}return C},y.prototype.getAttribute=function(d){var g=h.element_getAnAttributeByName(d,this);return g?g._value:null},y.prototype.getAttributeNS=function(d,g){var C=h.element_getAnAttributeByNamespaceAndLocalName(d,g,this);return C?C._value:null},y.prototype.setAttribute=function(d,g){if(!h.xml_isName(d))throw new l.InvalidCharacterError;this._namespace===f.namespace.HTML&&this._nodeDocument._type==="html"&&(d=d.toLowerCase());for(var C=null,S=0;S=h.length&&(h=void 0),{value:h&&h[x++],done:!h}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(1),c=r(71),p=r(0),l=r(12),f=function(h){function v(m){m===void 0&&(m="");var x=h.call(this,m)||this;return x._name="",x._assignedSlot=null,x}return o(v,h),Object.defineProperty(v.prototype,"wholeText",{get:function(){var m,x,y="";try{for(var d=s(p.text_contiguousTextNodes(this,!0)),g=d.next();!g.done;g=d.next())y+=g.value._data}catch(C){m={error:C}}finally{try{g&&!g.done&&(x=d.return)&&x.call(d)}finally{if(m)throw m.error}}return y},enumerable:!0,configurable:!0}),v.prototype.splitText=function(m){return p.text_split(this,m)},Object.defineProperty(v.prototype,"assignedSlot",{get:function(){throw new Error("Mixin: Slotable not implemented.")},enumerable:!0,configurable:!0}),v._create=function(m,x){x===void 0&&(x="");var y=new v(x);return y._nodeDocument=m,y},v}(c.CharacterDataImpl);n.TextImpl=f,l.idl_defineConst(f.prototype,"_nodeType",u.NodeType.Text)},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){}return Object.defineProperty(o.prototype,"_startNode",{get:function(){return this._start[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_startOffset",{get:function(){return this._start[1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_endNode",{get:function(){return this._end[0]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_endOffset",{get:function(){return this._end[1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_collapsed",{get:function(){return this._start[0]===this._end[0]&&this._start[1]===this._end[1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"startContainer",{get:function(){return this._startNode},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"startOffset",{get:function(){return this._startOffset},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"endContainer",{get:function(){return this._endNode},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"endOffset",{get:function(){return this._endOffset},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"collapsed",{get:function(){return this._collapsed},enumerable:!0,configurable:!0}),o}();n.AbstractRangeImpl=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=function(){function s(u){this._activeFlag=!1,this._root=u,this._whatToShow=i.WhatToShow.All,this._filter=null}return Object.defineProperty(s.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"whatToShow",{get:function(){return this._whatToShow},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"filter",{get:function(){return this._filter},enumerable:!0,configurable:!0}),s}();n.TraverserImpl=o},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=r(0),s=r(12),u=function(){function c(p,l){this._target=null,this._relatedTarget=null,this._touchTargetList=[],this._path=[],this._currentTarget=null,this._eventPhase=i.EventPhase.None,this._stopPropagationFlag=!1,this._stopImmediatePropagationFlag=!1,this._canceledFlag=!1,this._inPassiveListenerFlag=!1,this._composedFlag=!1,this._initializedFlag=!1,this._dispatchFlag=!1,this._isTrusted=!1,this._bubbles=!1,this._cancelable=!1,this._type=p,l&&(this._bubbles=l.bubbles||!1,this._cancelable=l.cancelable||!1,this._composedFlag=l.composed||!1),this._initializedFlag=!0,this._timeStamp=new Date().getTime()}return Object.defineProperty(c.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"srcElement",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"currentTarget",{get:function(){return this._currentTarget},enumerable:!0,configurable:!0}),c.prototype.composedPath=function(){var p=[],l=this._path;if(l.length===0)return p;var f=this._currentTarget;if(f===null)throw new Error("Event currentTarget is null.");p.push(f);for(var h=0,v=0,m=l.length-1;m>=0;){if(l[m].rootOfClosedTree&&v++,l[m].invocationTarget===f){h=m;break}l[m].slotInClosedTree&&v--,m--}var x=v,y=v;for(m=h-1;m>=0;)l[m].rootOfClosedTree&&x++,x<=y&&p.unshift(l[m].invocationTarget),l[m].slotInClosedTree&&--x0)&&!(C=T.next()).done;)w.push(C.value)}catch(_){S={error:_}}finally{try{C&&!C.done&&(g=T.return)&&g.call(T)}finally{if(S)throw S.error}}return w},o=this&&this.__values||function(y){var d=typeof Symbol=="function"&&Symbol.iterator,g=d&&y[d],C=0;if(g)return g.call(y);if(y&&typeof y.length=="number")return{next:function(){return y&&C>=y.length&&(y=void 0),{value:y&&y[C++],done:!y}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=r(6),u=r(3),c=r(2),p=r(99),l=r(73),f=r(17),h=r(173),v=r(30),m=r(52),x=r(37);n.document_elementInterface=function(y,d){return p.ElementImpl},n.document_internalCreateElementNS=function(y,d,g,C){var S=i(h.namespace_validateAndExtract(d,g),3),T=S[0],w=S[1],_=S[2],E=null;return C!==void 0&&(E=c.isString(C)?C:C.is),m.element_createAnElement(y,_,T,w,E,!0)},n.document_adopt=function(y,d){var g,C;if(y._nodeDocument!==d||y._parent!==null){var S=y._nodeDocument;if(y._parent&&x.mutation_remove(y,y._parent),d!==S)for(var T=f.tree_getFirstDescendantNode(y,!0,!0);T!==null;){if(T._nodeDocument=d,u.Guard.isElementNode(T))try{for(var w=(g=void 0,o(T._attributeList._asArray())),_=w.next();!_.done;_=w.next())_.value._nodeDocument=d}catch(E){g={error:E}}finally{try{_&&!_.done&&(C=w.return)&&C.call(w)}finally{if(g)throw g.error}}s.dom.features.customElements&&u.Guard.isElementNode(T)&&T._customElementState==="custom"&&l.customElement_enqueueACustomElementCallbackReaction(T,"adoptedCallback",[S,d]),s.dom.features.steps&&v.dom_runAdoptingSteps(T,S),T=f.tree_getNextDescendantNode(y,T,!0,!0)}}}},function(a,n,r){var i=this&&this.__values||function(f){var h=typeof Symbol=="function"&&Symbol.iterator,v=h&&f[h],m=0;if(v)return v.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&m>=f.length&&(f=void 0),{value:f&&f[m++],done:!f}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),u=r(9),c=r(17),p=r(51),l=r(30);n.characterData_replaceData=function(f,h,v,m){var x,y,d=c.tree_nodeLength(f);if(h>d)throw new u.IndexSizeError("Offset exceeds character data length. Offset: "+h+", Length: "+d+", Node is "+f.nodeName+".");h+v>d&&(v=d-h),o.dom.features.mutationObservers&&p.observer_queueMutationRecord("characterData",f,null,null,f._data,[],[],null,null);var g=f._data.substring(0,h)+m+f._data.substring(h+v);f._data=g;try{for(var C=i(o.dom.rangeList),S=C.next();!S.done;S=C.next()){var T=S.value;T._start[0]===f&&T._start[1]>h&&T._start[1]<=h+v&&(T._start[1]=h),T._end[0]===f&&T._end[1]>h&&T._end[1]<=h+v&&(T._end[1]=h),T._start[0]===f&&T._start[1]>h+v&&(T._start[1]+=m.length-v),T._end[0]===f&&T._end[1]>h+v&&(T._end[1]+=m.length-v)}}catch(w){x={error:w}}finally{try{S&&!S.done&&(y=C.return)&&y.call(C)}finally{if(x)throw x.error}}o.dom.features.steps&&s.Guard.isTextNode(f)&&f._parent!==null&&l.dom_runChildTextContentChangeSteps(f._parent)},n.characterData_substringData=function(f,h,v){var m=c.tree_nodeLength(f);if(h>m)throw new u.IndexSizeError("Offset exceeds character data length. Offset: "+h+", Length: "+m+", Node is "+f.nodeName+".");return h+v>m?f._data.substr(h):f._data.substr(h,v)}},function(a,n,r){var i=this&&this.__read||function(l,f){var h=typeof Symbol=="function"&&l[Symbol.iterator];if(!h)return l;var v,m,x=h.call(l),y=[];try{for(;(f===void 0||f-- >0)&&!(v=x.next()).done;)y.push(v.value)}catch(d){m={error:d}}finally{try{v&&!v.done&&(h=x.return)&&h.call(x)}finally{if(m)throw m.error}}return y},o=this&&this.__spread||function(){for(var l=[],f=0;f=l.length&&(l=void 0),{value:l&&l[v++],done:!l}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(7);function c(l){var f=u.string.splitAStringOnASCIIWhitespace(l);return new Set(f)}function p(l){return o(l).join(" ")}n.orderedSet_parse=c,n.orderedSet_serialize=p,n.orderedSet_sanitize=function(l){return p(c(l))},n.orderedSet_contains=function(l,f,h){var v,m,x,y;try{for(var d=s(f),g=d.next();!g.done;g=d.next()){var C=g.value,S=!1;try{for(var T=(x=void 0,s(l)),w=T.next();!w.done;w=T.next()){var _=w.value;if(h){if(_===C){S=!0;break}}else if(_.toUpperCase()===C.toUpperCase()){S=!0;break}}}catch(E){x={error:E}}finally{try{w&&!w.done&&(y=T.return)&&y.call(T)}finally{if(x)throw x.error}}if(!S)return!1}}catch(E){v={error:E}}finally{try{g&&!g.done&&(m=d.return)&&m.call(d)}finally{if(v)throw v.error}}return!0}},function(a,n,r){r(179),Object.defineProperty(n,"__esModule",{value:!0});var i=r(263),o=r(110),s=r(2);o.dom.setFeatures(!1),n.createDocument=function(){var u=new i.DOMImplementation().createDocument(null,"root",null);return u.documentElement&&u.removeChild(u.documentElement),u},n.sanitizeInput=function(u,c){if(u==null)return u;if(c===void 0)return u+"";var p="";u+="";for(var l=0;l=32&&f<=55295||f>=57344&&f<=65533)p+=u.charAt(l);else if(f>=55296&&f<=56319&&l=56320&&h<=57343?(f=1024*(f-55296)+h-56320+65536,p+=String.fromCodePoint(f),l++):p+=s.isString(c)?c:c(u.charAt(l),l,u)}else p+=s.isString(c)?c:c(u.charAt(l),l,u)}return p}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=r(153);n.AbortController=o.AbortControllerImpl;var s=r(154);n.AbortSignal=s.AbortSignalImpl;var u=r(102);n.AbstractRange=u.AbstractRangeImpl;var c=r(157);n.Attr=c.AttrImpl;var p=r(158);n.CDATASection=p.CDATASectionImpl;var l=r(71);n.CharacterData=l.CharacterDataImpl;var f=r(264),h=r(159);n.Comment=h.CommentImpl;var v=r(171);n.CustomEvent=v.CustomEventImpl;var m=r(100);n.DocumentFragment=m.DocumentFragmentImpl;var x=r(98);n.Document=x.DocumentImpl;var y=r(265),d=r(155);n.DocumentType=d.DocumentTypeImpl;var g=r(6);n.dom=g.dom;var C=r(148);n.DOMImplementation=C.DOMImplementationImpl;var S=r(170);n.DOMTokenList=S.DOMTokenListImpl;var T=r(99);n.Element=T.ElementImpl;var w=r(104);n.Event=w.EventImpl;var _=r(70);n.EventTarget=_.EventTargetImpl;var E=r(161);n.HTMLCollection=E.HTMLCollectionImpl;var D=r(266);n.MutationObserver=D.MutationObserverImpl;var O=r(169);n.MutationRecord=O.MutationRecordImpl;var b=r(164);n.NamedNodeMap=b.NamedNodeMapImpl;var R=r(168);n.NodeFilter=R.NodeFilterImpl;var N=r(34);n.Node=N.NodeImpl;var L=r(166);n.NodeIterator=L.NodeIteratorImpl;var B=r(162);n.NodeList=B.NodeListImpl;var P=r(163);n.NodeListStatic=P.NodeListStaticImpl;var F=r(267),k=r(268),G=r(269),W=r(160);n.ProcessingInstruction=W.ProcessingInstructionImpl;var H=r(165);n.Range=H.RangeImpl;var X=r(156);n.ShadowRoot=X.ShadowRootImpl;var Y=r(270),q=r(271);n.StaticRange=q.StaticRangeImpl;var Q=r(101);n.Text=Q.TextImpl;var ae=r(103);n.Traverser=ae.TraverserImpl;var ne=r(167);n.TreeWalker=ne.TreeWalkerImpl;var ee=r(149);n.Window=ee.WindowImpl;var V=r(151);n.XMLDocument=V.XMLDocumentImpl,i.applyMixin(T.ElementImpl,f.ChildNodeImpl),i.applyMixin(l.CharacterDataImpl,f.ChildNodeImpl),i.applyMixin(d.DocumentTypeImpl,f.ChildNodeImpl),i.applyMixin(x.DocumentImpl,y.DocumentOrShadowRootImpl),i.applyMixin(X.ShadowRootImpl,y.DocumentOrShadowRootImpl),i.applyMixin(T.ElementImpl,F.NonDocumentTypeChildNodeImpl),i.applyMixin(l.CharacterDataImpl,F.NonDocumentTypeChildNodeImpl),i.applyMixin(x.DocumentImpl,k.NonElementParentNodeImpl),i.applyMixin(m.DocumentFragmentImpl,k.NonElementParentNodeImpl),i.applyMixin(x.DocumentImpl,G.ParentNodeImpl),i.applyMixin(m.DocumentFragmentImpl,G.ParentNodeImpl),i.applyMixin(T.ElementImpl,G.ParentNodeImpl),i.applyMixin(Q.TextImpl,Y.SlotableImpl),i.applyMixin(T.ElementImpl,Y.SlotableImpl)},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),function(i){i[i.EOF=0]="EOF",i[i.Declaration=1]="Declaration",i[i.DocType=2]="DocType",i[i.Element=3]="Element",i[i.Text=4]="Text",i[i.CDATA=5]="CDATA",i[i.PI=6]="PI",i[i.Comment=7]="Comment",i[i.ClosingTag=8]="ClosingTag"}(n.TokenType||(n.TokenType={}))},function(a,n,r){r(64),r(20),r(66);var i,o=this&&this.__extends||(i=function(c,p){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,f){l.__proto__=f}||function(l,f){for(var h in f)f.hasOwnProperty(h)&&(l[h]=f[h])})(c,p)},function(c,p){function l(){this.constructor=c}i(c,p),c.prototype=p===null?Object.create(p):(l.prototype=p.prototype,new l)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),u=function(c){function p(){return c!==null&&c.apply(this,arguments)||this}return o(p,c),p.prototype._parse=function(l,f){var h=this,v=this._builderOptions,m=null;return s.isFunction(f)?m=this.parse(l,f.apply(this)):s.isArray(f)||s.isSet(f)?s.forEachArray(f,function(x){return m=h.parse(l,x)},this):s.isMap(f)||s.isObject(f)?s.forEachObject(f,function(x,y){if(s.isFunction(y)&&(y=y.apply(h)),v.ignoreConverters||x.indexOf(v.convert.att)!==0)if(v.ignoreConverters||x.indexOf(v.convert.text)!==0)if(v.ignoreConverters||x.indexOf(v.convert.cdata)!==0)if(v.ignoreConverters||x.indexOf(v.convert.comment)!==0)if(v.ignoreConverters||x.indexOf(v.convert.ins)!==0){if(!((s.isArray(y)||s.isSet(y))&&s.isEmpty(y))){if((s.isMap(y)||s.isObject(y))&&s.isEmpty(y))m=h.element(l,void 0,h.sanitize(x))||m;else if(v.keepNullNodes||y!=null)if(s.isArray(y)||s.isSet(y))s.forEachArray(y,function(T){var w={};w[x]=T,m=h.parse(l,w)},h);else if(s.isMap(y)||s.isObject(y))(d=h.element(l,void 0,h.sanitize(x)))&&(m=d,h.parse(d,y));else if(y!=null&&y!==""){var d;(d=h.element(l,void 0,h.sanitize(x)))&&(m=d,h.text(d,h._decodeText(h.sanitize(y))))}else m=h.element(l,void 0,h.sanitize(x))||m}}else if(s.isString(y)){var g=y.indexOf(" "),C=g===-1?y:y.substr(0,g),S=g===-1?"":y.substr(g+1);m=h.instruction(l,h.sanitize(C),h.sanitize(S))||m}else s.isArray(y)||s.isSet(y)?s.forEachArray(y,function(T){var w=T.indexOf(" "),_=w===-1?T:T.substr(0,w),E=w===-1?"":T.substr(w+1);m=h.instruction(l,h.sanitize(_),h.sanitize(E))||m},h):s.forEachObject(y,function(T,w){return m=h.instruction(l,h.sanitize(T),h.sanitize(w))||m},h);else s.isArray(y)||s.isSet(y)?s.forEachArray(y,function(T){return m=h.comment(l,h.sanitize(T))||m},h):m=h.comment(l,h.sanitize(y))||m;else s.isArray(y)||s.isSet(y)?s.forEachArray(y,function(T){return m=h.cdata(l,h.sanitize(T))||m},h):m=h.cdata(l,h.sanitize(y))||m;else m=s.isMap(y)||s.isObject(y)?h.parse(l,y):h.text(l,h._decodeText(h.sanitize(y)))||m;else if(x===v.convert.att){if(s.isArray(y)||s.isSet(y))throw new Error("Invalid attribute: "+y.toString()+". "+l._debugInfo());s.forEachObject(y,function(T,w){m=h.attribute(l,void 0,h.sanitize(T),h._decodeAttributeValue(h.sanitize(w)))||m})}else m=h.attribute(l,void 0,h.sanitize(x.substr(v.convert.att.length)),h._decodeAttributeValue(h.sanitize(y)))||m},this):(v.keepNullNodes||f!=null)&&(m=this.text(l,this._decodeText(this.sanitize(f)))||m),m||l},p}(r(75).BaseReader);n.ObjectReader=u},function(a,n,r){var i=r(39);a.exports=new i({explicit:[r(287),r(288),r(289)]})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(o){this.level=0,this._builderOptions=o,this._writerOptions=o};n.BaseCBWriter=i},function(a,n,r){var i=r(16),o=r(8),s=r(116);a.exports=!i&&!o(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7})},function(a,n,r){var i=r(11),o=r(13),s=i.document,u=o(s)&&o(s.createElement);a.exports=function(c){return u?s.createElement(c):{}}},function(a,n,r){var i=r(118),o=Function.toString;typeof i.inspectSource!="function"&&(i.inspectSource=function(s){return o.call(s)}),a.exports=i.inspectSource},function(a,n,r){var i=r(11),o=r(80),s=i["__core-js_shared__"]||o("__core-js_shared__",{});a.exports=s},function(a,n,r){var i=r(14),o=r(187),s=r(55),u=r(15);a.exports=function(c,p){for(var l=o(p),f=u.f,h=s.f,v=0;vh;)i(f,l=p[h++])&&(~s(v,l)||v.push(l));return v}},function(a,n,r){var i=r(24),o=r(26),s=r(83),u=function(c){return function(p,l,f){var h,v=i(p),m=o(v.length),x=s(f,m);if(c&&l!=l){for(;m>x;)if((h=v[x++])!=h)return!0}else for(;m>x;x++)if((c||x in v)&&v[x]===l)return c||x||0;return!c&&-1}};a.exports={includes:u(!0),indexOf:u(!1)}},function(a,n,r){var i=r(8),o=/#|\.prototype\./,s=function(f,h){var v=c[u(f)];return v==l||v!=p&&(typeof h=="function"?i(h):!!h)},u=s.normalize=function(f){return String(f).replace(o,".").toLowerCase()},c=s.data={},p=s.NATIVE="N",l=s.POLYFILL="P";a.exports=s},function(a,n,r){var i=r(86);a.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(a,n,r){var i=r(5);n.f=i},function(a,n,r){var i=r(120),o=r(14),s=r(125),u=r(15).f;a.exports=function(c){var p=i.Symbol||(i.Symbol={});o(p,c)||u(p,c,{value:s.f(c)})}},function(a,n){a.exports=function(r){if(typeof r!="function")throw TypeError(String(r)+" is not a function");return r}},function(a,n,r){var i=r(13),o=r(59),s=r(5)("species");a.exports=function(u,c){var p;return o(u)&&(typeof(p=u.constructor)!="function"||p!==Array&&!o(p.prototype)?i(p)&&(p=p[s])===null&&(p=void 0):p=void 0),new(p===void 0?Array:p)(c===0?0:c)}},function(a,n,r){var i,o,s=r(11),u=r(193),c=s.process,p=c&&c.versions,l=p&&p.v8;l?o=(i=l.split("."))[0]+i[1]:u&&(!(i=u.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=u.match(/Chrome\/(\d+)/))&&(o=i[1]),a.exports=o&&+o},function(a,n,r){var i=r(5),o=r(60),s=r(15),u=i("unscopables"),c=Array.prototype;c[u]==null&&s.f(c,u,{configurable:!0,value:o(null)}),a.exports=function(p){c[u][p]=!0}},function(a,n,r){var i,o,s,u=r(132),c=r(21),p=r(14),l=r(5),f=r(44),h=l("iterator"),v=!1;[].keys&&("next"in(s=[].keys())?(o=u(u(s)))!==Object.prototype&&(i=o):v=!0),i==null&&(i={}),f||p(i,h)||c(i,h,function(){return this}),a.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:v}},function(a,n,r){var i=r(14),o=r(27),s=r(57),u=r(196),c=s("IE_PROTO"),p=Object.prototype;a.exports=u?Object.getPrototypeOf:function(l){return l=o(l),i(l,c)?l[c]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?p:null}},function(a,n,r){var i=r(18),o=r(197);a.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var s,u=!1,c={};try{(s=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(c,[]),u=c instanceof Array}catch{}return function(p,l){return i(p),o(l),u?s.call(p,l):p.__proto__=l,p}}():void 0)},function(a,n,r){var i=r(56),o=r(15),s=r(40);a.exports=function(u,c,p){var l=i(c);l in u?o.f(u,l,s(0,p)):u[l]=p}},function(a,n,r){var i=r(90),o=r(42),s=r(5)("toStringTag"),u=o(function(){return arguments}())=="Arguments";a.exports=i?o:function(c){var p,l,f;return c===void 0?"Undefined":c===null?"Null":typeof(l=function(h,v){try{return h[v]}catch{}}(p=Object(c),s))=="string"?l:u?o(p):(f=o(p))=="Object"&&typeof p.callee=="function"?"Arguments":f}},function(a,n,r){var i=r(18);a.exports=function(){var o=i(this),s="";return o.global&&(s+="g"),o.ignoreCase&&(s+="i"),o.multiline&&(s+="m"),o.dotAll&&(s+="s"),o.unicode&&(s+="u"),o.sticky&&(s+="y"),s}},function(a,n,r){var i=r(47),o=r(35),s=function(u){return function(c,p){var l,f,h=String(o(c)),v=i(p),m=h.length;return v<0||v>=m?u?"":void 0:(l=h.charCodeAt(v))<55296||l>56319||v+1===m||(f=h.charCodeAt(v+1))<56320||f>57343?u?h.charAt(v):l:u?h.slice(v,v+2):f-56320+(l-55296<<10)+65536}};a.exports={codeAt:s(!1),charAt:s(!0)}},function(a,n,r){var i=r(4),o=r(27),s=r(61);i({target:"Object",stat:!0,forced:r(8)(function(){s(1)})},{keys:function(u){return s(o(u))}})},function(a,n,r){var i=r(4),o=r(11),s=r(123),u=r(25),c=r(140),p=r(141),l=r(142),f=r(13),h=r(8),v=r(208),m=r(62),x=r(209);a.exports=function(y,d,g){var C=y.indexOf("Map")!==-1,S=y.indexOf("Weak")!==-1,T=C?"set":"add",w=o[y],_=w&&w.prototype,E=w,D={},O=function(P){var F=_[P];u(_,P,P=="add"?function(k){return F.call(this,k===0?0:k),this}:P=="delete"?function(k){return!(S&&!f(k))&&F.call(this,k===0?0:k)}:P=="get"?function(k){return S&&!f(k)?void 0:F.call(this,k===0?0:k)}:P=="has"?function(k){return!(S&&!f(k))&&F.call(this,k===0?0:k)}:function(k,G){return F.call(this,k===0?0:k,G),this})};if(s(y,typeof w!="function"||!(S||_.forEach&&!h(function(){new w().entries().next()}))))E=g.getConstructor(d,y,C,T),c.REQUIRED=!0;else if(s(y,!0)){var b=new E,R=b[T](S?{}:-0,1)!=b,N=h(function(){b.has(1)}),L=v(function(P){new w(P)}),B=!S&&h(function(){for(var P=new w,F=5;F--;)P[T](F,F);return!P.has(-0)});L||((E=d(function(P,F){l(P,E,y);var k=x(new w,P,E);return F!=null&&p(F,k[T],k,C),k})).prototype=_,_.constructor=E),(N||B)&&(O("delete"),O("has"),C&&O("get")),(B||R)&&O(T),S&&_.clear&&delete _.clear}return D[y]=E,i({global:!0,forced:E!=w},D),m(E,y),S||g.setStrong(E,y,C),E}},function(a,n,r){var i=r(45),o=r(13),s=r(14),u=r(15).f,c=r(58),p=r(204),l=c("meta"),f=0,h=Object.isExtensible||function(){return!0},v=function(x){u(x,l,{value:{objectID:"O"+ ++f,weakData:{}}})},m=a.exports={REQUIRED:!1,fastKey:function(x,y){if(!o(x))return typeof x=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!s(x,l)){if(!h(x))return"F";if(!y)return"E";v(x)}return x[l].objectID},getWeakData:function(x,y){if(!s(x,l)){if(!h(x))return!0;if(!y)return!1;v(x)}return x[l].weakData},onFreeze:function(x){return p&&m.REQUIRED&&h(x)&&!s(x,l)&&v(x),x}};i[l]=!0},function(a,n,r){var i=r(18),o=r(205),s=r(26),u=r(87),c=r(206),p=r(207),l=function(f,h){this.stopped=f,this.result=h};(a.exports=function(f,h,v,m,x){var y,d,g,C,S,T,w,_=u(h,v,m?2:1);if(x)y=f;else{if(typeof(d=c(f))!="function")throw TypeError("Target is not iterable");if(o(d)){for(g=0,C=s(f.length);C>g;g++)if((S=m?_(i(w=f[g])[0],w[1]):_(f[g]))&&S instanceof l)return S;return new l(!1)}y=d.call(f)}for(T=y.next;!(w=T.call(y)).done;)if(typeof(S=p(y,_,w.value,m))=="object"&&S&&S instanceof l)return S;return new l(!1)}).stop=function(f){return new l(!0,f)}},function(a,n){a.exports=function(r,i,o){if(!(r instanceof i))throw TypeError("Incorrect "+(o?o+" ":"")+"invocation");return r}},function(a,n,r){var i=r(15).f,o=r(60),s=r(210),u=r(87),c=r(142),p=r(141),l=r(88),f=r(211),h=r(16),v=r(140).fastKey,m=r(43),x=m.set,y=m.getterFor;a.exports={getConstructor:function(d,g,C,S){var T=d(function(D,O){c(D,T,g),x(D,{type:g,index:o(null),first:void 0,last:void 0,size:0}),h||(D.size=0),O!=null&&p(O,D[S],D,C)}),w=y(g),_=function(D,O,b){var R,N,L=w(D),B=E(D,O);return B?B.value=b:(L.last=B={index:N=v(O,!0),key:O,value:b,previous:R=L.last,next:void 0,removed:!1},L.first||(L.first=B),R&&(R.next=B),h?L.size++:D.size++,N!=="F"&&(L.index[N]=B)),D},E=function(D,O){var b,R=w(D),N=v(O);if(N!=="F")return R.index[N];for(b=R.first;b;b=b.next)if(b.key==O)return b};return s(T.prototype,{clear:function(){for(var D=w(this),O=D.index,b=D.first;b;)b.removed=!0,b.previous&&(b.previous=b.previous.next=void 0),delete O[b.index],b=b.next;D.first=D.last=void 0,h?D.size=0:this.size=0},delete:function(D){var O=w(this),b=E(this,D);if(b){var R=b.next,N=b.previous;delete O.index[b.index],b.removed=!0,N&&(N.next=R),R&&(R.previous=N),O.first==b&&(O.first=R),O.last==b&&(O.last=N),h?O.size--:this.size--}return!!b},forEach:function(D){for(var O,b=w(this),R=u(D,arguments.length>1?arguments[1]:void 0,3);O=O?O.next:b.first;)for(R(O.value,O.key,this);O&&O.removed;)O=O.previous},has:function(D){return!!E(this,D)}}),s(T.prototype,C?{get:function(D){var O=E(this,D);return O&&O.value},set:function(D,O){return _(this,D===0?0:D,O)}}:{add:function(D){return _(this,D=D===0?0:D,D)}}),h&&i(T.prototype,"size",{get:function(){return w(this).size}}),T},setStrong:function(d,g,C){var S=g+" Iterator",T=y(g),w=y(S);l(d,g,function(_,E){x(this,{type:S,target:_,state:T(_),kind:E,last:void 0})},function(){for(var _=w(this),E=_.kind,D=_.last;D&&D.removed;)D=D.previous;return _.target&&(_.last=D=D?D.next:_.state.first)?E=="keys"?{value:D.key,done:!1}:E=="values"?{value:D.value,done:!1}:{value:[D.key,D.value],done:!1}:(_.target=void 0,{value:void 0,done:!0})},C?"entries":"values",!C,!0),f(g)}}},function(a,n,r){var i,o=r(4),s=r(55).f,u=r(26),c=r(222),p=r(35),l=r(224),f=r(44),h="".endsWith,v=Math.min,m=l("endsWith");o({target:"String",proto:!0,forced:!!(f||m||(i=s(String.prototype,"endsWith"),!i||i.writable))&&!m},{endsWith:function(x){var y=String(p(this));c(x);var d=arguments.length>1?arguments[1]:void 0,g=u(y.length),C=d===void 0?g:v(u(d),g),S=String(x);return h?h.call(y,S,C):y.slice(C-S.length,C)===S}})},function(a,n,r){(function(i){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */var o=r(229),s=r(230),c=r(231);function l(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(F,b){if(l()=l())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l().toString(16)+" bytes");return 0|F}function x(F,b){if(u.isBuffer(F))return F.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(F)||F instanceof ArrayBuffer))return F.byteLength;typeof F!="string"&&(F=""+F);var G=F.length;if(G===0)return 0;for(var U=!1;;)switch(b){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":case void 0:return re(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*G;case"hex":return G>>>1;case"base64":return ae(F).length;default:if(U)return re(F).length;b=(""+b).toLowerCase(),U=!0}}function y(F,b,G){var U=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((G===void 0||G>this.length)&&(G=this.length),G<=0)||(G>>>=0)<=(b>>>=0))return"";for(F||(F="utf8");;)switch(F){case"hex":return I(this,b,G);case"utf8":case"utf-8":return N(this,b,G);case"ascii":return R(this,b,G);case"latin1":case"binary":return B(this,b,G);case"base64":return M(this,b,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,b,G);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),U=!0}}function g(F,b,G){var U=F[b];F[b]=F[G],F[G]=U}function C(F,b,G,U,z){if(F.length===0)return-1;if(typeof G=="string"?(U=G,G=0):G>2147483647?G=2147483647:G<-2147483648&&(G=-2147483648),G=+G,isNaN(G)&&(G=z?0:F.length-1),G<0&&(G=F.length+G),G>=F.length){if(z)return-1;G=F.length-1}else if(G<0){if(!z)return-1;G=0}if(typeof b=="string"&&(b=u.from(b,U)),u.isBuffer(b))return b.length===0?-1:S(F,b,G,U,z);if(typeof b=="number")return b&=255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?z?Uint8Array.prototype.indexOf.call(F,b,G):Uint8Array.prototype.lastIndexOf.call(F,b,G):S(F,[b],G,U,z);throw new TypeError("val must be string, number or Buffer")}function S(F,b,G,U,z){var W,$=1,J=F.length,ne=b.length;if(U!==void 0&&((U=String(U).toLowerCase())==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(F.length<2||b.length<2)return-1;$=2,J/=2,ne/=2,G/=2}function oe(je,Le){return $===1?je[Le]:je.readUInt16BE(Le*$)}if(z){var ue=-1;for(W=G;WJ&&(G=J-ne),W=G;W>=0;W--){for(var Ce=!0,ye=0;yez&&(U=z):U=z;var W=b.length;if(W%2!=0)throw new TypeError("Invalid hex string");U>W/2&&(U=W/2);for(var $=0;$>8,ne=$%256,oe.push(ne),oe.push(J);return oe}(b,F.length-G),F,G,U)}function M(F,b,G){return b===0&&G===F.length?o.fromByteArray(F):o.fromByteArray(F.slice(b,G))}function N(F,b,G){G=Math.min(F.length,G);for(var U=[],z=b;z239?4:oe>223?3:oe>191?2:1;if(z+Ce<=G)switch(Ce){case 1:oe<128&&(ue=oe);break;case 2:(192&(W=F[z+1]))==128&&(ne=(31&oe)<<6|63&W)>127&&(ue=ne);break;case 3:W=F[z+1],$=F[z+2],(192&W)==128&&(192&$)==128&&(ne=(15&oe)<<12|(63&W)<<6|63&$)>2047&&(ne<55296||ne>57343)&&(ue=ne);break;case 4:W=F[z+1],$=F[z+2],J=F[z+3],(192&W)==128&&(192&$)==128&&(192&J)==128&&(ne=(15&oe)<<18|(63&W)<<12|(63&$)<<6|63&J)>65535&&ne<1114112&&(ue=ne)}ue===null?(ue=65533,Ce=1):ue>65535&&(ue-=65536,U.push(ue>>>10&1023|55296),ue=56320|1023&ue),U.push(ue),z+=Ce}return function(ye){var je=ye.length;if(je<=4096)return String.fromCharCode.apply(String,ye);for(var Le="",ge=0;ge0&&(F=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(F+=" ... ")),""},u.prototype.compare=function(F,b,G,U,z){if(!u.isBuffer(F))throw new TypeError("Argument must be a Buffer");if(b===void 0&&(b=0),G===void 0&&(G=F?F.length:0),U===void 0&&(U=0),z===void 0&&(z=this.length),b<0||G>F.length||U<0||z>this.length)throw new RangeError("out of range index");if(U>=z&&b>=G)return 0;if(U>=z)return-1;if(b>=G)return 1;if(this===F)return 0;for(var W=(z>>>=0)-(U>>>=0),$=(G>>>=0)-(b>>>=0),J=Math.min(W,$),ne=this.slice(U,z),oe=F.slice(b,G),ue=0;uez)&&(G=z),F.length>0&&(G<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");for(var W=!1;;)switch(U){case"hex":return T(this,F,b,G);case"utf8":case"utf-8":return w(this,F,b,G);case"ascii":return _(this,F,b,G);case"latin1":case"binary":return E(this,F,b,G);case"base64":return D(this,F,b,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,F,b,G);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(F,b,G){var U="";G=Math.min(F.length,G);for(var z=b;zU)&&(G=U);for(var z="",W=b;WG)throw new RangeError("Trying to access beyond buffer length")}function k(F,b,G,U,z,W){if(!u.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>z||bF.length)throw new RangeError("Index out of range")}function A(F,b,G,U){b<0&&(b=65535+b+1);for(var z=0,W=Math.min(F.length-G,2);z>>8*(U?z:1-z)}function j(F,b,G,U){b<0&&(b=4294967295+b+1);for(var z=0,W=Math.min(F.length-G,4);z>>8*(U?z:3-z)&255}function H(F,b,G,U,z,W){if(G+U>F.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("Index out of range")}function K(F,b,G,U,z){return z||H(F,0,G,4),s.write(F,b,G,U,23,4),G+4}function Y(F,b,G,U,z){return z||H(F,0,G,8),s.write(F,b,G,U,52,8),G+8}u.prototype.slice=function(F,b){var G,U=this.length;if((F=~~F)<0?(F+=U)<0&&(F=0):F>U&&(F=U),(b=b===void 0?U:~~b)<0?(b+=U)<0&&(b=0):b>U&&(b=U),b0&&(z*=256);)U+=this[F+--b]*z;return U},u.prototype.readUInt8=function(F,b){return b||L(F,1,this.length),this[F]},u.prototype.readUInt16LE=function(F,b){return b||L(F,2,this.length),this[F]|this[F+1]<<8},u.prototype.readUInt16BE=function(F,b){return b||L(F,2,this.length),this[F]<<8|this[F+1]},u.prototype.readUInt32LE=function(F,b){return b||L(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+16777216*this[F+3]},u.prototype.readUInt32BE=function(F,b){return b||L(F,4,this.length),16777216*this[F]+(this[F+1]<<16|this[F+2]<<8|this[F+3])},u.prototype.readIntLE=function(F,b,G){F|=0,b|=0,G||L(F,b,this.length);for(var U=this[F],z=1,W=0;++W=(z*=128)&&(U-=Math.pow(2,8*b)),U},u.prototype.readIntBE=function(F,b,G){F|=0,b|=0,G||L(F,b,this.length);for(var U=b,z=1,W=this[F+--U];U>0&&(z*=256);)W+=this[F+--U]*z;return W>=(z*=128)&&(W-=Math.pow(2,8*b)),W},u.prototype.readInt8=function(F,b){return b||L(F,1,this.length),128&this[F]?-1*(255-this[F]+1):this[F]},u.prototype.readInt16LE=function(F,b){b||L(F,2,this.length);var G=this[F]|this[F+1]<<8;return 32768&G?4294901760|G:G},u.prototype.readInt16BE=function(F,b){b||L(F,2,this.length);var G=this[F+1]|this[F]<<8;return 32768&G?4294901760|G:G},u.prototype.readInt32LE=function(F,b){return b||L(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},u.prototype.readInt32BE=function(F,b){return b||L(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},u.prototype.readFloatLE=function(F,b){return b||L(F,4,this.length),s.read(this,F,!0,23,4)},u.prototype.readFloatBE=function(F,b){return b||L(F,4,this.length),s.read(this,F,!1,23,4)},u.prototype.readDoubleLE=function(F,b){return b||L(F,8,this.length),s.read(this,F,!0,52,8)},u.prototype.readDoubleBE=function(F,b){return b||L(F,8,this.length),s.read(this,F,!1,52,8)},u.prototype.writeUIntLE=function(F,b,G,U){F=+F,b|=0,G|=0,U||k(this,F,b,G,Math.pow(2,8*G)-1,0);var z=1,W=0;for(this[b]=255&F;++W=0&&(W*=256);)this[b+z]=F/W&255;return b+G},u.prototype.writeUInt8=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,1,255,0),u.TYPED_ARRAY_SUPPORT||(F=Math.floor(F)),this[b]=255&F,b+1},u.prototype.writeUInt16LE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[b]=255&F,this[b+1]=F>>>8):A(this,F,b,!0),b+2},u.prototype.writeUInt16BE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[b]=F>>>8,this[b+1]=255&F):A(this,F,b,!1),b+2},u.prototype.writeUInt32LE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[b+3]=F>>>24,this[b+2]=F>>>16,this[b+1]=F>>>8,this[b]=255&F):j(this,F,b,!0),b+4},u.prototype.writeUInt32BE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[b]=F>>>24,this[b+1]=F>>>16,this[b+2]=F>>>8,this[b+3]=255&F):j(this,F,b,!1),b+4},u.prototype.writeIntLE=function(F,b,G,U){if(F=+F,b|=0,!U){var z=Math.pow(2,8*G-1);k(this,F,b,G,z-1,-z)}var W=0,$=1,J=0;for(this[b]=255&F;++W>0)-J&255;return b+G},u.prototype.writeIntBE=function(F,b,G,U){if(F=+F,b|=0,!U){var z=Math.pow(2,8*G-1);k(this,F,b,G,z-1,-z)}var W=G-1,$=1,J=0;for(this[b+W]=255&F;--W>=0&&($*=256);)F<0&&J===0&&this[b+W+1]!==0&&(J=1),this[b+W]=(F/$>>0)-J&255;return b+G},u.prototype.writeInt8=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,1,127,-128),u.TYPED_ARRAY_SUPPORT||(F=Math.floor(F)),F<0&&(F=255+F+1),this[b]=255&F,b+1},u.prototype.writeInt16LE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[b]=255&F,this[b+1]=F>>>8):A(this,F,b,!0),b+2},u.prototype.writeInt16BE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[b]=F>>>8,this[b+1]=255&F):A(this,F,b,!1),b+2},u.prototype.writeInt32LE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[b]=255&F,this[b+1]=F>>>8,this[b+2]=F>>>16,this[b+3]=F>>>24):j(this,F,b,!0),b+4},u.prototype.writeInt32BE=function(F,b,G){return F=+F,b|=0,G||k(this,F,b,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),u.TYPED_ARRAY_SUPPORT?(this[b]=F>>>24,this[b+1]=F>>>16,this[b+2]=F>>>8,this[b+3]=255&F):j(this,F,b,!1),b+4},u.prototype.writeFloatLE=function(F,b,G){return K(this,F,b,!0,G)},u.prototype.writeFloatBE=function(F,b,G){return K(this,F,b,!1,G)},u.prototype.writeDoubleLE=function(F,b,G){return Y(this,F,b,!0,G)},u.prototype.writeDoubleBE=function(F,b,G){return Y(this,F,b,!1,G)},u.prototype.copy=function(F,b,G,U){if(G||(G=0),U||U===0||(U=this.length),b>=F.length&&(b=F.length),b||(b=0),U>0&&U=this.length)throw new RangeError("sourceStart out of bounds");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),F.length-b=0;--z)F[z+b]=this[z+G];else if(W<1e3||!u.TYPED_ARRAY_SUPPORT)for(z=0;z>>=0,G=G===void 0?this.length:G>>>0,F||(F=0),typeof F=="number")for(W=b;W55295&&G<57344){if(!z){if(G>56319){(b-=3)>-1&&W.push(239,191,189);continue}if($+1===U){(b-=3)>-1&&W.push(239,191,189);continue}z=G;continue}if(G<56320){(b-=3)>-1&&W.push(239,191,189),z=G;continue}G=65536+(z-55296<<10|G-56320)}else z&&(b-=3)>-1&&W.push(239,191,189);if(z=null,G<128){if((b-=1)<0)break;W.push(G)}else if(G<2048){if((b-=2)<0)break;W.push(G>>6|192,63&G|128)}else if(G<65536){if((b-=3)<0)break;W.push(G>>12|224,G>>6&63|128,63&G|128)}else{if(!(G<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;W.push(G>>18|240,G>>12&63|128,G>>6&63|128,63&G|128)}}return W}function ae(F){return o.toByteArray(function(b){if((b=function(G){return G.trim?G.trim():G.replace(/^\s+|\s+$/g,"")}(b).replace(q,"")).length<2)return"";for(;b.length%4!=0;)b+="=";return b}(F))}function ee(F,b,G,U){for(var z=0;z=b.length||z>=F.length);++z)b[z+G]=F[z];return z}}).call(this,r(78))},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),n.isASCIIByte=function(i){return i>=0&&i<=127}},function(a,n,r){var i=this&&this.__read||function(s,c){var l=typeof Symbol=="function"&&s[Symbol.iterator];if(!l)return s;var p,u,f=l.call(s),h=[];try{for(;(c===void 0||c-- >0)&&!(p=f.next()).done;)h.push(p.value)}catch(d){u={error:d}}finally{try{p&&!p.done&&(l=f.return)&&l.call(f)}finally{if(u)throw u.error}}return h},o=this&&this.__spread||function(){for(var s=[],c=0;c=65&&l<=90&&(s[c]=l+32)}},n.byteUppercase=function(s){for(var c=0;c=97&&l<=122&&(s[c]=l-32)}},n.byteCaseInsensitiveMatch=function(s,c){if(s.length!==c.length)return!1;for(var l=0;l=65&&p<=90&&(p+=32),u>=65&&u<=90&&(u+=32),p!==u)return!1}return!0},n.startsWith=function(s,c){for(var l=0;;){if(l>=s.length)return!1;if(l>=c.length)return!0;if(s[l]!==c[l])return!1;l++}},n.byteLessThan=function(s,c){for(var l=0;;){if(l>=s.length)return!1;if(l>=c.length)return!0;var p=s[l],u=c[l];if(pu)return!1;l++}},n.isomorphicDecode=function(s){return String.fromCodePoint.apply(String,o(s))}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(6),o=r(7),s=r(0),c=r(12),l=function(){function p(u){this._associatedDocument=u||i.dom.window.document}return p.prototype.createDocumentType=function(u,f,h){return s.namespace_validate(u),s.create_documentType(this._associatedDocument,u,f,h)},p.prototype.createDocument=function(u,f,h){h===void 0&&(h=null);var d=s.create_xmlDocument(),v=null;return f&&(v=s.document_internalCreateElementNS(d,u,f)),h&&d.appendChild(h),v&&d.appendChild(v),d._origin=this._associatedDocument._origin,u===o.namespace.HTML?d._contentType="application/xhtml+xml":u===o.namespace.SVG?d._contentType="image/svg+xml":d._contentType="application/xml",d},p.prototype.createHTMLDocument=function(u){var f=s.create_document();f._type="html",f._contentType="text/html",f.appendChild(s.create_documentType(f,"html","",""));var h=s.element_createAnElement(f,"html",o.namespace.HTML);f.appendChild(h);var d=s.element_createAnElement(f,"head",o.namespace.HTML);if(h.appendChild(d),u!==void 0){var v=s.element_createAnElement(f,"title",o.namespace.HTML);d.appendChild(v);var m=s.create_text(f,u);v.appendChild(m)}var x=s.element_createAnElement(f,"body",o.namespace.HTML);return h.appendChild(x),f._origin=this._associatedDocument._origin,f},p.prototype.hasFeature=function(){return!0},p._create=function(u){return new p(u)},p}();n.DOMImplementationImpl=l,c.idl_defineConst(l.prototype,"_ID","@oozcitak/dom")},function(a,n,r){var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(70),c=r(1),l=r(0),p=function(u){function f(){var h=u.call(this)||this;return h._signalSlots=new Set,h._mutationObserverMicrotaskQueued=!1,h._mutationObservers=new Set,h._iteratorList=new c.FixedSizeSet,h._associatedDocument=l.create_document(),h}return o(f,u),Object.defineProperty(f.prototype,"document",{get:function(){return this._associatedDocument},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"event",{get:function(){return this._currentEvent},enumerable:!0,configurable:!0}),f._create=function(){return new f},f}(s.EventTargetImpl);n.WindowImpl=p},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=function(){function s(){}return s.isNode=function(c){return!!c&&c._nodeType!==void 0},s.isDocumentNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.Document},s.isDocumentTypeNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.DocumentType},s.isDocumentFragmentNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.DocumentFragment},s.isAttrNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.Attribute},s.isCharacterDataNode=function(c){if(!s.isNode(c))return!1;var l=c._nodeType;return l===i.NodeType.Text||l===i.NodeType.ProcessingInstruction||l===i.NodeType.Comment||l===i.NodeType.CData},s.isTextNode=function(c){return s.isNode(c)&&(c._nodeType===i.NodeType.Text||c._nodeType===i.NodeType.CData)},s.isExclusiveTextNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.Text},s.isCDATASectionNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.CData},s.isCommentNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.Comment},s.isProcessingInstructionNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.ProcessingInstruction},s.isElementNode=function(c){return s.isNode(c)&&c._nodeType===i.NodeType.Element},s.isCustomElementNode=function(c){return s.isElementNode(c)&&c._customElementState==="custom"},s.isShadowRoot=function(c){return!!c&&c.host!==void 0},s.isMouseEvent=function(c){return!!c&&c.screenX!==void 0&&c.screenY!=null},s.isSlotable=function(c){return!!c&&c._name!==void 0&&c._assignedSlot!==void 0&&(s.isTextNode(c)||s.isElementNode(c))},s.isSlot=function(c){return!!c&&c._name!==void 0&&c._assignedNodes!==void 0&&s.isElementNode(c)},s.isWindow=function(c){return!!c&&c.navigator!==void 0},s.isEventListener=function(c){return!!c&&c.handleEvent!==void 0},s.isRegisteredObserver=function(c){return!!c&&c.observer!==void 0&&c.options!==void 0},s.isTransientRegisteredObserver=function(c){return!!c&&c.source!==void 0&&s.isRegisteredObserver(c)},s}();n.Guard=o},function(a,n,r){var i,o=this&&this.__extends||(i=function(c,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,u){p.__proto__=u}||function(p,u){for(var f in u)u.hasOwnProperty(f)&&(p[f]=u[f])})(c,l)},function(c,l){function p(){this.constructor=c}i(c,l),c.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(c){function l(){return c.call(this)||this}return o(l,c),l}(r(98).DocumentImpl);n.XMLDocumentImpl=s},function(a,n,r){var i=this&&this.__values||function(U){var z=typeof Symbol=="function"&&Symbol.iterator,W=z&&U[z],$=0;if(W)return W.call(U);if(U&&typeof U.length=="number")return{next:function(){return U&&$>=U.length&&(U=void 0),{value:U&&U[$++],done:!U}}};throw new TypeError(z?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(U,z){var W=typeof Symbol=="function"&&U[Symbol.iterator];if(!W)return U;var $,J,ne=W.call(U),oe=[];try{for(;(z===void 0||z-- >0)&&!($=ne.next()).done;)oe.push($.value)}catch(ue){J={error:ue}}finally{try{$&&!$.done&&(W=ne.return)&&W.call(ne)}finally{if(J)throw J.error}}return oe};Object.defineProperty(n,"__esModule",{value:!0});var s,c=r(1),l=r(243),p=r(7),u=r(244),f={ftp:21,file:null,http:80,https:443,ws:80,wss:443},h=/[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,d=/[ "<>`]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[ "<>`#?{}]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/[ "<>`#?{}/:;=@\[\]\\\^\|]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,x=/[0-9A-Za-z!\$&-\/:;=\?@_~\xA0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uD83E\uD840-\uD87E\uD880-\uD8BE\uD8C0-\uD8FE\uD900-\uD93E\uD940-\uD97E\uD980-\uD9BE\uD9C0-\uD9FE\uDA00-\uDA3E\uDA40-\uDA7E\uDA80-\uDABE\uDAC0-\uDAFE\uDB00-\uDB3E\uDB40-\uDB7E\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDC00-\uDFFD]/,y=/[\0\t\f\r #%/:?@\[\\\]]/;function g(U){s!==void 0&&s.call(null,"Validation Error: "+U)}function C(){return{scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,_cannotBeABaseURLFlag:!1,_blobURLEntry:null}}function S(U){return U in f}function T(U){return S(U.scheme)}function w(U){return f[U]||null}function _(U){return U.username!==""||U.password!==""}function E(U,z){var W,$;z===void 0&&(z=!1);var J=U.scheme+":";if(U.host!==null?(J+="//",_(U)&&(J+=U.username,U.password!==""&&(J+=":"+U.password),J+="@"),J+=D(U.host),U.port!==null&&(J+=":"+U.port)):U.host===null&&U.scheme==="file"&&(J+="//"),U._cannotBeABaseURLFlag)J+=U.path[0];else try{for(var ne=i(U.path),oe=ne.next();!oe.done;oe=ne.next())J+="/"+oe.value}catch(ue){W={error:ue}}finally{try{oe&&!oe.done&&($=ne.return)&&$.call(ne)}finally{if(W)throw W.error}}return U.query!==null&&(J+="?"+U.query),z||U.fragment===null||(J+="#"+U.fragment),J}function D(U){return c.isNumber(U)?O(U):c.isArray(U)?"["+M(U)+"]":U}function O(U){for(var z="",W=U,$=1;$<=4;$++)z=(W%256).toString()+z,$!==4&&(z="."+z),W=Math.floor(W/256);return z}function M(U){for(var z="",W=null,$=-1,J=0,ne=0,oe=0;oe<8;oe++)if(U[oe]===0){J=1;for(var ue=oe+1;ue<8&&U[ue]===0;ue++)J++;J>ne&&(ne=J,$=oe)}ne>1&&(W=$);for(var Ce=!1,ye=0;ye<8;ye++)Ce&&U[ye]===0||(Ce&&(Ce=!1),W!==ye?(z+=U[ye].toString(16),ye!==7&&(z+=":")):(z+=ye===0?"::":":",Ce=!0));return z}function N(U,z,W,$,J){var ne,oe,ue,Ce;if($===void 0){$={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,_cannotBeABaseURLFlag:!1,_blobURLEntry:null};var ye=/^[\u0000-\u001F\u0020]+/,je=/[\u0000-\u001F\u0020]+$/;(ye.test(U)||je.test(U))&&g("Input string contains leading or trailing control characters or space."),U=(U=U.replace(ye,"")).replace(je,"")}var Le=/[\u0009\u000A\u000D]/g;Le.test(U)&&g("Input string contains tab or newline characters."),U=U.replace(Le,"");var ge=J===void 0?l.ParserState.SchemeStart:J;z===void 0&&(z=null);for(var tt=W===void 0||W==="replacement"||W==="UTF-16BE"||W==="UTF-16LE"?"UTF-8":W,X="",De=!1,Oe=!1,de=!1,te=new c.StringWalker(U);;){switch(ge){case l.ParserState.SchemeStart:if(p.codePoint.ASCIIAlpha.test(te.c()))X+=te.c().toLowerCase(),ge=l.ParserState.Scheme;else{if(J!==void 0)return g("Invalid scheme start character."),null;ge=l.ParserState.NoScheme,te.pointer--}break;case l.ParserState.Scheme:if(p.codePoint.ASCIIAlphanumeric.test(te.c())||te.c()==="+"||te.c()==="-"||te.c()===".")X+=te.c().toLowerCase();else{if(te.c()!==":"){if(J===void 0){X="",ge=l.ParserState.NoScheme,te.pointer=0;continue}return g("Invalid input string."),null}if(J!==void 0&&(S($.scheme)&&!S(X)||!S($.scheme)&&S(X)||(_($)||$.port!==null)&&X==="file"||$.scheme==="file"&&($.host===""||$.host===null)))return $;if($.scheme=X,J!==void 0)return $.port===w($.scheme)&&($.port=null),$;X="",$.scheme==="file"?(te.remaining().startsWith("//")||g("Invalid file URL scheme, '//' expected."),ge=l.ParserState.File):T($)&&z!==null&&z.scheme===$.scheme?ge=l.ParserState.SpecialRelativeOrAuthority:T($)?ge=l.ParserState.SpecialAuthoritySlashes:te.remaining().startsWith("/")?(ge=l.ParserState.PathOrAuthority,te.pointer++):($._cannotBeABaseURLFlag=!0,$.path.push(""),ge=l.ParserState.CannotBeABaseURLPath)}break;case l.ParserState.NoScheme:if(z===null||z._cannotBeABaseURLFlag&&te.c()!=="#")return g("Invalid input string."),null;z._cannotBeABaseURLFlag&&te.c()==="#"?($.scheme=z.scheme,$.path=p.list.clone(z.path),$.query=z.query,$.fragment="",$._cannotBeABaseURLFlag=!0,ge=l.ParserState.Fragment):z.scheme!=="file"?(ge=l.ParserState.Relative,te.pointer--):(ge=l.ParserState.File,te.pointer--);break;case l.ParserState.SpecialRelativeOrAuthority:te.c()==="/"&&te.remaining().startsWith("/")?(ge=l.ParserState.SpecialAuthorityIgnoreSlashes,te.pointer++):(g("Invalid input string."),ge=l.ParserState.Relative,te.pointer--);break;case l.ParserState.PathOrAuthority:te.c()==="/"?ge=l.ParserState.Authority:(ge=l.ParserState.Path,te.pointer--);break;case l.ParserState.Relative:if(z===null)throw new Error("Invalid parser state. Base URL is null.");switch($.scheme=z.scheme,te.c()){case"":$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.query=z.query;break;case"/":ge=l.ParserState.RelativeSlash;break;case"?":$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.query="",ge=l.ParserState.Query;break;case"#":$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.query=z.query,$.fragment="",ge=l.ParserState.Fragment;break;default:T($)&&te.c()==="\\"?(g("Invalid input string."),ge=l.ParserState.RelativeSlash):($.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.path.length!==0&&$.path.splice($.path.length-1,1),ge=l.ParserState.Path,te.pointer--)}break;case l.ParserState.RelativeSlash:if(!T($)||te.c()!=="/"&&te.c()!=="\\")if(te.c()==="/")ge=l.ParserState.Authority;else{if(z===null)throw new Error("Invalid parser state. Base URL is null.");$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,ge=l.ParserState.Path,te.pointer--}else te.c()==="\\"&&g("Invalid input string."),ge=l.ParserState.SpecialAuthorityIgnoreSlashes;break;case l.ParserState.SpecialAuthoritySlashes:te.c()==="/"&&te.remaining().startsWith("/")?(ge=l.ParserState.SpecialAuthorityIgnoreSlashes,te.pointer++):(g("Expected '//'."),ge=l.ParserState.SpecialAuthorityIgnoreSlashes,te.pointer--);break;case l.ParserState.SpecialAuthorityIgnoreSlashes:te.c()!=="/"&&te.c()!=="\\"?(ge=l.ParserState.Authority,te.pointer--):g("Unexpected '/' or '\\'.");break;case l.ParserState.Authority:if(te.c()==="@"){g("Unexpected '@'."),De&&(X="%40"+X),De=!0;try{for(var ce=(ne=void 0,i(X)),he=ce.next();!he.done;he=ce.next()){var fe=he.value;if(fe!==":"||de){var ve=ee(fe,m);de?$.password+=ve:$.username+=ve}else de=!0}}catch($t){ne={error:$t}}finally{try{he&&!he.done&&(oe=ce.return)&&oe.call(ce)}finally{if(ne)throw ne.error}}X=""}else if(te.c()===""||te.c()==="/"||te.c()==="?"||te.c()==="#"||T($)&&te.c()==="\\"){if(De&&X==="")return g("Invalid input string."),null;te.pointer-=X.length+1,X="",ge=l.ParserState.Host}else X+=te.c();break;case l.ParserState.Host:case l.ParserState.Hostname:if(J!==void 0&&$.scheme==="file")te.pointer--,ge=l.ParserState.FileHost;else if(te.c()!==":"||Oe)if(te.c()===""||te.c()==="/"||te.c()==="?"||te.c()==="#"||T($)&&te.c()==="\\"){if(te.pointer--,T($)&&X==="")return g("Invalid input string."),null;if(J!==void 0&&X===""&&(_($)||$.port!==null))return g("Invalid input string."),$;if((Se=A(X,!T($)))===null)return null;if($.host=Se,X="",ge=l.ParserState.PathStart,J!==void 0)return $}else te.c()==="["&&(Oe=!0),te.c()==="]"&&(Oe=!1),X+=te.c();else{if(X==="")return g("Invalid input string."),null;if((Se=A(X,!T($)))===null)return null;if($.host=Se,X="",ge=l.ParserState.Port,J===l.ParserState.Hostname)return $}break;case l.ParserState.Port:if(p.codePoint.ASCIIDigit.test(te.c()))X+=te.c();else{if(!(te.c()===""||te.c()==="/"||te.c()==="?"||te.c()==="#"||T($)&&te.c()==="\\"||J))return g("Invalid input string."),null;if(X!==""&&X!==""){var Ae=parseInt(X,10);if(Ae>Math.pow(2,16)-1)return g("Invalid port number."),null;$.port=Ae===w($.scheme)?null:Ae,X=""}if(J!==void 0)return $;ge=l.ParserState.PathStart,te.pointer--}break;case l.ParserState.File:if($.scheme="file",te.c()==="/"||te.c()==="\\")te.c()==="\\"&&g("Invalid input string."),ge=l.ParserState.FileSlash;else if(z!==null&&z.scheme==="file")switch(te.c()){case"":$.host=z.host,$.path=p.list.clone(z.path),$.query=z.query;break;case"?":$.host=z.host,$.path=p.list.clone(z.path),$.query="",ge=l.ParserState.Query;break;case"#":$.host=z.host,$.path=p.list.clone(z.path),$.query=z.query,$.fragment="",ge=l.ParserState.Fragment;break;default:k(te.substring())?g("Unexpected windows drive letter in input string."):($.host=z.host,$.path=p.list.clone(z.path),I($)),ge=l.ParserState.Path,te.pointer--}else ge=l.ParserState.Path,te.pointer--;break;case l.ParserState.FileSlash:te.c()==="/"||te.c()==="\\"?(te.c()==="\\"&&g("Invalid input string."),ge=l.ParserState.FileHost):(z===null||z.scheme!=="file"||k(te.substring())||(P(z.path[0])?$.path.push(z.path[0]):$.host=z.host),ge=l.ParserState.Path,te.pointer--);break;case l.ParserState.FileHost:if(te.c()===""||te.c()==="/"||te.c()==="\\"||te.c()==="?"||te.c()==="#")if(te.pointer--,J===void 0&&L(X))g("Unexpected windows drive letter in input string."),ge=l.ParserState.Path;else if(X===""){if($.host="",J!==void 0)return $;ge=l.ParserState.PathStart}else{var Se;if((Se=A(X,!T($)))===null)return null;if(Se==="localhost"&&(Se=""),$.host=Se,J!==void 0)return $;X="",ge=l.ParserState.PathStart}else X+=te.c();break;case l.ParserState.PathStart:T($)?(te.c()==="\\"&&g("Invalid input string."),ge=l.ParserState.Path,te.c()!=="/"&&te.c()!=="\\"&&te.pointer--):J===void 0&&te.c()==="?"?($.query="",ge=l.ParserState.Query):J===void 0&&te.c()==="#"?($.fragment="",ge=l.ParserState.Fragment):te.c()!==""&&(ge=l.ParserState.Path,te.c()!=="/"&&te.pointer--);break;case l.ParserState.Path:if(te.c()===""||te.c()==="/"||T($)&&te.c()==="\\"||J===void 0&&(te.c()==="?"||te.c()==="#")){if(T($)&&te.c()==="\\"&&g("Invalid input string."),B(X))I($),te.c()==="/"||T($)&&te.c()==="\\"||$.path.push("");else if(!R(X)||te.c()==="/"||T($)&&te.c()==="\\"){if(!R(X)){if($.scheme==="file"&&$.path.length===0&&L(X)){$.host!==null&&$.host!==""&&(g("Invalid input string."),$.host="");var Be=Array.from(X);X=Be.slice(0,1)+":"+Be.slice(2)}$.path.push(X)}}else $.path.push("");if(X="",$.scheme==="file"&&(te.c()===""||te.c()==="?"||te.c()==="#"))for(;$.path.length>1&&$.path[0]==="";)g("Invalid input string."),$.path.splice(0,1);te.c()==="?"&&($.query="",ge=l.ParserState.Query),te.c()==="#"&&($.fragment="",ge=l.ParserState.Fragment)}else x.test(te.c())||te.c()==="%"||g("Character is not a URL code point or a percent encoded character."),te.c()!=="%"||/^[0-9a-fA-F][0-9a-fA-F]/.test(te.remaining())||g("Percent encoded character must be followed by two hex digits."),X+=ee(te.c(),v);break;case l.ParserState.CannotBeABaseURLPath:te.c()==="?"?($.query="",ge=l.ParserState.Query):te.c()==="#"?($.fragment="",ge=l.ParserState.Fragment):(te.c()===""||x.test(te.c())||te.c()==="%"||g("Character is not a URL code point or a percent encoded character."),te.c()!=="%"||/^[0-9a-fA-F][0-9a-fA-F]/.test(te.remaining())||g("Percent encoded character must be followed by two hex digits."),te.c()!==""&&($.path[0]+=ee(te.c(),h)));break;case l.ParserState.Query:if(tt==="UTF-8"||T($)&&$.scheme!=="ws"&&$.scheme!=="wss"||(tt="UTF-8"),J===void 0&&te.c()==="#")$.fragment="",ge=l.ParserState.Fragment;else if(te.c()!==""){if(x.test(te.c())||te.c()==="%"||g("Character is not a URL code point or a percent encoded character."),te.c()!=="%"||/^[0-9a-fA-F][0-9a-fA-F]/.test(te.remaining())||g("Percent encoded character must be followed by two hex digits."),tt.toUpperCase()!=="UTF-8")throw new Error("Only UTF-8 encoding is supported.");var Ie=c.utf8Encode(te.c());if(Ie.length>=3&&Ie[0]===38&&Ie[1]===35&&Ie[Ie.length-1]===59)Ie=Ie.subarray(2,Ie.length-1),$.query+="%26%23"+p.byteSequence.isomorphicDecode(Ie)+"%3B";else try{for(var Tt=(ue=void 0,i(Ie)),Ft=Tt.next();!Ft.done;Ft=Tt.next()){var at=Ft.value;at<33||at>126||at===34||at===35||at===60||at===62||at===39&&T($)?$.query+=Z(at):$.query+=String.fromCharCode(at)}}catch($t){ue={error:$t}}finally{try{Ft&&!Ft.done&&(Ce=Tt.return)&&Ce.call(Tt)}finally{if(ue)throw ue.error}}}break;case l.ParserState.Fragment:te.c()===""||(te.c()==="\0"?g("NULL character in input string."):(x.test(te.c())||te.c()==="%"||g("Unexpected character in fragment string."),te.c()!=="%"||/^[A-Za-z0-9][A-Za-z0-9]/.test(te.remaining())||g("Unexpected character in fragment string."),$.fragment+=ee(te.c(),d)))}if(te.eof)break;te.pointer++}return $}function R(U){return U==="."||U.toLowerCase()==="%2e"}function B(U){var z=U.toLowerCase();return z===".."||z===".%2e"||z==="%2e."||z==="%2e%2e"}function I(U){var z=U.path;z.length!==0&&(U.scheme==="file"&&z.length===1&&P(z[0])||U.path.splice(U.path.length-1,1))}function P(U){return U.length>=2&&p.codePoint.ASCIIAlpha.test(U[0])&&U[1]===":"}function L(U){return U.length>=2&&p.codePoint.ASCIIAlpha.test(U[0])&&(U[1]===":"||U[1]==="|")}function k(U){return U.length>=2&&L(U)&&(U.length===2||U[2]==="/"||U[2]==="\\"||U[2]==="?"||U[2]==="#")}function A(U,z){if(z===void 0&&(z=!1),U.startsWith("["))return U.endsWith("]")?K(U.substring(1,U.length-1)):(g("Expected ']' after '['."),null);if(z)return Y(U);var W=G(c.utf8Decode(ae(U)));if(W===null||y.test(W))return g("Invalid domain."),null;var $=H(W);return $===null||c.isNumber($)?$:W}function j(U,z){z===void 0&&(z={value:!1});var W=10;return U.startsWith("0x")||U.startsWith("0X")?(z.value=!0,U=U.substr(2),W=16):U.length>=2&&U[0]==="0"&&(z.value=!0,U=U.substr(1),W=8),U===""?0:(W===10?/^[0-9]+$/:W===16?/^[0-9A-Fa-f]+$/:/^[0-7]+$/).test(U)?parseInt(U,W):null}function H(U){var z,W,$,J,ne={value:!1},oe=U.split(".");if(oe[oe.length-1]===""&&(ne.value=!0,oe.length>1&&oe.pop()),oe.length>4)return U;var ue=[];try{for(var Ce=i(oe),ye=Ce.next();!ye.done;ye=Ce.next()){var je=ye.value;if(je===""||(Oe=j(je,ne))===null)return U;ue.push(Oe)}}catch(de){z={error:de}}finally{try{ye&&!ye.done&&(W=Ce.return)&&W.call(Ce)}finally{if(z)throw z.error}}ne.value&&g("Invalid IP v4 address.");for(var Le=0;Le255&&(g("Invalid IP v4 address."),Le=Math.pow(256,5-ue.length))return g("Invalid IP v4 address."),null;var ge=ue[ue.length-1];ue.pop();var tt=0;try{for(var X=i(ue),De=X.next();!De.done;De=X.next()){var Oe;ge+=(Oe=De.value)*Math.pow(256,3-tt),tt++}}catch(de){$={error:de}}finally{try{De&&!De.done&&(J=X.return)&&J.call(X)}finally{if($)throw $.error}}return ge}function K(U){var z,W=[0,0,0,0,0,0,0,0],$=0,J=null,ne=new c.StringWalker(U);if(ne.c()===":"){if(!ne.remaining().startsWith(":"))return g("Invalid IP v6 address."),null;ne.pointer+=2,J=$+=1}for(;ne.c()!=="";){if($===8)return g("Invalid IP v6 address."),null;if(ne.c()!==":"){for(var oe=0,ue=0;ue<4&&p.codePoint.ASCIIHexDigit.test(ne.c());)oe=16*oe+parseInt(ne.c(),16),ne.pointer++,ue++;if(ne.c()==="."){if(ue===0||(ne.pointer-=ue,$>6))return g("Invalid IP v6 address."),null;for(var Ce=0;ne.c()!=="";){var ye=null;if(Ce>0){if(!(ne.c()==="."&&Ce<4))return g("Invalid IP v6 address."),null;ne.pointer++}if(!p.codePoint.ASCIIDigit.test(ne.c()))return g("Invalid IP v6 address."),null;for(;p.codePoint.ASCIIDigit.test(ne.c());){var je=parseInt(ne.c(),10);if(ye===null)ye=je;else{if(ye===0)return g("Invalid IP v6 address."),null;ye=10*ye+je}if(ye>255)return g("Invalid IP v6 address."),null;ne.pointer++}if(ye===null)return g("Invalid IP v6 address."),null;W[$]=256*W[$]+ye,++Ce!==2&&Ce!==4||$++}if(Ce!==4)return g("Invalid IP v6 address."),null;break}if(ne.c()===":"){if(ne.pointer++,ne.c()==="")return g("Invalid IP v6 address."),null}else if(ne.c()!=="")return g("Invalid IP v6 address."),null;W[$]=oe,$++}else{if(J!==null)return g("Invalid IP v6 address."),null;ne.pointer++,J=++$}}if(J!==null){var Le=$-J;for($=7;$!==0&&Le>0;)z=o([W[J+Le-1],W[$]],2),W[$]=z[0],W[J+Le-1]=z[1],$--,Le--}else if(J===null&&$!==8)return g("Invalid IP v6 address."),null;return W}function Y(U){var z,W;if(/[\x00\t\f\r #/:?@\[\\\]]/.test(U))return g("Invalid host string."),null;var $="";try{for(var J=i(U),ne=J.next();!ne.done;ne=J.next())$+=ee(ne.value,h)}catch(oe){z={error:oe}}finally{try{ne&&!ne.done&&(W=J.return)&&W.call(J)}finally{if(z)throw z.error}}return $}function q(U){return null}function Z(U){return"%"+("00"+U.toString(16).toUpperCase()).slice(-2)}function re(U){for(var z=function(ue){return ue>=48&&ue<=57||ue>=65&&ue<=70||ue>=97&&ue<=102},W=new Uint8Array(U.length),$=0,J=0;J=U.length-2)W[$]=ne,$++;else if(ne!==37||z(U[J+1])&&z(U[J+2])){var oe=parseInt(c.utf8Decode(Uint8Array.of(U[J+1],U[J+2])),16);W[$]=oe,$++,J+=2}else W[$]=ne,$++}return W.subarray(0,$)}function ae(U){return re(c.utf8Encode(U))}function ee(U,z){var W,$;if(!z.test(U))return U;var J=c.utf8Encode(U),ne="";try{for(var oe=i(J),ue=oe.next();!ue.done;ue=oe.next())ne+=Z(ue.value)}catch(Ce){W={error:Ce}}finally{try{ue&&!ue.done&&($=oe.return)&&$.call(oe)}finally{if(W)throw W.error}}return ne}function F(U){var z,W,$,J,ne=[],oe=[];try{for(var ue=i(U),Ce=ue.next();!Ce.done;Ce=ue.next()){var ye=Ce.value;ye===38?(ne.push(Uint8Array.from(oe)),oe=[]):oe.push(ye)}}catch(he){z={error:he}}finally{try{Ce&&!Ce.done&&(W=ue.return)&&W.call(ue)}finally{if(z)throw z.error}}oe.length!==0&&ne.push(Uint8Array.from(oe));var je=[];try{for(var Le=i(ne),ge=Le.next();!ge.done;ge=Le.next()){var tt=ge.value;if(tt.length!==0){for(var X=tt.indexOf(61),De=X!==-1?tt.slice(0,X):tt,Oe=X!==-1?tt.slice(X+1):new Uint8Array,de=0;de=48&&oe<=57||oe>=65&&oe<=90||oe===95||oe>=97&&oe<=122?String.fromCodePoint(oe):Z(oe)}}catch(ue){z={error:ue}}finally{try{ne&&!ne.done&&(W=J.return)&&W.call(J)}finally{if(z)throw z.error}}return $}function G(U,z){var W=u.domainToASCII(U);return W===""?(g("Invalid domain name."),null):W}n.setValidationErrorCallback=function(U){s=U},n.newURL=C,n.isSpecialScheme=S,n.isSpecial=T,n.defaultPort=w,n.includesCredentials=_,n.cannotHaveAUsernamePasswordPort=function(U){return U.host===null||U.host===""||U._cannotBeABaseURLFlag||U.scheme==="file"},n.urlSerializer=E,n.hostSerializer=D,n.iPv4Serializer=O,n.iPv6Serializer=M,n.urlParser=function(U,z,W){var $=N(U,z,W);return $===null?null:($.scheme!=="blob"||($._blobURLEntry=null),$)},n.basicURLParser=N,n.setTheUsername=function(U,z){var W,$,J="";try{for(var ne=i(z),oe=ne.next();!oe.done;oe=ne.next())J+=ee(oe.value,m)}catch(ue){W={error:ue}}finally{try{oe&&!oe.done&&($=ne.return)&&$.call(ne)}finally{if(W)throw W.error}}U.username=J},n.setThePassword=function(U,z){var W,$,J="";try{for(var ne=i(z),oe=ne.next();!oe.done;oe=ne.next())J+=ee(oe.value,m)}catch(ue){W={error:ue}}finally{try{oe&&!oe.done&&($=ne.return)&&$.call(ne)}finally{if(W)throw W.error}}U.password=J},n.isSingleDotPathSegment=R,n.isDoubleDotPathSegment=B,n.shorten=I,n.isNormalizedWindowsDriveLetter=P,n.isWindowsDriveLetter=L,n.startsWithAWindowsDriveLetter=k,n.hostParser=A,n.iPv4NumberParser=j,n.iPv4Parser=H,n.iPv6Parser=K,n.opaqueHostParser=Y,n.resolveABlobURL=q,n.percentEncode=Z,n.percentDecode=re,n.stringPercentDecode=ae,n.utf8PercentEncode=ee,n.hostEquals=function(U,z){return U===z},n.urlEquals=function(U,z,W){return W===void 0&&(W=!1),E(U,W)===E(z,W)},n.urlEncodedStringParser=function(U){return F(c.utf8Encode(U))},n.urlEncodedParser=F,n.urlEncodedByteSerializer=b,n.urlEncodedSerializer=function(U,z){var W,$;if((z===void 0||z==="replacement"||z==="UTF-16BE"||z==="UTF-16LE"?"UTF-8":z).toUpperCase()!=="UTF-8")throw new Error("Only UTF-8 encoding is supported.");var J="";try{for(var ne=i(U),oe=ne.next();!oe.done;oe=ne.next()){var ue=oe.value,Ce=b(c.utf8Encode(ue[0])),ye=ue[1];ye=b(c.utf8Encode(ye)),J!==""&&(J+="&"),J+=Ce+"="+ye}}catch(je){W={error:je}}finally{try{oe&&!oe.done&&($=ne.return)&&$.call(ne)}finally{if(W)throw W.error}}return J},n.origin=function U(z){switch(z.scheme){case"blob":z._blobURLEntry;var W=N(z.path[0]);return W===null?l.OpaqueOrigin:U(W);case"ftp":case"http":case"https":case"ws":case"wss":return[z.scheme,z.host===null?"":z.host,z.port,null];case"file":default:return l.OpaqueOrigin}},n.domainToASCII=G,n.domainToUnicode=function(U,z){var W=u.domainToUnicode(U);return W===""&&g("Invalid domain name."),W},n.asciiSerializationOfAnOrigin=function(U){if(U[0]===""&&U[1]===""&&U[2]===null&&U[3]===null)return"null";var z=U[0]+"://"+D(U[1]);return U[2]!==null&&(z+=":"+U[2].toString()),z}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(0),o=function(){function s(){this._signal=i.create_abortSignal()}return Object.defineProperty(s.prototype,"signal",{get:function(){return this._signal},enumerable:!0,configurable:!0}),s.prototype.abort=function(){i.abort_signalAbort(this._signal)},s}();n.AbortControllerImpl=o},function(a,n,r){var i,o=this&&this.__extends||(i=function(p,u){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var d in h)h.hasOwnProperty(d)&&(f[d]=h[d])})(p,u)},function(p,u){function f(){this.constructor=p}i(p,u),p.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(70),c=r(0),l=function(p){function u(){var f=p.call(this)||this;return f._abortedFlag=!1,f._abortAlgorithms=new Set,f}return o(u,p),Object.defineProperty(u.prototype,"aborted",{get:function(){return this._abortedFlag},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"onabort",{get:function(){return c.event_getterEventHandlerIDLAttribute(this,"onabort")},set:function(f){c.event_setterEventHandlerIDLAttribute(this,"onabort",f)},enumerable:!0,configurable:!0}),u._create=function(){return new u},u}(s.EventTargetImpl);n.AbortSignalImpl=l},function(a,n,r){var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),c=r(34),l=r(12),p=function(u){function f(h,d,v){var m=u.call(this)||this;return m._name="",m._publicId="",m._systemId="",m._name=h,m._publicId=d,m._systemId=v,m}return o(f,u),Object.defineProperty(f.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"publicId",{get:function(){return this._publicId},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"systemId",{get:function(){return this._systemId},enumerable:!0,configurable:!0}),f.prototype.before=function(){for(var h=[],d=0;d=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(1),c=r(0),l=function(){function p(u){return this._live=!0,this._filter=null,this._length=0,this._root=u,new Proxy(this,this)}return Object.defineProperty(p.prototype,"length",{get:function(){return this._root._children.size},enumerable:!0,configurable:!0}),p.prototype.item=function(u){if(u<0||u>this.length-1)return null;if(u=l.length&&(l=void 0),{value:l&&l[f++],done:!l}}};throw new TypeError(p?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(1),c=function(){function l(p){return this._live=!1,this._items=[],this._length=0,this._root=p,this._items=[],this._filter=function(u){return!0},new Proxy(this,this)}return Object.defineProperty(l.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),l.prototype.item=function(p){return p<0||p>this.length-1?null:this._items[p]},l.prototype.keys=function(){var p;return(p={})[Symbol.iterator]=function(){var u=0;return{next:function(){return u===this.length?{done:!0,value:null}:{done:!1,value:u++}}.bind(this)}}.bind(this),p},l.prototype.values=function(){var p;return(p={})[Symbol.iterator]=function(){var u=this[Symbol.iterator]();return{next:function(){return u.next()}}}.bind(this),p},l.prototype.entries=function(){var p;return(p={})[Symbol.iterator]=function(){var u=this[Symbol.iterator](),f=0;return{next:function(){var h=u.next();return h.done?{done:!0,value:null}:{done:!1,value:[f++,h.value]}}}}.bind(this),p},l.prototype[Symbol.iterator]=function(){var p=this._items[Symbol.iterator]();return{next:function(){return p.next()}}},l.prototype.forEach=function(p,u){var f,h;u===void 0&&(u=o.dom.window);var d=0;try{for(var v=i(this._items),m=v.next();!m.done;m=v.next()){var x=m.value;p.call(u,x,d++,this)}}catch(y){f={error:y}}finally{try{m&&!m.done&&(h=v.return)&&h.call(v)}finally{if(f)throw f.error}}},l.prototype.get=function(p,u,f){if(!s.isString(u))return Reflect.get(p,u,f);var h=Number(u);return isNaN(h)?Reflect.get(p,u,f):p._items[h]||void 0},l.prototype.set=function(p,u,f,h){if(!s.isString(u))return Reflect.set(p,u,f,h);var d=Number(u);return isNaN(d)?Reflect.set(p,u,f,h):d>=0&&d=m.length&&(m=void 0),{value:m&&m[g++],done:!m}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(6),l=r(2),p=r(102),u=r(9),f=r(0),h=r(12),d=r(3),v=function(m){function x(){var y=m.call(this)||this,g=c.dom.window._associatedDocument;return y._start=[g,0],y._end=[g,0],c.dom.rangeList.add(y),y}return o(x,m),Object.defineProperty(x.prototype,"commonAncestorContainer",{get:function(){for(var y=this._start[0];!f.tree_isAncestorOf(this._end[0],y,!0);){if(y._parent===null)throw new Error("Parent node is null.");y=y._parent}return y},enumerable:!0,configurable:!0}),x.prototype.setStart=function(y,g){f.range_setTheStart(this,y,g)},x.prototype.setEnd=function(y,g){f.range_setTheEnd(this,y,g)},x.prototype.setStartBefore=function(y){var g=y._parent;if(g===null)throw new u.InvalidNodeTypeError;f.range_setTheStart(this,g,f.tree_index(y))},x.prototype.setStartAfter=function(y){var g=y._parent;if(g===null)throw new u.InvalidNodeTypeError;f.range_setTheStart(this,g,f.tree_index(y)+1)},x.prototype.setEndBefore=function(y){var g=y._parent;if(g===null)throw new u.InvalidNodeTypeError;f.range_setTheEnd(this,g,f.tree_index(y))},x.prototype.setEndAfter=function(y){var g=y._parent;if(g===null)throw new u.InvalidNodeTypeError;f.range_setTheEnd(this,g,f.tree_index(y)+1)},x.prototype.collapse=function(y){y?this._end=this._start:this._start=this._end},x.prototype.selectNode=function(y){f.range_select(y,this)},x.prototype.selectNodeContents=function(y){if(d.Guard.isDocumentTypeNode(y))throw new u.InvalidNodeTypeError;var g=f.tree_nodeLength(y);this._start=[y,0],this._end=[y,g]},x.prototype.compareBoundaryPoints=function(y,g){if(y!==l.HowToCompare.StartToStart&&y!==l.HowToCompare.StartToEnd&&y!==l.HowToCompare.EndToEnd&&y!==l.HowToCompare.EndToStart)throw new u.NotSupportedError;if(f.range_root(this)!==f.range_root(g))throw new u.WrongDocumentError;var C,S;switch(y){case l.HowToCompare.StartToStart:C=this._start,S=g._start;break;case l.HowToCompare.StartToEnd:C=this._end,S=g._start;break;case l.HowToCompare.EndToEnd:C=this._end,S=g._end;break;case l.HowToCompare.EndToStart:C=this._start,S=g._end;break;default:throw new u.NotSupportedError}var T=f.boundaryPoint_position(C,S);return T===l.BoundaryPosition.Before?-1:T===l.BoundaryPosition.After?1:0},x.prototype.deleteContents=function(){var y,g,C,S;if(!f.range_collapsed(this)){var T=this._startNode,w=this._startOffset,_=this._endNode,E=this._endOffset;if(T===_&&d.Guard.isCharacterDataNode(T))f.characterData_replaceData(T,w,E-w,"");else{var D,O,M=[];try{for(var N=s(f.range_getContainedNodes(this)),R=N.next();!R.done;R=N.next()){var B=(k=R.value)._parent;B!==null&&f.range_isContained(B,this)||M.push(k)}}catch(A){y={error:A}}finally{try{R&&!R.done&&(g=N.return)&&g.call(N)}finally{if(y)throw y.error}}if(f.tree_isAncestorOf(_,T,!0))D=T,O=w;else{for(var I=T;I._parent!==null&&!f.tree_isAncestorOf(_,I._parent,!0);)I=I._parent;if(I._parent===null)throw new Error("Parent node is null.");D=I._parent,O=f.tree_index(I)+1}d.Guard.isCharacterDataNode(T)&&f.characterData_replaceData(T,w,f.tree_nodeLength(T)-w,"");try{for(var P=s(M),L=P.next();!L.done;L=P.next()){var k;(k=L.value)._parent&&f.mutation_remove(k,k._parent)}}catch(A){C={error:A}}finally{try{L&&!L.done&&(S=P.return)&&S.call(P)}finally{if(C)throw C.error}}d.Guard.isCharacterDataNode(_)&&f.characterData_replaceData(_,0,E,""),this._start=[D,O],this._end=[D,O]}}},x.prototype.extractContents=function(){return f.range_extract(this)},x.prototype.cloneContents=function(){return f.range_cloneTheContents(this)},x.prototype.insertNode=function(y){return f.range_insert(y,this)},x.prototype.surroundContents=function(y){var g,C;try{for(var S=s(f.range_getPartiallyContainedNodes(this)),T=S.next();!T.done;T=S.next()){var w=T.value;if(!d.Guard.isTextNode(w))throw new u.InvalidStateError}}catch(E){g={error:E}}finally{try{T&&!T.done&&(C=S.return)&&C.call(S)}finally{if(g)throw g.error}}if(d.Guard.isDocumentNode(y)||d.Guard.isDocumentTypeNode(y)||d.Guard.isDocumentFragmentNode(y))throw new u.InvalidNodeTypeError;var _=f.range_extract(this);y._children.size!==0&&f.mutation_replaceAll(null,y),f.range_insert(y,this),f.mutation_append(_,y),f.range_select(y,this)},x.prototype.cloneRange=function(){return f.create_range(this._start,this._end)},x.prototype.detach=function(){c.dom.rangeList.delete(this)},x.prototype.isPointInRange=function(y,g){if(f.tree_rootNode(y)!==f.range_root(this))return!1;if(d.Guard.isDocumentTypeNode(y))throw new u.InvalidNodeTypeError;if(g>f.tree_nodeLength(y))throw new u.IndexSizeError;var C=[y,g];return f.boundaryPoint_position(C,this._start)!==l.BoundaryPosition.Before&&f.boundaryPoint_position(C,this._end)!==l.BoundaryPosition.After},x.prototype.comparePoint=function(y,g){if(f.tree_rootNode(y)!==f.range_root(this))throw new u.WrongDocumentError;if(d.Guard.isDocumentTypeNode(y))throw new u.InvalidNodeTypeError;if(g>f.tree_nodeLength(y))throw new u.IndexSizeError;var C=[y,g];return f.boundaryPoint_position(C,this._start)===l.BoundaryPosition.Before?-1:f.boundaryPoint_position(C,this._end)===l.BoundaryPosition.After?1:0},x.prototype.intersectsNode=function(y){if(f.tree_rootNode(y)!==f.range_root(this))return!1;var g=y._parent;if(g===null)return!0;var C=f.tree_index(y);return f.boundaryPoint_position([g,C],this._end)===l.BoundaryPosition.Before&&f.boundaryPoint_position([g,C+1],this._start)===l.BoundaryPosition.After},x.prototype.toString=function(){var y,g,C="";if(this._startNode===this._endNode&&d.Guard.isTextNode(this._startNode))return this._startNode._data.substring(this._startOffset,this._endOffset);d.Guard.isTextNode(this._startNode)&&(C+=this._startNode._data.substring(this._startOffset));try{for(var S=s(f.range_getContainedNodes(this)),T=S.next();!T.done;T=S.next()){var w=T.value;d.Guard.isTextNode(w)&&(C+=w._data)}}catch(_){y={error:_}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(y)throw y.error}}return d.Guard.isTextNode(this._endNode)&&(C+=this._endNode._data.substring(0,this._endOffset)),C},x._create=function(y,g){var C=new x;return y&&(C._start=y),g&&(C._end=g),C},x.START_TO_START=0,x.START_TO_END=1,x.END_TO_END=2,x.END_TO_START=3,x}(p.AbstractRangeImpl);n.RangeImpl=v,h.idl_defineConst(v.prototype,"START_TO_START",0),h.idl_defineConst(v.prototype,"START_TO_END",1),h.idl_defineConst(v.prototype,"END_TO_END",2),h.idl_defineConst(v.prototype,"END_TO_START",3)},function(a,n,r){var i,o=this&&this.__extends||(i=function(p,u){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var d in h)h.hasOwnProperty(d)&&(f[d]=h[d])})(p,u)},function(p,u){function f(){this.constructor=p}i(p,u),p.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(103),c=r(0),l=function(p){function u(f,h,d){var v=p.call(this,f)||this;return v._iteratorCollection=void 0,v._reference=h,v._pointerBeforeReference=d,c.nodeIterator_iteratorList().add(v),v}return o(u,p),Object.defineProperty(u.prototype,"referenceNode",{get:function(){return this._reference},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"pointerBeforeReferenceNode",{get:function(){return this._pointerBeforeReference},enumerable:!0,configurable:!0}),u.prototype.nextNode=function(){return c.nodeIterator_traverse(this,!0)},u.prototype.previousNode=function(){return c.nodeIterator_traverse(this,!1)},u.prototype.detach=function(){c.nodeIterator_iteratorList().delete(this)},u._create=function(f,h,d){return new u(f,h,d)},u}(s.TraverserImpl);n.NodeIteratorImpl=l},function(a,n,r){var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),c=r(103),l=r(0),p=function(u){function f(h,d){var v=u.call(this,h)||this;return v._current=d,v}return o(f,u),Object.defineProperty(f.prototype,"currentNode",{get:function(){return this._current},set:function(h){this._current=h},enumerable:!0,configurable:!0}),f.prototype.parentNode=function(){for(var h=this._current;h!==null&&h!==this._root;)if((h=h._parent)!==null&&l.traversal_filter(this,h)===s.FilterResult.Accept)return this._current=h,h;return null},f.prototype.firstChild=function(){return l.treeWalker_traverseChildren(this,!0)},f.prototype.lastChild=function(){return l.treeWalker_traverseChildren(this,!1)},f.prototype.nextSibling=function(){return l.treeWalker_traverseSiblings(this,!0)},f.prototype.previousNode=function(){for(var h=this._current;h!==this._root;){for(var d=h._previousSibling;d;){h=d;for(var v=l.traversal_filter(this,h);v!==s.FilterResult.Reject&&h._lastChild;)h=h._lastChild,v=l.traversal_filter(this,h);if(v===s.FilterResult.Accept)return this._current=h,h;d=h._previousSibling}if(h===this._root||h._parent===null)return null;if(h=h._parent,l.traversal_filter(this,h)===s.FilterResult.Accept)return this._current=h,h}return null},f.prototype.previousSibling=function(){return l.treeWalker_traverseSiblings(this,!1)},f.prototype.nextNode=function(){for(var h=this._current,d=s.FilterResult.Accept;;){for(;d!==s.FilterResult.Reject&&h._firstChild;)if(h=h._firstChild,(d=l.traversal_filter(this,h))===s.FilterResult.Accept)return this._current=h,h;for(var v=null,m=h;m!==null;){if(m===this._root)return null;if((v=m._nextSibling)!==null){h=v;break}m=m._parent}if((d=l.traversal_filter(this,h))===s.FilterResult.Accept)return this._current=h,h}},f._create=function(h,d){return new f(h,d)},f}(c.TraverserImpl);n.TreeWalkerImpl=p},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=r(12),s=function(){function c(){}return c.prototype.acceptNode=function(l){return i.FilterResult.Accept},c._create=function(){return new c},c.FILTER_ACCEPT=1,c.FILTER_REJECT=2,c.FILTER_SKIP=3,c.SHOW_ALL=4294967295,c.SHOW_ELEMENT=1,c.SHOW_ATTRIBUTE=2,c.SHOW_TEXT=4,c.SHOW_CDATA_SECTION=8,c.SHOW_ENTITY_REFERENCE=16,c.SHOW_ENTITY=32,c.SHOW_PROCESSING_INSTRUCTION=64,c.SHOW_COMMENT=128,c.SHOW_DOCUMENT=256,c.SHOW_DOCUMENT_TYPE=512,c.SHOW_DOCUMENT_FRAGMENT=1024,c.SHOW_NOTATION=2048,c}();n.NodeFilterImpl=s,o.idl_defineConst(s.prototype,"FILTER_ACCEPT",1),o.idl_defineConst(s.prototype,"FILTER_REJECT",2),o.idl_defineConst(s.prototype,"FILTER_SKIP",3),o.idl_defineConst(s.prototype,"SHOW_ALL",4294967295),o.idl_defineConst(s.prototype,"SHOW_ELEMENT",1),o.idl_defineConst(s.prototype,"SHOW_ATTRIBUTE",2),o.idl_defineConst(s.prototype,"SHOW_TEXT",4),o.idl_defineConst(s.prototype,"SHOW_CDATA_SECTION",8),o.idl_defineConst(s.prototype,"SHOW_ENTITY_REFERENCE",16),o.idl_defineConst(s.prototype,"SHOW_ENTITY",32),o.idl_defineConst(s.prototype,"SHOW_PROCESSING_INSTRUCTION",64),o.idl_defineConst(s.prototype,"SHOW_COMMENT",128),o.idl_defineConst(s.prototype,"SHOW_DOCUMENT",256),o.idl_defineConst(s.prototype,"SHOW_DOCUMENT_TYPE",512),o.idl_defineConst(s.prototype,"SHOW_DOCUMENT_FRAGMENT",1024),o.idl_defineConst(s.prototype,"SHOW_NOTATION",2048)},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s,c,l,p,u,f,h,d,v){this._type=s,this._target=c,this._addedNodes=l,this._removedNodes=p,this._previousSibling=u,this._nextSibling=f,this._attributeName=h,this._attributeNamespace=d,this._oldValue=v}return Object.defineProperty(o.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"addedNodes",{get:function(){return this._addedNodes},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"removedNodes",{get:function(){return this._removedNodes},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"previousSibling",{get:function(){return this._previousSibling},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"nextSibling",{get:function(){return this._nextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attributeName",{get:function(){return this._attributeName},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attributeNamespace",{get:function(){return this._attributeNamespace},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"oldValue",{get:function(){return this._oldValue},enumerable:!0,configurable:!0}),o._create=function(s,c,l,p,u,f,h,d,v){return new o(s,c,l,p,u,f,h,d,v)},o}();n.MutationRecordImpl=i},function(a,n,r){var i=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&u[f],d=0;if(h)return h.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&d>=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(9),c=r(7),l=r(0),p=function(){function u(f,h){this._element=f,this._attribute=h,this._tokenSet=new Set;var d=h._localName,v=l.element_getAnAttributeValue(f,d),m=this;this._element._attributeChangeSteps.push(function(x,y,g,C,S){y===m._attribute._localName&&S===null&&(C?m._tokenSet=l.orderedSet_parse(C):m._tokenSet.clear())}),o.dom.features.steps&&l.dom_runAttributeChangeSteps(f,d,v,v,null)}return Object.defineProperty(u.prototype,"length",{get:function(){return this._tokenSet.size},enumerable:!0,configurable:!0}),u.prototype.item=function(f){var h,d,v=0;try{for(var m=i(this._tokenSet),x=m.next();!x.done;x=m.next()){var y=x.value;if(v===f)return y;v++}}catch(g){h={error:g}}finally{try{x&&!x.done&&(d=m.return)&&d.call(m)}finally{if(h)throw h.error}}return null},u.prototype.contains=function(f){return this._tokenSet.has(f)},u.prototype.add=function(){for(var f,h,d=[],v=0;v=97&&s<=122||s>=65&&s<=90||s===58||s===95||s>=192&&s<=214||s>=216&&s<=246||s>=248&&s<=767||s>=880&&s<=893||s>=895&&s<=8191||s>=8204&&s<=8205||s>=8304&&s<=8591||s>=11264&&s<=12271||s>=12289&&s<=55295||s>=63744&&s<=64975||s>=65008&&s<=65533)&&(o===0||!(s===45||s===46||s>=48&&s<=57||s===183||s>=768&&s<=879||s>=8255&&s<=8256))){if(s>=55296&&s<=56319&&o=56320&&c<=57343&&(o++,(s=1024*(s-55296)+c-56320+65536)>=65536&&s<=983039))continue}return!1}}return!0},n.xml_isQName=function(i){for(var o=!1,s=0;s=97&&c<=122||c>=65&&c<=90||c===95||c>=192&&c<=214||c>=216&&c<=246||c>=248&&c<=767||c>=880&&c<=893||c>=895&&c<=8191||c>=8204&&c<=8205||c>=8304&&c<=8591||c>=11264&&c<=12271||c>=12289&&c<=55295||c>=63744&&c<=64975||c>=65008&&c<=65533)&&(s===0||!(c===45||c===46||c>=48&&c<=57||c===183||c>=768&&c<=879||c>=8255&&c<=8256))){if(s===0||c!==58){if(c>=55296&&c<=56319&&s=56320&&l<=57343&&(s++,(c=1024*(c-55296)+l-56320+65536)>=65536&&c<=983039))continue}return!1}if(o||s===i.length-1)return!1;o=!0}}return!0},n.xml_isLegalChar=function(i){for(var o=0;o=32&&s<=55295||s>=57344&&s<=65533)){if(s>=55296&&s<=56319&&o=56320&&c<=57343&&(o++,(s=1024*(s-55296)+c-56320+65536)>=65536&&s<=1114111))continue}return!1}}return!0},n.xml_isPubidChar=function(i){for(var o=0;o=97&&s<=122||s>=65&&s<=90||s>=39&&s<=59||s===32||s===13||s===10||s>=35&&s<=37||s===33||s===61||s===63||s===64||s===95))return!1}return!0}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=r(17);n.boundaryPoint_position=function s(c,l){var p=c[0],u=c[1],f=l[0],h=l[1];if(console.assert(o.tree_rootNode(p)===o.tree_rootNode(f),"Boundary points must share the same root node."),p===f)return u===h?i.BoundaryPosition.Equal:u=d.length&&(d=void 0),{value:d&&d[x++],done:!d}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),c=r(7),l=r(29),p=r(108),u=r(30),f=r(37),h=r(52);n.node_stringReplaceAll=function(d,v){var m=null;d!==""&&(m=l.create_text(v._nodeDocument,d)),f.mutation_replaceAll(m,v)},n.node_clone=function d(v,m,x){var y,g,C,S,T;if(m===void 0&&(m=null),x===void 0&&(x=!1),m===null&&(m=v._nodeDocument),s.Guard.isElementNode(v)){T=h.element_createAnElement(m,v._localName,v._namespace,v._namespacePrefix,v._is,!1);try{for(var w=i(v._attributeList),_=w.next();!_.done;_=w.next()){var E=d(_.value,m);h.element_append(E,T)}}catch(B){y={error:B}}finally{try{_&&!_.done&&(g=w.return)&&g.call(w)}finally{if(y)throw y.error}}}else if(s.Guard.isDocumentNode(v)){var D=l.create_document();D._encoding=v._encoding,D._contentType=v._contentType,D._URL=v._URL,D._origin=v._origin,D._type=v._type,D._mode=v._mode,T=D}else if(s.Guard.isDocumentTypeNode(v))T=l.create_documentType(m,v._name,v._publicId,v._systemId);else if(s.Guard.isAttrNode(v)){var O=l.create_attr(m,v.localName);O._namespace=v._namespace,O._namespacePrefix=v._namespacePrefix,O._value=v._value,T=O}else T=s.Guard.isExclusiveTextNode(v)?l.create_text(m,v._data):s.Guard.isCDATASectionNode(v)?l.create_cdataSection(m,v._data):s.Guard.isCommentNode(v)?l.create_comment(m,v._data):s.Guard.isProcessingInstructionNode(v)?l.create_processingInstruction(m,v._target,v._data):s.Guard.isDocumentFragmentNode(v)?l.create_documentFragment(m):Object.create(v);if(s.Guard.isDocumentNode(T)?(T._nodeDocument=T,m=T):T._nodeDocument=m,o.dom.features.steps&&u.dom_runCloningSteps(T,v,m,x),x)try{for(var M=i(v._children),N=M.next();!N.done;N=M.next()){var R=d(N.value,m,!0);f.mutation_append(R,T)}}catch(B){C={error:B}}finally{try{N&&!N.done&&(S=M.return)&&S.call(M)}finally{if(C)throw C.error}}return T},n.node_equals=function d(v,m){var x,y,g,C;if(v._nodeType!==m._nodeType)return!1;if(s.Guard.isDocumentTypeNode(v)&&s.Guard.isDocumentTypeNode(m)){if(v._name!==m._name||v._publicId!==m._publicId||v._systemId!==m._systemId)return!1}else if(s.Guard.isElementNode(v)&&s.Guard.isElementNode(m)){if(v._namespace!==m._namespace||v._namespacePrefix!==m._namespacePrefix||v._localName!==m._localName||v._attributeList.length!==m._attributeList.length)return!1}else if(s.Guard.isAttrNode(v)&&s.Guard.isAttrNode(m)){if(v._namespace!==m._namespace||v._localName!==m._localName||v._value!==m._value)return!1}else if(s.Guard.isProcessingInstructionNode(v)&&s.Guard.isProcessingInstructionNode(m)){if(v._target!==m._target||v._data!==m._data)return!1}else if(s.Guard.isCharacterDataNode(v)&&s.Guard.isCharacterDataNode(m)&&v._data!==m._data)return!1;if(s.Guard.isElementNode(v)&&s.Guard.isElementNode(m)){var S={};try{for(var T=i(v._attributeList),w=T.next();!w.done;w=T.next())S[(D=w.value)._localName]=D}catch(I){x={error:I}}finally{try{w&&!w.done&&(y=T.return)&&y.call(T)}finally{if(x)throw x.error}}try{for(var _=i(m._attributeList),E=_.next();!E.done;E=_.next()){var D,O=E.value;if(!(D=S[O._localName])||!d(D,O))return!1}}catch(I){g={error:I}}finally{try{E&&!E.done&&(C=_.return)&&C.call(_)}finally{if(g)throw g.error}}}if(v._children.size!==m._children.size)return!1;for(var M=v._children[Symbol.iterator](),N=m._children[Symbol.iterator](),R=M.next(),B=N.next();!R.done&&!B.done;){if(!d(R.value,B.value))return!1;R=M.next(),B=N.next()}return!0},n.node_listOfElementsWithQualifiedName=function(d,v){return d==="*"?l.create_htmlCollection(v):v._nodeDocument._type==="html"?l.create_htmlCollection(v,function(m){return m._namespace===c.namespace.HTML&&m._qualifiedName===d.toLowerCase()||m._namespace!==c.namespace.HTML&&m._qualifiedName===d}):l.create_htmlCollection(v,function(m){return m._qualifiedName===d})},n.node_listOfElementsWithNamespace=function(d,v,m){return d===""&&(d=null),d==="*"&&v==="*"?l.create_htmlCollection(m):d==="*"?l.create_htmlCollection(m,function(x){return x._localName===v}):v==="*"?l.create_htmlCollection(m,function(x){return x._namespace===d}):l.create_htmlCollection(m,function(x){return x._localName===v&&x._namespace===d})},n.node_listOfElementsWithClassNames=function(d,v){var m=p.orderedSet_parse(d);if(m.size===0)return l.create_htmlCollection(v,function(){return!1});var x=v._nodeDocument._mode!=="quirks";return l.create_htmlCollection(v,function(y){var g=y.classList;return p.orderedSet_contains(g._tokenSet,m,x)})},n.node_locateANamespacePrefix=function d(v,m){if(v._namespace===m&&v._namespacePrefix!==null)return v._namespacePrefix;for(var x=0;x=h.length&&(h=void 0),{value:h&&h[m++],done:!h}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),c=r(9),l=r(29),p=r(17),u=r(107),f=r(37);n.text_contiguousTextNodes=function(h,d){var v;return d===void 0&&(d=!1),(v={})[Symbol.iterator]=function(){for(var m=h;m&&s.Guard.isTextNode(m._previousSibling);)m=m._previousSibling;return{next:function(){if(m&&!d&&m===h&&(m=s.Guard.isTextNode(m._nextSibling)?m._nextSibling:null),m===null)return{done:!0,value:null};var x={done:!1,value:m};return m=s.Guard.isTextNode(m._nextSibling)?m._nextSibling:null,x}}},v},n.text_contiguousExclusiveTextNodes=function(h,d){var v;return d===void 0&&(d=!1),(v={})[Symbol.iterator]=function(){for(var m=h;m&&s.Guard.isExclusiveTextNode(m._previousSibling);)m=m._previousSibling;return{next:function(){if(m&&!d&&m===h&&(m=s.Guard.isExclusiveTextNode(m._nextSibling)?m._nextSibling:null),m===null)return{done:!0,value:null};var x={done:!1,value:m};return m=s.Guard.isExclusiveTextNode(m._nextSibling)?m._nextSibling:null,x}}},v},n.text_descendantTextContent=function(h){for(var d="",v=p.tree_getFirstDescendantNode(h,!1,!1,function(m){return s.Guard.isTextNode(m)});v!==null;)d+=v._data,v=p.tree_getNextDescendantNode(h,v,!1,!1,function(m){return s.Guard.isTextNode(m)});return d},n.text_split=function(h,d){var v,m,x=h._data.length;if(d>x)throw new c.IndexSizeError;var y=x-d,g=u.characterData_substringData(h,d,y),C=l.create_text(h._nodeDocument,g),S=h._parent;if(S!==null){f.mutation_insert(C,S,h._nextSibling);try{for(var T=i(o.dom.rangeList),w=T.next();!w.done;w=T.next()){var _=w.value;_._start[0]===h&&_._start[1]>d&&(_._start[0]=C,_._start[1]-=d),_._end[0]===h&&_._end[1]>d&&(_._end[0]=C,_._end[1]-=d);var E=p.tree_index(h);_._start[0]===S&&_._start[1]===E+1&&_._start[1]++,_._end[0]===S&&_._end[1]===E+1&&_._end[1]++}}catch(D){v={error:D}}finally{try{w&&!w.done&&(m=T.return)&&m.call(T)}finally{if(v)throw v.error}}}return u.characterData_replaceData(h,d,y,""),C}},function(a,n,r){var i=r(4),o=r(41),s=r(24),c=r(48),l=[].join,p=o!=Object,u=c("join",",");i({target:"Array",proto:!0,forced:p||!u},{join:function(f){return l.call(s(this),f===void 0?",":f)}})},function(a,n,r){var i=r(4),o=r(83),s=String.fromCharCode,c=String.fromCodePoint;i({target:"String",stat:!0,forced:!!c&&c.length!=1},{fromCodePoint:function(l){for(var p,u=[],f=arguments.length,h=0;f>h;){if(p=+arguments[h++],o(p,1114111)!==p)throw RangeError(p+" is not a valid code point");u.push(p<65536?s(p):s(55296+((p-=65536)>>10),p%1024+56320))}return u.join("")}})},function(a,n,r){var i=this&&this.__read||function(c,l){var p=typeof Symbol=="function"&&c[Symbol.iterator];if(!p)return c;var u,f,h=p.call(c),d=[];try{for(;(l===void 0||l-- >0)&&!(u=h.next()).done;)d.push(u.value)}catch(v){f={error:v}}finally{try{u&&!u.done&&(p=h.return)&&p.call(h)}finally{if(f)throw f.error}}return d};Object.defineProperty(n,"__esModule",{value:!0});var o=r(111),s=function(){function c(l,p){this._options={skipWhitespaceOnlyText:!1},this.err={line:-1,col:-1,index:-1,str:""},this._str=l,this._index=0,this._length=l.length,p&&(this._options.skipWhitespaceOnlyText=p.skipWhitespaceOnlyText||!1)}return c.prototype.nextToken=function(){if(this.eof())return{type:o.TokenType.EOF};var l=this.skipIfStartsWith("<")?this.openBracket():this.text();return this._options.skipWhitespaceOnlyText&&l.type===o.TokenType.Text&&c.isWhiteSpaceToken(l)&&(l=this.nextToken()),l},c.prototype.openBracket=function(){return this.skipIfStartsWith("?")?this.skipIfStartsWith("xml")?c.isSpace(this._str[this._index])?this.declaration():(this.seek(-3),this.pi()):this.pi():this.skipIfStartsWith("!")?this.skipIfStartsWith("--")?this.comment():this.skipIfStartsWith("[CDATA[")?this.cdata():this.skipIfStartsWith("DOCTYPE")?this.doctype():void this.throwError("Invalid '!' in opening tag."):this.skipIfStartsWith("/")?this.closeTag():this.openTag()},c.prototype.declaration=function(){for(var l="",p="",u="";!this.eof();){if(this.skipSpace(),this.skipIfStartsWith("?>"))return{type:o.TokenType.Declaration,version:l,encoding:p,standalone:u};var f=i(this.attribute(),2),h=f[0],d=f[1];h==="version"?l=d:h==="encoding"?p=d:h==="standalone"?u=d:this.throwError("Invalid attribute name: "+h)}this.throwError("Missing declaration end symbol `?>`")},c.prototype.doctype=function(){var l="",p="";this.skipSpace();var u=this.takeUntil2("[",">",!0);return this.skipSpace(),this.skipIfStartsWith("PUBLIC")?(l=this.quotedString(),p=this.quotedString()):this.skipIfStartsWith("SYSTEM")&&(p=this.quotedString()),this.skipSpace(),this.skipIfStartsWith("[")&&(this.skipUntil("]"),this.skipIfStartsWith("]")||this.throwError("Missing end bracket of DTD internal subset")),this.skipSpace(),this.skipIfStartsWith(">")||this.throwError("Missing doctype end symbol `>`"),{type:o.TokenType.DocType,name:u,pubId:l,sysId:p}},c.prototype.pi=function(){var l=this.takeUntilStartsWith("?>",!0);if(this.eof()&&this.throwError("Missing processing instruction end symbol `?>`"),this.skipSpace(),this.skipIfStartsWith("?>"))return{type:o.TokenType.PI,target:l,data:""};var p=this.takeUntilStartsWith("?>");return this.eof()&&this.throwError("Missing processing instruction end symbol `?>`"),this.seek(2),{type:o.TokenType.PI,target:l,data:p}},c.prototype.text=function(){var l=this.takeUntil("<");return{type:o.TokenType.Text,data:l}},c.prototype.comment=function(){var l=this.takeUntilStartsWith("-->");return this.eof()&&this.throwError("Missing comment end symbol `-->`"),this.seek(3),{type:o.TokenType.Comment,data:l}},c.prototype.cdata=function(){var l=this.takeUntilStartsWith("]]>");return this.eof()&&this.throwError("Missing CDATA end symbol `]>`"),this.seek(3),{type:o.TokenType.CDATA,data:l}},c.prototype.openTag=function(){this.skipSpace();var l=this.takeUntil2(">","/",!0);if(this.skipSpace(),this.skipIfStartsWith(">"))return{type:o.TokenType.Element,name:l,attributes:[],selfClosing:!1};if(this.skipIfStartsWith("/>"))return{type:o.TokenType.Element,name:l,attributes:[],selfClosing:!0};for(var p=[];!this.eof();){if(this.skipSpace(),this.skipIfStartsWith(">"))return{type:o.TokenType.Element,name:l,attributes:p,selfClosing:!1};if(this.skipIfStartsWith("/>"))return{type:o.TokenType.Element,name:l,attributes:p,selfClosing:!0};var u=this.attribute();p.push(u)}this.throwError("Missing opening element tag end symbol `>`")},c.prototype.closeTag=function(){this.skipSpace();var l=this.takeUntil(">",!0);return this.skipSpace(),this.skipIfStartsWith(">")||this.throwError("Missing closing element tag end symbol `>`"),{type:o.TokenType.ClosingTag,name:l}},c.prototype.attribute=function(){this.skipSpace();var l=this.takeUntil("=",!0);return this.skipSpace(),this.skipIfStartsWith("=")||this.throwError("Missing equals sign before attribute value"),[l,this.quotedString()]},c.prototype.quotedString=function(){this.skipSpace();var l=this.take(1);c.isQuote(l)||this.throwError("Missing start quote character before quoted value");var p=this.takeUntil(l);return this.skipIfStartsWith(l)||this.throwError("Missing end quote character after quoted value"),p},c.prototype.eof=function(){return this._index>=this._length},c.prototype.skipIfStartsWith=function(l){var p=l.length;if(p===1)return this._str[this._index]===l&&(this._index++,!0);for(var u=0;uthis._length&&(this._index=this._length)},c.prototype.skipSpace=function(){for(;!this.eof()&&c.isSpace(this._str[this._index]);)this._index++},c.prototype.take=function(l){if(l===1)return this._str[this._index++];var p=this._index;return this.seek(l),this._str.slice(p,this._index)},c.prototype.takeUntil=function(l,p){p===void 0&&(p=!1);for(var u=this._index;this._indexthis._index){d=u.index;break}throw this.err={line:f,col:this._index-h,index:this._index,str:this._str.substring(h,d)},new Error(l+` + */var o=r(229),s=r(230),u=r(231);function c(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(V,M){if(c()=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|V}function y(V,M){if(l.isBuffer(V))return V.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(V)||V instanceof ArrayBuffer))return V.byteLength;typeof V!="string"&&(V=""+V);var I=V.length;if(I===0)return 0;for(var U=!1;;)switch(M){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":case void 0:return ae(V).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*I;case"hex":return I>>>1;case"base64":return ne(V).length;default:if(U)return ae(V).length;M=(""+M).toLowerCase(),U=!0}}function d(V,M,I){var U=!1;if((M===void 0||M<0)&&(M=0),M>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0)<=(M>>>=0))return"";for(V||(V="utf8");;)switch(V){case"hex":return B(this,M,I);case"utf8":case"utf-8":return R(this,M,I);case"ascii":return N(this,M,I);case"latin1":case"binary":return L(this,M,I);case"base64":return b(this,M,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,M,I);default:if(U)throw new TypeError("Unknown encoding: "+V);V=(V+"").toLowerCase(),U=!0}}function g(V,M,I){var U=V[M];V[M]=V[I],V[I]=U}function C(V,M,I,U,z){if(V.length===0)return-1;if(typeof I=="string"?(U=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,isNaN(I)&&(I=z?0:V.length-1),I<0&&(I=V.length+I),I>=V.length){if(z)return-1;I=V.length-1}else if(I<0){if(!z)return-1;I=0}if(typeof M=="string"&&(M=l.from(M,U)),l.isBuffer(M))return M.length===0?-1:S(V,M,I,U,z);if(typeof M=="number")return M&=255,l.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?z?Uint8Array.prototype.indexOf.call(V,M,I):Uint8Array.prototype.lastIndexOf.call(V,M,I):S(V,[M],I,U,z);throw new TypeError("val must be string, number or Buffer")}function S(V,M,I,U,z){var j,$=1,J=V.length,re=M.length;if(U!==void 0&&((U=String(U).toLowerCase())==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(V.length<2||M.length<2)return-1;$=2,J/=2,re/=2,I/=2}function oe(Xe,ke){return $===1?Xe[ke]:Xe.readUInt16BE(ke*$)}if(z){var ue=-1;for(j=I;jJ&&(I=J-re),j=I;j>=0;j--){for(var Te=!0,Ce=0;Cez&&(U=z):U=z;var j=M.length;if(j%2!=0)throw new TypeError("Invalid hex string");U>j/2&&(U=j/2);for(var $=0;$>8,re=$%256,oe.push(re),oe.push(J);return oe}(M,V.length-I),V,I,U)}function b(V,M,I){return M===0&&I===V.length?o.fromByteArray(V):o.fromByteArray(V.slice(M,I))}function R(V,M,I){I=Math.min(V.length,I);for(var U=[],z=M;z239?4:oe>223?3:oe>191?2:1;if(z+Te<=I)switch(Te){case 1:oe<128&&(ue=oe);break;case 2:(192&(j=V[z+1]))==128&&(re=(31&oe)<<6|63&j)>127&&(ue=re);break;case 3:j=V[z+1],$=V[z+2],(192&j)==128&&(192&$)==128&&(re=(15&oe)<<12|(63&j)<<6|63&$)>2047&&(re<55296||re>57343)&&(ue=re);break;case 4:j=V[z+1],$=V[z+2],J=V[z+3],(192&j)==128&&(192&$)==128&&(192&J)==128&&(re=(15&oe)<<18|(63&j)<<12|(63&$)<<6|63&J)>65535&&re<1114112&&(ue=re)}ue===null?(ue=65533,Te=1):ue>65535&&(ue-=65536,U.push(ue>>>10&1023|55296),ue=56320|1023&ue),U.push(ue),z+=Te}return function(Ce){var Xe=Ce.length;if(Xe<=4096)return String.fromCharCode.apply(String,Ce);for(var ke="",ge=0;ge0&&(V=this.toString("hex",0,M).match(/.{2}/g).join(" "),this.length>M&&(V+=" ... ")),""},l.prototype.compare=function(V,M,I,U,z){if(!l.isBuffer(V))throw new TypeError("Argument must be a Buffer");if(M===void 0&&(M=0),I===void 0&&(I=V?V.length:0),U===void 0&&(U=0),z===void 0&&(z=this.length),M<0||I>V.length||U<0||z>this.length)throw new RangeError("out of range index");if(U>=z&&M>=I)return 0;if(U>=z)return-1;if(M>=I)return 1;if(this===V)return 0;for(var j=(z>>>=0)-(U>>>=0),$=(I>>>=0)-(M>>>=0),J=Math.min(j,$),re=this.slice(U,z),oe=V.slice(M,I),ue=0;uez)&&(I=z),V.length>0&&(I<0||M<0)||M>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");for(var j=!1;;)switch(U){case"hex":return T(this,V,M,I);case"utf8":case"utf-8":return w(this,V,M,I);case"ascii":return _(this,V,M,I);case"latin1":case"binary":return E(this,V,M,I);case"base64":return D(this,V,M,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,V,M,I);default:if(j)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),j=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(V,M,I){var U="";I=Math.min(V.length,I);for(var z=M;zU)&&(I=U);for(var z="",j=M;jI)throw new RangeError("Trying to access beyond buffer length")}function k(V,M,I,U,z,j){if(!l.isBuffer(V))throw new TypeError('"buffer" argument must be a Buffer instance');if(M>z||MV.length)throw new RangeError("Index out of range")}function G(V,M,I,U){M<0&&(M=65535+M+1);for(var z=0,j=Math.min(V.length-I,2);z>>8*(U?z:1-z)}function W(V,M,I,U){M<0&&(M=4294967295+M+1);for(var z=0,j=Math.min(V.length-I,4);z>>8*(U?z:3-z)&255}function H(V,M,I,U,z,j){if(I+U>V.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function X(V,M,I,U,z){return z||H(V,0,I,4),s.write(V,M,I,U,23,4),I+4}function Y(V,M,I,U,z){return z||H(V,0,I,8),s.write(V,M,I,U,52,8),I+8}l.prototype.slice=function(V,M){var I,U=this.length;if((V=~~V)<0?(V+=U)<0&&(V=0):V>U&&(V=U),(M=M===void 0?U:~~M)<0?(M+=U)<0&&(M=0):M>U&&(M=U),M0&&(z*=256);)U+=this[V+--M]*z;return U},l.prototype.readUInt8=function(V,M){return M||F(V,1,this.length),this[V]},l.prototype.readUInt16LE=function(V,M){return M||F(V,2,this.length),this[V]|this[V+1]<<8},l.prototype.readUInt16BE=function(V,M){return M||F(V,2,this.length),this[V]<<8|this[V+1]},l.prototype.readUInt32LE=function(V,M){return M||F(V,4,this.length),(this[V]|this[V+1]<<8|this[V+2]<<16)+16777216*this[V+3]},l.prototype.readUInt32BE=function(V,M){return M||F(V,4,this.length),16777216*this[V]+(this[V+1]<<16|this[V+2]<<8|this[V+3])},l.prototype.readIntLE=function(V,M,I){V|=0,M|=0,I||F(V,M,this.length);for(var U=this[V],z=1,j=0;++j=(z*=128)&&(U-=Math.pow(2,8*M)),U},l.prototype.readIntBE=function(V,M,I){V|=0,M|=0,I||F(V,M,this.length);for(var U=M,z=1,j=this[V+--U];U>0&&(z*=256);)j+=this[V+--U]*z;return j>=(z*=128)&&(j-=Math.pow(2,8*M)),j},l.prototype.readInt8=function(V,M){return M||F(V,1,this.length),128&this[V]?-1*(255-this[V]+1):this[V]},l.prototype.readInt16LE=function(V,M){M||F(V,2,this.length);var I=this[V]|this[V+1]<<8;return 32768&I?4294901760|I:I},l.prototype.readInt16BE=function(V,M){M||F(V,2,this.length);var I=this[V+1]|this[V]<<8;return 32768&I?4294901760|I:I},l.prototype.readInt32LE=function(V,M){return M||F(V,4,this.length),this[V]|this[V+1]<<8|this[V+2]<<16|this[V+3]<<24},l.prototype.readInt32BE=function(V,M){return M||F(V,4,this.length),this[V]<<24|this[V+1]<<16|this[V+2]<<8|this[V+3]},l.prototype.readFloatLE=function(V,M){return M||F(V,4,this.length),s.read(this,V,!0,23,4)},l.prototype.readFloatBE=function(V,M){return M||F(V,4,this.length),s.read(this,V,!1,23,4)},l.prototype.readDoubleLE=function(V,M){return M||F(V,8,this.length),s.read(this,V,!0,52,8)},l.prototype.readDoubleBE=function(V,M){return M||F(V,8,this.length),s.read(this,V,!1,52,8)},l.prototype.writeUIntLE=function(V,M,I,U){V=+V,M|=0,I|=0,U||k(this,V,M,I,Math.pow(2,8*I)-1,0);var z=1,j=0;for(this[M]=255&V;++j=0&&(j*=256);)this[M+z]=V/j&255;return M+I},l.prototype.writeUInt8=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,1,255,0),l.TYPED_ARRAY_SUPPORT||(V=Math.floor(V)),this[M]=255&V,M+1},l.prototype.writeUInt16LE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[M]=255&V,this[M+1]=V>>>8):G(this,V,M,!0),M+2},l.prototype.writeUInt16BE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[M]=V>>>8,this[M+1]=255&V):G(this,V,M,!1),M+2},l.prototype.writeUInt32LE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[M+3]=V>>>24,this[M+2]=V>>>16,this[M+1]=V>>>8,this[M]=255&V):W(this,V,M,!0),M+4},l.prototype.writeUInt32BE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[M]=V>>>24,this[M+1]=V>>>16,this[M+2]=V>>>8,this[M+3]=255&V):W(this,V,M,!1),M+4},l.prototype.writeIntLE=function(V,M,I,U){if(V=+V,M|=0,!U){var z=Math.pow(2,8*I-1);k(this,V,M,I,z-1,-z)}var j=0,$=1,J=0;for(this[M]=255&V;++j>0)-J&255;return M+I},l.prototype.writeIntBE=function(V,M,I,U){if(V=+V,M|=0,!U){var z=Math.pow(2,8*I-1);k(this,V,M,I,z-1,-z)}var j=I-1,$=1,J=0;for(this[M+j]=255&V;--j>=0&&($*=256);)V<0&&J===0&&this[M+j+1]!==0&&(J=1),this[M+j]=(V/$>>0)-J&255;return M+I},l.prototype.writeInt8=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,1,127,-128),l.TYPED_ARRAY_SUPPORT||(V=Math.floor(V)),V<0&&(V=255+V+1),this[M]=255&V,M+1},l.prototype.writeInt16LE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[M]=255&V,this[M+1]=V>>>8):G(this,V,M,!0),M+2},l.prototype.writeInt16BE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[M]=V>>>8,this[M+1]=255&V):G(this,V,M,!1),M+2},l.prototype.writeInt32LE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[M]=255&V,this[M+1]=V>>>8,this[M+2]=V>>>16,this[M+3]=V>>>24):W(this,V,M,!0),M+4},l.prototype.writeInt32BE=function(V,M,I){return V=+V,M|=0,I||k(this,V,M,4,2147483647,-2147483648),V<0&&(V=4294967295+V+1),l.TYPED_ARRAY_SUPPORT?(this[M]=V>>>24,this[M+1]=V>>>16,this[M+2]=V>>>8,this[M+3]=255&V):W(this,V,M,!1),M+4},l.prototype.writeFloatLE=function(V,M,I){return X(this,V,M,!0,I)},l.prototype.writeFloatBE=function(V,M,I){return X(this,V,M,!1,I)},l.prototype.writeDoubleLE=function(V,M,I){return Y(this,V,M,!0,I)},l.prototype.writeDoubleBE=function(V,M,I){return Y(this,V,M,!1,I)},l.prototype.copy=function(V,M,I,U){if(I||(I=0),U||U===0||(U=this.length),M>=V.length&&(M=V.length),M||(M=0),U>0&&U=this.length)throw new RangeError("sourceStart out of bounds");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),V.length-M=0;--z)V[z+M]=this[z+I];else if(j<1e3||!l.TYPED_ARRAY_SUPPORT)for(z=0;z>>=0,I=I===void 0?this.length:I>>>0,V||(V=0),typeof V=="number")for(j=M;j55295&&I<57344){if(!z){if(I>56319){(M-=3)>-1&&j.push(239,191,189);continue}if($+1===U){(M-=3)>-1&&j.push(239,191,189);continue}z=I;continue}if(I<56320){(M-=3)>-1&&j.push(239,191,189),z=I;continue}I=65536+(z-55296<<10|I-56320)}else z&&(M-=3)>-1&&j.push(239,191,189);if(z=null,I<128){if((M-=1)<0)break;j.push(I)}else if(I<2048){if((M-=2)<0)break;j.push(I>>6|192,63&I|128)}else if(I<65536){if((M-=3)<0)break;j.push(I>>12|224,I>>6&63|128,63&I|128)}else{if(!(I<1114112))throw new Error("Invalid code point");if((M-=4)<0)break;j.push(I>>18|240,I>>12&63|128,I>>6&63|128,63&I|128)}}return j}function ne(V){return o.toByteArray(function(M){if((M=function(I){return I.trim?I.trim():I.replace(/^\s+|\s+$/g,"")}(M).replace(q,"")).length<2)return"";for(;M.length%4!=0;)M+="=";return M}(V))}function ee(V,M,I,U){for(var z=0;z=M.length||z>=V.length);++z)M[z+I]=V[z];return z}}).call(this,r(78))},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),n.isASCIIByte=function(i){return i>=0&&i<=127}},function(a,n,r){var i=this&&this.__read||function(s,u){var c=typeof Symbol=="function"&&s[Symbol.iterator];if(!c)return s;var p,l,f=c.call(s),h=[];try{for(;(u===void 0||u-- >0)&&!(p=f.next()).done;)h.push(p.value)}catch(v){l={error:v}}finally{try{p&&!p.done&&(c=f.return)&&c.call(f)}finally{if(l)throw l.error}}return h},o=this&&this.__spread||function(){for(var s=[],u=0;u=65&&c<=90&&(s[u]=c+32)}},n.byteUppercase=function(s){for(var u=0;u=97&&c<=122&&(s[u]=c-32)}},n.byteCaseInsensitiveMatch=function(s,u){if(s.length!==u.length)return!1;for(var c=0;c=65&&p<=90&&(p+=32),l>=65&&l<=90&&(l+=32),p!==l)return!1}return!0},n.startsWith=function(s,u){for(var c=0;;){if(c>=s.length)return!1;if(c>=u.length)return!0;if(s[c]!==u[c])return!1;c++}},n.byteLessThan=function(s,u){for(var c=0;;){if(c>=s.length)return!1;if(c>=u.length)return!0;var p=s[c],l=u[c];if(pl)return!1;c++}},n.isomorphicDecode=function(s){return String.fromCodePoint.apply(String,o(s))}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(6),o=r(7),s=r(0),u=r(12),c=function(){function p(l){this._associatedDocument=l||i.dom.window.document}return p.prototype.createDocumentType=function(l,f,h){return s.namespace_validate(l),s.create_documentType(this._associatedDocument,l,f,h)},p.prototype.createDocument=function(l,f,h){h===void 0&&(h=null);var v=s.create_xmlDocument(),m=null;return f&&(m=s.document_internalCreateElementNS(v,l,f)),h&&v.appendChild(h),m&&v.appendChild(m),v._origin=this._associatedDocument._origin,l===o.namespace.HTML?v._contentType="application/xhtml+xml":l===o.namespace.SVG?v._contentType="image/svg+xml":v._contentType="application/xml",v},p.prototype.createHTMLDocument=function(l){var f=s.create_document();f._type="html",f._contentType="text/html",f.appendChild(s.create_documentType(f,"html","",""));var h=s.element_createAnElement(f,"html",o.namespace.HTML);f.appendChild(h);var v=s.element_createAnElement(f,"head",o.namespace.HTML);if(h.appendChild(v),l!==void 0){var m=s.element_createAnElement(f,"title",o.namespace.HTML);v.appendChild(m);var x=s.create_text(f,l);m.appendChild(x)}var y=s.element_createAnElement(f,"body",o.namespace.HTML);return h.appendChild(y),f._origin=this._associatedDocument._origin,f},p.prototype.hasFeature=function(){return!0},p._create=function(l){return new p(l)},p}();n.DOMImplementationImpl=c,u.idl_defineConst(c.prototype,"_ID","@oozcitak/dom")},function(a,n,r){var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(70),u=r(2),c=r(0),p=function(l){function f(){var h=l.call(this)||this;return h._signalSlots=new Set,h._mutationObserverMicrotaskQueued=!1,h._mutationObservers=new Set,h._iteratorList=new u.FixedSizeSet,h._associatedDocument=c.create_document(),h}return o(f,l),Object.defineProperty(f.prototype,"document",{get:function(){return this._associatedDocument},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"event",{get:function(){return this._currentEvent},enumerable:!0,configurable:!0}),f._create=function(){return new f},f}(s.EventTargetImpl);n.WindowImpl=p},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=function(){function s(){}return s.isNode=function(u){return!!u&&u._nodeType!==void 0},s.isDocumentNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.Document},s.isDocumentTypeNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.DocumentType},s.isDocumentFragmentNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.DocumentFragment},s.isAttrNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.Attribute},s.isCharacterDataNode=function(u){if(!s.isNode(u))return!1;var c=u._nodeType;return c===i.NodeType.Text||c===i.NodeType.ProcessingInstruction||c===i.NodeType.Comment||c===i.NodeType.CData},s.isTextNode=function(u){return s.isNode(u)&&(u._nodeType===i.NodeType.Text||u._nodeType===i.NodeType.CData)},s.isExclusiveTextNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.Text},s.isCDATASectionNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.CData},s.isCommentNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.Comment},s.isProcessingInstructionNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.ProcessingInstruction},s.isElementNode=function(u){return s.isNode(u)&&u._nodeType===i.NodeType.Element},s.isCustomElementNode=function(u){return s.isElementNode(u)&&u._customElementState==="custom"},s.isShadowRoot=function(u){return!!u&&u.host!==void 0},s.isMouseEvent=function(u){return!!u&&u.screenX!==void 0&&u.screenY!=null},s.isSlotable=function(u){return!!u&&u._name!==void 0&&u._assignedSlot!==void 0&&(s.isTextNode(u)||s.isElementNode(u))},s.isSlot=function(u){return!!u&&u._name!==void 0&&u._assignedNodes!==void 0&&s.isElementNode(u)},s.isWindow=function(u){return!!u&&u.navigator!==void 0},s.isEventListener=function(u){return!!u&&u.handleEvent!==void 0},s.isRegisteredObserver=function(u){return!!u&&u.observer!==void 0&&u.options!==void 0},s.isTransientRegisteredObserver=function(u){return!!u&&u.source!==void 0&&s.isRegisteredObserver(u)},s}();n.Guard=o},function(a,n,r){var i,o=this&&this.__extends||(i=function(u,c){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,l){p.__proto__=l}||function(p,l){for(var f in l)l.hasOwnProperty(f)&&(p[f]=l[f])})(u,c)},function(u,c){function p(){this.constructor=u}i(u,c),u.prototype=c===null?Object.create(c):(p.prototype=c.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(u){function c(){return u.call(this)||this}return o(c,u),c}(r(98).DocumentImpl);n.XMLDocumentImpl=s},function(a,n,r){var i=this&&this.__values||function(U){var z=typeof Symbol=="function"&&Symbol.iterator,j=z&&U[z],$=0;if(j)return j.call(U);if(U&&typeof U.length=="number")return{next:function(){return U&&$>=U.length&&(U=void 0),{value:U&&U[$++],done:!U}}};throw new TypeError(z?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(U,z){var j=typeof Symbol=="function"&&U[Symbol.iterator];if(!j)return U;var $,J,re=j.call(U),oe=[];try{for(;(z===void 0||z-- >0)&&!($=re.next()).done;)oe.push($.value)}catch(ue){J={error:ue}}finally{try{$&&!$.done&&(j=re.return)&&j.call(re)}finally{if(J)throw J.error}}return oe};Object.defineProperty(n,"__esModule",{value:!0});var s,u=r(2),c=r(243),p=r(7),l=r(244),f={ftp:21,file:null,http:80,https:443,ws:80,wss:443},h=/[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[ "<>`]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/[ "<>`#?{}]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,x=/[ "<>`#?{}/:;=@\[\]\\\^\|]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[0-9A-Za-z!\$&-\/:;=\?@_~\xA0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uD83E\uD840-\uD87E\uD880-\uD8BE\uD8C0-\uD8FE\uD900-\uD93E\uD940-\uD97E\uD980-\uD9BE\uD9C0-\uD9FE\uDA00-\uDA3E\uDA40-\uDA7E\uDA80-\uDABE\uDAC0-\uDAFE\uDB00-\uDB3E\uDB40-\uDB7E\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDC00-\uDFFD]/,d=/[\0\t\f\r #%/:?@\[\\\]]/;function g(U){s!==void 0&&s.call(null,"Validation Error: "+U)}function C(){return{scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,_cannotBeABaseURLFlag:!1,_blobURLEntry:null}}function S(U){return U in f}function T(U){return S(U.scheme)}function w(U){return f[U]||null}function _(U){return U.username!==""||U.password!==""}function E(U,z){var j,$;z===void 0&&(z=!1);var J=U.scheme+":";if(U.host!==null?(J+="//",_(U)&&(J+=U.username,U.password!==""&&(J+=":"+U.password),J+="@"),J+=D(U.host),U.port!==null&&(J+=":"+U.port)):U.host===null&&U.scheme==="file"&&(J+="//"),U._cannotBeABaseURLFlag)J+=U.path[0];else try{for(var re=i(U.path),oe=re.next();!oe.done;oe=re.next())J+="/"+oe.value}catch(ue){j={error:ue}}finally{try{oe&&!oe.done&&($=re.return)&&$.call(re)}finally{if(j)throw j.error}}return U.query!==null&&(J+="?"+U.query),z||U.fragment===null||(J+="#"+U.fragment),J}function D(U){return u.isNumber(U)?O(U):u.isArray(U)?"["+b(U)+"]":U}function O(U){for(var z="",j=U,$=1;$<=4;$++)z=(j%256).toString()+z,$!==4&&(z="."+z),j=Math.floor(j/256);return z}function b(U){for(var z="",j=null,$=-1,J=0,re=0,oe=0;oe<8;oe++)if(U[oe]===0){J=1;for(var ue=oe+1;ue<8&&U[ue]===0;ue++)J++;J>re&&(re=J,$=oe)}re>1&&(j=$);for(var Te=!1,Ce=0;Ce<8;Ce++)Te&&U[Ce]===0||(Te&&(Te=!1),j!==Ce?(z+=U[Ce].toString(16),Ce!==7&&(z+=":")):(z+=Ce===0?"::":":",Te=!0));return z}function R(U,z,j,$,J){var re,oe,ue,Te;if($===void 0){$={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,_cannotBeABaseURLFlag:!1,_blobURLEntry:null};var Ce=/^[\u0000-\u001F\u0020]+/,Xe=/[\u0000-\u001F\u0020]+$/;(Ce.test(U)||Xe.test(U))&&g("Input string contains leading or trailing control characters or space."),U=(U=U.replace(Ce,"")).replace(Xe,"")}var ke=/[\u0009\u000A\u000D]/g;ke.test(U)&&g("Input string contains tab or newline characters."),U=U.replace(ke,"");var ge=J===void 0?c.ParserState.SchemeStart:J;z===void 0&&(z=null);for(var nt=j===void 0||j==="replacement"||j==="UTF-16BE"||j==="UTF-16LE"?"UTF-8":j,K="",De=!1,Oe=!1,ve=!1,te=new u.StringWalker(U);;){switch(ge){case c.ParserState.SchemeStart:if(p.codePoint.ASCIIAlpha.test(te.c()))K+=te.c().toLowerCase(),ge=c.ParserState.Scheme;else{if(J!==void 0)return g("Invalid scheme start character."),null;ge=c.ParserState.NoScheme,te.pointer--}break;case c.ParserState.Scheme:if(p.codePoint.ASCIIAlphanumeric.test(te.c())||te.c()==="+"||te.c()==="-"||te.c()===".")K+=te.c().toLowerCase();else{if(te.c()!==":"){if(J===void 0){K="",ge=c.ParserState.NoScheme,te.pointer=0;continue}return g("Invalid input string."),null}if(J!==void 0&&(S($.scheme)&&!S(K)||!S($.scheme)&&S(K)||(_($)||$.port!==null)&&K==="file"||$.scheme==="file"&&($.host===""||$.host===null)))return $;if($.scheme=K,J!==void 0)return $.port===w($.scheme)&&($.port=null),$;K="",$.scheme==="file"?(te.remaining().startsWith("//")||g("Invalid file URL scheme, '//' expected."),ge=c.ParserState.File):T($)&&z!==null&&z.scheme===$.scheme?ge=c.ParserState.SpecialRelativeOrAuthority:T($)?ge=c.ParserState.SpecialAuthoritySlashes:te.remaining().startsWith("/")?(ge=c.ParserState.PathOrAuthority,te.pointer++):($._cannotBeABaseURLFlag=!0,$.path.push(""),ge=c.ParserState.CannotBeABaseURLPath)}break;case c.ParserState.NoScheme:if(z===null||z._cannotBeABaseURLFlag&&te.c()!=="#")return g("Invalid input string."),null;z._cannotBeABaseURLFlag&&te.c()==="#"?($.scheme=z.scheme,$.path=p.list.clone(z.path),$.query=z.query,$.fragment="",$._cannotBeABaseURLFlag=!0,ge=c.ParserState.Fragment):z.scheme!=="file"?(ge=c.ParserState.Relative,te.pointer--):(ge=c.ParserState.File,te.pointer--);break;case c.ParserState.SpecialRelativeOrAuthority:te.c()==="/"&&te.remaining().startsWith("/")?(ge=c.ParserState.SpecialAuthorityIgnoreSlashes,te.pointer++):(g("Invalid input string."),ge=c.ParserState.Relative,te.pointer--);break;case c.ParserState.PathOrAuthority:te.c()==="/"?ge=c.ParserState.Authority:(ge=c.ParserState.Path,te.pointer--);break;case c.ParserState.Relative:if(z===null)throw new Error("Invalid parser state. Base URL is null.");switch($.scheme=z.scheme,te.c()){case"":$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.query=z.query;break;case"/":ge=c.ParserState.RelativeSlash;break;case"?":$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.query="",ge=c.ParserState.Query;break;case"#":$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.query=z.query,$.fragment="",ge=c.ParserState.Fragment;break;default:T($)&&te.c()==="\\"?(g("Invalid input string."),ge=c.ParserState.RelativeSlash):($.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,$.path=p.list.clone(z.path),$.path.length!==0&&$.path.splice($.path.length-1,1),ge=c.ParserState.Path,te.pointer--)}break;case c.ParserState.RelativeSlash:if(!T($)||te.c()!=="/"&&te.c()!=="\\")if(te.c()==="/")ge=c.ParserState.Authority;else{if(z===null)throw new Error("Invalid parser state. Base URL is null.");$.username=z.username,$.password=z.password,$.host=z.host,$.port=z.port,ge=c.ParserState.Path,te.pointer--}else te.c()==="\\"&&g("Invalid input string."),ge=c.ParserState.SpecialAuthorityIgnoreSlashes;break;case c.ParserState.SpecialAuthoritySlashes:te.c()==="/"&&te.remaining().startsWith("/")?(ge=c.ParserState.SpecialAuthorityIgnoreSlashes,te.pointer++):(g("Expected '//'."),ge=c.ParserState.SpecialAuthorityIgnoreSlashes,te.pointer--);break;case c.ParserState.SpecialAuthorityIgnoreSlashes:te.c()!=="/"&&te.c()!=="\\"?(ge=c.ParserState.Authority,te.pointer--):g("Unexpected '/' or '\\'.");break;case c.ParserState.Authority:if(te.c()==="@"){g("Unexpected '@'."),De&&(K="%40"+K),De=!0;try{for(var ce=(re=void 0,i(K)),he=ce.next();!he.done;he=ce.next()){var fe=he.value;if(fe!==":"||ve){var ye=ee(fe,x);ve?$.password+=ye:$.username+=ye}else ve=!0}}catch(Ht){re={error:Ht}}finally{try{he&&!he.done&&(oe=ce.return)&&oe.call(ce)}finally{if(re)throw re.error}}K=""}else if(te.c()===""||te.c()==="/"||te.c()==="?"||te.c()==="#"||T($)&&te.c()==="\\"){if(De&&K==="")return g("Invalid input string."),null;te.pointer-=K.length+1,K="",ge=c.ParserState.Host}else K+=te.c();break;case c.ParserState.Host:case c.ParserState.Hostname:if(J!==void 0&&$.scheme==="file")te.pointer--,ge=c.ParserState.FileHost;else if(te.c()!==":"||Oe)if(te.c()===""||te.c()==="/"||te.c()==="?"||te.c()==="#"||T($)&&te.c()==="\\"){if(te.pointer--,T($)&&K==="")return g("Invalid input string."),null;if(J!==void 0&&K===""&&(_($)||$.port!==null))return g("Invalid input string."),$;if((Se=G(K,!T($)))===null)return null;if($.host=Se,K="",ge=c.ParserState.PathStart,J!==void 0)return $}else te.c()==="["&&(Oe=!0),te.c()==="]"&&(Oe=!1),K+=te.c();else{if(K==="")return g("Invalid input string."),null;if((Se=G(K,!T($)))===null)return null;if($.host=Se,K="",ge=c.ParserState.Port,J===c.ParserState.Hostname)return $}break;case c.ParserState.Port:if(p.codePoint.ASCIIDigit.test(te.c()))K+=te.c();else{if(!(te.c()===""||te.c()==="/"||te.c()==="?"||te.c()==="#"||T($)&&te.c()==="\\"||J))return g("Invalid input string."),null;if(K!==""&&K!==""){var Ve=parseInt(K,10);if(Ve>Math.pow(2,16)-1)return g("Invalid port number."),null;$.port=Ve===w($.scheme)?null:Ve,K=""}if(J!==void 0)return $;ge=c.ParserState.PathStart,te.pointer--}break;case c.ParserState.File:if($.scheme="file",te.c()==="/"||te.c()==="\\")te.c()==="\\"&&g("Invalid input string."),ge=c.ParserState.FileSlash;else if(z!==null&&z.scheme==="file")switch(te.c()){case"":$.host=z.host,$.path=p.list.clone(z.path),$.query=z.query;break;case"?":$.host=z.host,$.path=p.list.clone(z.path),$.query="",ge=c.ParserState.Query;break;case"#":$.host=z.host,$.path=p.list.clone(z.path),$.query=z.query,$.fragment="",ge=c.ParserState.Fragment;break;default:k(te.substring())?g("Unexpected windows drive letter in input string."):($.host=z.host,$.path=p.list.clone(z.path),B($)),ge=c.ParserState.Path,te.pointer--}else ge=c.ParserState.Path,te.pointer--;break;case c.ParserState.FileSlash:te.c()==="/"||te.c()==="\\"?(te.c()==="\\"&&g("Invalid input string."),ge=c.ParserState.FileHost):(z===null||z.scheme!=="file"||k(te.substring())||(P(z.path[0])?$.path.push(z.path[0]):$.host=z.host),ge=c.ParserState.Path,te.pointer--);break;case c.ParserState.FileHost:if(te.c()===""||te.c()==="/"||te.c()==="\\"||te.c()==="?"||te.c()==="#")if(te.pointer--,J===void 0&&F(K))g("Unexpected windows drive letter in input string."),ge=c.ParserState.Path;else if(K===""){if($.host="",J!==void 0)return $;ge=c.ParserState.PathStart}else{var Se;if((Se=G(K,!T($)))===null)return null;if(Se==="localhost"&&(Se=""),$.host=Se,J!==void 0)return $;K="",ge=c.ParserState.PathStart}else K+=te.c();break;case c.ParserState.PathStart:T($)?(te.c()==="\\"&&g("Invalid input string."),ge=c.ParserState.Path,te.c()!=="/"&&te.c()!=="\\"&&te.pointer--):J===void 0&&te.c()==="?"?($.query="",ge=c.ParserState.Query):J===void 0&&te.c()==="#"?($.fragment="",ge=c.ParserState.Fragment):te.c()!==""&&(ge=c.ParserState.Path,te.c()!=="/"&&te.pointer--);break;case c.ParserState.Path:if(te.c()===""||te.c()==="/"||T($)&&te.c()==="\\"||J===void 0&&(te.c()==="?"||te.c()==="#")){if(T($)&&te.c()==="\\"&&g("Invalid input string."),L(K))B($),te.c()==="/"||T($)&&te.c()==="\\"||$.path.push("");else if(!N(K)||te.c()==="/"||T($)&&te.c()==="\\"){if(!N(K)){if($.scheme==="file"&&$.path.length===0&&F(K)){$.host!==null&&$.host!==""&&(g("Invalid input string."),$.host="");var Be=Array.from(K);K=Be.slice(0,1)+":"+Be.slice(2)}$.path.push(K)}}else $.path.push("");if(K="",$.scheme==="file"&&(te.c()===""||te.c()==="?"||te.c()==="#"))for(;$.path.length>1&&$.path[0]==="";)g("Invalid input string."),$.path.splice(0,1);te.c()==="?"&&($.query="",ge=c.ParserState.Query),te.c()==="#"&&($.fragment="",ge=c.ParserState.Fragment)}else y.test(te.c())||te.c()==="%"||g("Character is not a URL code point or a percent encoded character."),te.c()!=="%"||/^[0-9a-fA-F][0-9a-fA-F]/.test(te.remaining())||g("Percent encoded character must be followed by two hex digits."),K+=ee(te.c(),m);break;case c.ParserState.CannotBeABaseURLPath:te.c()==="?"?($.query="",ge=c.ParserState.Query):te.c()==="#"?($.fragment="",ge=c.ParserState.Fragment):(te.c()===""||y.test(te.c())||te.c()==="%"||g("Character is not a URL code point or a percent encoded character."),te.c()!=="%"||/^[0-9a-fA-F][0-9a-fA-F]/.test(te.remaining())||g("Percent encoded character must be followed by two hex digits."),te.c()!==""&&($.path[0]+=ee(te.c(),h)));break;case c.ParserState.Query:if(nt==="UTF-8"||T($)&&$.scheme!=="ws"&&$.scheme!=="wss"||(nt="UTF-8"),J===void 0&&te.c()==="#")$.fragment="",ge=c.ParserState.Fragment;else if(te.c()!==""){if(y.test(te.c())||te.c()==="%"||g("Character is not a URL code point or a percent encoded character."),te.c()!=="%"||/^[0-9a-fA-F][0-9a-fA-F]/.test(te.remaining())||g("Percent encoded character must be followed by two hex digits."),nt.toUpperCase()!=="UTF-8")throw new Error("Only UTF-8 encoding is supported.");var Ie=u.utf8Encode(te.c());if(Ie.length>=3&&Ie[0]===38&&Ie[1]===35&&Ie[Ie.length-1]===59)Ie=Ie.subarray(2,Ie.length-1),$.query+="%26%23"+p.byteSequence.isomorphicDecode(Ie)+"%3B";else try{for(var wt=(ue=void 0,i(Ie)),Ft=wt.next();!Ft.done;Ft=wt.next()){var it=Ft.value;it<33||it>126||it===34||it===35||it===60||it===62||it===39&&T($)?$.query+=Q(it):$.query+=String.fromCharCode(it)}}catch(Ht){ue={error:Ht}}finally{try{Ft&&!Ft.done&&(Te=wt.return)&&Te.call(wt)}finally{if(ue)throw ue.error}}}break;case c.ParserState.Fragment:te.c()===""||(te.c()==="\0"?g("NULL character in input string."):(y.test(te.c())||te.c()==="%"||g("Unexpected character in fragment string."),te.c()!=="%"||/^[A-Za-z0-9][A-Za-z0-9]/.test(te.remaining())||g("Unexpected character in fragment string."),$.fragment+=ee(te.c(),v)))}if(te.eof)break;te.pointer++}return $}function N(U){return U==="."||U.toLowerCase()==="%2e"}function L(U){var z=U.toLowerCase();return z===".."||z===".%2e"||z==="%2e."||z==="%2e%2e"}function B(U){var z=U.path;z.length!==0&&(U.scheme==="file"&&z.length===1&&P(z[0])||U.path.splice(U.path.length-1,1))}function P(U){return U.length>=2&&p.codePoint.ASCIIAlpha.test(U[0])&&U[1]===":"}function F(U){return U.length>=2&&p.codePoint.ASCIIAlpha.test(U[0])&&(U[1]===":"||U[1]==="|")}function k(U){return U.length>=2&&F(U)&&(U.length===2||U[2]==="/"||U[2]==="\\"||U[2]==="?"||U[2]==="#")}function G(U,z){if(z===void 0&&(z=!1),U.startsWith("["))return U.endsWith("]")?X(U.substring(1,U.length-1)):(g("Expected ']' after '['."),null);if(z)return Y(U);var j=I(u.utf8Decode(ne(U)));if(j===null||d.test(j))return g("Invalid domain."),null;var $=H(j);return $===null||u.isNumber($)?$:j}function W(U,z){z===void 0&&(z={value:!1});var j=10;return U.startsWith("0x")||U.startsWith("0X")?(z.value=!0,U=U.substr(2),j=16):U.length>=2&&U[0]==="0"&&(z.value=!0,U=U.substr(1),j=8),U===""?0:(j===10?/^[0-9]+$/:j===16?/^[0-9A-Fa-f]+$/:/^[0-7]+$/).test(U)?parseInt(U,j):null}function H(U){var z,j,$,J,re={value:!1},oe=U.split(".");if(oe[oe.length-1]===""&&(re.value=!0,oe.length>1&&oe.pop()),oe.length>4)return U;var ue=[];try{for(var Te=i(oe),Ce=Te.next();!Ce.done;Ce=Te.next()){var Xe=Ce.value;if(Xe===""||(Oe=W(Xe,re))===null)return U;ue.push(Oe)}}catch(ve){z={error:ve}}finally{try{Ce&&!Ce.done&&(j=Te.return)&&j.call(Te)}finally{if(z)throw z.error}}re.value&&g("Invalid IP v4 address.");for(var ke=0;ke255&&(g("Invalid IP v4 address."),ke=Math.pow(256,5-ue.length))return g("Invalid IP v4 address."),null;var ge=ue[ue.length-1];ue.pop();var nt=0;try{for(var K=i(ue),De=K.next();!De.done;De=K.next()){var Oe;ge+=(Oe=De.value)*Math.pow(256,3-nt),nt++}}catch(ve){$={error:ve}}finally{try{De&&!De.done&&(J=K.return)&&J.call(K)}finally{if($)throw $.error}}return ge}function X(U){var z,j=[0,0,0,0,0,0,0,0],$=0,J=null,re=new u.StringWalker(U);if(re.c()===":"){if(!re.remaining().startsWith(":"))return g("Invalid IP v6 address."),null;re.pointer+=2,J=$+=1}for(;re.c()!=="";){if($===8)return g("Invalid IP v6 address."),null;if(re.c()!==":"){for(var oe=0,ue=0;ue<4&&p.codePoint.ASCIIHexDigit.test(re.c());)oe=16*oe+parseInt(re.c(),16),re.pointer++,ue++;if(re.c()==="."){if(ue===0||(re.pointer-=ue,$>6))return g("Invalid IP v6 address."),null;for(var Te=0;re.c()!=="";){var Ce=null;if(Te>0){if(!(re.c()==="."&&Te<4))return g("Invalid IP v6 address."),null;re.pointer++}if(!p.codePoint.ASCIIDigit.test(re.c()))return g("Invalid IP v6 address."),null;for(;p.codePoint.ASCIIDigit.test(re.c());){var Xe=parseInt(re.c(),10);if(Ce===null)Ce=Xe;else{if(Ce===0)return g("Invalid IP v6 address."),null;Ce=10*Ce+Xe}if(Ce>255)return g("Invalid IP v6 address."),null;re.pointer++}if(Ce===null)return g("Invalid IP v6 address."),null;j[$]=256*j[$]+Ce,++Te!==2&&Te!==4||$++}if(Te!==4)return g("Invalid IP v6 address."),null;break}if(re.c()===":"){if(re.pointer++,re.c()==="")return g("Invalid IP v6 address."),null}else if(re.c()!=="")return g("Invalid IP v6 address."),null;j[$]=oe,$++}else{if(J!==null)return g("Invalid IP v6 address."),null;re.pointer++,J=++$}}if(J!==null){var ke=$-J;for($=7;$!==0&&ke>0;)z=o([j[J+ke-1],j[$]],2),j[$]=z[0],j[J+ke-1]=z[1],$--,ke--}else if(J===null&&$!==8)return g("Invalid IP v6 address."),null;return j}function Y(U){var z,j;if(/[\x00\t\f\r #/:?@\[\\\]]/.test(U))return g("Invalid host string."),null;var $="";try{for(var J=i(U),re=J.next();!re.done;re=J.next())$+=ee(re.value,h)}catch(oe){z={error:oe}}finally{try{re&&!re.done&&(j=J.return)&&j.call(J)}finally{if(z)throw z.error}}return $}function q(U){return null}function Q(U){return"%"+("00"+U.toString(16).toUpperCase()).slice(-2)}function ae(U){for(var z=function(ue){return ue>=48&&ue<=57||ue>=65&&ue<=70||ue>=97&&ue<=102},j=new Uint8Array(U.length),$=0,J=0;J=U.length-2)j[$]=re,$++;else if(re!==37||z(U[J+1])&&z(U[J+2])){var oe=parseInt(u.utf8Decode(Uint8Array.of(U[J+1],U[J+2])),16);j[$]=oe,$++,J+=2}else j[$]=re,$++}return j.subarray(0,$)}function ne(U){return ae(u.utf8Encode(U))}function ee(U,z){var j,$;if(!z.test(U))return U;var J=u.utf8Encode(U),re="";try{for(var oe=i(J),ue=oe.next();!ue.done;ue=oe.next())re+=Q(ue.value)}catch(Te){j={error:Te}}finally{try{ue&&!ue.done&&($=oe.return)&&$.call(oe)}finally{if(j)throw j.error}}return re}function V(U){var z,j,$,J,re=[],oe=[];try{for(var ue=i(U),Te=ue.next();!Te.done;Te=ue.next()){var Ce=Te.value;Ce===38?(re.push(Uint8Array.from(oe)),oe=[]):oe.push(Ce)}}catch(he){z={error:he}}finally{try{Te&&!Te.done&&(j=ue.return)&&j.call(ue)}finally{if(z)throw z.error}}oe.length!==0&&re.push(Uint8Array.from(oe));var Xe=[];try{for(var ke=i(re),ge=ke.next();!ge.done;ge=ke.next()){var nt=ge.value;if(nt.length!==0){for(var K=nt.indexOf(61),De=K!==-1?nt.slice(0,K):nt,Oe=K!==-1?nt.slice(K+1):new Uint8Array,ve=0;ve=48&&oe<=57||oe>=65&&oe<=90||oe===95||oe>=97&&oe<=122?String.fromCodePoint(oe):Q(oe)}}catch(ue){z={error:ue}}finally{try{re&&!re.done&&(j=J.return)&&j.call(J)}finally{if(z)throw z.error}}return $}function I(U,z){var j=l.domainToASCII(U);return j===""?(g("Invalid domain name."),null):j}n.setValidationErrorCallback=function(U){s=U},n.newURL=C,n.isSpecialScheme=S,n.isSpecial=T,n.defaultPort=w,n.includesCredentials=_,n.cannotHaveAUsernamePasswordPort=function(U){return U.host===null||U.host===""||U._cannotBeABaseURLFlag||U.scheme==="file"},n.urlSerializer=E,n.hostSerializer=D,n.iPv4Serializer=O,n.iPv6Serializer=b,n.urlParser=function(U,z,j){var $=R(U,z,j);return $===null?null:($.scheme!=="blob"||($._blobURLEntry=null),$)},n.basicURLParser=R,n.setTheUsername=function(U,z){var j,$,J="";try{for(var re=i(z),oe=re.next();!oe.done;oe=re.next())J+=ee(oe.value,x)}catch(ue){j={error:ue}}finally{try{oe&&!oe.done&&($=re.return)&&$.call(re)}finally{if(j)throw j.error}}U.username=J},n.setThePassword=function(U,z){var j,$,J="";try{for(var re=i(z),oe=re.next();!oe.done;oe=re.next())J+=ee(oe.value,x)}catch(ue){j={error:ue}}finally{try{oe&&!oe.done&&($=re.return)&&$.call(re)}finally{if(j)throw j.error}}U.password=J},n.isSingleDotPathSegment=N,n.isDoubleDotPathSegment=L,n.shorten=B,n.isNormalizedWindowsDriveLetter=P,n.isWindowsDriveLetter=F,n.startsWithAWindowsDriveLetter=k,n.hostParser=G,n.iPv4NumberParser=W,n.iPv4Parser=H,n.iPv6Parser=X,n.opaqueHostParser=Y,n.resolveABlobURL=q,n.percentEncode=Q,n.percentDecode=ae,n.stringPercentDecode=ne,n.utf8PercentEncode=ee,n.hostEquals=function(U,z){return U===z},n.urlEquals=function(U,z,j){return j===void 0&&(j=!1),E(U,j)===E(z,j)},n.urlEncodedStringParser=function(U){return V(u.utf8Encode(U))},n.urlEncodedParser=V,n.urlEncodedByteSerializer=M,n.urlEncodedSerializer=function(U,z){var j,$;if((z===void 0||z==="replacement"||z==="UTF-16BE"||z==="UTF-16LE"?"UTF-8":z).toUpperCase()!=="UTF-8")throw new Error("Only UTF-8 encoding is supported.");var J="";try{for(var re=i(U),oe=re.next();!oe.done;oe=re.next()){var ue=oe.value,Te=M(u.utf8Encode(ue[0])),Ce=ue[1];Ce=M(u.utf8Encode(Ce)),J!==""&&(J+="&"),J+=Te+"="+Ce}}catch(Xe){j={error:Xe}}finally{try{oe&&!oe.done&&($=re.return)&&$.call(re)}finally{if(j)throw j.error}}return J},n.origin=function U(z){switch(z.scheme){case"blob":z._blobURLEntry;var j=R(z.path[0]);return j===null?c.OpaqueOrigin:U(j);case"ftp":case"http":case"https":case"ws":case"wss":return[z.scheme,z.host===null?"":z.host,z.port,null];case"file":default:return c.OpaqueOrigin}},n.domainToASCII=I,n.domainToUnicode=function(U,z){var j=l.domainToUnicode(U);return j===""&&g("Invalid domain name."),j},n.asciiSerializationOfAnOrigin=function(U){if(U[0]===""&&U[1]===""&&U[2]===null&&U[3]===null)return"null";var z=U[0]+"://"+D(U[1]);return U[2]!==null&&(z+=":"+U[2].toString()),z}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(0),o=function(){function s(){this._signal=i.create_abortSignal()}return Object.defineProperty(s.prototype,"signal",{get:function(){return this._signal},enumerable:!0,configurable:!0}),s.prototype.abort=function(){i.abort_signalAbort(this._signal)},s}();n.AbortControllerImpl=o},function(a,n,r){var i,o=this&&this.__extends||(i=function(p,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var v in h)h.hasOwnProperty(v)&&(f[v]=h[v])})(p,l)},function(p,l){function f(){this.constructor=p}i(p,l),p.prototype=l===null?Object.create(l):(f.prototype=l.prototype,new f)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(70),u=r(0),c=function(p){function l(){var f=p.call(this)||this;return f._abortedFlag=!1,f._abortAlgorithms=new Set,f}return o(l,p),Object.defineProperty(l.prototype,"aborted",{get:function(){return this._abortedFlag},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"onabort",{get:function(){return u.event_getterEventHandlerIDLAttribute(this,"onabort")},set:function(f){u.event_setterEventHandlerIDLAttribute(this,"onabort",f)},enumerable:!0,configurable:!0}),l._create=function(){return new l},l}(s.EventTargetImpl);n.AbortSignalImpl=c},function(a,n,r){var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(1),u=r(34),c=r(12),p=function(l){function f(h,v,m){var x=l.call(this)||this;return x._name="",x._publicId="",x._systemId="",x._name=h,x._publicId=v,x._systemId=m,x}return o(f,l),Object.defineProperty(f.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"publicId",{get:function(){return this._publicId},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"systemId",{get:function(){return this._systemId},enumerable:!0,configurable:!0}),f.prototype.before=function(){for(var h=[],v=0;v=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(2),u=r(0),c=function(){function p(l){return this._live=!0,this._filter=null,this._length=0,this._root=l,new Proxy(this,this)}return Object.defineProperty(p.prototype,"length",{get:function(){return this._root._children.size},enumerable:!0,configurable:!0}),p.prototype.item=function(l){if(l<0||l>this.length-1)return null;if(l=c.length&&(c=void 0),{value:c&&c[f++],done:!c}}};throw new TypeError(p?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(2),u=function(){function c(p){return this._live=!1,this._items=[],this._length=0,this._root=p,this._items=[],this._filter=function(l){return!0},new Proxy(this,this)}return Object.defineProperty(c.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),c.prototype.item=function(p){return p<0||p>this.length-1?null:this._items[p]},c.prototype.keys=function(){var p;return(p={})[Symbol.iterator]=function(){var l=0;return{next:function(){return l===this.length?{done:!0,value:null}:{done:!1,value:l++}}.bind(this)}}.bind(this),p},c.prototype.values=function(){var p;return(p={})[Symbol.iterator]=function(){var l=this[Symbol.iterator]();return{next:function(){return l.next()}}}.bind(this),p},c.prototype.entries=function(){var p;return(p={})[Symbol.iterator]=function(){var l=this[Symbol.iterator](),f=0;return{next:function(){var h=l.next();return h.done?{done:!0,value:null}:{done:!1,value:[f++,h.value]}}}}.bind(this),p},c.prototype[Symbol.iterator]=function(){var p=this._items[Symbol.iterator]();return{next:function(){return p.next()}}},c.prototype.forEach=function(p,l){var f,h;l===void 0&&(l=o.dom.window);var v=0;try{for(var m=i(this._items),x=m.next();!x.done;x=m.next()){var y=x.value;p.call(l,y,v++,this)}}catch(d){f={error:d}}finally{try{x&&!x.done&&(h=m.return)&&h.call(m)}finally{if(f)throw f.error}}},c.prototype.get=function(p,l,f){if(!s.isString(l))return Reflect.get(p,l,f);var h=Number(l);return isNaN(h)?Reflect.get(p,l,f):p._items[h]||void 0},c.prototype.set=function(p,l,f,h){if(!s.isString(l))return Reflect.set(p,l,f,h);var v=Number(l);return isNaN(v)?Reflect.set(p,l,f,h):v>=0&&v=x.length&&(x=void 0),{value:x&&x[g++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(6),c=r(1),p=r(102),l=r(9),f=r(0),h=r(12),v=r(3),m=function(x){function y(){var d=x.call(this)||this,g=u.dom.window._associatedDocument;return d._start=[g,0],d._end=[g,0],u.dom.rangeList.add(d),d}return o(y,x),Object.defineProperty(y.prototype,"commonAncestorContainer",{get:function(){for(var d=this._start[0];!f.tree_isAncestorOf(this._end[0],d,!0);){if(d._parent===null)throw new Error("Parent node is null.");d=d._parent}return d},enumerable:!0,configurable:!0}),y.prototype.setStart=function(d,g){f.range_setTheStart(this,d,g)},y.prototype.setEnd=function(d,g){f.range_setTheEnd(this,d,g)},y.prototype.setStartBefore=function(d){var g=d._parent;if(g===null)throw new l.InvalidNodeTypeError;f.range_setTheStart(this,g,f.tree_index(d))},y.prototype.setStartAfter=function(d){var g=d._parent;if(g===null)throw new l.InvalidNodeTypeError;f.range_setTheStart(this,g,f.tree_index(d)+1)},y.prototype.setEndBefore=function(d){var g=d._parent;if(g===null)throw new l.InvalidNodeTypeError;f.range_setTheEnd(this,g,f.tree_index(d))},y.prototype.setEndAfter=function(d){var g=d._parent;if(g===null)throw new l.InvalidNodeTypeError;f.range_setTheEnd(this,g,f.tree_index(d)+1)},y.prototype.collapse=function(d){d?this._end=this._start:this._start=this._end},y.prototype.selectNode=function(d){f.range_select(d,this)},y.prototype.selectNodeContents=function(d){if(v.Guard.isDocumentTypeNode(d))throw new l.InvalidNodeTypeError;var g=f.tree_nodeLength(d);this._start=[d,0],this._end=[d,g]},y.prototype.compareBoundaryPoints=function(d,g){if(d!==c.HowToCompare.StartToStart&&d!==c.HowToCompare.StartToEnd&&d!==c.HowToCompare.EndToEnd&&d!==c.HowToCompare.EndToStart)throw new l.NotSupportedError;if(f.range_root(this)!==f.range_root(g))throw new l.WrongDocumentError;var C,S;switch(d){case c.HowToCompare.StartToStart:C=this._start,S=g._start;break;case c.HowToCompare.StartToEnd:C=this._end,S=g._start;break;case c.HowToCompare.EndToEnd:C=this._end,S=g._end;break;case c.HowToCompare.EndToStart:C=this._start,S=g._end;break;default:throw new l.NotSupportedError}var T=f.boundaryPoint_position(C,S);return T===c.BoundaryPosition.Before?-1:T===c.BoundaryPosition.After?1:0},y.prototype.deleteContents=function(){var d,g,C,S;if(!f.range_collapsed(this)){var T=this._startNode,w=this._startOffset,_=this._endNode,E=this._endOffset;if(T===_&&v.Guard.isCharacterDataNode(T))f.characterData_replaceData(T,w,E-w,"");else{var D,O,b=[];try{for(var R=s(f.range_getContainedNodes(this)),N=R.next();!N.done;N=R.next()){var L=(k=N.value)._parent;L!==null&&f.range_isContained(L,this)||b.push(k)}}catch(G){d={error:G}}finally{try{N&&!N.done&&(g=R.return)&&g.call(R)}finally{if(d)throw d.error}}if(f.tree_isAncestorOf(_,T,!0))D=T,O=w;else{for(var B=T;B._parent!==null&&!f.tree_isAncestorOf(_,B._parent,!0);)B=B._parent;if(B._parent===null)throw new Error("Parent node is null.");D=B._parent,O=f.tree_index(B)+1}v.Guard.isCharacterDataNode(T)&&f.characterData_replaceData(T,w,f.tree_nodeLength(T)-w,"");try{for(var P=s(b),F=P.next();!F.done;F=P.next()){var k;(k=F.value)._parent&&f.mutation_remove(k,k._parent)}}catch(G){C={error:G}}finally{try{F&&!F.done&&(S=P.return)&&S.call(P)}finally{if(C)throw C.error}}v.Guard.isCharacterDataNode(_)&&f.characterData_replaceData(_,0,E,""),this._start=[D,O],this._end=[D,O]}}},y.prototype.extractContents=function(){return f.range_extract(this)},y.prototype.cloneContents=function(){return f.range_cloneTheContents(this)},y.prototype.insertNode=function(d){return f.range_insert(d,this)},y.prototype.surroundContents=function(d){var g,C;try{for(var S=s(f.range_getPartiallyContainedNodes(this)),T=S.next();!T.done;T=S.next()){var w=T.value;if(!v.Guard.isTextNode(w))throw new l.InvalidStateError}}catch(E){g={error:E}}finally{try{T&&!T.done&&(C=S.return)&&C.call(S)}finally{if(g)throw g.error}}if(v.Guard.isDocumentNode(d)||v.Guard.isDocumentTypeNode(d)||v.Guard.isDocumentFragmentNode(d))throw new l.InvalidNodeTypeError;var _=f.range_extract(this);d._children.size!==0&&f.mutation_replaceAll(null,d),f.range_insert(d,this),f.mutation_append(_,d),f.range_select(d,this)},y.prototype.cloneRange=function(){return f.create_range(this._start,this._end)},y.prototype.detach=function(){u.dom.rangeList.delete(this)},y.prototype.isPointInRange=function(d,g){if(f.tree_rootNode(d)!==f.range_root(this))return!1;if(v.Guard.isDocumentTypeNode(d))throw new l.InvalidNodeTypeError;if(g>f.tree_nodeLength(d))throw new l.IndexSizeError;var C=[d,g];return f.boundaryPoint_position(C,this._start)!==c.BoundaryPosition.Before&&f.boundaryPoint_position(C,this._end)!==c.BoundaryPosition.After},y.prototype.comparePoint=function(d,g){if(f.tree_rootNode(d)!==f.range_root(this))throw new l.WrongDocumentError;if(v.Guard.isDocumentTypeNode(d))throw new l.InvalidNodeTypeError;if(g>f.tree_nodeLength(d))throw new l.IndexSizeError;var C=[d,g];return f.boundaryPoint_position(C,this._start)===c.BoundaryPosition.Before?-1:f.boundaryPoint_position(C,this._end)===c.BoundaryPosition.After?1:0},y.prototype.intersectsNode=function(d){if(f.tree_rootNode(d)!==f.range_root(this))return!1;var g=d._parent;if(g===null)return!0;var C=f.tree_index(d);return f.boundaryPoint_position([g,C],this._end)===c.BoundaryPosition.Before&&f.boundaryPoint_position([g,C+1],this._start)===c.BoundaryPosition.After},y.prototype.toString=function(){var d,g,C="";if(this._startNode===this._endNode&&v.Guard.isTextNode(this._startNode))return this._startNode._data.substring(this._startOffset,this._endOffset);v.Guard.isTextNode(this._startNode)&&(C+=this._startNode._data.substring(this._startOffset));try{for(var S=s(f.range_getContainedNodes(this)),T=S.next();!T.done;T=S.next()){var w=T.value;v.Guard.isTextNode(w)&&(C+=w._data)}}catch(_){d={error:_}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(d)throw d.error}}return v.Guard.isTextNode(this._endNode)&&(C+=this._endNode._data.substring(0,this._endOffset)),C},y._create=function(d,g){var C=new y;return d&&(C._start=d),g&&(C._end=g),C},y.START_TO_START=0,y.START_TO_END=1,y.END_TO_END=2,y.END_TO_START=3,y}(p.AbstractRangeImpl);n.RangeImpl=m,h.idl_defineConst(m.prototype,"START_TO_START",0),h.idl_defineConst(m.prototype,"START_TO_END",1),h.idl_defineConst(m.prototype,"END_TO_END",2),h.idl_defineConst(m.prototype,"END_TO_START",3)},function(a,n,r){var i,o=this&&this.__extends||(i=function(p,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var v in h)h.hasOwnProperty(v)&&(f[v]=h[v])})(p,l)},function(p,l){function f(){this.constructor=p}i(p,l),p.prototype=l===null?Object.create(l):(f.prototype=l.prototype,new f)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(103),u=r(0),c=function(p){function l(f,h,v){var m=p.call(this,f)||this;return m._iteratorCollection=void 0,m._reference=h,m._pointerBeforeReference=v,u.nodeIterator_iteratorList().add(m),m}return o(l,p),Object.defineProperty(l.prototype,"referenceNode",{get:function(){return this._reference},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"pointerBeforeReferenceNode",{get:function(){return this._pointerBeforeReference},enumerable:!0,configurable:!0}),l.prototype.nextNode=function(){return u.nodeIterator_traverse(this,!0)},l.prototype.previousNode=function(){return u.nodeIterator_traverse(this,!1)},l.prototype.detach=function(){u.nodeIterator_iteratorList().delete(this)},l._create=function(f,h,v){return new l(f,h,v)},l}(s.TraverserImpl);n.NodeIteratorImpl=c},function(a,n,r){var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(1),u=r(103),c=r(0),p=function(l){function f(h,v){var m=l.call(this,h)||this;return m._current=v,m}return o(f,l),Object.defineProperty(f.prototype,"currentNode",{get:function(){return this._current},set:function(h){this._current=h},enumerable:!0,configurable:!0}),f.prototype.parentNode=function(){for(var h=this._current;h!==null&&h!==this._root;)if((h=h._parent)!==null&&c.traversal_filter(this,h)===s.FilterResult.Accept)return this._current=h,h;return null},f.prototype.firstChild=function(){return c.treeWalker_traverseChildren(this,!0)},f.prototype.lastChild=function(){return c.treeWalker_traverseChildren(this,!1)},f.prototype.nextSibling=function(){return c.treeWalker_traverseSiblings(this,!0)},f.prototype.previousNode=function(){for(var h=this._current;h!==this._root;){for(var v=h._previousSibling;v;){h=v;for(var m=c.traversal_filter(this,h);m!==s.FilterResult.Reject&&h._lastChild;)h=h._lastChild,m=c.traversal_filter(this,h);if(m===s.FilterResult.Accept)return this._current=h,h;v=h._previousSibling}if(h===this._root||h._parent===null)return null;if(h=h._parent,c.traversal_filter(this,h)===s.FilterResult.Accept)return this._current=h,h}return null},f.prototype.previousSibling=function(){return c.treeWalker_traverseSiblings(this,!1)},f.prototype.nextNode=function(){for(var h=this._current,v=s.FilterResult.Accept;;){for(;v!==s.FilterResult.Reject&&h._firstChild;)if(h=h._firstChild,(v=c.traversal_filter(this,h))===s.FilterResult.Accept)return this._current=h,h;for(var m=null,x=h;x!==null;){if(x===this._root)return null;if((m=x._nextSibling)!==null){h=m;break}x=x._parent}if((v=c.traversal_filter(this,h))===s.FilterResult.Accept)return this._current=h,h}},f._create=function(h,v){return new f(h,v)},f}(u.TraverserImpl);n.TreeWalkerImpl=p},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=r(12),s=function(){function u(){}return u.prototype.acceptNode=function(c){return i.FilterResult.Accept},u._create=function(){return new u},u.FILTER_ACCEPT=1,u.FILTER_REJECT=2,u.FILTER_SKIP=3,u.SHOW_ALL=4294967295,u.SHOW_ELEMENT=1,u.SHOW_ATTRIBUTE=2,u.SHOW_TEXT=4,u.SHOW_CDATA_SECTION=8,u.SHOW_ENTITY_REFERENCE=16,u.SHOW_ENTITY=32,u.SHOW_PROCESSING_INSTRUCTION=64,u.SHOW_COMMENT=128,u.SHOW_DOCUMENT=256,u.SHOW_DOCUMENT_TYPE=512,u.SHOW_DOCUMENT_FRAGMENT=1024,u.SHOW_NOTATION=2048,u}();n.NodeFilterImpl=s,o.idl_defineConst(s.prototype,"FILTER_ACCEPT",1),o.idl_defineConst(s.prototype,"FILTER_REJECT",2),o.idl_defineConst(s.prototype,"FILTER_SKIP",3),o.idl_defineConst(s.prototype,"SHOW_ALL",4294967295),o.idl_defineConst(s.prototype,"SHOW_ELEMENT",1),o.idl_defineConst(s.prototype,"SHOW_ATTRIBUTE",2),o.idl_defineConst(s.prototype,"SHOW_TEXT",4),o.idl_defineConst(s.prototype,"SHOW_CDATA_SECTION",8),o.idl_defineConst(s.prototype,"SHOW_ENTITY_REFERENCE",16),o.idl_defineConst(s.prototype,"SHOW_ENTITY",32),o.idl_defineConst(s.prototype,"SHOW_PROCESSING_INSTRUCTION",64),o.idl_defineConst(s.prototype,"SHOW_COMMENT",128),o.idl_defineConst(s.prototype,"SHOW_DOCUMENT",256),o.idl_defineConst(s.prototype,"SHOW_DOCUMENT_TYPE",512),o.idl_defineConst(s.prototype,"SHOW_DOCUMENT_FRAGMENT",1024),o.idl_defineConst(s.prototype,"SHOW_NOTATION",2048)},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s,u,c,p,l,f,h,v,m){this._type=s,this._target=u,this._addedNodes=c,this._removedNodes=p,this._previousSibling=l,this._nextSibling=f,this._attributeName=h,this._attributeNamespace=v,this._oldValue=m}return Object.defineProperty(o.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"addedNodes",{get:function(){return this._addedNodes},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"removedNodes",{get:function(){return this._removedNodes},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"previousSibling",{get:function(){return this._previousSibling},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"nextSibling",{get:function(){return this._nextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attributeName",{get:function(){return this._attributeName},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attributeNamespace",{get:function(){return this._attributeNamespace},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"oldValue",{get:function(){return this._oldValue},enumerable:!0,configurable:!0}),o._create=function(s,u,c,p,l,f,h,v,m){return new o(s,u,c,p,l,f,h,v,m)},o}();n.MutationRecordImpl=i},function(a,n,r){var i=this&&this.__values||function(l){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&l[f],v=0;if(h)return h.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&v>=l.length&&(l=void 0),{value:l&&l[v++],done:!l}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(9),u=r(7),c=r(0),p=function(){function l(f,h){this._element=f,this._attribute=h,this._tokenSet=new Set;var v=h._localName,m=c.element_getAnAttributeValue(f,v),x=this;this._element._attributeChangeSteps.push(function(y,d,g,C,S){d===x._attribute._localName&&S===null&&(C?x._tokenSet=c.orderedSet_parse(C):x._tokenSet.clear())}),o.dom.features.steps&&c.dom_runAttributeChangeSteps(f,v,m,m,null)}return Object.defineProperty(l.prototype,"length",{get:function(){return this._tokenSet.size},enumerable:!0,configurable:!0}),l.prototype.item=function(f){var h,v,m=0;try{for(var x=i(this._tokenSet),y=x.next();!y.done;y=x.next()){var d=y.value;if(m===f)return d;m++}}catch(g){h={error:g}}finally{try{y&&!y.done&&(v=x.return)&&v.call(x)}finally{if(h)throw h.error}}return null},l.prototype.contains=function(f){return this._tokenSet.has(f)},l.prototype.add=function(){for(var f,h,v=[],m=0;m=97&&s<=122||s>=65&&s<=90||s===58||s===95||s>=192&&s<=214||s>=216&&s<=246||s>=248&&s<=767||s>=880&&s<=893||s>=895&&s<=8191||s>=8204&&s<=8205||s>=8304&&s<=8591||s>=11264&&s<=12271||s>=12289&&s<=55295||s>=63744&&s<=64975||s>=65008&&s<=65533)&&(o===0||!(s===45||s===46||s>=48&&s<=57||s===183||s>=768&&s<=879||s>=8255&&s<=8256))){if(s>=55296&&s<=56319&&o=56320&&u<=57343&&(o++,(s=1024*(s-55296)+u-56320+65536)>=65536&&s<=983039))continue}return!1}}return!0},n.xml_isQName=function(i){for(var o=!1,s=0;s=97&&u<=122||u>=65&&u<=90||u===95||u>=192&&u<=214||u>=216&&u<=246||u>=248&&u<=767||u>=880&&u<=893||u>=895&&u<=8191||u>=8204&&u<=8205||u>=8304&&u<=8591||u>=11264&&u<=12271||u>=12289&&u<=55295||u>=63744&&u<=64975||u>=65008&&u<=65533)&&(s===0||!(u===45||u===46||u>=48&&u<=57||u===183||u>=768&&u<=879||u>=8255&&u<=8256))){if(s===0||u!==58){if(u>=55296&&u<=56319&&s=56320&&c<=57343&&(s++,(u=1024*(u-55296)+c-56320+65536)>=65536&&u<=983039))continue}return!1}if(o||s===i.length-1)return!1;o=!0}}return!0},n.xml_isLegalChar=function(i){for(var o=0;o=32&&s<=55295||s>=57344&&s<=65533)){if(s>=55296&&s<=56319&&o=56320&&u<=57343&&(o++,(s=1024*(s-55296)+u-56320+65536)>=65536&&s<=1114111))continue}return!1}}return!0},n.xml_isPubidChar=function(i){for(var o=0;o=97&&s<=122||s>=65&&s<=90||s>=39&&s<=59||s===32||s===13||s===10||s>=35&&s<=37||s===33||s===61||s===63||s===64||s===95))return!1}return!0}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=r(17);n.boundaryPoint_position=function s(u,c){var p=u[0],l=u[1],f=c[0],h=c[1];if(console.assert(o.tree_rootNode(p)===o.tree_rootNode(f),"Boundary points must share the same root node."),p===f)return l===h?i.BoundaryPosition.Equal:l=v.length&&(v=void 0),{value:v&&v[y++],done:!v}}};throw new TypeError(m?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),u=r(7),c=r(29),p=r(108),l=r(30),f=r(37),h=r(52);n.node_stringReplaceAll=function(v,m){var x=null;v!==""&&(x=c.create_text(m._nodeDocument,v)),f.mutation_replaceAll(x,m)},n.node_clone=function v(m,x,y){var d,g,C,S,T;if(x===void 0&&(x=null),y===void 0&&(y=!1),x===null&&(x=m._nodeDocument),s.Guard.isElementNode(m)){T=h.element_createAnElement(x,m._localName,m._namespace,m._namespacePrefix,m._is,!1);try{for(var w=i(m._attributeList),_=w.next();!_.done;_=w.next()){var E=v(_.value,x);h.element_append(E,T)}}catch(L){d={error:L}}finally{try{_&&!_.done&&(g=w.return)&&g.call(w)}finally{if(d)throw d.error}}}else if(s.Guard.isDocumentNode(m)){var D=c.create_document();D._encoding=m._encoding,D._contentType=m._contentType,D._URL=m._URL,D._origin=m._origin,D._type=m._type,D._mode=m._mode,T=D}else if(s.Guard.isDocumentTypeNode(m))T=c.create_documentType(x,m._name,m._publicId,m._systemId);else if(s.Guard.isAttrNode(m)){var O=c.create_attr(x,m.localName);O._namespace=m._namespace,O._namespacePrefix=m._namespacePrefix,O._value=m._value,T=O}else T=s.Guard.isExclusiveTextNode(m)?c.create_text(x,m._data):s.Guard.isCDATASectionNode(m)?c.create_cdataSection(x,m._data):s.Guard.isCommentNode(m)?c.create_comment(x,m._data):s.Guard.isProcessingInstructionNode(m)?c.create_processingInstruction(x,m._target,m._data):s.Guard.isDocumentFragmentNode(m)?c.create_documentFragment(x):Object.create(m);if(s.Guard.isDocumentNode(T)?(T._nodeDocument=T,x=T):T._nodeDocument=x,o.dom.features.steps&&l.dom_runCloningSteps(T,m,x,y),y)try{for(var b=i(m._children),R=b.next();!R.done;R=b.next()){var N=v(R.value,x,!0);f.mutation_append(N,T)}}catch(L){C={error:L}}finally{try{R&&!R.done&&(S=b.return)&&S.call(b)}finally{if(C)throw C.error}}return T},n.node_equals=function v(m,x){var y,d,g,C;if(m._nodeType!==x._nodeType)return!1;if(s.Guard.isDocumentTypeNode(m)&&s.Guard.isDocumentTypeNode(x)){if(m._name!==x._name||m._publicId!==x._publicId||m._systemId!==x._systemId)return!1}else if(s.Guard.isElementNode(m)&&s.Guard.isElementNode(x)){if(m._namespace!==x._namespace||m._namespacePrefix!==x._namespacePrefix||m._localName!==x._localName||m._attributeList.length!==x._attributeList.length)return!1}else if(s.Guard.isAttrNode(m)&&s.Guard.isAttrNode(x)){if(m._namespace!==x._namespace||m._localName!==x._localName||m._value!==x._value)return!1}else if(s.Guard.isProcessingInstructionNode(m)&&s.Guard.isProcessingInstructionNode(x)){if(m._target!==x._target||m._data!==x._data)return!1}else if(s.Guard.isCharacterDataNode(m)&&s.Guard.isCharacterDataNode(x)&&m._data!==x._data)return!1;if(s.Guard.isElementNode(m)&&s.Guard.isElementNode(x)){var S={};try{for(var T=i(m._attributeList),w=T.next();!w.done;w=T.next())S[(D=w.value)._localName]=D}catch(B){y={error:B}}finally{try{w&&!w.done&&(d=T.return)&&d.call(T)}finally{if(y)throw y.error}}try{for(var _=i(x._attributeList),E=_.next();!E.done;E=_.next()){var D,O=E.value;if(!(D=S[O._localName])||!v(D,O))return!1}}catch(B){g={error:B}}finally{try{E&&!E.done&&(C=_.return)&&C.call(_)}finally{if(g)throw g.error}}}if(m._children.size!==x._children.size)return!1;for(var b=m._children[Symbol.iterator](),R=x._children[Symbol.iterator](),N=b.next(),L=R.next();!N.done&&!L.done;){if(!v(N.value,L.value))return!1;N=b.next(),L=R.next()}return!0},n.node_listOfElementsWithQualifiedName=function(v,m){return v==="*"?c.create_htmlCollection(m):m._nodeDocument._type==="html"?c.create_htmlCollection(m,function(x){return x._namespace===u.namespace.HTML&&x._qualifiedName===v.toLowerCase()||x._namespace!==u.namespace.HTML&&x._qualifiedName===v}):c.create_htmlCollection(m,function(x){return x._qualifiedName===v})},n.node_listOfElementsWithNamespace=function(v,m,x){return v===""&&(v=null),v==="*"&&m==="*"?c.create_htmlCollection(x):v==="*"?c.create_htmlCollection(x,function(y){return y._localName===m}):m==="*"?c.create_htmlCollection(x,function(y){return y._namespace===v}):c.create_htmlCollection(x,function(y){return y._localName===m&&y._namespace===v})},n.node_listOfElementsWithClassNames=function(v,m){var x=p.orderedSet_parse(v);if(x.size===0)return c.create_htmlCollection(m,function(){return!1});var y=m._nodeDocument._mode!=="quirks";return c.create_htmlCollection(m,function(d){var g=d.classList;return p.orderedSet_contains(g._tokenSet,x,y)})},n.node_locateANamespacePrefix=function v(m,x){if(m._namespace===x&&m._namespacePrefix!==null)return m._namespacePrefix;for(var y=0;y=h.length&&(h=void 0),{value:h&&h[x++],done:!h}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),u=r(9),c=r(29),p=r(17),l=r(107),f=r(37);n.text_contiguousTextNodes=function(h,v){var m;return v===void 0&&(v=!1),(m={})[Symbol.iterator]=function(){for(var x=h;x&&s.Guard.isTextNode(x._previousSibling);)x=x._previousSibling;return{next:function(){if(x&&!v&&x===h&&(x=s.Guard.isTextNode(x._nextSibling)?x._nextSibling:null),x===null)return{done:!0,value:null};var y={done:!1,value:x};return x=s.Guard.isTextNode(x._nextSibling)?x._nextSibling:null,y}}},m},n.text_contiguousExclusiveTextNodes=function(h,v){var m;return v===void 0&&(v=!1),(m={})[Symbol.iterator]=function(){for(var x=h;x&&s.Guard.isExclusiveTextNode(x._previousSibling);)x=x._previousSibling;return{next:function(){if(x&&!v&&x===h&&(x=s.Guard.isExclusiveTextNode(x._nextSibling)?x._nextSibling:null),x===null)return{done:!0,value:null};var y={done:!1,value:x};return x=s.Guard.isExclusiveTextNode(x._nextSibling)?x._nextSibling:null,y}}},m},n.text_descendantTextContent=function(h){for(var v="",m=p.tree_getFirstDescendantNode(h,!1,!1,function(x){return s.Guard.isTextNode(x)});m!==null;)v+=m._data,m=p.tree_getNextDescendantNode(h,m,!1,!1,function(x){return s.Guard.isTextNode(x)});return v},n.text_split=function(h,v){var m,x,y=h._data.length;if(v>y)throw new u.IndexSizeError;var d=y-v,g=l.characterData_substringData(h,v,d),C=c.create_text(h._nodeDocument,g),S=h._parent;if(S!==null){f.mutation_insert(C,S,h._nextSibling);try{for(var T=i(o.dom.rangeList),w=T.next();!w.done;w=T.next()){var _=w.value;_._start[0]===h&&_._start[1]>v&&(_._start[0]=C,_._start[1]-=v),_._end[0]===h&&_._end[1]>v&&(_._end[0]=C,_._end[1]-=v);var E=p.tree_index(h);_._start[0]===S&&_._start[1]===E+1&&_._start[1]++,_._end[0]===S&&_._end[1]===E+1&&_._end[1]++}}catch(D){m={error:D}}finally{try{w&&!w.done&&(x=T.return)&&x.call(T)}finally{if(m)throw m.error}}}return l.characterData_replaceData(h,v,d,""),C}},function(a,n,r){var i=r(4),o=r(41),s=r(24),u=r(48),c=[].join,p=o!=Object,l=u("join",",");i({target:"Array",proto:!0,forced:p||!l},{join:function(f){return c.call(s(this),f===void 0?",":f)}})},function(a,n,r){var i=r(4),o=r(83),s=String.fromCharCode,u=String.fromCodePoint;i({target:"String",stat:!0,forced:!!u&&u.length!=1},{fromCodePoint:function(c){for(var p,l=[],f=arguments.length,h=0;f>h;){if(p=+arguments[h++],o(p,1114111)!==p)throw RangeError(p+" is not a valid code point");l.push(p<65536?s(p):s(55296+((p-=65536)>>10),p%1024+56320))}return l.join("")}})},function(a,n,r){var i=this&&this.__read||function(u,c){var p=typeof Symbol=="function"&&u[Symbol.iterator];if(!p)return u;var l,f,h=p.call(u),v=[];try{for(;(c===void 0||c-- >0)&&!(l=h.next()).done;)v.push(l.value)}catch(m){f={error:m}}finally{try{l&&!l.done&&(p=h.return)&&p.call(h)}finally{if(f)throw f.error}}return v};Object.defineProperty(n,"__esModule",{value:!0});var o=r(111),s=function(){function u(c,p){this._options={skipWhitespaceOnlyText:!1},this.err={line:-1,col:-1,index:-1,str:""},this._str=c,this._index=0,this._length=c.length,p&&(this._options.skipWhitespaceOnlyText=p.skipWhitespaceOnlyText||!1)}return u.prototype.nextToken=function(){if(this.eof())return{type:o.TokenType.EOF};var c=this.skipIfStartsWith("<")?this.openBracket():this.text();return this._options.skipWhitespaceOnlyText&&c.type===o.TokenType.Text&&u.isWhiteSpaceToken(c)&&(c=this.nextToken()),c},u.prototype.openBracket=function(){return this.skipIfStartsWith("?")?this.skipIfStartsWith("xml")?u.isSpace(this._str[this._index])?this.declaration():(this.seek(-3),this.pi()):this.pi():this.skipIfStartsWith("!")?this.skipIfStartsWith("--")?this.comment():this.skipIfStartsWith("[CDATA[")?this.cdata():this.skipIfStartsWith("DOCTYPE")?this.doctype():void this.throwError("Invalid '!' in opening tag."):this.skipIfStartsWith("/")?this.closeTag():this.openTag()},u.prototype.declaration=function(){for(var c="",p="",l="";!this.eof();){if(this.skipSpace(),this.skipIfStartsWith("?>"))return{type:o.TokenType.Declaration,version:c,encoding:p,standalone:l};var f=i(this.attribute(),2),h=f[0],v=f[1];h==="version"?c=v:h==="encoding"?p=v:h==="standalone"?l=v:this.throwError("Invalid attribute name: "+h)}this.throwError("Missing declaration end symbol `?>`")},u.prototype.doctype=function(){var c="",p="";this.skipSpace();var l=this.takeUntil2("[",">",!0);return this.skipSpace(),this.skipIfStartsWith("PUBLIC")?(c=this.quotedString(),p=this.quotedString()):this.skipIfStartsWith("SYSTEM")&&(p=this.quotedString()),this.skipSpace(),this.skipIfStartsWith("[")&&(this.skipUntil("]"),this.skipIfStartsWith("]")||this.throwError("Missing end bracket of DTD internal subset")),this.skipSpace(),this.skipIfStartsWith(">")||this.throwError("Missing doctype end symbol `>`"),{type:o.TokenType.DocType,name:l,pubId:c,sysId:p}},u.prototype.pi=function(){var c=this.takeUntilStartsWith("?>",!0);if(this.eof()&&this.throwError("Missing processing instruction end symbol `?>`"),this.skipSpace(),this.skipIfStartsWith("?>"))return{type:o.TokenType.PI,target:c,data:""};var p=this.takeUntilStartsWith("?>");return this.eof()&&this.throwError("Missing processing instruction end symbol `?>`"),this.seek(2),{type:o.TokenType.PI,target:c,data:p}},u.prototype.text=function(){var c=this.takeUntil("<");return{type:o.TokenType.Text,data:c}},u.prototype.comment=function(){var c=this.takeUntilStartsWith("-->");return this.eof()&&this.throwError("Missing comment end symbol `-->`"),this.seek(3),{type:o.TokenType.Comment,data:c}},u.prototype.cdata=function(){var c=this.takeUntilStartsWith("]]>");return this.eof()&&this.throwError("Missing CDATA end symbol `]>`"),this.seek(3),{type:o.TokenType.CDATA,data:c}},u.prototype.openTag=function(){this.skipSpace();var c=this.takeUntil2(">","/",!0);if(this.skipSpace(),this.skipIfStartsWith(">"))return{type:o.TokenType.Element,name:c,attributes:[],selfClosing:!1};if(this.skipIfStartsWith("/>"))return{type:o.TokenType.Element,name:c,attributes:[],selfClosing:!0};for(var p=[];!this.eof();){if(this.skipSpace(),this.skipIfStartsWith(">"))return{type:o.TokenType.Element,name:c,attributes:p,selfClosing:!1};if(this.skipIfStartsWith("/>"))return{type:o.TokenType.Element,name:c,attributes:p,selfClosing:!0};var l=this.attribute();p.push(l)}this.throwError("Missing opening element tag end symbol `>`")},u.prototype.closeTag=function(){this.skipSpace();var c=this.takeUntil(">",!0);return this.skipSpace(),this.skipIfStartsWith(">")||this.throwError("Missing closing element tag end symbol `>`"),{type:o.TokenType.ClosingTag,name:c}},u.prototype.attribute=function(){this.skipSpace();var c=this.takeUntil("=",!0);return this.skipSpace(),this.skipIfStartsWith("=")||this.throwError("Missing equals sign before attribute value"),[c,this.quotedString()]},u.prototype.quotedString=function(){this.skipSpace();var c=this.take(1);u.isQuote(c)||this.throwError("Missing start quote character before quoted value");var p=this.takeUntil(c);return this.skipIfStartsWith(c)||this.throwError("Missing end quote character after quoted value"),p},u.prototype.eof=function(){return this._index>=this._length},u.prototype.skipIfStartsWith=function(c){var p=c.length;if(p===1)return this._str[this._index]===c&&(this._index++,!0);for(var l=0;lthis._length&&(this._index=this._length)},u.prototype.skipSpace=function(){for(;!this.eof()&&u.isSpace(this._str[this._index]);)this._index++},u.prototype.take=function(c){if(c===1)return this._str[this._index++];var p=this._index;return this.seek(c),this._str.slice(p,this._index)},u.prototype.takeUntil=function(c,p){p===void 0&&(p=!1);for(var l=this._index;this._indexthis._index){v=l.index;break}throw this.err={line:f,col:this._index-h,index:this._index,str:this._str.substring(h,v)},new Error(c+` Index: `+this.err.index+` Ln: `+this.err.line+", Col: "+this.err.col+` -Input: `+this.err.str)},c.prototype[Symbol.iterator]=function(){return this._index=0,{next:function(){var l=this.nextToken();return l.type===o.TokenType.EOF?{done:!0,value:null}:{done:!1,value:l}}.bind(this)}},c}();n.XMLStringLexer=s},function(a,n,r){var i=r(39);a.exports=new i({include:[r(182)]})},function(a,n,r){var i=r(39);a.exports=new i({include:[r(113)],implicit:[r(289),r(290),r(291),r(292)]})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(91),o=r(1),s=r(3),c=r(77),l=r(109);function p(d,v){var m=f(d===void 0||u(d)?d:i.DefaultBuilderOptions),x=u(d)?v:d,y=l.createDocument();h(y,m);var g=new c.XMLBuilderImpl(y);return x!==void 0&&g.ele(x),g}function u(d){if(!o.isPlainObject(d))return!1;for(var v in d)if(d.hasOwnProperty(v)&&!i.XMLBuilderOptionKeys.has(v))return!1;return!0}function f(d){d===void 0&&(d={});var v=o.applyDefaults(d,i.DefaultBuilderOptions);if(v.convert.att.length===0||v.convert.ins.length===0||v.convert.text.length===0||v.convert.cdata.length===0||v.convert.comment.length===0)throw new Error("JS object converter strings cannot be zero length.");return v}function h(d,v,m){var x=d;x._xmlBuilderOptions=v,x._isFragment=m}n.builder=function(d,v){var m=f(u(d)?d:i.DefaultBuilderOptions),x=s.Guard.isNode(d)||o.isArray(d)?d:v;if(x===void 0)throw new Error("Invalid arguments.");if(o.isArray(x)){for(var y=[],g=0;g0)&&!(C=T.next()).done;)w.push(C.value)}catch(_){S={error:_}}finally{try{C&&!C.done&&(g=T.return)&&g.call(T)}finally{if(S)throw S.error}}return w},o=this&&this.__values||function(x){var y=typeof Symbol=="function"&&Symbol.iterator,g=y&&x[y],C=0;if(g)return g.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&C>=x.length&&(x=void 0),{value:x&&x[C++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=r(91),c=r(1),l=r(217),p=r(2),u=r(3),f=r(0),h=r(109),d=r(7),v=r(276),m=function(){function x(y){this._domNode=y}return Object.defineProperty(x.prototype,"node",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),x.prototype.set=function(y){return this._options=c.applyDefaults(c.applyDefaults(this._options,y,!0),s.DefaultBuilderOptions),this},x.prototype.ele=function(y,g,C){var S,T,w,_,E,D;if(c.isObject(y))return new v.ObjectReader(this._options).parse(this,y);if(y!==null&&/^\s*0&&(y===void 0&&(y=g.slice(S+1)),g=g.slice(0,S)),y===void 0)y=C?this._options.defaultNamespace.ele:this._options.defaultNamespace.att;else if(y!==null&&y[0]==="@"){var T=y.slice(1);if((y=this._options.namespaceAlias[T])===void 0)throw new Error("Namespace alias `"+T+"` is not defined. "+this._debugInfo())}return[y,g]},x.prototype._updateNamespace=function(y){var g,C,S,T,w=this._domNode;if(u.Guard.isElementNode(w)&&y!==null&&w.namespaceURI!==y){var _=i(f.namespace_extractQName(w.prefix?w.prefix+":"+w.localName:w.localName),2),E=_[0],D=_[1],O=f.create_element(this._doc,D,y,E);try{for(var M=o(w.attributes),N=M.next();!N.done;N=M.next()){var R=N.value,B=R.prefix?R.prefix+":"+R.localName:R.localName,I=i(f.namespace_extractQName(B),1)[0],P=R.namespaceURI;P===null&&I!==null&&(P=w.lookupNamespaceURI(I)),P===null?O.setAttribute(B,R.value):O.setAttributeNS(P,B,R.value)}}catch(Y){g={error:Y}}finally{try{N&&!N.done&&(C=M.return)&&C.call(M)}finally{if(g)throw g.error}}var L=w.parentNode;if(L===null)throw new Error("Parent node is null."+this._debugInfo());L.replaceChild(O,w),this._domNode=O;try{for(var k=o(w.childNodes),A=k.next();!A.done;A=k.next()){var j=A.value.cloneNode(!0);if(O.appendChild(j),u.Guard.isElementNode(j)){var H=i(f.namespace_extractQName(j.prefix?j.prefix+":"+j.localName:j.localName),1)[0],K=O.lookupNamespaceURI(H);new x(j)._updateNamespace(K)}}}catch(Y){S={error:Y}}finally{try{A&&!A.done&&(T=k.return)&&T.call(k)}finally{if(S)throw S.error}}}},Object.defineProperty(x.prototype,"_doc",{get:function(){var y=this.node;if(u.Guard.isDocumentNode(y))return y;var g=y.ownerDocument;if(!g)throw new Error("Owner document is null. "+this._debugInfo());return g},enumerable:!0,configurable:!0}),x.prototype._debugInfo=function(y){var g=this.node,C=g.parentNode;y=y||g.nodeName;var S=C?C.nodeName:"";return S?"node: <"+y+">, parent: <"+S+">":"node: <"+y+">"},Object.defineProperty(x.prototype,"_options",{get:function(){var y=this._doc;if(y._xmlBuilderOptions===void 0)throw new Error("Builder options is not set.");return y._xmlBuilderOptions},set:function(y){this._doc._xmlBuilderOptions=y},enumerable:!0,configurable:!0}),x}();n.XMLBuilderImpl=m},function(a,n,r){var i=r(11),o=r(117),s=i.WeakMap;a.exports=typeof s=="function"&&/native code/.test(o(s))},function(a,n,r){var i=r(46),o=r(82),s=r(85),c=r(18);a.exports=i("Reflect","ownKeys")||function(l){var p=o.f(c(l)),u=s.f;return u?p.concat(u(l)):p}},function(a,n,r){var i=r(16),o=r(15),s=r(18),c=r(61);a.exports=i?Object.defineProperties:function(l,p){s(l);for(var u,f=c(p),h=f.length,d=0;h>d;)o.f(l,u=f[d++],p[u]);return l}},function(a,n,r){var i=r(46);a.exports=i("document","documentElement")},function(a,n,r){var i=r(24),o=r(82).f,s={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];a.exports.f=function(l){return c&&s.call(l)=="[object Window]"?function(p){try{return o(p)}catch{return c.slice()}}(l):o(i(l))}},function(a,n,r){var i=r(4),o=r(36).every,s=r(48),c=r(28),l=s("every"),p=c("every");i({target:"Array",proto:!0,forced:!l||!p},{every:function(u){return o(this,u,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(4),o=r(36).filter,s=r(63),c=r(28),l=s("filter"),p=c("filter");i({target:"Array",proto:!0,forced:!l||!p},{filter:function(u){return o(this,u,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(46);a.exports=i("navigator","userAgent")||""},function(a,n,r){var i=r(4),o=r(36).find,s=r(130),c=r(28),l=!0,p=c("find");"find"in[]&&Array(1).find(function(){l=!1}),i({target:"Array",proto:!0,forced:l||!p},{find:function(u){return o(this,u,arguments.length>1?arguments[1]:void 0)}}),s("find")},function(a,n,r){var i=r(131).IteratorPrototype,o=r(60),s=r(40),c=r(62),l=r(49),p=function(){return this};a.exports=function(u,f,h){var d=f+" Iterator";return u.prototype=o(i,{next:s(1,h)}),c(u,d,!1,!0),l[d]=p,u}},function(a,n,r){var i=r(8);a.exports=!i(function(){function o(){}return o.prototype.constructor=null,Object.getPrototypeOf(new o)!==o.prototype})},function(a,n,r){var i=r(13);a.exports=function(o){if(!i(o)&&o!==null)throw TypeError("Can't set "+String(o)+" as a prototype");return o}},function(a,n,r){var i=r(4),o=r(36).map,s=r(63),c=r(28),l=s("map"),p=c("map");i({target:"Array",proto:!0,forced:!l||!p},{map:function(u){return o(this,u,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(4),o=r(200).left,s=r(48),c=r(28),l=s("reduce"),p=c("reduce",{1:0});i({target:"Array",proto:!0,forced:!l||!p},{reduce:function(u){return o(this,u,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(127),o=r(27),s=r(41),c=r(26),l=function(p){return function(u,f,h,d){i(f);var v=o(u),m=s(v),x=c(v.length),y=p?x-1:0,g=p?-1:1;if(h<2)for(;;){if(y in m){d=m[y],y+=g;break}if(y+=g,p?y<0:x<=y)throw TypeError("Reduce of empty array with no initial value")}for(;p?y>=0:x>y;y+=g)y in m&&(d=f(d,m[y],y,v));return d}};a.exports={left:l(!1),right:l(!0)}},function(a,n,r){var i=r(4),o=r(36).some,s=r(48),c=r(28),l=s("some"),p=c("some");i({target:"Array",proto:!0,forced:!l||!p},{some:function(u){return o(this,u,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(90),o=r(135);a.exports=i?{}.toString:function(){return"[object "+o(this)+"]"}},function(a,n){a.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(a,n,r){var i=r(8);a.exports=!i(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(a,n,r){var i=r(5),o=r(49),s=i("iterator"),c=Array.prototype;a.exports=function(l){return l!==void 0&&(o.Array===l||c[s]===l)}},function(a,n,r){var i=r(135),o=r(49),s=r(5)("iterator");a.exports=function(c){if(c!=null)return c[s]||c["@@iterator"]||o[i(c)]}},function(a,n,r){var i=r(18);a.exports=function(o,s,c,l){try{return l?s(i(c)[0],c[1]):s(c)}catch(u){var p=o.return;throw p!==void 0&&i(p.call(o)),u}}},function(a,n,r){var i=r(5)("iterator"),o=!1;try{var s=0,c={next:function(){return{done:!!s++}},return:function(){o=!0}};c[i]=function(){return this},Array.from(c,function(){throw 2})}catch{}a.exports=function(l,p){if(!p&&!o)return!1;var u=!1;try{var f={};f[i]=function(){return{next:function(){return{done:u=!0}}}},l(f)}catch{}return u}},function(a,n,r){var i=r(13),o=r(133);a.exports=function(s,c,l){var p,u;return o&&typeof(p=c.constructor)=="function"&&p!==l&&i(u=p.prototype)&&u!==l.prototype&&o(s,u),s}},function(a,n,r){var i=r(25);a.exports=function(o,s,c){for(var l in s)i(o,l,s[l],c);return o}},function(a,n,r){var i=r(46),o=r(15),s=r(5),c=r(16),l=s("species");a.exports=function(p){var u=i(p),f=o.f;c&&u&&!u[l]&&f(u,l,{configurable:!0,get:function(){return this}})}},function(a,n,r){var i=this&&this.__generator||function(c,l){var p,u,f,h,d={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function v(m){return function(x){return function(y){if(p)throw new TypeError("Generator is already executing.");for(;d;)try{if(p=1,u&&(f=2&y[0]?u.return:y[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,y[1])).done)return f;switch(u=0,f&&(y=[2&y[0],f.value]),y[0]){case 0:case 1:f=y;break;case 4:return d.label++,{value:y[1],done:!1};case 5:d.label++,u=y[1],y=[0];continue;case 7:y=d.ops.pop(),d.trys.pop();continue;default:if(f=d.trys,!((f=f.length>0&&f[f.length-1])||y[0]!==6&&y[0]!==2)){d=0;continue}if(y[0]===3&&(!f||y[1]>f[0]&&y[1]=c.length&&(c=void 0),{value:c&&c[u++],done:!c}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function c(l){l===void 0&&(l=1e3),this._items=new Set,this._limit=l}return c.prototype.add=function(l){if(this._items.add(l),this._items.size>this._limit){var p=this._items.values().next();p.done||this._items.delete(p.value)}return this},c.prototype.delete=function(l){return this._items.delete(l)},c.prototype.has=function(l){return this._items.has(l)},c.prototype.clear=function(){this._items.clear()},Object.defineProperty(c.prototype,"size",{get:function(){return this._items.size},enumerable:!0,configurable:!0}),c.prototype.forEach=function(l,p){var u=this;this._items.forEach(function(f){return l.call(p,f,f,u)})},c.prototype.keys=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items.keys())];case 1:return l.sent(),[2]}})},c.prototype.values=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items.values())];case 1:return l.sent(),[2]}})},c.prototype.entries=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items.entries())];case 1:return l.sent(),[2]}})},c.prototype[Symbol.iterator]=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items)];case 1:return l.sent(),[2]}})},Object.defineProperty(c.prototype,Symbol.toStringTag,{get:function(){return"FixedSizeSet"},enumerable:!0,configurable:!0}),c}();n.FixedSizeSet=s},function(a,n,r){var i=this&&this.__generator||function(c,l){var p,u,f,h,d={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function v(m){return function(x){return function(y){if(p)throw new TypeError("Generator is already executing.");for(;d;)try{if(p=1,u&&(f=2&y[0]?u.return:y[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,y[1])).done)return f;switch(u=0,f&&(y=[2&y[0],f.value]),y[0]){case 0:case 1:f=y;break;case 4:return d.label++,{value:y[1],done:!1};case 5:d.label++,u=y[1],y=[0];continue;case 7:y=d.ops.pop(),d.trys.pop();continue;default:if(f=d.trys,!((f=f.length>0&&f[f.length-1])||y[0]!==6&&y[0]!==2)){d=0;continue}if(y[0]===3&&(!f||y[1]>f[0]&&y[1]=c.length&&(c=void 0),{value:c&&c[u++],done:!c}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function c(l){l===void 0&&(l=1e3),this._items=new Map,this._limit=l}return c.prototype.get=function(l){return this._items.get(l)},c.prototype.set=function(l,p){if(this._items.set(l,p),this._items.size>this._limit){var u=this._items.keys().next();u.done||this._items.delete(u.value)}},c.prototype.delete=function(l){return this._items.delete(l)},c.prototype.has=function(l){return this._items.has(l)},c.prototype.clear=function(){this._items.clear()},Object.defineProperty(c.prototype,"size",{get:function(){return this._items.size},enumerable:!0,configurable:!0}),c.prototype.forEach=function(l,p){this._items.forEach(function(u,f){return l.call(p,f,u)})},c.prototype.keys=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items.keys())];case 1:return l.sent(),[2]}})},c.prototype.values=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items.values())];case 1:return l.sent(),[2]}})},c.prototype.entries=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items.entries())];case 1:return l.sent(),[2]}})},c.prototype[Symbol.iterator]=function(){return i(this,function(l){switch(l.label){case 0:return[5,o(this._items)];case 1:return l.sent(),[2]}})},Object.defineProperty(c.prototype,Symbol.toStringTag,{get:function(){return"ObjectCache"},enumerable:!0,configurable:!0}),c}();n.ObjectCache=s},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s){s===void 0&&(s=1e3),this._items=new Map,this._limit=s}return o.prototype.check=function(s,c){if(this._items.get(s)===c)return!0;if(this._items.get(c)===s)return!1;var l=Math.random()<.5;if(l?this._items.set(s,c):this._items.set(c,s),this._items.size>this._limit){var p=this._items.keys().next();p.done||this._items.delete(p.value)}return l},o}();n.CompareCache=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s){this._initialized=!1,this._value=void 0,this._initFunc=s}return Object.defineProperty(o.prototype,"value",{get:function(){return this._initialized||(this._value=this._initFunc(),this._initialized=!0),this._value},enumerable:!0,configurable:!0}),o}();n.Lazy=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s){this._pointer=0,this._chars=Array.from(s),this._length=this._chars.length}return Object.defineProperty(o.prototype,"eof",{get:function(){return this._pointer>=this._length},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),o.prototype.codePoint=function(){if(this._codePoint===void 0)if(this.eof)this._codePoint=-1;else{var s=this._chars[this._pointer].codePointAt(0);this._codePoint=s!==void 0?s:-1}return this._codePoint},o.prototype.c=function(){return this._c===void 0&&(this._c=this.eof?"":this._chars[this._pointer]),this._c},o.prototype.remaining=function(){return this._remaining===void 0&&(this._remaining=this.eof?"":this._chars.slice(this._pointer+1).join("")),this._remaining},o.prototype.substring=function(){return this._substring===void 0&&(this._substring=this.eof?"":this._chars.slice(this._pointer).join("")),this._substring},Object.defineProperty(o.prototype,"pointer",{get:function(){return this._pointer},set:function(s){s!==this._pointer&&(this._pointer=s,this._codePoint=void 0,this._c=void 0,this._remaining=void 0,this._substring=void 0)},enumerable:!0,configurable:!0}),o}();n.StringWalker=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(218);n.MapWriter=i.MapWriter;var o=r(258);n.XMLWriter=o.XMLWriter;var s=r(67);n.ObjectWriter=s.ObjectWriter;var c=r(260);n.JSONWriter=c.JSONWriter;var l=r(261);n.YAMLWriter=l.YAMLWriter},function(a,n,r){r(19),r(219),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(p,u){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var d in h)h.hasOwnProperty(d)&&(f[d]=h[d])})(p,u)},function(p,u){function f(){this.constructor=p}i(p,u),p.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(1),c=r(67),l=function(p){function u(f,h){var d=p.call(this,f)||this;return d._writerOptions=s.applyDefaults(h,{format:"map",wellFormed:!1,group:!1,verbose:!1}),d}return o(u,p),u.prototype.serialize=function(f){var h=s.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1,verbose:!1}),d=new c.ObjectWriter(this._builderOptions,h).serialize(f);return this._convertObject(d)},u.prototype._convertObject=function(f){if(s.isArray(f)){for(var h=0;h=51||!o(function(){var C=[];return C[m]=!1,C.concat()[0]!==C}),y=h("concat"),g=function(C){if(!c(C))return!1;var S=C[m];return S!==void 0?!!S:s(C)};i({target:"Array",proto:!0,forced:!x||!y},{concat:function(C){var S,T,w,_,E,D=l(this),O=f(D,0),M=0;for(S=-1,w=arguments.length;S9007199254740991)throw TypeError("Maximum allowed index exceeded");for(T=0;T<_;T++,M++)T in E&&u(O,M,E[T])}else{if(M>=9007199254740991)throw TypeError("Maximum allowed index exceeded");u(O,M++,E)}return O.length=M,O}})},function(a,n,r){var i=r(8);function o(s,c){return RegExp(s,c)}n.UNSUPPORTED_Y=i(function(){var s=o("a","y");return s.lastIndex=2,s.exec("abcd")!=null}),n.BROKEN_CARET=i(function(){var s=o("^r","gy");return s.lastIndex=2,s.exec("str")!=null})},function(a,n,r){var i=r(223);a.exports=function(o){if(i(o))throw TypeError("The method doesn't accept regular expressions");return o}},function(a,n,r){var i=r(13),o=r(42),s=r(5)("match");a.exports=function(c){var l;return i(c)&&((l=c[s])!==void 0?!!l:o(c)=="RegExp")}},function(a,n,r){var i=r(5)("match");a.exports=function(o){var s=/./;try{"/./"[o](s)}catch{try{return s[i]=!1,"/./"[o](s)}catch{}}return!1}},function(a,n,r){r(68);var i=r(25),o=r(8),s=r(5),c=r(93),l=r(21),p=s("species"),u=!o(function(){var m=/./;return m.exec=function(){var x=[];return x.groups={a:"7"},x},"".replace(m,"$")!=="7"}),f="a".replace(/./,"$0")==="$0",h=s("replace"),d=!!/./[h]&&/./[h]("a","$0")==="",v=!o(function(){var m=/(?:)/,x=m.exec;m.exec=function(){return x.apply(this,arguments)};var y="ab".split(m);return y.length!==2||y[0]!=="a"||y[1]!=="b"});a.exports=function(m,x,y,g){var C=s(m),S=!o(function(){var O={};return O[C]=function(){return 7},""[m](O)!=7}),T=S&&!o(function(){var O=!1,M=/a/;return m==="split"&&((M={}).constructor={},M.constructor[p]=function(){return M},M.flags="",M[C]=/./[C]),M.exec=function(){return O=!0,null},M[C](""),!O});if(!S||!T||m==="replace"&&(!u||!f||d)||m==="split"&&!v){var w=/./[C],_=y(C,""[m],function(O,M,N,R,B){return M.exec===c?S&&!B?{done:!0,value:w.call(M,N,R)}:{done:!0,value:O.call(N,M,R)}:{done:!1}},{REPLACE_KEEPS_$0:f,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),E=_[0],D=_[1];i(String.prototype,m,E),i(RegExp.prototype,C,x==2?function(O,M){return D.call(O,this,M)}:function(O){return D.call(O,this)})}g&&l(RegExp.prototype[C],"sham",!0)}},function(a,n,r){var i=r(137).charAt;a.exports=function(o,s,c){return s+(c?i(o,s).length:1)}},function(a,n,r){var i=r(42),o=r(93);a.exports=function(s,c){var l=s.exec;if(typeof l=="function"){var p=l.call(s,c);if(typeof p!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return p}if(i(s)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return o.call(s,c)}},function(a,n,r){(function(i){Object.defineProperty(n,"__esModule",{value:!0});var o=r(96);n.forgivingBase64Encode=function(s){return i.from(s).toString("base64")},n.forgivingBase64Decode=function(s){return s===""?"":((s=s.replace(o.ASCIIWhiteSpace,"")).length%4==0&&(s.endsWith("==")?s=s.substr(0,s.length-2):s.endsWith("=")&&(s=s.substr(0,s.length-1))),s.length%4==1?null:/[0-9A-Za-z+/]/.test(s)?i.from(s,"base64").toString("utf8"):null)}}).call(this,r(145).Buffer)},function(a,n,r){n.byteLength=function(h){var d=u(h),v=d[0],m=d[1];return 3*(v+m)/4-m},n.toByteArray=function(h){var d,v,m=u(h),x=m[0],y=m[1],g=new s(function(T,w,_){return 3*(w+_)/4-_}(0,x,y)),C=0,S=y>0?x-4:x;for(v=0;v>16&255,g[C++]=d>>8&255,g[C++]=255&d;return y===2&&(d=o[h.charCodeAt(v)]<<2|o[h.charCodeAt(v+1)]>>4,g[C++]=255&d),y===1&&(d=o[h.charCodeAt(v)]<<10|o[h.charCodeAt(v+1)]<<4|o[h.charCodeAt(v+2)]>>2,g[C++]=d>>8&255,g[C++]=255&d),g},n.fromByteArray=function(h){for(var d,v=h.length,m=v%3,x=[],y=0,g=v-m;yg?g:y+16383));return m===1?(d=h[v-1],x.push(i[d>>2]+i[d<<4&63]+"==")):m===2&&(d=(h[v-2]<<8)+h[v-1],x.push(i[d>>10]+i[d>>4&63]+i[d<<2&63]+"=")),x.join("")};for(var i=[],o=[],s=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=c.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var v=h.indexOf("=");return v===-1&&(v=d),[v,v===d?0:4-v%4]}function f(h,d,v){for(var m,x,y=[],g=d;g>18&63]+i[x>>12&63]+i[x>>6&63]+i[63&x]);return y.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(a,n){n.read=function(r,i,o,s,c){var l,p,u=8*c-s-1,f=(1<>1,d=-7,v=o?c-1:0,m=o?-1:1,x=r[i+v];for(v+=m,l=x&(1<<-d)-1,x>>=-d,d+=u;d>0;l=256*l+r[i+v],v+=m,d-=8);for(p=l&(1<<-d)-1,l>>=-d,d+=s;d>0;p=256*p+r[i+v],v+=m,d-=8);if(l===0)l=1-h;else{if(l===f)return p?NaN:1/0*(x?-1:1);p+=Math.pow(2,s),l-=h}return(x?-1:1)*p*Math.pow(2,l-s)},n.write=function(r,i,o,s,c,l){var p,u,f,h=8*l-c-1,d=(1<>1,m=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=s?0:l-1,y=s?1:-1,g=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(u=isNaN(i)?1:0,p=d):(p=Math.floor(Math.log(i)/Math.LN2),i*(f=Math.pow(2,-p))<1&&(p--,f*=2),(i+=p+v>=1?m/f:m*Math.pow(2,1-v))*f>=2&&(p++,f/=2),p+v>=d?(u=0,p=d):p+v>=1?(u=(i*f-1)*Math.pow(2,c),p+=v):(u=i*Math.pow(2,v-1)*Math.pow(2,c),p=0));c>=8;r[o+x]=255&u,x+=y,u/=256,c-=8);for(p=p<0;r[o+x]=255&p,x+=y,p/=256,h-=8);r[o+x-y]|=128*g}},function(a,n){var r={}.toString;a.exports=Array.isArray||function(i){return r.call(i)=="[object Array]"}},function(a,n,r){var i=this&&this.__values||function(c){var l=typeof Symbol=="function"&&Symbol.iterator,p=l&&c[l],u=0;if(p)return p.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&u>=c.length&&(c=void 0),{value:c&&c[u++],done:!c}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(1);function s(c){var l,p;if(c===null||o.isString(c)||o.isNumber(c))return c;if(o.isArray(c)){var u=new Array;try{for(var f=i(c),h=f.next();!h.done;h=f.next()){var d=h.value;u.push(s(d))}}catch(x){l={error:x}}finally{try{h&&!h.done&&(p=f.return)&&p.call(f)}finally{if(l)throw l.error}}return u}if(o.isObject(c)){u=new Map;for(var v in c)if(c.hasOwnProperty(v)){var m=c[v];u.set(v,s(m))}return u}return c}n.parseJSONFromBytes=function(c){var l=o.utf8Decode(c);return JSON.parse.call(void 0,l)},n.serializeJSONToBytes=function(c){var l=JSON.stringify.call(void 0,c);return o.utf8Encode(l)},n.parseJSONIntoInfraValues=function(c){return s(JSON.parse.call(void 0,c))},n.convertAJSONDerivedJavaScriptValueToAnInfraValue=s},function(a,n,r){var i=this&&this.__generator||function(p,u){var f,h,d,v,m={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return v={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function x(y){return function(g){return function(C){if(f)throw new TypeError("Generator is already executing.");for(;m;)try{if(f=1,h&&(d=2&C[0]?h.return:C[0]?h.throw||((d=h.return)&&d.call(h),0):h.next)&&!(d=d.call(h,C[1])).done)return d;switch(h=0,d&&(C=[2&C[0],d.value]),C[0]){case 0:case 1:d=C;break;case 4:return m.label++,{value:C[1],done:!1};case 5:m.label++,h=C[1],C=[0];continue;case 7:C=m.ops.pop(),m.trys.pop();continue;default:if(d=m.trys,!((d=d.length>0&&d[d.length-1])||C[0]!==6&&C[0]!==2)){m=0;continue}if(C[0]===3&&(!d||C[1]>d[0]&&C[1]0)&&!(h=v.next()).done;)m.push(h.value)}catch(x){d={error:x}}finally{try{h&&!h.done&&(f=v.return)&&f.call(v)}finally{if(d)throw d.error}}return m},s=this&&this.__spread||function(){for(var p=[],u=0;u=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var l=r(1);n.append=function(p,u){p.push(u)},n.extend=function(p,u){p.push.apply(p,s(u))},n.prepend=function(p,u){p.unshift(u)},n.replace=function(p,u,f){var h,d,v=0;try{for(var m=c(p),x=m.next();!x.done;x=m.next()){var y=x.value;if(l.isFunction(u))u.call(null,y)&&(p[v]=f);else if(y===u)return void(p[v]=f);v++}}catch(g){h={error:g}}finally{try{x&&!x.done&&(d=m.return)&&d.call(m)}finally{if(h)throw h.error}}},n.insert=function(p,u,f){p.splice(f,0,u)},n.remove=function(p,u){for(var f=p.length;f--;){var h=p[f];if(l.isFunction(u))u.call(null,h)&&p.splice(f,1);else if(h===u)return void p.splice(f,1)}},n.empty=function(p){p.length=0},n.contains=function(p,u){var f,h;try{for(var d=c(p),v=d.next();!v.done;v=d.next()){var m=v.value;if(l.isFunction(u)){if(u.call(null,m))return!0}else if(m===u)return!0}}catch(x){f={error:x}}finally{try{v&&!v.done&&(h=d.return)&&h.call(d)}finally{if(f)throw f.error}}return!1},n.size=function(p,u){var f,h;if(u===void 0)return p.length;var d=0;try{for(var v=c(p),m=v.next();!m.done;m=v.next()){var x=m.value;u.call(null,x)&&d++}}catch(y){f={error:y}}finally{try{m&&!m.done&&(h=v.return)&&h.call(v)}finally{if(f)throw f.error}}return d},n.isEmpty=function(p){return p.length===0},n.forEach=function(p,u){var f,h,d,v,m,x;return i(this,function(y){switch(y.label){case 0:return u!==void 0?[3,2]:[5,c(p)];case 1:return y.sent(),[3,9];case 2:y.trys.push([2,7,8,9]),f=c(p),h=f.next(),y.label=3;case 3:return h.done?[3,6]:(d=h.value,u.call(null,d)?[4,d]:[3,5]);case 4:y.sent(),y.label=5;case 5:return h=f.next(),[3,3];case 6:return[3,9];case 7:return v=y.sent(),m={error:v},[3,9];case 8:try{h&&!h.done&&(x=f.return)&&x.call(f)}finally{if(m)throw m.error}return[7];case 9:return[2]}})},n.clone=function(p){return new(Array.bind.apply(Array,s([void 0],p)))},n.sortInAscendingOrder=function(p,u){return p.sort(function(f,h){return u.call(null,f,h)?-1:1})},n.sortInDescendingOrder=function(p,u){return p.sort(function(f,h){return u.call(null,f,h)?1:-1})}},function(a,n,r){var i=this&&this.__generator||function(p,u){var f,h,d,v,m={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return v={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function x(y){return function(g){return function(C){if(f)throw new TypeError("Generator is already executing.");for(;m;)try{if(f=1,h&&(d=2&C[0]?h.return:C[0]?h.throw||((d=h.return)&&d.call(h),0):h.next)&&!(d=d.call(h,C[1])).done)return d;switch(h=0,d&&(C=[2&C[0],d.value]),C[0]){case 0:case 1:d=C;break;case 4:return m.label++,{value:C[1],done:!1};case 5:m.label++,h=C[1],C=[0];continue;case 7:C=m.ops.pop(),m.trys.pop();continue;default:if(d=m.trys,!((d=d.length>0&&d[d.length-1])||C[0]!==6&&C[0]!==2)){m=0;continue}if(C[0]===3&&(!d||C[1]>d[0]&&C[1]=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(p,u){var f=typeof Symbol=="function"&&p[Symbol.iterator];if(!f)return p;var h,d,v=f.call(p),m=[];try{for(;(u===void 0||u-- >0)&&!(h=v.next()).done;)m.push(h.value)}catch(x){d={error:x}}finally{try{h&&!h.done&&(f=v.return)&&f.call(v)}finally{if(d)throw d.error}}return m},c=this&&this.__spread||function(){for(var p=[],u=0;u0&&v[v.length-1])||S[0]!==6&&S[0]!==2)){x=0;continue}if(S[0]===3&&(!v||S[1]>v[0]&&S[1]=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(u,f){var h=typeof Symbol=="function"&&u[Symbol.iterator];if(!h)return u;var d,v,m=h.call(u),x=[];try{for(;(f===void 0||f-- >0)&&!(d=m.next()).done;)x.push(d.value)}catch(y){v={error:y}}finally{try{d&&!d.done&&(h=m.return)&&h.call(m)}finally{if(v)throw v.error}}return x},c=this&&this.__spread||function(){for(var u=[],f=0;f=x.length&&(x=void 0),{value:x&&x[C++],done:!x}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(96),s=r(147),c=r(146),l=r(1);function p(x,y){for(var g=0;;){var C=g=65&&_<=90?String.fromCodePoint(_+32):w}}catch(E){y={error:E}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(y)throw y.error}}return C}function d(x){return x.replace(/^[\t\n\f\r ]+/,"").replace(/[\t\n\f\r ]+$/,"")}function v(x,y,g){if(!l.isArray(y))return v(x,Array.from(y),g);for(var C="";g.position=97&&_<=122?String.fromCodePoint(_-32):w}}catch(E){y={error:E}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(y)throw y.error}}return C},n.asciiCaseInsensitiveMatch=function(x,y){return h(x)===h(y)},n.asciiEncode=function(x){return console.assert(f(x),"asciiEncode requires an ASCII string."),u(x)},n.asciiDecode=function(x){var y,g;try{for(var C=i(x),S=C.next();!S.done;S=C.next()){var T=S.value;console.assert(c.isASCIIByte(T),"asciiDecode requires an ASCII byte sequence.")}}catch(w){y={error:w}}finally{try{S&&!S.done&&(g=C.return)&&g.call(C)}finally{if(y)throw y.error}}return s.isomorphicDecode(x)},n.stripNewlines=function(x){return x.replace(/[\n\r]/g,"")},n.normalizeNewlines=function(x){return x.replace(/\r\n/g,` +Input: `+this.err.str)},u.prototype[Symbol.iterator]=function(){return this._index=0,{next:function(){var c=this.nextToken();return c.type===o.TokenType.EOF?{done:!0,value:null}:{done:!1,value:c}}.bind(this)}},u}();n.XMLStringLexer=s},function(a,n,r){var i=r(39);a.exports=new i({include:[r(182)]})},function(a,n,r){var i=r(39);a.exports=new i({include:[r(113)],implicit:[r(290),r(291),r(292),r(293)]})},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(91),o=r(2),s=r(3),u=r(77),c=r(109);function p(v,m){var x=f(v===void 0||l(v)?v:i.DefaultBuilderOptions),y=l(v)?m:v,d=c.createDocument();h(d,x);var g=new u.XMLBuilderImpl(d);return y!==void 0&&g.ele(y),g}function l(v){if(!o.isPlainObject(v))return!1;for(var m in v)if(v.hasOwnProperty(m)&&!i.XMLBuilderOptionKeys.has(m))return!1;return!0}function f(v){v===void 0&&(v={});var m=o.applyDefaults(v,i.DefaultBuilderOptions);if(m.convert.att.length===0||m.convert.ins.length===0||m.convert.text.length===0||m.convert.cdata.length===0||m.convert.comment.length===0)throw new Error("JS object converter strings cannot be zero length.");return m}function h(v,m,x){var y=v;y._xmlBuilderOptions=m,y._isFragment=x}n.builder=function(v,m){var x=f(l(v)?v:i.DefaultBuilderOptions),y=s.Guard.isNode(v)||o.isArray(v)?v:m;if(y===void 0)throw new Error("Invalid arguments.");if(o.isArray(y)){for(var d=[],g=0;g0)&&!(C=T.next()).done;)w.push(C.value)}catch(_){S={error:_}}finally{try{C&&!C.done&&(g=T.return)&&g.call(T)}finally{if(S)throw S.error}}return w},o=this&&this.__values||function(y){var d=typeof Symbol=="function"&&Symbol.iterator,g=d&&y[d],C=0;if(g)return g.call(y);if(y&&typeof y.length=="number")return{next:function(){return y&&C>=y.length&&(y=void 0),{value:y&&y[C++],done:!y}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=r(91),u=r(2),c=r(217),p=r(1),l=r(3),f=r(0),h=r(109),v=r(7),m=r(277),x=function(){function y(d){this._domNode=d}return Object.defineProperty(y.prototype,"node",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),y.prototype.set=function(d){return this._options=u.applyDefaults(u.applyDefaults(this._options,d,!0),s.DefaultBuilderOptions),this},y.prototype.ele=function(d,g,C){var S,T,w,_,E,D;if(u.isObject(d))return new m.ObjectReader(this._options).parse(this,d);if(d!==null&&/^\s*0&&(d===void 0&&(d=g.slice(S+1)),g=g.slice(0,S)),d===void 0)d=C?this._options.defaultNamespace.ele:this._options.defaultNamespace.att;else if(d!==null&&d[0]==="@"){var T=d.slice(1);if((d=this._options.namespaceAlias[T])===void 0)throw new Error("Namespace alias `"+T+"` is not defined. "+this._debugInfo())}return[d,g]},y.prototype._updateNamespace=function(d){var g,C,S,T,w=this._domNode;if(l.Guard.isElementNode(w)&&d!==null&&w.namespaceURI!==d){var _=i(f.namespace_extractQName(w.prefix?w.prefix+":"+w.localName:w.localName),2),E=_[0],D=_[1],O=f.create_element(this._doc,D,d,E);try{for(var b=o(w.attributes),R=b.next();!R.done;R=b.next()){var N=R.value,L=N.prefix?N.prefix+":"+N.localName:N.localName,B=i(f.namespace_extractQName(L),1)[0],P=N.namespaceURI;P===null&&B!==null&&(P=w.lookupNamespaceURI(B)),P===null?O.setAttribute(L,N.value):O.setAttributeNS(P,L,N.value)}}catch(Y){g={error:Y}}finally{try{R&&!R.done&&(C=b.return)&&C.call(b)}finally{if(g)throw g.error}}var F=w.parentNode;if(F===null)throw new Error("Parent node is null."+this._debugInfo());F.replaceChild(O,w),this._domNode=O;try{for(var k=o(w.childNodes),G=k.next();!G.done;G=k.next()){var W=G.value.cloneNode(!0);if(O.appendChild(W),l.Guard.isElementNode(W)){var H=i(f.namespace_extractQName(W.prefix?W.prefix+":"+W.localName:W.localName),1)[0],X=O.lookupNamespaceURI(H);new y(W)._updateNamespace(X)}}}catch(Y){S={error:Y}}finally{try{G&&!G.done&&(T=k.return)&&T.call(k)}finally{if(S)throw S.error}}}},Object.defineProperty(y.prototype,"_doc",{get:function(){var d=this.node;if(l.Guard.isDocumentNode(d))return d;var g=d.ownerDocument;if(!g)throw new Error("Owner document is null. "+this._debugInfo());return g},enumerable:!0,configurable:!0}),y.prototype._debugInfo=function(d){var g=this.node,C=g.parentNode;d=d||g.nodeName;var S=C?C.nodeName:"";return S?"node: <"+d+">, parent: <"+S+">":"node: <"+d+">"},Object.defineProperty(y.prototype,"_options",{get:function(){var d=this._doc;if(d._xmlBuilderOptions===void 0)throw new Error("Builder options is not set.");return d._xmlBuilderOptions},set:function(d){this._doc._xmlBuilderOptions=d},enumerable:!0,configurable:!0}),y}();n.XMLBuilderImpl=x},function(a,n,r){var i=r(11),o=r(117),s=i.WeakMap;a.exports=typeof s=="function"&&/native code/.test(o(s))},function(a,n,r){var i=r(46),o=r(82),s=r(85),u=r(18);a.exports=i("Reflect","ownKeys")||function(c){var p=o.f(u(c)),l=s.f;return l?p.concat(l(c)):p}},function(a,n,r){var i=r(16),o=r(15),s=r(18),u=r(61);a.exports=i?Object.defineProperties:function(c,p){s(c);for(var l,f=u(p),h=f.length,v=0;h>v;)o.f(c,l=f[v++],p[l]);return c}},function(a,n,r){var i=r(46);a.exports=i("document","documentElement")},function(a,n,r){var i=r(24),o=r(82).f,s={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];a.exports.f=function(c){return u&&s.call(c)=="[object Window]"?function(p){try{return o(p)}catch{return u.slice()}}(c):o(i(c))}},function(a,n,r){var i=r(4),o=r(36).every,s=r(48),u=r(28),c=s("every"),p=u("every");i({target:"Array",proto:!0,forced:!c||!p},{every:function(l){return o(this,l,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(4),o=r(36).filter,s=r(63),u=r(28),c=s("filter"),p=u("filter");i({target:"Array",proto:!0,forced:!c||!p},{filter:function(l){return o(this,l,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(46);a.exports=i("navigator","userAgent")||""},function(a,n,r){var i=r(4),o=r(36).find,s=r(130),u=r(28),c=!0,p=u("find");"find"in[]&&Array(1).find(function(){c=!1}),i({target:"Array",proto:!0,forced:c||!p},{find:function(l){return o(this,l,arguments.length>1?arguments[1]:void 0)}}),s("find")},function(a,n,r){var i=r(131).IteratorPrototype,o=r(60),s=r(40),u=r(62),c=r(49),p=function(){return this};a.exports=function(l,f,h){var v=f+" Iterator";return l.prototype=o(i,{next:s(1,h)}),u(l,v,!1,!0),c[v]=p,l}},function(a,n,r){var i=r(8);a.exports=!i(function(){function o(){}return o.prototype.constructor=null,Object.getPrototypeOf(new o)!==o.prototype})},function(a,n,r){var i=r(13);a.exports=function(o){if(!i(o)&&o!==null)throw TypeError("Can't set "+String(o)+" as a prototype");return o}},function(a,n,r){var i=r(4),o=r(36).map,s=r(63),u=r(28),c=s("map"),p=u("map");i({target:"Array",proto:!0,forced:!c||!p},{map:function(l){return o(this,l,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(4),o=r(200).left,s=r(48),u=r(28),c=s("reduce"),p=u("reduce",{1:0});i({target:"Array",proto:!0,forced:!c||!p},{reduce:function(l){return o(this,l,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(127),o=r(27),s=r(41),u=r(26),c=function(p){return function(l,f,h,v){i(f);var m=o(l),x=s(m),y=u(m.length),d=p?y-1:0,g=p?-1:1;if(h<2)for(;;){if(d in x){v=x[d],d+=g;break}if(d+=g,p?d<0:y<=d)throw TypeError("Reduce of empty array with no initial value")}for(;p?d>=0:y>d;d+=g)d in x&&(v=f(v,x[d],d,m));return v}};a.exports={left:c(!1),right:c(!0)}},function(a,n,r){var i=r(4),o=r(36).some,s=r(48),u=r(28),c=s("some"),p=u("some");i({target:"Array",proto:!0,forced:!c||!p},{some:function(l){return o(this,l,arguments.length>1?arguments[1]:void 0)}})},function(a,n,r){var i=r(90),o=r(135);a.exports=i?{}.toString:function(){return"[object "+o(this)+"]"}},function(a,n){a.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(a,n,r){var i=r(8);a.exports=!i(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(a,n,r){var i=r(5),o=r(49),s=i("iterator"),u=Array.prototype;a.exports=function(c){return c!==void 0&&(o.Array===c||u[s]===c)}},function(a,n,r){var i=r(135),o=r(49),s=r(5)("iterator");a.exports=function(u){if(u!=null)return u[s]||u["@@iterator"]||o[i(u)]}},function(a,n,r){var i=r(18);a.exports=function(o,s,u,c){try{return c?s(i(u)[0],u[1]):s(u)}catch(l){var p=o.return;throw p!==void 0&&i(p.call(o)),l}}},function(a,n,r){var i=r(5)("iterator"),o=!1;try{var s=0,u={next:function(){return{done:!!s++}},return:function(){o=!0}};u[i]=function(){return this},Array.from(u,function(){throw 2})}catch{}a.exports=function(c,p){if(!p&&!o)return!1;var l=!1;try{var f={};f[i]=function(){return{next:function(){return{done:l=!0}}}},c(f)}catch{}return l}},function(a,n,r){var i=r(13),o=r(133);a.exports=function(s,u,c){var p,l;return o&&typeof(p=u.constructor)=="function"&&p!==c&&i(l=p.prototype)&&l!==c.prototype&&o(s,l),s}},function(a,n,r){var i=r(25);a.exports=function(o,s,u){for(var c in s)i(o,c,s[c],u);return o}},function(a,n,r){var i=r(46),o=r(15),s=r(5),u=r(16),c=s("species");a.exports=function(p){var l=i(p),f=o.f;u&&l&&!l[c]&&f(l,c,{configurable:!0,get:function(){return this}})}},function(a,n,r){var i=this&&this.__generator||function(u,c){var p,l,f,h,v={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function m(x){return function(y){return function(d){if(p)throw new TypeError("Generator is already executing.");for(;v;)try{if(p=1,l&&(f=2&d[0]?l.return:d[0]?l.throw||((f=l.return)&&f.call(l),0):l.next)&&!(f=f.call(l,d[1])).done)return f;switch(l=0,f&&(d=[2&d[0],f.value]),d[0]){case 0:case 1:f=d;break;case 4:return v.label++,{value:d[1],done:!1};case 5:v.label++,l=d[1],d=[0];continue;case 7:d=v.ops.pop(),v.trys.pop();continue;default:if(f=v.trys,!((f=f.length>0&&f[f.length-1])||d[0]!==6&&d[0]!==2)){v=0;continue}if(d[0]===3&&(!f||d[1]>f[0]&&d[1]=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function u(c){c===void 0&&(c=1e3),this._items=new Set,this._limit=c}return u.prototype.add=function(c){if(this._items.add(c),this._items.size>this._limit){var p=this._items.values().next();p.done||this._items.delete(p.value)}return this},u.prototype.delete=function(c){return this._items.delete(c)},u.prototype.has=function(c){return this._items.has(c)},u.prototype.clear=function(){this._items.clear()},Object.defineProperty(u.prototype,"size",{get:function(){return this._items.size},enumerable:!0,configurable:!0}),u.prototype.forEach=function(c,p){var l=this;this._items.forEach(function(f){return c.call(p,f,f,l)})},u.prototype.keys=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items.keys())];case 1:return c.sent(),[2]}})},u.prototype.values=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items.values())];case 1:return c.sent(),[2]}})},u.prototype.entries=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items.entries())];case 1:return c.sent(),[2]}})},u.prototype[Symbol.iterator]=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items)];case 1:return c.sent(),[2]}})},Object.defineProperty(u.prototype,Symbol.toStringTag,{get:function(){return"FixedSizeSet"},enumerable:!0,configurable:!0}),u}();n.FixedSizeSet=s},function(a,n,r){var i=this&&this.__generator||function(u,c){var p,l,f,h,v={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function m(x){return function(y){return function(d){if(p)throw new TypeError("Generator is already executing.");for(;v;)try{if(p=1,l&&(f=2&d[0]?l.return:d[0]?l.throw||((f=l.return)&&f.call(l),0):l.next)&&!(f=f.call(l,d[1])).done)return f;switch(l=0,f&&(d=[2&d[0],f.value]),d[0]){case 0:case 1:f=d;break;case 4:return v.label++,{value:d[1],done:!1};case 5:v.label++,l=d[1],d=[0];continue;case 7:d=v.ops.pop(),v.trys.pop();continue;default:if(f=v.trys,!((f=f.length>0&&f[f.length-1])||d[0]!==6&&d[0]!==2)){v=0;continue}if(d[0]===3&&(!f||d[1]>f[0]&&d[1]=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function u(c){c===void 0&&(c=1e3),this._items=new Map,this._limit=c}return u.prototype.get=function(c){return this._items.get(c)},u.prototype.set=function(c,p){if(this._items.set(c,p),this._items.size>this._limit){var l=this._items.keys().next();l.done||this._items.delete(l.value)}},u.prototype.delete=function(c){return this._items.delete(c)},u.prototype.has=function(c){return this._items.has(c)},u.prototype.clear=function(){this._items.clear()},Object.defineProperty(u.prototype,"size",{get:function(){return this._items.size},enumerable:!0,configurable:!0}),u.prototype.forEach=function(c,p){this._items.forEach(function(l,f){return c.call(p,f,l)})},u.prototype.keys=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items.keys())];case 1:return c.sent(),[2]}})},u.prototype.values=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items.values())];case 1:return c.sent(),[2]}})},u.prototype.entries=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items.entries())];case 1:return c.sent(),[2]}})},u.prototype[Symbol.iterator]=function(){return i(this,function(c){switch(c.label){case 0:return[5,o(this._items)];case 1:return c.sent(),[2]}})},Object.defineProperty(u.prototype,Symbol.toStringTag,{get:function(){return"ObjectCache"},enumerable:!0,configurable:!0}),u}();n.ObjectCache=s},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s){s===void 0&&(s=1e3),this._items=new Map,this._limit=s}return o.prototype.check=function(s,u){if(this._items.get(s)===u)return!0;if(this._items.get(u)===s)return!1;var c=Math.random()<.5;if(c?this._items.set(s,u):this._items.set(u,s),this._items.size>this._limit){var p=this._items.keys().next();p.done||this._items.delete(p.value)}return c},o}();n.CompareCache=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s){this._initialized=!1,this._value=void 0,this._initFunc=s}return Object.defineProperty(o.prototype,"value",{get:function(){return this._initialized||(this._value=this._initFunc(),this._initialized=!0),this._value},enumerable:!0,configurable:!0}),o}();n.Lazy=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(s){this._pointer=0,this._chars=Array.from(s),this._length=this._chars.length}return Object.defineProperty(o.prototype,"eof",{get:function(){return this._pointer>=this._length},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),o.prototype.codePoint=function(){if(this._codePoint===void 0)if(this.eof)this._codePoint=-1;else{var s=this._chars[this._pointer].codePointAt(0);this._codePoint=s!==void 0?s:-1}return this._codePoint},o.prototype.c=function(){return this._c===void 0&&(this._c=this.eof?"":this._chars[this._pointer]),this._c},o.prototype.remaining=function(){return this._remaining===void 0&&(this._remaining=this.eof?"":this._chars.slice(this._pointer+1).join("")),this._remaining},o.prototype.substring=function(){return this._substring===void 0&&(this._substring=this.eof?"":this._chars.slice(this._pointer).join("")),this._substring},Object.defineProperty(o.prototype,"pointer",{get:function(){return this._pointer},set:function(s){s!==this._pointer&&(this._pointer=s,this._codePoint=void 0,this._c=void 0,this._remaining=void 0,this._substring=void 0)},enumerable:!0,configurable:!0}),o}();n.StringWalker=i},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(218);n.MapWriter=i.MapWriter;var o=r(259);n.XMLWriter=o.XMLWriter;var s=r(67);n.ObjectWriter=s.ObjectWriter;var u=r(261);n.JSONWriter=u.JSONWriter;var c=r(262);n.YAMLWriter=c.YAMLWriter},function(a,n,r){r(19),r(219),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(p,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var v in h)h.hasOwnProperty(v)&&(f[v]=h[v])})(p,l)},function(p,l){function f(){this.constructor=p}i(p,l),p.prototype=l===null?Object.create(l):(f.prototype=l.prototype,new f)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),u=r(67),c=function(p){function l(f,h){var v=p.call(this,f)||this;return v._writerOptions=s.applyDefaults(h,{format:"map",wellFormed:!1,group:!1,verbose:!1}),v}return o(l,p),l.prototype.serialize=function(f){var h=s.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1,verbose:!1}),v=new u.ObjectWriter(this._builderOptions,h).serialize(f);return this._convertObject(v)},l.prototype._convertObject=function(f){if(s.isArray(f)){for(var h=0;h=51||!o(function(){var C=[];return C[x]=!1,C.concat()[0]!==C}),d=h("concat"),g=function(C){if(!u(C))return!1;var S=C[x];return S!==void 0?!!S:s(C)};i({target:"Array",proto:!0,forced:!y||!d},{concat:function(C){var S,T,w,_,E,D=c(this),O=f(D,0),b=0;for(S=-1,w=arguments.length;S9007199254740991)throw TypeError("Maximum allowed index exceeded");for(T=0;T<_;T++,b++)T in E&&l(O,b,E[T])}else{if(b>=9007199254740991)throw TypeError("Maximum allowed index exceeded");l(O,b++,E)}return O.length=b,O}})},function(a,n,r){var i=r(8);function o(s,u){return RegExp(s,u)}n.UNSUPPORTED_Y=i(function(){var s=o("a","y");return s.lastIndex=2,s.exec("abcd")!=null}),n.BROKEN_CARET=i(function(){var s=o("^r","gy");return s.lastIndex=2,s.exec("str")!=null})},function(a,n,r){var i=r(223);a.exports=function(o){if(i(o))throw TypeError("The method doesn't accept regular expressions");return o}},function(a,n,r){var i=r(13),o=r(42),s=r(5)("match");a.exports=function(u){var c;return i(u)&&((c=u[s])!==void 0?!!c:o(u)=="RegExp")}},function(a,n,r){var i=r(5)("match");a.exports=function(o){var s=/./;try{"/./"[o](s)}catch{try{return s[i]=!1,"/./"[o](s)}catch{}}return!1}},function(a,n,r){r(68);var i=r(25),o=r(8),s=r(5),u=r(93),c=r(21),p=s("species"),l=!o(function(){var x=/./;return x.exec=function(){var y=[];return y.groups={a:"7"},y},"".replace(x,"$")!=="7"}),f="a".replace(/./,"$0")==="$0",h=s("replace"),v=!!/./[h]&&/./[h]("a","$0")==="",m=!o(function(){var x=/(?:)/,y=x.exec;x.exec=function(){return y.apply(this,arguments)};var d="ab".split(x);return d.length!==2||d[0]!=="a"||d[1]!=="b"});a.exports=function(x,y,d,g){var C=s(x),S=!o(function(){var O={};return O[C]=function(){return 7},""[x](O)!=7}),T=S&&!o(function(){var O=!1,b=/a/;return x==="split"&&((b={}).constructor={},b.constructor[p]=function(){return b},b.flags="",b[C]=/./[C]),b.exec=function(){return O=!0,null},b[C](""),!O});if(!S||!T||x==="replace"&&(!l||!f||v)||x==="split"&&!m){var w=/./[C],_=d(C,""[x],function(O,b,R,N,L){return b.exec===u?S&&!L?{done:!0,value:w.call(b,R,N)}:{done:!0,value:O.call(R,b,N)}:{done:!1}},{REPLACE_KEEPS_$0:f,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:v}),E=_[0],D=_[1];i(String.prototype,x,E),i(RegExp.prototype,C,y==2?function(O,b){return D.call(O,this,b)}:function(O){return D.call(O,this)})}g&&c(RegExp.prototype[C],"sham",!0)}},function(a,n,r){var i=r(137).charAt;a.exports=function(o,s,u){return s+(u?i(o,s).length:1)}},function(a,n,r){var i=r(42),o=r(93);a.exports=function(s,u){var c=s.exec;if(typeof c=="function"){var p=c.call(s,u);if(typeof p!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return p}if(i(s)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return o.call(s,u)}},function(a,n,r){(function(i){Object.defineProperty(n,"__esModule",{value:!0});var o=r(96);n.forgivingBase64Encode=function(s){return i.from(s).toString("base64")},n.forgivingBase64Decode=function(s){return s===""?"":((s=s.replace(o.ASCIIWhiteSpace,"")).length%4==0&&(s.endsWith("==")?s=s.substr(0,s.length-2):s.endsWith("=")&&(s=s.substr(0,s.length-1))),s.length%4==1?null:/[0-9A-Za-z+/]/.test(s)?i.from(s,"base64").toString("utf8"):null)}}).call(this,r(145).Buffer)},function(a,n,r){n.byteLength=function(h){var v=l(h),m=v[0],x=v[1];return 3*(m+x)/4-x},n.toByteArray=function(h){var v,m,x=l(h),y=x[0],d=x[1],g=new s(function(T,w,_){return 3*(w+_)/4-_}(0,y,d)),C=0,S=d>0?y-4:y;for(m=0;m>16&255,g[C++]=v>>8&255,g[C++]=255&v;return d===2&&(v=o[h.charCodeAt(m)]<<2|o[h.charCodeAt(m+1)]>>4,g[C++]=255&v),d===1&&(v=o[h.charCodeAt(m)]<<10|o[h.charCodeAt(m+1)]<<4|o[h.charCodeAt(m+2)]>>2,g[C++]=v>>8&255,g[C++]=255&v),g},n.fromByteArray=function(h){for(var v,m=h.length,x=m%3,y=[],d=0,g=m-x;dg?g:d+16383));return x===1?(v=h[m-1],y.push(i[v>>2]+i[v<<4&63]+"==")):x===2&&(v=(h[m-2]<<8)+h[m-1],y.push(i[v>>10]+i[v>>4&63]+i[v<<2&63]+"=")),y.join("")};for(var i=[],o=[],s=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,p=u.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var m=h.indexOf("=");return m===-1&&(m=v),[m,m===v?0:4-m%4]}function f(h,v,m){for(var x,y,d=[],g=v;g>18&63]+i[y>>12&63]+i[y>>6&63]+i[63&y]);return d.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(a,n){n.read=function(r,i,o,s,u){var c,p,l=8*u-s-1,f=(1<>1,v=-7,m=o?u-1:0,x=o?-1:1,y=r[i+m];for(m+=x,c=y&(1<<-v)-1,y>>=-v,v+=l;v>0;c=256*c+r[i+m],m+=x,v-=8);for(p=c&(1<<-v)-1,c>>=-v,v+=s;v>0;p=256*p+r[i+m],m+=x,v-=8);if(c===0)c=1-h;else{if(c===f)return p?NaN:1/0*(y?-1:1);p+=Math.pow(2,s),c-=h}return(y?-1:1)*p*Math.pow(2,c-s)},n.write=function(r,i,o,s,u,c){var p,l,f,h=8*c-u-1,v=(1<>1,x=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=s?0:c-1,d=s?1:-1,g=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(l=isNaN(i)?1:0,p=v):(p=Math.floor(Math.log(i)/Math.LN2),i*(f=Math.pow(2,-p))<1&&(p--,f*=2),(i+=p+m>=1?x/f:x*Math.pow(2,1-m))*f>=2&&(p++,f/=2),p+m>=v?(l=0,p=v):p+m>=1?(l=(i*f-1)*Math.pow(2,u),p+=m):(l=i*Math.pow(2,m-1)*Math.pow(2,u),p=0));u>=8;r[o+y]=255&l,y+=d,l/=256,u-=8);for(p=p<0;r[o+y]=255&p,y+=d,p/=256,h-=8);r[o+y-d]|=128*g}},function(a,n){var r={}.toString;a.exports=Array.isArray||function(i){return r.call(i)=="[object Array]"}},function(a,n,r){var i=this&&this.__values||function(u){var c=typeof Symbol=="function"&&Symbol.iterator,p=c&&u[c],l=0;if(p)return p.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&l>=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(2);function s(u){var c,p;if(u===null||o.isString(u)||o.isNumber(u))return u;if(o.isArray(u)){var l=new Array;try{for(var f=i(u),h=f.next();!h.done;h=f.next()){var v=h.value;l.push(s(v))}}catch(y){c={error:y}}finally{try{h&&!h.done&&(p=f.return)&&p.call(f)}finally{if(c)throw c.error}}return l}if(o.isObject(u)){l=new Map;for(var m in u)if(u.hasOwnProperty(m)){var x=u[m];l.set(m,s(x))}return l}return u}n.parseJSONFromBytes=function(u){var c=o.utf8Decode(u);return JSON.parse.call(void 0,c)},n.serializeJSONToBytes=function(u){var c=JSON.stringify.call(void 0,u);return o.utf8Encode(c)},n.parseJSONIntoInfraValues=function(u){return s(JSON.parse.call(void 0,u))},n.convertAJSONDerivedJavaScriptValueToAnInfraValue=s},function(a,n,r){var i=this&&this.__generator||function(p,l){var f,h,v,m,x={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return m={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function y(d){return function(g){return function(C){if(f)throw new TypeError("Generator is already executing.");for(;x;)try{if(f=1,h&&(v=2&C[0]?h.return:C[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,C[1])).done)return v;switch(h=0,v&&(C=[2&C[0],v.value]),C[0]){case 0:case 1:v=C;break;case 4:return x.label++,{value:C[1],done:!1};case 5:x.label++,h=C[1],C=[0];continue;case 7:C=x.ops.pop(),x.trys.pop();continue;default:if(v=x.trys,!((v=v.length>0&&v[v.length-1])||C[0]!==6&&C[0]!==2)){x=0;continue}if(C[0]===3&&(!v||C[1]>v[0]&&C[1]0)&&!(h=m.next()).done;)x.push(h.value)}catch(y){v={error:y}}finally{try{h&&!h.done&&(f=m.return)&&f.call(m)}finally{if(v)throw v.error}}return x},s=this&&this.__spread||function(){for(var p=[],l=0;l=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(2);n.append=function(p,l){p.push(l)},n.extend=function(p,l){p.push.apply(p,s(l))},n.prepend=function(p,l){p.unshift(l)},n.replace=function(p,l,f){var h,v,m=0;try{for(var x=u(p),y=x.next();!y.done;y=x.next()){var d=y.value;if(c.isFunction(l))l.call(null,d)&&(p[m]=f);else if(d===l)return void(p[m]=f);m++}}catch(g){h={error:g}}finally{try{y&&!y.done&&(v=x.return)&&v.call(x)}finally{if(h)throw h.error}}},n.insert=function(p,l,f){p.splice(f,0,l)},n.remove=function(p,l){for(var f=p.length;f--;){var h=p[f];if(c.isFunction(l))l.call(null,h)&&p.splice(f,1);else if(h===l)return void p.splice(f,1)}},n.empty=function(p){p.length=0},n.contains=function(p,l){var f,h;try{for(var v=u(p),m=v.next();!m.done;m=v.next()){var x=m.value;if(c.isFunction(l)){if(l.call(null,x))return!0}else if(x===l)return!0}}catch(y){f={error:y}}finally{try{m&&!m.done&&(h=v.return)&&h.call(v)}finally{if(f)throw f.error}}return!1},n.size=function(p,l){var f,h;if(l===void 0)return p.length;var v=0;try{for(var m=u(p),x=m.next();!x.done;x=m.next()){var y=x.value;l.call(null,y)&&v++}}catch(d){f={error:d}}finally{try{x&&!x.done&&(h=m.return)&&h.call(m)}finally{if(f)throw f.error}}return v},n.isEmpty=function(p){return p.length===0},n.forEach=function(p,l){var f,h,v,m,x,y;return i(this,function(d){switch(d.label){case 0:return l!==void 0?[3,2]:[5,u(p)];case 1:return d.sent(),[3,9];case 2:d.trys.push([2,7,8,9]),f=u(p),h=f.next(),d.label=3;case 3:return h.done?[3,6]:(v=h.value,l.call(null,v)?[4,v]:[3,5]);case 4:d.sent(),d.label=5;case 5:return h=f.next(),[3,3];case 6:return[3,9];case 7:return m=d.sent(),x={error:m},[3,9];case 8:try{h&&!h.done&&(y=f.return)&&y.call(f)}finally{if(x)throw x.error}return[7];case 9:return[2]}})},n.clone=function(p){return new(Array.bind.apply(Array,s([void 0],p)))},n.sortInAscendingOrder=function(p,l){return p.sort(function(f,h){return l.call(null,f,h)?-1:1})},n.sortInDescendingOrder=function(p,l){return p.sort(function(f,h){return l.call(null,f,h)?1:-1})}},function(a,n,r){var i=this&&this.__generator||function(p,l){var f,h,v,m,x={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return m={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function y(d){return function(g){return function(C){if(f)throw new TypeError("Generator is already executing.");for(;x;)try{if(f=1,h&&(v=2&C[0]?h.return:C[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,C[1])).done)return v;switch(h=0,v&&(C=[2&C[0],v.value]),C[0]){case 0:case 1:v=C;break;case 4:return x.label++,{value:C[1],done:!1};case 5:x.label++,h=C[1],C=[0];continue;case 7:C=x.ops.pop(),x.trys.pop();continue;default:if(v=x.trys,!((v=v.length>0&&v[v.length-1])||C[0]!==6&&C[0]!==2)){x=0;continue}if(C[0]===3&&(!v||C[1]>v[0]&&C[1]=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(p,l){var f=typeof Symbol=="function"&&p[Symbol.iterator];if(!f)return p;var h,v,m=f.call(p),x=[];try{for(;(l===void 0||l-- >0)&&!(h=m.next()).done;)x.push(h.value)}catch(y){v={error:y}}finally{try{h&&!h.done&&(f=m.return)&&f.call(m)}finally{if(v)throw v.error}}return x},u=this&&this.__spread||function(){for(var p=[],l=0;l0&&m[m.length-1])||S[0]!==6&&S[0]!==2)){y=0;continue}if(S[0]===3&&(!m||S[1]>m[0]&&S[1]=l.length&&(l=void 0),{value:l&&l[v++],done:!l}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(l,f){var h=typeof Symbol=="function"&&l[Symbol.iterator];if(!h)return l;var v,m,x=h.call(l),y=[];try{for(;(f===void 0||f-- >0)&&!(v=x.next()).done;)y.push(v.value)}catch(d){m={error:d}}finally{try{v&&!v.done&&(h=x.return)&&h.call(x)}finally{if(m)throw m.error}}return y},u=this&&this.__spread||function(){for(var l=[],f=0;f=y.length&&(y=void 0),{value:y&&y[C++],done:!y}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(96),s=r(147),u=r(146),c=r(2);function p(y,d){for(var g=0;;){var C=g=65&&_<=90?String.fromCodePoint(_+32):w}}catch(E){d={error:E}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(d)throw d.error}}return C}function v(y){return y.replace(/^[\t\n\f\r ]+/,"").replace(/[\t\n\f\r ]+$/,"")}function m(y,d,g){if(!c.isArray(d))return m(y,Array.from(d),g);for(var C="";g.position=97&&_<=122?String.fromCodePoint(_-32):w}}catch(E){d={error:E}}finally{try{T&&!T.done&&(g=S.return)&&g.call(S)}finally{if(d)throw d.error}}return C},n.asciiCaseInsensitiveMatch=function(y,d){return h(y)===h(d)},n.asciiEncode=function(y){return console.assert(f(y),"asciiEncode requires an ASCII string."),l(y)},n.asciiDecode=function(y){var d,g;try{for(var C=i(y),S=C.next();!S.done;S=C.next()){var T=S.value;console.assert(u.isASCIIByte(T),"asciiDecode requires an ASCII byte sequence.")}}catch(w){d={error:w}}finally{try{S&&!S.done&&(g=C.return)&&g.call(C)}finally{if(d)throw d.error}}return s.isomorphicDecode(y)},n.stripNewlines=function(y){return y.replace(/[\n\r]/g,"")},n.normalizeNewlines=function(y){return y.replace(/\r\n/g,` `).replace(/\r/g,` -`)},n.stripLeadingAndTrailingASCIIWhitespace=d,n.stripAndCollapseASCIIWhitespace=function(x){return d(x.replace(/[\t\n\f\r ]{2,}/g," "))},n.collectASequenceOfCodePoints=v,n.skipASCIIWhitespace=m,n.strictlySplit=function x(y,g){if(!l.isArray(y))return x(Array.from(y),g);var C={position:0},S=[],T=v(function(w){return g!==w},y,C);for(S.push(T);C.position=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(97);n.abort_add=function(s,c){c._abortedFlag||c._abortAlgorithms.add(s)},n.abort_remove=function(s,c){c._abortAlgorithms.delete(s)},n.abort_signalAbort=function(s){var c,l;if(!s._abortedFlag){s._abortedFlag=!0;try{for(var p=i(s._abortAlgorithms),u=p.next();!u.done;u=p.next())u.value.call(s)}catch(f){c={error:f}}finally{try{u&&!u.done&&(l=p.return)&&l.call(p)}finally{if(c)throw c.error}}s._abortAlgorithms.clear(),o.event_fireAnEvent("abort",s)}}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(150),o=function(){function s(){}return s.asNode=function(c){if(i.Guard.isNode(c))return c;throw new Error("Invalid object. Node expected.")},s}();n.Cast=o},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function s(){}return Object.defineProperty(s.prototype,"size",{get:function(){return 0},enumerable:!0,configurable:!0}),s.prototype.add=function(c){throw new Error("Cannot add to an empty set.")},s.prototype.clear=function(){},s.prototype.delete=function(c){return!1},s.prototype.forEach=function(c,l){},s.prototype.has=function(c){return!1},s.prototype[Symbol.iterator]=function(){return new o},s.prototype.entries=function(){return new o},s.prototype.keys=function(){return new o},s.prototype.values=function(){return new o},Object.defineProperty(s.prototype,Symbol.toStringTag,{get:function(){return"EmptySet"},enumerable:!0,configurable:!0}),s}();n.EmptySet=i;var o=function(){function s(){}return s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){return{done:!0,value:null}},s}()},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),function(i){i[i.SchemeStart=0]="SchemeStart",i[i.Scheme=1]="Scheme",i[i.NoScheme=2]="NoScheme",i[i.SpecialRelativeOrAuthority=3]="SpecialRelativeOrAuthority",i[i.PathOrAuthority=4]="PathOrAuthority",i[i.Relative=5]="Relative",i[i.RelativeSlash=6]="RelativeSlash",i[i.SpecialAuthoritySlashes=7]="SpecialAuthoritySlashes",i[i.SpecialAuthorityIgnoreSlashes=8]="SpecialAuthorityIgnoreSlashes",i[i.Authority=9]="Authority",i[i.Host=10]="Host",i[i.Hostname=11]="Hostname",i[i.Port=12]="Port",i[i.File=13]="File",i[i.FileSlash=14]="FileSlash",i[i.FileHost=15]="FileHost",i[i.PathStart=16]="PathStart",i[i.Path=17]="Path",i[i.CannotBeABaseURLPath=18]="CannotBeABaseURLPath",i[i.Query=19]="Query",i[i.Fragment=20]="Fragment"}(n.ParserState||(n.ParserState={})),n.OpaqueOrigin=["","",null,null]},function(a,n,r){var i=r(245),o=r(247);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=S,n.resolve=function(T,w){return S(T,!1,!0).resolve(w)},n.resolveObject=function(T,w){return T?S(T,!1,!0).resolveObject(w):w},n.format=function(T){return o.isString(T)&&(T=S(T)),T instanceof s?T.format():s.prototype.format.call(T)},n.Url=s;var c=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),f=["'"].concat(u),h=["%","/","?",";","#"].concat(f),d=["/","?","#"],v=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=r(248);function S(T,w,_){if(T&&o.isObject(T)&&T instanceof s)return T;var E=new s;return E.parse(T,w,_),E}s.prototype.parse=function(T,w,_){if(!o.isString(T))throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var E=T.indexOf("?"),D=E!==-1&&E127?Z+="x":Z+=q[re];if(!Z.match(v)){var ee=K.slice(0,A),F=K.slice(A+1),b=q.match(m);b&&(ee.push(b[1]),F.unshift(b[2])),F.length&&(M="/"+F.join(".")+M),this.hostname=ee.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),H||(this.hostname=i.toASCII(this.hostname));var G=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+G,this.href+=this.host,H&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),M[0]!=="/"&&(M="/"+M))}if(!x[B])for(A=0,Y=f.length;A0)&&_.host.split("@"))&&(_.auth=b.shift(),_.host=_.hostname=b.shift())),_.search=T.search,_.query=T.query,o.isNull(_.pathname)&&o.isNull(_.search)||(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.href=_.format(),_;if(!q.length)return _.pathname=null,_.search?_.path="/"+_.search:_.path=null,_.href=_.format(),_;for(var re=q.slice(-1)[0],ae=(_.host||T.host||q.length>1)&&(re==="."||re==="..")||re==="",ee=0,F=q.length;F>=0;F--)(re=q[F])==="."?q.splice(F,1):re===".."?(q.splice(F,1),ee++):ee&&(q.splice(F,1),ee--);if(!K&&!Y)for(;ee--;ee)q.unshift("..");!K||q[0]===""||q[0]&&q[0].charAt(0)==="/"||q.unshift(""),ae&&q.join("/").substr(-1)!=="/"&&q.push("");var b,G=q[0]===""||q[0]&&q[0].charAt(0)==="/";return Z&&(_.hostname=_.host=G?"":q.length?q.shift():"",(b=!!(_.host&&_.host.indexOf("@")>0)&&_.host.split("@"))&&(_.auth=b.shift(),_.host=_.hostname=b.shift())),(K=K||_.host&&q.length)&&!G&&q.unshift(""),q.length?_.pathname=q.join("/"):(_.pathname=null,_.path=null),o.isNull(_.pathname)&&o.isNull(_.search)||(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.auth=T.auth||_.auth,_.slashes=_.slashes||T.slashes,_.href=_.format(),_},s.prototype.parseHost=function(){var T=this.host,w=l.exec(T);w&&((w=w[0])!==":"&&(this.port=w.substr(1)),T=T.substr(0,T.length-w.length)),T&&(this.hostname=T)}},function(a,n,r){(function(i,o){var s;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(c){n&&n.nodeType,i&&i.nodeType;var l=typeof o=="object"&&o;l.global!==l&&l.window!==l&&l.self;var p,u=2147483647,f=/^xn--/,h=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,x=String.fromCharCode;function y(O){throw new RangeError(v[O])}function g(O,M){for(var N=O.length,R=[];N--;)R[N]=M(O[N]);return R}function C(O,M){var N=O.split("@"),R="";return N.length>1&&(R=N[0]+"@",O=N[1]),R+g((O=O.replace(d,".")).split("."),M).join(".")}function S(O){for(var M,N,R=[],B=0,I=O.length;B=55296&&M<=56319&&B65535&&(N+=x((M-=65536)>>>10&1023|55296),M=56320|1023&M),N+=x(M)}).join("")}function w(O,M){return O+22+75*(O<26)-((M!=0)<<5)}function _(O,M,N){var R=0;for(O=N?m(O/700):O>>1,O+=m(O/M);O>455;R+=36)O=m(O/35);return m(R+36*O/(O+38))}function E(O){var M,N,R,B,I,P,L,k,A,j,H,K=[],Y=O.length,q=0,Z=128,re=72;for((N=O.lastIndexOf("-"))<0&&(N=0),R=0;R=128&&y("not-basic"),K.push(O.charCodeAt(R));for(B=N>0?N+1:0;B=Y&&y("invalid-input"),((k=(H=O.charCodeAt(B++))-48<10?H-22:H-65<26?H-65:H-97<26?H-97:36)>=36||k>m((u-q)/P))&&y("overflow"),q+=k*P,!(k<(A=L<=re?1:L>=re+26?26:L-re));L+=36)P>m(u/(j=36-A))&&y("overflow"),P*=j;re=_(q-I,M=K.length+1,I==0),m(q/M)>u-Z&&y("overflow"),Z+=m(q/M),q%=M,K.splice(q++,0,Z)}return T(K)}function D(O){var M,N,R,B,I,P,L,k,A,j,H,K,Y,q,Z,re=[];for(K=(O=S(O)).length,M=128,N=0,I=72,P=0;P=M&&Hm((u-N)/(Y=R+1))&&y("overflow"),N+=(L-M)*Y,M=L,P=0;Pu&&y("overflow"),H==M){for(k=N,A=36;!(k<(j=A<=I?1:A>=I+26?26:A-I));A+=36)Z=k-j,q=36-j,re.push(x(w(j+Z%q,0))),k=m(Z/q);re.push(x(w(k,0))),I=_(N,Y,R==B),N=0,++R}++N,++M}return re.join("")}p={version:"1.4.1",ucs2:{decode:S,encode:T},decode:E,encode:D,toASCII:function(O){return C(O,function(M){return h.test(M)?"xn--"+D(M):M})},toUnicode:function(O){return C(O,function(M){return f.test(M)?E(M.slice(4).toLowerCase()):M})}},(s=function(){return p}.call(n,r,n,i))===void 0||(i.exports=s)})()}).call(this,r(246)(a),r(78))},function(a,n){a.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(a,n,r){a.exports={isString:function(i){return typeof i=="string"},isObject:function(i){return typeof i=="object"&&i!==null},isNull:function(i){return i===null},isNullOrUndefined:function(i){return i==null}}},function(a,n,r){n.decode=n.parse=r(249),n.encode=n.stringify=r(250)},function(a,n,r){function i(s,c){return Object.prototype.hasOwnProperty.call(s,c)}a.exports=function(s,c,l,p){c=c||"&",l=l||"=";var u={};if(typeof s!="string"||s.length===0)return u;var f=/\+/g;s=s.split(c);var h=1e3;p&&typeof p.maxKeys=="number"&&(h=p.maxKeys);var d=s.length;h>0&&d>h&&(d=h);for(var v=0;v=0?(m=C.substr(0,S),x=C.substr(S+1)):(m=C,x=""),y=decodeURIComponent(m),g=decodeURIComponent(x),i(u,y)?o(u[y])?u[y].push(g):u[y]=[u[y],g]:u[y]=g}return u};var o=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"}},function(a,n,r){var i=function(l){switch(typeof l){case"string":return l;case"boolean":return l?"true":"false";case"number":return isFinite(l)?l:"";default:return""}};a.exports=function(l,p,u,f){return p=p||"&",u=u||"=",l===null&&(l=void 0),typeof l=="object"?s(c(l),function(h){var d=encodeURIComponent(i(h))+u;return o(l[h])?s(l[h],function(v){return d+encodeURIComponent(i(v))}).join(p):d+encodeURIComponent(i(l[h]))}).join(p):f?encodeURIComponent(i(f))+u+encodeURIComponent(i(l)):""};var o=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"};function s(l,p){if(l.map)return l.map(p);for(var u=[],f=0;f=c.length&&(c=void 0),{value:c&&c[u++],done:!c}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(1);function s(c){return o.isBoolean(c)?c:c.capture||!1}n.eventTarget_flatten=s,n.eventTarget_flattenMore=function(c){var l=s(c),p=!1,u=!1;return o.isBoolean(c)||(p=c.once||!1,u=c.passive||!1),[l,u,p]},n.eventTarget_addEventListener=function(c,l){if(l.callback!==null){for(var p=0;p=c.length&&(c=void 0),{value:c&&c[u++],done:!c}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(1),s=r(29);n.parentNode_convertNodesIntoANode=function(c,l){for(var p,u,f=null,h=0;h=w.length&&(w=void 0),{value:w&&w[D++],done:!w}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(w,_){var E=typeof Symbol=="function"&&w[Symbol.iterator];if(!E)return w;var D,O,M=E.call(w),N=[];try{for(;(_===void 0||_-- >0)&&!(D=M.next()).done;)N.push(D.value)}catch(R){O={error:R}}finally{try{D&&!D.done&&(E=M.return)&&E.call(M)}finally{if(O)throw O.error}}return N},s=this&&this.__spread||function(){for(var w=[],_=0;_0;q--){var Z;if(S(Z=Y[q],w)){K=Z;break}}var re,ae,ee=[];try{for(var F=i(k._children),b=F.next();!b.done;b=F.next())if(C(J=b.value,w)){if(p.Guard.isDocumentTypeNode(J))throw new l.HierarchyRequestError;ee.push(J)}}catch(ne){D={error:ne}}finally{try{b&&!b.done&&(O=F.return)&&O.call(F)}finally{if(D)throw D.error}}if(f.tree_isAncestorOf(P,B,!0))re=B,ae=I;else{for(var G=B;G._parent!==null&&!f.tree_isAncestorOf(P,G._parent);)G=G._parent;if(G._parent===null)throw new Error("Parent node is null.");re=G._parent,ae=1+f.tree_index(G)}if(p.Guard.isCharacterDataNode(A))(U=v.node_clone(B))._data=d.characterData_substringData(B,I,f.tree_nodeLength(B)-I),m.mutation_append(U,R),d.characterData_replaceData(B,I,f.tree_nodeLength(B)-I,"");else if(A!==null){var U=v.node_clone(A);m.mutation_append(U,R);var z=T(u.create_range([B,I],[A,f.tree_nodeLength(A)]));m.mutation_append(z,U)}try{for(var W=i(ee),$=W.next();!$.done;$=W.next()){var J=$.value;m.mutation_append(J,R)}}catch(ne){M={error:ne}}finally{try{$&&!$.done&&(N=W.return)&&N.call(W)}finally{if(M)throw M.error}}return p.Guard.isCharacterDataNode(K)?((U=v.node_clone(P))._data=d.characterData_substringData(P,0,L),m.mutation_append(U,R),d.characterData_replaceData(P,0,L,"")):K!==null&&(U=v.node_clone(K),m.mutation_append(U,R),z=T(u.create_range([K,0],[P,L])),m.mutation_append(z,U)),w._start=[re,ae],w._end=[re,ae],R}n.range_collapsed=y,n.range_root=g,n.range_isContained=C,n.range_isPartiallyContained=S,n.range_setTheStart=function(w,_,E){if(p.Guard.isDocumentTypeNode(_))throw new l.InvalidNodeTypeError;if(E>f.tree_nodeLength(_))throw new l.IndexSizeError;var D=[_,E];g(w)===f.tree_rootNode(_)&&h.boundaryPoint_position(D,w._end)!==c.BoundaryPosition.After||(w._end=D),w._start=D},n.range_setTheEnd=function(w,_,E){if(p.Guard.isDocumentTypeNode(_))throw new l.InvalidNodeTypeError;if(E>f.tree_nodeLength(_))throw new l.IndexSizeError;var D=[_,E];g(w)===f.tree_rootNode(_)&&h.boundaryPoint_position(D,w._start)!==c.BoundaryPosition.Before||(w._start=D),w._end=D},n.range_select=function(w,_){var E=w._parent;if(E===null)throw new l.InvalidNodeTypeError;var D=f.tree_index(w);_._start=[E,D],_._end=[E,D+1]},n.range_extract=T,n.range_cloneTheContents=function w(_){var E,D,O,M,N,R,B=u.create_documentFragment(_._startNode._nodeDocument);if(y(_))return B;var I=_._startNode,P=_._startOffset,L=_._endNode,k=_._endOffset;I===L&&p.Guard.isCharacterDataNode(I)&&((b=v.node_clone(I))._data=d.characterData_substringData(I,P,k-P),m.mutation_append(b,B));for(var A=I;!f.tree_isAncestorOf(L,A,!0);){if(A._parent===null)throw new Error("Parent node is null.");A=A._parent}var j=null;if(!f.tree_isAncestorOf(L,I,!0))try{for(var H=i(A._children),K=H.next();!K.done;K=H.next())if(S(re=K.value,_)){j=re;break}}catch($){E={error:$}}finally{try{K&&!K.done&&(D=H.return)&&D.call(H)}finally{if(E)throw E.error}}var Y=null;if(!f.tree_isAncestorOf(I,L,!0))for(var q=s(A._children),Z=q.length-1;Z>0;Z--){var re;if(S(re=q[Z],_)){Y=re;break}}var ae=[];try{for(var ee=i(A._children),F=ee.next();!F.done;F=ee.next())if(C(W=F.value,_)){if(p.Guard.isDocumentTypeNode(W))throw new l.HierarchyRequestError;ae.push(W)}}catch($){O={error:$}}finally{try{F&&!F.done&&(M=ee.return)&&M.call(ee)}finally{if(O)throw O.error}}if(p.Guard.isCharacterDataNode(j))(b=v.node_clone(I))._data=d.characterData_substringData(I,P,f.tree_nodeLength(I)-P),m.mutation_append(b,B);else if(j!==null){var b=v.node_clone(j);m.mutation_append(b,B);var G=w(u.create_range([I,P],[j,f.tree_nodeLength(j)]));m.mutation_append(G,b)}try{for(var U=i(ae),z=U.next();!z.done;z=U.next()){var W=z.value,b=v.node_clone(W);m.mutation_append(b,B)}}catch($){N={error:$}}finally{try{z&&!z.done&&(R=U.return)&&R.call(U)}finally{if(N)throw N.error}}return p.Guard.isCharacterDataNode(Y)?((b=v.node_clone(L))._data=d.characterData_substringData(L,0,k),m.mutation_append(b,B)):Y!==null&&(b=v.node_clone(Y),B.append(b),G=T(u.create_range([Y,0],[L,k])),m.mutation_append(G,b)),B},n.range_insert=function(w,_){var E,D;if(p.Guard.isProcessingInstructionNode(_._startNode)||p.Guard.isCommentNode(_._startNode)||p.Guard.isTextNode(_._startNode)&&_._startNode._parent===null||_._startNode===w)throw new l.HierarchyRequestError;var O,M=null;if(p.Guard.isTextNode(_._startNode))M=_._startNode;else{var N=0;try{for(var R=i(_._startNode._children),B=R.next();!B.done;B=R.next()){var I=B.value;if(N===_._startOffset){M=I;break}N++}}catch(L){E={error:L}}finally{try{B&&!B.done&&(D=R.return)&&D.call(R)}finally{if(E)throw E.error}}}if(M===null)O=_._startNode;else{if(M._parent===null)throw new Error("Parent node is null.");O=M._parent}m.mutation_ensurePreInsertionValidity(w,O,M),p.Guard.isTextNode(_._startNode)&&(M=x.text_split(_._startNode,_._startOffset)),w===M&&(M=w._nextSibling),w._parent!==null&&m.mutation_remove(w,w._parent);var P=M===null?f.tree_nodeLength(O):f.tree_index(M);p.Guard.isDocumentFragmentNode(w)?P+=f.tree_nodeLength(w):P++,m.mutation_preInsert(w,O,M),y(_)&&(_._end=[O,P])},n.range_getContainedNodes=function(w){var _;return(_={})[Symbol.iterator]=function(){var E=w.commonAncestorContainer,D=f.tree_getFirstDescendantNode(E);return{next:function(){for(;D&&!C(D,w);)D=f.tree_getNextDescendantNode(E,D);if(D===null)return{done:!0,value:null};var O={done:!1,value:D};return D=f.tree_getNextDescendantNode(E,D),O}}},_},n.range_getPartiallyContainedNodes=function(w){var _;return(_={})[Symbol.iterator]=function(){var E=w.commonAncestorContainer,D=f.tree_getFirstDescendantNode(E);return{next:function(){for(;D&&!S(D,w);)D=f.tree_getNextDescendantNode(E,D);if(D===null)return{done:!0,value:null};var O={done:!1,value:D};return D=f.tree_getNextDescendantNode(E,D),O}}},_}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(9);n.selectors_scopeMatchASelectorsString=function(o,s){throw new i.NotSupportedError}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(2),o=r(105);n.treeWalker_traverseChildren=function(s,c){for(var l=c?s._current._firstChild:s._current._lastChild;l!==null;){var p=o.traversal_filter(s,l);if(p===i.FilterResult.Accept)return s._current=l,l;if(p===i.FilterResult.Skip){var u=c?l._firstChild:l._lastChild;if(u!==null){l=u;continue}}for(;l!==null;){var f=c?l._nextSibling:l._previousSibling;if(f!==null){l=f;break}var h=l._parent;if(h===null||h===s._root||h===s._current)return null;l=h}}return null},n.treeWalker_traverseSiblings=function(s,c){var l=s._current;if(l===s._root)return null;for(;;){for(var p=c?l._nextSibling:l._previousSibling;p!==null;){l=p;var u=o.traversal_filter(s,l);if(u===i.FilterResult.Accept)return s._current=l,l;p=c?l._firstChild:l._lastChild,u!==i.FilterResult.Reject&&p!==null||(p=c?l._nextSibling:l._previousSibling)}if((l=l._parent)===null||l===s._root||o.traversal_filter(s,l)===i.FilterResult.Accept)return null}}},function(a,n,r){r(89),r(74);var i,o=this&&this.__extends||(i=function(f,h){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,v){d.__proto__=v}||function(d,v){for(var m in v)v.hasOwnProperty(m)&&(d[m]=v[m])})(f,h)},function(f,h){function d(){this.constructor=f}i(f,h),f.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(1),c=r(2),l=r(50),p=r(3),u=function(f){function h(d,v){var m=f.call(this,d)||this;return m._indentation={},m._lengthToLastNewline=0,m._writerOptions=s.applyDefaults(v,{wellFormed:!1,headless:!1,prettyPrint:!1,indent:" ",newline:` -`,offset:0,width:0,allowEmptyTags:!1,indentTextOnlyNodes:!1,spaceBeforeSlash:!1}),m}return o(h,f),h.prototype.serialize=function(d){return this._refs={suppressPretty:!1,emptyNode:!1,markup:""},d.nodeType!==c.NodeType.Document||this._writerOptions.headless||this.declaration(this._builderOptions.version,this._builderOptions.encoding,this._builderOptions.standalone),this.serializeNode(d,this._writerOptions.wellFormed),this._writerOptions.prettyPrint&&this._refs.markup.slice(-this._writerOptions.newline.length)===this._writerOptions.newline&&(this._refs.markup=this._refs.markup.slice(0,-this._writerOptions.newline.length)),this._refs.markup},h.prototype.declaration=function(d,v,m){this._beginLine(),this._refs.markup+='",this._endLine()},h.prototype.docType=function(d,v,m){this._beginLine(),this._refs.markup+=v&&m?"':v?"':m?"':"",this._endLine()},h.prototype.openTagBegin=function(d){this._beginLine(),this._refs.markup+="<"+d},h.prototype.openTagEnd=function(d,v,m){if(this._refs.suppressPretty=!1,this._refs.emptyNode=!1,this._writerOptions.prettyPrint&&!v&&!m){for(var x=!0,y=!0,g=this.currentNode.firstChild,C=0,S=0;g;){if(p.Guard.isExclusiveTextNode(g))S++;else{if(!p.Guard.isCDATASectionNode(g)){x=!1,y=!1;break}C++}g.data!==""&&(y=!1),g=g.nextSibling}this._refs.suppressPretty=!this._writerOptions.indentTextOnlyNodes&&x&&(C<=1&&S===0||C===0),this._refs.emptyNode=y}(m||v||this._refs.emptyNode)&&this._writerOptions.allowEmptyTags?this._refs.markup+=">":this._refs.markup+=m?" />":v||this._refs.emptyNode?this._writerOptions.spaceBeforeSlash?" />":"/>":">",this._endLine()},h.prototype.closeTag=function(d){this._refs.emptyNode||(this._beginLine(),this._refs.markup+=""),this._refs.suppressPretty=!1,this._refs.emptyNode=!1,this._endLine()},h.prototype.attribute=function(d,v){var m=d+'="'+v+'"';this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._refs.markup.length-this._lengthToLastNewline+1+m.length>this._writerOptions.width?(this._endLine(),this._beginLine(),this._refs.markup+=this._indent(1)+m):this._refs.markup+=" "+m},h.prototype.text=function(d){d!==""&&(this._beginLine(),this._refs.markup+=d,this._endLine())},h.prototype.cdata=function(d){d!==""&&(this._beginLine(),this._refs.markup+="",this._endLine())},h.prototype.comment=function(d){this._beginLine(),this._refs.markup+="",this._endLine()},h.prototype.instruction=function(d,v){this._beginLine(),this._refs.markup+="",this._endLine()},h.prototype._beginLine=function(){this._writerOptions.prettyPrint&&!this._refs.suppressPretty&&(this._refs.markup+=this._indent(this._writerOptions.offset+this.level))},h.prototype._endLine=function(){this._writerOptions.prettyPrint&&!this._refs.suppressPretty&&(this._refs.markup+=this._writerOptions.newline,this._lengthToLastNewline=this._refs.markup.length)},h.prototype._indent=function(d){if(d<=0)return"";if(this._indentation[d]!==void 0)return this._indentation[d];var v=this._writerOptions.indent.repeat(d);return this._indentation[d]=v,v},h}(l.BaseWriter);n.XMLWriter=u},function(a,n,r){var i=r(47),o=r(35);a.exports="".repeat||function(s){var c=String(o(this)),l="",p=i(s);if(p<0||p==1/0)throw RangeError("Wrong number of repetitions");for(;p>0;(p>>>=1)&&(c+=c))1&p&&(l+=c);return l}},function(a,n,r){r(31),r(32),r(33),r(19),r(178),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),s=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&u[f],d=0;if(h)return h.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&d>=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(67),l=r(1),p=function(u){function f(h,d){var v=u.call(this,h)||this;return v._writerOptions=l.applyDefaults(d,{wellFormed:!1,prettyPrint:!1,indent:" ",newline:` -`,offset:0,group:!1,verbose:!1}),v}return o(f,u),f.prototype.serialize=function(h){var d=l.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1}),v=new c.ObjectWriter(this._builderOptions,d).serialize(h);return this._beginLine(this._writerOptions,0)+this._convertObject(v,this._writerOptions)},f.prototype._convertObject=function(h,d,v){var m,x,y=this;v===void 0&&(v=0);var g="",C=this._isLeafNode(h);if(l.isArray(h)){g+="[";var S=h.length,T=0;try{for(var w=s(h),_=w.next();!_.done;_=w.next()){var E=_.value;g+=this._endLine(d,v+1)+this._beginLine(d,v+1)+this._convertObject(E,d,v+1),T0?new Array(v).join(h.indent):""},f.prototype._endLine=function(h,d){return h.prettyPrint?h.newline:""},f.prototype._key=function(h){return'"'+h+'":'},f.prototype._val=function(h){return JSON.stringify(h)},f.prototype._isLeafNode=function(h){return this._descendantCount(h)<=1},f.prototype._descendantCount=function(h,d){var v=this;return d===void 0&&(d=0),l.isArray(h)?l.forEachArray(h,function(m){return d+=v._descendantCount(m,d)},this):l.isObject(h)?l.forEachObject(h,function(m,x){return d+=v._descendantCount(x,d)},this):d++,d},f}(r(50).BaseWriter);n.JSONWriter=p},function(a,n,r){r(31),r(32),r(33),r(19),r(178),r(89),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),s=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&u[f],d=0;if(h)return h.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&d>=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(67),l=r(1),p=function(u){function f(h,d){var v=u.call(this,h)||this;if(v._writerOptions=l.applyDefaults(d,{wellFormed:!1,indent:" ",newline:` -`,offset:0,group:!1,verbose:!1}),v._writerOptions.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(v._writerOptions.offset<0)throw new Error("YAML offset should be zero or a positive number.");return v}return o(f,u),f.prototype.serialize=function(h){var d=l.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1}),v=new c.ObjectWriter(this._builderOptions,d).serialize(h),m=this._beginLine(this._writerOptions,0)+"---"+this._endLine(this._writerOptions)+this._convertObject(v,this._writerOptions,0);return m.slice(-this._writerOptions.newline.length)===this._writerOptions.newline&&(m=m.slice(0,-this._writerOptions.newline.length)),m},f.prototype._convertObject=function(h,d,v,m){var x,y,g=this;m===void 0&&(m=!1);var C="";if(l.isArray(h))try{for(var S=s(h),T=S.next();!T.done;T=S.next()){var w=T.value;C+=this._beginLine(d,v,!0),l.isObject(w)?l.isEmpty(w)?C+='""'+this._endLine(d):C+=this._convertObject(w,d,v,!0):C+=this._val(w)+this._endLine(d)}}catch(_){x={error:_}}finally{try{T&&!T.done&&(y=S.return)&&y.call(S)}finally{if(x)throw x.error}}else l.forEachObject(h,function(_,E){m?(C+=g._key(_),m=!1):C+=g._beginLine(d,v)+g._key(_),l.isObject(E)?l.isEmpty(E)?C+=' ""'+g._endLine(d):C+=g._endLine(d)+g._convertObject(E,d,v+1):C+=" "+g._val(E)+g._endLine(d)},this);return C},f.prototype._beginLine=function(h,d,v){v===void 0&&(v=!1);var m=h.offset+d+1,x=new Array(m).join(h.indent);return v?x.substr(0,x.length-2)+"-"+x.substr(-1,1):x},f.prototype._endLine=function(h){return h.newline},f.prototype._key=function(h){return'"'+h+'":'},f.prototype._val=function(h){return JSON.stringify(h)},f}(r(50).BaseWriter);n.YAMLWriter=p},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),r(110).dom.setFeatures(!0);var i=r(110);n.DOMImplementation=i.DOMImplementation;var o=r(271);n.DOMParser=o.DOMParser;var s=r(274);n.XMLSerializer=s.XMLSerializer},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(3),o=r(0),s=function(){function c(){}return c.prototype.before=function(){for(var l=[],p=0;p=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),c=r(7),l=function(){function p(u){this._nodeList=[],this._recordQueue=[],this._callback=u;var f=o.dom.window;c.set.append(f._mutationObservers,this)}return p.prototype.observe=function(u,f){var h,d;if((f=f||{childList:!1,subtree:!1}).attributeOldValue===void 0&&f.attributeFilter===void 0||f.attributes!==void 0||(f.attributes=!0),f.characterDataOldValue!==void 0&&f.characterData===void 0&&(f.characterData=!0),!f.childList&&!f.attributes&&!f.characterData)throw new TypeError;if(f.attributeOldValue&&!f.attributes)throw new TypeError;if(f.attributeFilter!==void 0&&!f.attributes)throw new TypeError;if(f.characterDataOldValue&&!f.characterData)throw new TypeError;var v=!1,m=f,x=function(S){var T,w;if(S.observer===y){v=!0;try{for(var _=(T=void 0,i(y._nodeList)),E=_.next();!E.done;E=_.next()){var D=E.value;c.list.remove(D._registeredObserverList,function(O){return s.Guard.isTransientRegisteredObserver(O)&&O.source===S})}}catch(O){T={error:O}}finally{try{E&&!E.done&&(w=_.return)&&w.call(_)}finally{if(T)throw T.error}}S.options=m}},y=this;try{for(var g=i(u._registeredObserverList),C=g.next();!C.done;C=g.next())x(C.value)}catch(S){h={error:S}}finally{try{C&&!C.done&&(d=g.return)&&d.call(g)}finally{if(h)throw h.error}}v||(u._registeredObserverList.push({observer:this,options:f}),this._nodeList.push(u))},p.prototype.disconnect=function(){var u,f,h=this;try{for(var d=i(this._nodeList),v=d.next();!v.done;v=d.next()){var m=v.value;c.list.remove(m._registeredObserverList,function(x){return x.observer===h})}}catch(x){u={error:x}}finally{try{v&&!v.done&&(f=d.return)&&f.call(d)}finally{if(u)throw u.error}}this._recordQueue=[]},p.prototype.takeRecords=function(){var u=this._recordQueue;return this._recordQueue=[],u},p}();n.MutationObserverImpl=l},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(3),o=function(){function s(){}return Object.defineProperty(s.prototype,"previousElementSibling",{get:function(){for(var c=i.Cast.asNode(this)._previousSibling;c;){if(i.Guard.isElementNode(c))return c;c=c._previousSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"nextElementSibling",{get:function(){for(var c=i.Cast.asNode(this)._nextSibling;c;){if(i.Guard.isElementNode(c))return c;c=c._nextSibling}return null},enumerable:!0,configurable:!0}),s}();n.NonDocumentTypeChildNodeImpl=o},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(3),o=r(0),s=function(){function c(){}return c.prototype.getElementById=function(l){for(var p=o.tree_getFirstDescendantNode(i.Cast.asNode(this),!1,!1,function(u){return i.Guard.isElementNode(u)});p!==null;){if(p._uniqueIdentifier===l)return p;p=o.tree_getNextDescendantNode(i.Cast.asNode(this),p,!1,!1,function(u){return i.Guard.isElementNode(u)})}return null},c}();n.NonElementParentNodeImpl=s},function(a,n,r){var i=this&&this.__values||function(l){var p=typeof Symbol=="function"&&Symbol.iterator,u=p&&l[p],f=0;if(u)return u.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&f>=l.length&&(l=void 0),{value:l&&l[f++],done:!l}}};throw new TypeError(p?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(3),s=r(0),c=function(){function l(){}return Object.defineProperty(l.prototype,"children",{get:function(){return s.create_htmlCollection(o.Cast.asNode(this))},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"firstElementChild",{get:function(){for(var p=o.Cast.asNode(this)._firstChild;p;){if(o.Guard.isElementNode(p))return p;p=p._nextSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"lastElementChild",{get:function(){for(var p=o.Cast.asNode(this)._lastChild;p;){if(o.Guard.isElementNode(p))return p;p=p._previousSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"childElementCount",{get:function(){var p,u,f=0;try{for(var h=i(o.Cast.asNode(this)._children),d=h.next();!d.done;d=h.next()){var v=d.value;o.Guard.isElementNode(v)&&f++}}catch(m){p={error:m}}finally{try{d&&!d.done&&(u=h.return)&&u.call(h)}finally{if(p)throw p.error}}return f},enumerable:!0,configurable:!0}),l.prototype.prepend=function(){for(var p=[],u=0;u0)&&!(m=y.next()).done;)g.push(m.value)}catch(C){x={error:C}}finally{try{m&&!m.done&&(v=y.return)&&v.call(y)}finally{if(x)throw x.error}}return g},o=this&&this.__values||function(h){var d=typeof Symbol=="function"&&Symbol.iterator,v=d&&h[d],m=0;if(v)return v.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&m>=h.length&&(h=void 0),{value:h&&h[m++],done:!h}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=r(180),c=r(111),l=r(7),p=r(0),u=r(69),f=function(){function h(){}return h.prototype.parse=function(d){for(var v,m,x,y,g=new s.XMLStringLexer(d,{skipWhitespaceOnlyText:!0}),C=p.create_document(),S=C,T=g.nextToken();T.type!==c.TokenType.EOF;){switch(T.type){case c.TokenType.Declaration:var w=T;if(w.version!=="1.0")throw new Error("Invalid xml version: "+w.version);break;case c.TokenType.DocType:var _=T;if(!p.xml_isPubidChar(_.pubId))throw new Error("DocType public identifier does not match PubidChar construct.");if(!p.xml_isLegalChar(_.sysId)||_.sysId.indexOf('"')!==-1&&_.sysId.indexOf("'")!==-1)throw new Error("DocType system identifier contains invalid characters.");S.appendChild(C.implementation.createDocumentType(_.name,_.pubId,_.sysId));break;case c.TokenType.CDATA:var E=T;if(!p.xml_isLegalChar(E.data)||E.data.indexOf("]]>")!==-1)throw new Error("CDATA contains invalid characters.");S.appendChild(C.createCDATASection(E.data));break;case c.TokenType.Comment:var D=T;if(!p.xml_isLegalChar(D.data)||D.data.indexOf("--")!==-1||D.data.endsWith("-"))throw new Error("Comment data contains invalid characters.");S.appendChild(C.createComment(D.data));break;case c.TokenType.PI:var O=T;if(O.target.indexOf(":")!==-1||/^xml$/i.test(O.target))throw new Error("Processing instruction target contains invalid characters.");if(!p.xml_isLegalChar(O.data)||O.data.indexOf("?>")!==-1)throw new Error("Processing instruction data contains invalid characters.");S.appendChild(C.createProcessingInstruction(O.target,O.data));break;case c.TokenType.Text:var M=T;if(!p.xml_isLegalChar(M.data))throw new Error("Text data contains invalid characters.");S.appendChild(C.createTextNode(this._decodeText(M.data)));break;case c.TokenType.Element:var N=T,R=i(p.namespace_extractQName(N.name),2),B=R[0],I=R[1];if(I.indexOf(":")!==-1||!p.xml_isName(I))throw new Error("Node local name contains invalid characters.");if(B==="xmlns")throw new Error("An element cannot have the 'xmlns' prefix.");var P=S.lookupNamespaceURI(B),L={};try{for(var k=(v=void 0,o(N.attributes)),A=k.next();!A.done;A=k.next()){var j=i(A.value,2),H=j[0],K=j[1];if(H==="xmlns")P=K;else{var Y=i(p.namespace_extractQName(H),2),q=Y[0],Z=Y[1];q==="xmlns"&&(Z===B&&(P=K),L[Z]=K)}}}catch(z){v={error:z}}finally{try{A&&!A.done&&(m=k.return)&&m.call(k)}finally{if(v)throw v.error}}var re=P!==null?C.createElementNS(P,N.name):C.createElement(N.name);S.appendChild(re);var ae=new u.LocalNameSet;try{for(var ee=(x=void 0,o(N.attributes)),F=ee.next();!F.done;F=ee.next()){var b=i(F.value,2),G=(H=b[0],K=b[1],i(p.namespace_extractQName(H),2)),U=(q=G[0],Z=G[1],null);if(q==="xmlns"||q===null&&Z==="xmlns"?U=l.namespace.XMLNS:(U=re.lookupNamespaceURI(q))!==null&&re.isDefaultNamespace(U)?U=null:U===null&&q!==null&&(U=L[q]||null),ae.has(U,Z))throw new Error("Element contains duplicate attributes.");if(ae.set(U,Z),U===l.namespace.XMLNS&&K===l.namespace.XMLNS)throw new Error("XMLNS namespace is reserved.");if(Z.indexOf(":")!==-1||!p.xml_isName(Z))throw new Error("Attribute local name contains invalid characters.");if(q==="xmlns"&&K==="")throw new Error("Empty XML namespace is not allowed.");U!==null?re.setAttributeNS(U,H,this._decodeAttributeValue(K)):re.setAttribute(H,this._decodeAttributeValue(K))}}catch(z){x={error:z}}finally{try{F&&!F.done&&(y=ee.return)&&y.call(ee)}finally{if(x)throw x.error}}N.selfClosing||(S=re);break;case c.TokenType.ClosingTag:if(T.name!==S.nodeName)throw new Error("Closing tag name does not match opening tag name.");S._parent&&(S=S._parent)}T=g.nextToken()}return C},h.prototype._decodeText=function(d){return d==null?d:d.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},h.prototype._decodeAttributeValue=function(d){return d==null?d:d.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},h}();n.XMLParserImpl=f},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(275);n.XMLSerializer=i.XMLSerializerImpl},function(a,n,r){var i=this&&this.__values||function(h){var d=typeof Symbol=="function"&&Symbol.iterator,v=d&&h[d],m=0;if(v)return v.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&m>=h.length&&(h=void 0),{value:h&&h[m++],done:!h}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(2),s=r(69),c=r(95),l=r(9),p=r(7),u=r(0),f=function(){function h(){}return h.prototype.serializeToString=function(d){return this._xmlSerialization(d,!1)},h.prototype._xmlSerialization=function(d,v){if(d._nodeDocument===void 0||d._nodeDocument._hasNamespaces){var m=new c.NamespacePrefixMap;m.set("xml",p.namespace.XML);try{return this._serializeNodeNS(d,null,m,{value:1},v)}catch{throw new l.InvalidStateError}}else try{return this._serializeNode(d,v)}catch{throw new l.InvalidStateError}},h.prototype._serializeNodeNS=function(d,v,m,x,y){switch(d.nodeType){case o.NodeType.Element:return this._serializeElementNS(d,v,m,x,y);case o.NodeType.Document:return this._serializeDocumentNS(d,v,m,x,y);case o.NodeType.Comment:return this._serializeComment(d,y);case o.NodeType.Text:return this._serializeText(d,y);case o.NodeType.DocumentFragment:return this._serializeDocumentFragmentNS(d,v,m,x,y);case o.NodeType.DocumentType:return this._serializeDocumentType(d,y);case o.NodeType.ProcessingInstruction:return this._serializeProcessingInstruction(d,y);case o.NodeType.CData:return this._serializeCData(d,y);default:throw new Error("Unknown node type: "+d.nodeType)}},h.prototype._serializeNode=function(d,v){switch(d.nodeType){case o.NodeType.Element:return this._serializeElement(d,v);case o.NodeType.Document:return this._serializeDocument(d,v);case o.NodeType.Comment:return this._serializeComment(d,v);case o.NodeType.Text:return this._serializeText(d,v);case o.NodeType.DocumentFragment:return this._serializeDocumentFragment(d,v);case o.NodeType.DocumentType:return this._serializeDocumentType(d,v);case o.NodeType.ProcessingInstruction:return this._serializeProcessingInstruction(d,v);case o.NodeType.CData:return this._serializeCData(d,v);default:throw new Error("Unknown node type: "+d.nodeType)}},h.prototype._serializeElementNS=function(d,v,m,x,y){var g,C;if(y&&(d.localName.indexOf(":")!==-1||!u.xml_isName(d.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var S="<",T="",w=!1,_=!1,E=m.copy(),D={},O=this._recordNamespaceInformation(d,E,D),M=v,N=d.namespaceURI;if(M===N)O!==null&&(_=!0),S+=T=N===p.namespace.XML?"xml:"+d.localName:d.localName;else{var R=d.prefix,B=null;if(R===null&&N===O||(B=E.get(R,N)),R==="xmlns"){if(y)throw new Error("An element cannot have the 'xmlns' prefix (well-formed required).");B=R}B!==null?(T=B+":"+d.localName,O!==null&&O!==p.namespace.XML&&(M=O||null),S+=T):R!==null?(R in D&&(R=this._generatePrefix(N,E,x)),E.set(R,N),S+=T+=R+":"+d.localName,S+=" xmlns:"+R+'="'+this._serializeAttributeValue(N,y)+'"',O!==null&&(M=O||null)):O===null||O!==null&&O!==N?(_=!0,M=N,S+=T+=d.localName,S+=' xmlns="'+this._serializeAttributeValue(N,y)+'"'):(M=N,S+=T+=d.localName)}S+=this._serializeAttributesNS(d,E,x,D,_,y);var I=N===p.namespace.HTML;if(I&&d.childNodes.length===0&&h._VoidElementNames.has(d.localName)?(S+=" /",w=!0):I||d.childNodes.length!==0||(S+="/",w=!0),S+=">",w)return S;if(!(I&&d.localName==="template"))try{for(var P=i(d._children||d.childNodes),L=P.next();!L.done;L=P.next()){var k=L.value;S+=this._serializeNodeNS(k,M,E,x,y)}}catch(A){g={error:A}}finally{try{L&&!L.done&&(C=P.return)&&C.call(P)}finally{if(g)throw g.error}}return S+=""},h.prototype._serializeDocumentNS=function(d,v,m,x,y){var g,C;if(y&&d.documentElement===null)throw new Error("Missing document element (well-formed required).");var S="";try{for(var T=i(d._children||d.childNodes),w=T.next();!w.done;w=T.next()){var _=w.value;S+=this._serializeNodeNS(_,v,m,x,y)}}catch(E){g={error:E}}finally{try{w&&!w.done&&(C=T.return)&&C.call(T)}finally{if(g)throw g.error}}return S},h.prototype._serializeComment=function(d,v){if(v&&(!u.xml_isLegalChar(d.data)||d.data.indexOf("--")!==-1||d.data.endsWith("-")))throw new Error("Comment data contains invalid characters (well-formed required).");return""},h.prototype._serializeText=function(d,v){if(v&&!u.xml_isLegalChar(d.data))throw new Error("Text data contains invalid characters (well-formed required).");for(var m="",x=0;x"?">":y}return m},h.prototype._serializeDocumentFragmentNS=function(d,v,m,x,y){var g,C,S="";try{for(var T=i(d._children||d.childNodes),w=T.next();!w.done;w=T.next()){var _=w.value;S+=this._serializeNodeNS(_,v,m,x,y)}}catch(E){g={error:E}}finally{try{w&&!w.done&&(C=T.return)&&C.call(T)}finally{if(g)throw g.error}}return S},h.prototype._serializeDocumentType=function(d,v){if(v&&!u.xml_isPubidChar(d.publicId))throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");if(v&&(!u.xml_isLegalChar(d.systemId)||d.systemId.indexOf('"')!==-1&&d.systemId.indexOf("'")!==-1))throw new Error("DocType system identifier contains invalid characters (well-formed required).");return d.publicId&&d.systemId?"':d.publicId?"':d.systemId?"':""},h.prototype._serializeProcessingInstruction=function(d,v){if(v&&(d.target.indexOf(":")!==-1||/^xml$/i.test(d.target)))throw new Error("Processing instruction target contains invalid characters (well-formed required).");if(v&&(!u.xml_isLegalChar(d.data)||d.data.indexOf("?>")!==-1))throw new Error("Processing instruction data contains invalid characters (well-formed required).");return""},h.prototype._serializeCData=function(d,v){if(v&&d.data.indexOf("]]>")!==-1)throw new Error("CDATA contains invalid characters (well-formed required).");return""},h.prototype._serializeAttributesNS=function(d,v,m,x,y,g){var C,S,T="",w=g?new s.LocalNameSet:void 0;try{for(var _=i(d.attributes),E=_.next();!E.done;E=_.next()){var D=E.value;if(y||g||D.namespaceURI!==null){if(g&&w&&w.has(D.namespaceURI,D.localName))throw new Error("Element contains duplicate attributes (well-formed required).");g&&w&&w.set(D.namespaceURI,D.localName);var O=D.namespaceURI,M=null;if(O!==null)if(M=v.get(D.prefix,O),O===p.namespace.XMLNS){if(D.value===p.namespace.XML||D.prefix===null&&y||D.prefix!==null&&(!(D.localName in x)||x[D.localName]!==D.value)&&v.has(D.localName,D.value))continue;if(g&&D.value===p.namespace.XMLNS)throw new Error("XMLNS namespace is reserved (well-formed required).");if(g&&D.value==="")throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");D.prefix==="xmlns"&&(M="xmlns")}else M===null&&(T+=" xmlns:"+(M=D.prefix===null||v.hasPrefix(D.prefix)&&!v.has(D.prefix,O)?this._generatePrefix(O,v,m):D.prefix)+'="'+this._serializeAttributeValue(O,g)+'"');if(T+=" ",M!==null&&(T+=M+":"),g&&(D.localName.indexOf(":")!==-1||!u.xml_isName(D.localName)||D.localName==="xmlns"&&O===null))throw new Error("Attribute local name contains invalid characters (well-formed required).");T+=D.localName+'="'+this._serializeAttributeValue(D.value,g)+'"'}else T+=" "+D.localName+'="'+this._serializeAttributeValue(D.value,g)+'"'}}catch(N){C={error:N}}finally{try{E&&!E.done&&(S=_.return)&&S.call(_)}finally{if(C)throw C.error}}return T},h.prototype._recordNamespaceInformation=function(d,v,m){var x,y,g=null;try{for(var C=i(d.attributes),S=C.next();!S.done;S=C.next()){var T=S.value,w=T.namespaceURI,_=T.prefix;if(w===p.namespace.XMLNS){if(_===null){g=T.value;continue}var E=T.localName,D=T.value;if(D===p.namespace.XML||(D===""&&(D=null),v.has(E,D)))continue;v.set(E,D),m[E]=D||""}}}catch(O){x={error:O}}finally{try{S&&!S.done&&(y=C.return)&&y.call(C)}finally{if(x)throw x.error}}return g},h.prototype._generatePrefix=function(d,v,m){var x="ns"+m.value;return m.value++,v.set(x,d),x},h.prototype._serializeAttributeValue=function(d,v){if(v&&d!==null&&!u.xml_isLegalChar(d))throw new Error("Invalid characters in attribute value.");if(d===null)return"";for(var m="",x=0;x"?">":y}return m},h.prototype._serializeElement=function(d,v){var m,x;if(v&&(d.localName.indexOf(":")!==-1||!u.xml_isName(d.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var y=!1,g=d.localName,C="<"+g;if(C+=this._serializeAttributes(d,v),d._children.size===0&&(C+="/",y=!0),C+=">",y)return C;try{for(var S=i(d._children),T=S.next();!T.done;T=S.next()){var w=T.value;C+=this._serializeNode(w,v)}}catch(_){m={error:_}}finally{try{T&&!T.done&&(x=S.return)&&x.call(S)}finally{if(m)throw m.error}}return C+=""},h.prototype._serializeDocument=function(d,v){var m,x;if(v&&d.documentElement===null)throw new Error("Missing document element (well-formed required).");var y="";try{for(var g=i(d._children),C=g.next();!C.done;C=g.next()){var S=C.value;y+=this._serializeNode(S,v)}}catch(T){m={error:T}}finally{try{C&&!C.done&&(x=g.return)&&x.call(g)}finally{if(m)throw m.error}}return y},h.prototype._serializeDocumentFragment=function(d,v){var m,x,y="";try{for(var g=i(d._children),C=g.next();!C.done;C=g.next()){var S=C.value;y+=this._serializeNode(S,v)}}catch(T){m={error:T}}finally{try{C&&!C.done&&(x=g.return)&&x.call(g)}finally{if(m)throw m.error}}return y},h.prototype._serializeAttributes=function(d,v){var m,x,y="",g=v?{}:void 0;try{for(var C=i(d.attributes),S=C.next();!S.done;S=C.next()){var T=S.value;if(v&&g&&T.localName in g)throw new Error("Element contains duplicate attributes (well-formed required).");if(v&&g&&(g[T.localName]=!0),v&&(T.localName.indexOf(":")!==-1||!u.xml_isName(T.localName)))throw new Error("Attribute local name contains invalid characters (well-formed required).");y+=" "+T.localName+'="'+this._serializeAttributeValue(T.value,v)+'"'}}catch(w){m={error:w}}finally{try{S&&!S.done&&(x=C.return)&&x.call(C)}finally{if(m)throw m.error}}return y},h._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),h}();n.XMLSerializerImpl=f},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(277);n.XMLReader=i.XMLReader;var o=r(112);n.ObjectReader=o.ObjectReader;var s=r(280);n.JSONReader=s.JSONReader;var c=r(281);n.YAMLReader=c.YAMLReader},function(a,n,r){r(31),r(32),r(33),r(19),r(65),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(d,v){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,x){m.__proto__=x}||function(m,x){for(var y in x)x.hasOwnProperty(y)&&(m[y]=x[y])})(d,v)},function(d,v){function m(){this.constructor=d}i(d,v),d.prototype=v===null?Object.create(v):(m.prototype=v.prototype,new m)}),s=this&&this.__read||function(d,v){var m=typeof Symbol=="function"&&d[Symbol.iterator];if(!m)return d;var x,y,g=m.call(d),C=[];try{for(;(v===void 0||v-- >0)&&!(x=g.next()).done;)C.push(x.value)}catch(S){y={error:S}}finally{try{x&&!x.done&&(m=g.return)&&m.call(g)}finally{if(y)throw y.error}}return C},c=this&&this.__values||function(d){var v=typeof Symbol=="function"&&Symbol.iterator,m=v&&d[v],x=0;if(m)return m.call(d);if(d&&typeof d.length=="number")return{next:function(){return d&&x>=d.length&&(d=void 0),{value:d&&d[x++],done:!d}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var l=r(180),p=r(111),u=r(7),f=r(0),h=function(d){function v(){return d!==null&&d.apply(this,arguments)||this}return o(v,d),v.prototype._parse=function(m,x){for(var y,g,C,S,T=new l.XMLStringLexer(x,{skipWhitespaceOnlyText:!0}),w=m,_=m,E=T.nextToken();E.type!==p.TokenType.EOF;){switch(E.type){case p.TokenType.Declaration:var D=E,O=this.sanitize(D.version);if(O!=="1.0")throw new Error("Invalid xml version: "+O);var M={version:O};D.encoding&&(M.encoding=this.sanitize(D.encoding)),D.standalone&&(M.standalone=this.sanitize(D.standalone)==="yes"),_.set(M);break;case p.TokenType.DocType:var N=E;_=this.docType(_,this.sanitize(N.name),this.sanitize(N.pubId),this.sanitize(N.sysId))||_;break;case p.TokenType.CDATA:var R=E;_=this.cdata(_,this.sanitize(R.data))||_;break;case p.TokenType.Comment:var B=E;_=this.comment(_,this.sanitize(B.data))||_;break;case p.TokenType.PI:var I=E;_=this.instruction(_,this.sanitize(I.target),this.sanitize(I.data))||_;break;case p.TokenType.Text:var P=E;_=this.text(_,this._decodeText(this.sanitize(P.data)))||_;break;case p.TokenType.Element:var L=E,k=this.sanitize(L.name),A=s(f.namespace_extractQName(k),1)[0],j=_.node.lookupNamespaceURI(A),H={};try{for(var K=(y=void 0,c(L.attributes)),Y=K.next();!Y.done;Y=K.next()){var q=s(Y.value,2),Z=q[0],re=q[1];if(Z=this.sanitize(Z),re=this.sanitize(re),Z==="xmlns")j=re;else{var ae=s(f.namespace_extractQName(Z),2),ee=ae[0],F=ae[1];ee==="xmlns"&&(F===A&&(j=re),H[F]=re)}}}catch(J){y={error:J}}finally{try{Y&&!Y.done&&(g=K.return)&&g.call(K)}finally{if(y)throw y.error}}var b=j!==null?this.element(_,j,k):this.element(_,void 0,k);if(b===void 0)break;_.node===m.node&&(w=b);try{for(var G=(C=void 0,c(L.attributes)),U=G.next();!U.done;U=G.next()){var z=s(U.value,2);Z=z[0],re=z[1],Z=this.sanitize(Z),re=this.sanitize(re);var W=s(f.namespace_extractQName(Z),2),$=(ee=W[0],F=W[1],null);ee==="xmlns"||ee===null&&F==="xmlns"?$=u.namespace.XMLNS:($=b.node.lookupNamespaceURI(ee))!==null&&b.node.isDefaultNamespace($)?$=null:$===null&&ee!==null&&($=H[ee]||null),$!==null?this.attribute(b,$,Z,this._decodeAttributeValue(re)):this.attribute(b,void 0,Z,this._decodeAttributeValue(re))}}catch(J){C={error:J}}finally{try{U&&!U.done&&(S=G.return)&&S.call(G)}finally{if(C)throw C.error}}L.selfClosing||(_=b);break;case p.TokenType.ClosingTag:_.node.parentNode&&(_=_.up())}E=T.nextToken()}return w},v}(r(75).BaseReader);n.XMLReader=h},function(a,n,r){var i=r(4),o=r(279);i({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(a,n,r){var i=r(16),o=r(8),s=r(61),c=r(85),l=r(79),p=r(27),u=r(41),f=Object.assign,h=Object.defineProperty;a.exports=!f||o(function(){if(i&&f({b:1},f(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var d={},v={},m=Symbol();return d[m]=7,"abcdefghijklmnopqrst".split("").forEach(function(x){v[x]=x}),f({},d)[m]!=7||s(f({},v)).join("")!="abcdefghijklmnopqrst"})?function(d,v){for(var m=p(d),x=arguments.length,y=1,g=c.f,C=l.f;x>y;)for(var S,T=u(arguments[y++]),w=g?s(T).concat(g(T)):s(T),_=w.length,E=0;_>E;)S=w[E++],i&&!C.call(T,S)||(m[S]=T[S]);return m}:f},function(a,n,r){var i,o=this&&this.__extends||(i=function(l,p){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var h in f)f.hasOwnProperty(h)&&(u[h]=f[h])})(l,p)},function(l,p){function u(){this.constructor=l}i(l,p),l.prototype=p===null?Object.create(p):(u.prototype=p.prototype,new u)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(112),c=function(l){function p(){return l!==null&&l.apply(this,arguments)||this}return o(p,l),p.prototype._parse=function(u,f){return new s.ObjectReader(this._builderOptions).parse(u,JSON.parse(f))},p}(r(75).BaseReader);n.JSONReader=c},function(a,n,r){var i,o=this&&this.__extends||(i=function(u,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var v in d)d.hasOwnProperty(v)&&(h[v]=d[v])})(u,f)},function(u,f){function h(){this.constructor=u}i(u,f),u.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(112),c=r(75),l=r(282),p=function(u){function f(){return u!==null&&u.apply(this,arguments)||this}return o(f,u),f.prototype._parse=function(h,d){var v=l.safeLoad(d);if(v===void 0)throw new Error("Unable to parse YAML document.");return new s.ObjectReader(this._builderOptions).parse(h,v)},f}(c.BaseReader);n.YAMLReader=p},function(a,n,r){var i=r(283);a.exports=i},function(a,n,r){var i=r(284),o=r(303);function s(c){return function(){throw new Error("Function "+c+" is deprecated and cannot be used.")}}a.exports.Type=r(10),a.exports.Schema=r(39),a.exports.FAILSAFE_SCHEMA=r(113),a.exports.JSON_SCHEMA=r(182),a.exports.CORE_SCHEMA=r(181),a.exports.DEFAULT_SAFE_SCHEMA=r(54),a.exports.DEFAULT_FULL_SCHEMA=r(76),a.exports.load=i.load,a.exports.loadAll=i.loadAll,a.exports.safeLoad=i.safeLoad,a.exports.safeLoadAll=i.safeLoadAll,a.exports.dump=o.dump,a.exports.safeDump=o.safeDump,a.exports.YAMLException=r(53),a.exports.MINIMAL_SCHEMA=r(113),a.exports.SAFE_SCHEMA=r(54),a.exports.DEFAULT_SCHEMA=r(76),a.exports.scan=s("scan"),a.exports.parse=s("parse"),a.exports.compose=s("compose"),a.exports.addConstructor=s("addConstructor")},function(a,n,r){var i=r(38),o=r(53),s=r(285),c=r(54),l=r(76),p=Object.prototype.hasOwnProperty,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,h=/[,\[\]\{\}]/,d=/^(?:!|!!|![a-z\-]+!)$/i,v=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function m(b){return Object.prototype.toString.call(b)}function x(b){return b===10||b===13}function y(b){return b===9||b===32}function g(b){return b===9||b===32||b===10||b===13}function C(b){return b===44||b===91||b===93||b===123||b===125}function S(b){var G;return 48<=b&&b<=57?b-48:97<=(G=32|b)&&G<=102?G-97+10:-1}function T(b){return b===48?"\0":b===97?"\x07":b===98?"\b":b===116||b===9?" ":b===110?` -`:b===118?"\v":b===102?"\f":b===114?"\r":b===101?"\x1B":b===32?" ":b===34?'"':b===47?"/":b===92?"\\":b===78?"…":b===95?" ":b===76?"\u2028":b===80?"\u2029":""}function w(b){return b<=65535?String.fromCharCode(b):String.fromCharCode(55296+(b-65536>>10),56320+(b-65536&1023))}for(var _=new Array(256),E=new Array(256),D=0;D<256;D++)_[D]=T(D)?1:0,E[D]=T(D);function O(b,G){this.input=b,this.filename=G.filename||null,this.schema=G.schema||l,this.onWarning=G.onWarning||null,this.legacy=G.legacy||!1,this.json=G.json||!1,this.listener=G.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=b.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function M(b,G){return new o(G,new s(b.filename,b.input,b.position,b.line,b.position-b.lineStart))}function N(b,G){throw M(b,G)}function R(b,G){b.onWarning&&b.onWarning.call(null,M(b,G))}var B={YAML:function(b,G,U){var z,W,$;b.version!==null&&N(b,"duplication of %YAML directive"),U.length!==1&&N(b,"YAML directive accepts exactly one argument"),(z=/^([0-9]+)\.([0-9]+)$/.exec(U[0]))===null&&N(b,"ill-formed argument of the YAML directive"),W=parseInt(z[1],10),$=parseInt(z[2],10),W!==1&&N(b,"unacceptable YAML version of the document"),b.version=U[0],b.checkLineBreaks=$<2,$!==1&&$!==2&&R(b,"unsupported YAML version of the document")},TAG:function(b,G,U){var z,W;U.length!==2&&N(b,"TAG directive accepts exactly two arguments"),z=U[0],W=U[1],d.test(z)||N(b,"ill-formed tag handle (first argument) of the TAG directive"),p.call(b.tagMap,z)&&N(b,'there is a previously declared suffix for "'+z+'" tag handle'),v.test(W)||N(b,"ill-formed tag prefix (second argument) of the TAG directive"),b.tagMap[z]=W}};function I(b,G,U,z){var W,$,J,ne;if(G1&&(b.result+=i.repeat(` -`,G-1))}function K(b,G){var U,z,W=b.tag,$=b.anchor,J=[],ne=!1;for(b.anchor!==null&&(b.anchorMap[b.anchor]=J),z=b.input.charCodeAt(b.position);z!==0&&z===45&&g(b.input.charCodeAt(b.position+1));)if(ne=!0,b.position++,A(b,!0,-1)&&b.lineIndent<=G)J.push(null),z=b.input.charCodeAt(b.position);else if(U=b.line,Z(b,G,3,!1,!0),J.push(b.result),A(b,!0,-1),z=b.input.charCodeAt(b.position),(b.line===U||b.lineIndent>G)&&z!==0)N(b,"bad indentation of a sequence entry");else if(b.lineIndentG?Le=1:b.lineIndent===G?Le=0:b.lineIndentG?Le=1:b.lineIndent===G?Le=0:b.lineIndentDe)&&(Z(X,De,4,!0,te)&&(at?Tt=X.result:Ft=X.result),at||(L(X,Se,Be,Ie,Tt,Ft,ce,he),Ie=Tt=Ft=null),A(X,!0,-1),fe=X.input.charCodeAt(X.position)),X.lineIndent>De&&fe!==0)N(X,"bad indentation of a mapping entry");else if(X.lineIndent=0))break;te===0?N(X,"bad explicit indentation width of a block scalar; it cannot be less than one"):Ae?N(X,"repeat of an indentation width identifier"):(Se=De+te-1,Ae=!0)}if(y(ce)){do ce=X.input.charCodeAt(++X.position);while(y(ce));if(ce===35)do ce=X.input.charCodeAt(++X.position);while(!x(ce)&&ce!==0)}for(;ce!==0;){for(k(X),X.lineIndent=0,ce=X.input.charCodeAt(X.position);(!Ae||X.lineIndentSe&&(Se=X.lineIndent),x(ce))Be++;else{if(X.lineIndent0){for(te=he,ce=0;te>0;te--)(he=S(fe=X.input.charCodeAt(++X.position)))>=0?ce=(ce<<4)+he:N(X,"expected hexadecimal character");X.result+=w(ce),X.position++}else N(X,"unknown escape sequence");Oe=de=X.position}else x(fe)?(I(X,Oe,de,!0),H(X,A(X,!1,De)),Oe=de=X.position):X.position===X.lineStart&&j(X)?N(X,"unexpected end of the document within a double quoted scalar"):(X.position++,de=X.position)}N(X,"unexpected end of the stream within a double quoted scalar")}(b,ye)?tt=!0:function(X){var De,Oe,de;if((de=X.input.charCodeAt(X.position))!==42)return!1;for(de=X.input.charCodeAt(++X.position),De=X.position;de!==0&&!g(de)&&!C(de);)de=X.input.charCodeAt(++X.position);return X.position===De&&N(X,"name of an alias node must contain at least one character"),Oe=X.input.slice(De,X.position),X.anchorMap.hasOwnProperty(Oe)||N(X,'unidentified alias "'+Oe+'"'),X.result=X.anchorMap[Oe],A(X,!0,-1),!0}(b)?(tt=!0,b.tag===null&&b.anchor===null||N(b,"alias node should not have any properties")):function(X,De,Oe){var de,te,ce,he,fe,ve,Ae,Se,Be=X.kind,Ie=X.result;if(g(Se=X.input.charCodeAt(X.position))||C(Se)||Se===35||Se===38||Se===42||Se===33||Se===124||Se===62||Se===39||Se===34||Se===37||Se===64||Se===96||(Se===63||Se===45)&&(g(de=X.input.charCodeAt(X.position+1))||Oe&&C(de)))return!1;for(X.kind="scalar",X.result="",te=ce=X.position,he=!1;Se!==0;){if(Se===58){if(g(de=X.input.charCodeAt(X.position+1))||Oe&&C(de))break}else if(Se===35){if(g(X.input.charCodeAt(X.position-1)))break}else{if(X.position===X.lineStart&&j(X)||Oe&&C(Se))break;if(x(Se)){if(fe=X.line,ve=X.lineStart,Ae=X.lineIndent,A(X,!1,-1),X.lineIndent>=De){he=!0,Se=X.input.charCodeAt(X.position);continue}X.position=ce,X.line=fe,X.lineStart=ve,X.lineIndent=Ae;break}}he&&(I(X,te,ce,!1),H(X,X.line-fe),te=ce=X.position,he=!1),y(Se)||(ce=X.position+1),Se=X.input.charCodeAt(++X.position)}return I(X,te,ce,!1),!!X.result||(X.kind=Be,X.result=Ie,!1)}(b,ye,U===1)&&(tt=!0,b.tag===null&&(b.tag="?")),b.anchor!==null&&(b.anchorMap[b.anchor]=b.result)):Le===0&&(tt=ne&&K(b,je))),b.tag!==null&&b.tag!=="!")if(b.tag==="?"){for(b.result!==null&&b.kind!=="scalar"&&N(b,'unacceptable node kind for ! tag; it should be "scalar", not "'+b.kind+'"'),oe=0,ue=b.implicitTypes.length;oe tag; it should be "'+Ce.kind+'", not "'+b.kind+'"'),Ce.resolve(b.result)?(b.result=Ce.construct(b.result),b.anchor!==null&&(b.anchorMap[b.anchor]=b.result)):N(b,"cannot resolve a node with !<"+b.tag+"> explicit tag")):N(b,"unknown tag !<"+b.tag+">");return b.listener!==null&&b.listener("close",b),b.tag!==null||b.anchor!==null||tt}function re(b){var G,U,z,W,$=b.position,J=!1;for(b.version=null,b.checkLineBreaks=b.legacy,b.tagMap={},b.anchorMap={};(W=b.input.charCodeAt(b.position))!==0&&(A(b,!0,-1),W=b.input.charCodeAt(b.position),!(b.lineIndent>0||W!==37));){for(J=!0,W=b.input.charCodeAt(++b.position),G=b.position;W!==0&&!g(W);)W=b.input.charCodeAt(++b.position);for(z=[],(U=b.input.slice(G,b.position)).length<1&&N(b,"directive name must not be less than one character in length");W!==0;){for(;y(W);)W=b.input.charCodeAt(++b.position);if(W===35){do W=b.input.charCodeAt(++b.position);while(W!==0&&!x(W));break}if(x(W))break;for(G=b.position;W!==0&&!g(W);)W=b.input.charCodeAt(++b.position);z.push(b.input.slice(G,b.position))}W!==0&&k(b),p.call(B,U)?B[U](b,U,z):R(b,'unknown document directive "'+U+'"')}A(b,!0,-1),b.lineIndent===0&&b.input.charCodeAt(b.position)===45&&b.input.charCodeAt(b.position+1)===45&&b.input.charCodeAt(b.position+2)===45?(b.position+=3,A(b,!0,-1)):J&&N(b,"directives end mark is expected"),Z(b,b.lineIndent-1,4,!1,!0),A(b,!0,-1),b.checkLineBreaks&&f.test(b.input.slice($,b.position))&&R(b,"non-ASCII line breaks are interpreted as content"),b.documents.push(b.result),b.position===b.lineStart&&j(b)?b.input.charCodeAt(b.position)===46&&(b.position+=3,A(b,!0,-1)):b.position0&&`\0 -…\u2028\u2029`.indexOf(this.buffer.charAt(p-1))===-1;)if(p-=1,this.position-p>c/2-1){l=" ... ",p+=5;break}for(u="",f=this.position;fc/2-1){u=" ... ",f-=5;break}return h=this.buffer.slice(p,f),i.repeat(" ",s)+l+h+u+` -`+i.repeat(" ",s+this.position-p+l.length)+"^"},o.prototype.toString=function(s){var c,l="";return this.name&&(l+='in "'+this.name+'" '),l+="at line "+(this.line+1)+", column "+(this.column+1),s||(c=this.getSnippet())&&(l+=`: -`+c),l},a.exports=o},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(o){return o!==null?o:""}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(o){return o!==null?o:[]}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(o){return o!==null?o:{}}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(o){if(o===null)return!0;var s=o.length;return s===1&&o==="~"||s===4&&(o==="null"||o==="Null"||o==="NULL")},construct:function(){return null},predicate:function(o){return o===null},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(o){if(o===null)return!1;var s=o.length;return s===4&&(o==="true"||o==="True"||o==="TRUE")||s===5&&(o==="false"||o==="False"||o==="FALSE")},construct:function(o){return o==="true"||o==="True"||o==="TRUE"},predicate:function(o){return Object.prototype.toString.call(o)==="[object Boolean]"},represent:{lowercase:function(o){return o?"true":"false"},uppercase:function(o){return o?"TRUE":"FALSE"},camelcase:function(o){return o?"True":"False"}},defaultStyle:"lowercase"})},function(a,n,r){var i=r(38),o=r(10);function s(l){return 48<=l&&l<=55}function c(l){return 48<=l&&l<=57}a.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(l){if(l===null)return!1;var p,u,f=l.length,h=0,d=!1;if(!f)return!1;if((p=l[h])!=="-"&&p!=="+"||(p=l[++h]),p==="0"){if(h+1===f)return!0;if((p=l[++h])==="b"){for(h++;h=0?"0b"+l.toString(2):"-0b"+l.toString(2).slice(1)},octal:function(l){return l>=0?"0"+l.toString(8):"-0"+l.toString(8).slice(1)},decimal:function(l){return l.toString(10)},hexadecimal:function(l){return l>=0?"0x"+l.toString(16).toUpperCase():"-0x"+l.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(a,n,r){var i=r(38),o=r(10),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),c=/^[-+]?[0-9]+e/;a.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(l){return l!==null&&!(!s.test(l)||l[l.length-1]==="_")},construct:function(l){var p,u,f,h;return u=(p=l.replace(/_/g,"").toLowerCase())[0]==="-"?-1:1,h=[],"+-".indexOf(p[0])>=0&&(p=p.slice(1)),p===".inf"?u===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:p===".nan"?NaN:p.indexOf(":")>=0?(p.split(":").forEach(function(d){h.unshift(parseFloat(d,10))}),p=0,f=1,h.forEach(function(d){p+=d*f,f*=60}),u*p):u*parseFloat(p,10)},predicate:function(l){return Object.prototype.toString.call(l)==="[object Number]"&&(l%1!=0||i.isNegativeZero(l))},represent:function(l,p){var u;if(isNaN(l))switch(p){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===l)switch(p){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===l)switch(p){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(l))return"-0.0";return u=l.toString(10),c.test(u)?u.replace("e",".e"):u},defaultStyle:"lowercase"})},function(a,n,r){var i=r(10),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a.exports=new i("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(c){return c!==null&&(o.exec(c)!==null||s.exec(c)!==null)},construct:function(c){var l,p,u,f,h,d,v,m,x=0,y=null;if((l=o.exec(c))===null&&(l=s.exec(c)),l===null)throw new Error("Date resolve error");if(p=+l[1],u=+l[2]-1,f=+l[3],!l[4])return new Date(Date.UTC(p,u,f));if(h=+l[4],d=+l[5],v=+l[6],l[7]){for(x=l[7].slice(0,3);x.length<3;)x+="0";x=+x}return l[9]&&(y=6e4*(60*+l[10]+ +(l[11]||0)),l[9]==="-"&&(y=-y)),m=new Date(Date.UTC(p,u,f,h,d,v,x)),y&&m.setTime(m.getTime()-y),m},instanceOf:Date,represent:function(c){return c.toISOString()}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(o){return o==="<<"||o===null}})},function(a,n,r){var i;try{i=r(145).Buffer}catch{}var o=r(10),s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;a.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(c){if(c===null)return!1;var l,p,u=0,f=c.length,h=s;for(p=0;p64)){if(l<0)return!1;u+=6}return u%8==0},construct:function(c){var l,p,u=c.replace(/[\r\n=]/g,""),f=u.length,h=s,d=0,v=[];for(l=0;l>16&255),v.push(d>>8&255),v.push(255&d)),d=d<<6|h.indexOf(u.charAt(l));return(p=f%4*6)===0?(v.push(d>>16&255),v.push(d>>8&255),v.push(255&d)):p===18?(v.push(d>>10&255),v.push(d>>2&255)):p===12&&v.push(d>>4&255),i?i.from?i.from(v):new i(v):v},predicate:function(c){return i&&i.isBuffer(c)},represent:function(c){var l,p,u="",f=0,h=c.length,d=s;for(l=0;l>18&63],u+=d[f>>12&63],u+=d[f>>6&63],u+=d[63&f]),f=(f<<8)+c[l];return(p=h%3)===0?(u+=d[f>>18&63],u+=d[f>>12&63],u+=d[f>>6&63],u+=d[63&f]):p===2?(u+=d[f>>10&63],u+=d[f>>4&63],u+=d[f<<2&63],u+=d[64]):p===1&&(u+=d[f>>2&63],u+=d[f<<4&63],u+=d[64],u+=d[64]),u}})},function(a,n,r){var i=r(10),o=Object.prototype.hasOwnProperty,s=Object.prototype.toString;a.exports=new i("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(c){if(c===null)return!0;var l,p,u,f,h,d=[],v=c;for(l=0,p=v.length;l3||s[s.length-l.length-1]!=="/"))},construct:function(o){var s=o,c=/\/([gim]*)$/.exec(o),l="";return s[0]==="/"&&(c&&(l=c[1]),s=s.slice(1,s.length-l.length-1)),new RegExp(s,l)},predicate:function(o){return Object.prototype.toString.call(o)==="[object RegExp]"},represent:function(o){var s="/"+o.source+"/";return o.global&&(s+="g"),o.multiline&&(s+="m"),o.ignoreCase&&(s+="i"),s}})},function(a,n,r){var i;try{i=r(302)}catch{typeof window<"u"&&(i=window.esprima)}var o=r(10);a.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(s){if(s===null)return!1;try{var c="("+s+")",l=i.parse(c,{range:!0});return l.type==="Program"&&l.body.length===1&&l.body[0].type==="ExpressionStatement"&&(l.body[0].expression.type==="ArrowFunctionExpression"||l.body[0].expression.type==="FunctionExpression")}catch{return!1}},construct:function(s){var c,l="("+s+")",p=i.parse(l,{range:!0}),u=[];if(p.type!=="Program"||p.body.length!==1||p.body[0].type!=="ExpressionStatement"||p.body[0].expression.type!=="ArrowFunctionExpression"&&p.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return p.body[0].expression.params.forEach(function(f){u.push(f.name)}),c=p.body[0].expression.body.range,p.body[0].expression.body.type==="BlockStatement"?new Function(u,l.slice(c[0]+1,c[1]-1)):new Function(u,"return "+l.slice(c[0],c[1]))},predicate:function(s){return Object.prototype.toString.call(s)==="[object Function]"},represent:function(s){return s.toString()}})},function(a,n,r){var i;i=function(){return function(o){var s={};function c(l){if(s[l])return s[l].exports;var p=s[l]={exports:{},id:l,loaded:!1};return o[l].call(p.exports,p,p.exports,c),p.loaded=!0,p.exports}return c.m=o,c.c=s,c.p="",c(0)}([function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(1),p=c(3),u=c(8),f=c(15);function h(v,m,x){var y=null,g=function(D,O){x&&x(D,O),y&&y.visit(D,O)},C=typeof x=="function"?g:null,S=!1;if(m){S=typeof m.comment=="boolean"&&m.comment;var T=typeof m.attachComment=="boolean"&&m.attachComment;(S||T)&&((y=new l.CommentHandler).attach=T,m.comment=!0,C=g)}var w,_=!1;m&&typeof m.sourceType=="string"&&(_=m.sourceType==="module"),w=m&&typeof m.jsx=="boolean"&&m.jsx?new p.JSXParser(v,m,C):new u.Parser(v,m,C);var E=_?w.parseModule():w.parseScript();return S&&y&&(E.comments=y.comments),w.config.tokens&&(E.tokens=w.tokens),w.config.tolerant&&(E.errors=w.errorHandler.errors),E}s.parse=h,s.parseModule=function(v,m,x){var y=m||{};return y.sourceType="module",h(v,y,x)},s.parseScript=function(v,m,x){var y=m||{};return y.sourceType="script",h(v,y,x)},s.tokenize=function(v,m,x){var y,g=new f.Tokenizer(v,m);y=[];try{for(;;){var C=g.getNextToken();if(!C)break;x&&(C=x(C)),y.push(C)}}catch(S){g.errorHandler.tolerate(S)}return g.errorHandler.tolerant&&(y.errors=g.errors()),y};var d=c(2);s.Syntax=d.Syntax,s.version="4.0.1"},function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(2),p=function(){function u(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return u.prototype.insertInnerComments=function(f,h){if(f.type===l.Syntax.BlockStatement&&f.body.length===0){for(var d=[],v=this.leading.length-1;v>=0;--v){var m=this.leading[v];h.end.offset>=m.start&&(d.unshift(m.comment),this.leading.splice(v,1),this.trailing.splice(v,1))}d.length&&(f.innerComments=d)}},u.prototype.findTrailingComments=function(f){var h=[];if(this.trailing.length>0){for(var d=this.trailing.length-1;d>=0;--d){var v=this.trailing[d];v.start>=f.end.offset&&h.unshift(v.comment)}return this.trailing.length=0,h}var m=this.stack[this.stack.length-1];if(m&&m.node.trailingComments){var x=m.node.trailingComments[0];x&&x.range[0]>=f.end.offset&&(h=m.node.trailingComments,delete m.node.trailingComments)}return h},u.prototype.findLeadingComments=function(f){for(var h,d=[];this.stack.length>0&&(x=this.stack[this.stack.length-1])&&x.start>=f.start.offset;)h=x.node,this.stack.pop();if(h){for(var v=(h.leadingComments?h.leadingComments.length:0)-1;v>=0;--v){var m=h.leadingComments[v];m.range[1]<=f.start.offset&&(d.unshift(m),h.leadingComments.splice(v,1))}return h.leadingComments&&h.leadingComments.length===0&&delete h.leadingComments,d}for(v=this.leading.length-1;v>=0;--v){var x;(x=this.leading[v]).start<=f.start.offset&&(d.unshift(x.comment),this.leading.splice(v,1))}return d},u.prototype.visitNode=function(f,h){if(!(f.type===l.Syntax.Program&&f.body.length>0)){this.insertInnerComments(f,h);var d=this.findTrailingComments(h),v=this.findLeadingComments(h);v.length>0&&(f.leadingComments=v),d.length>0&&(f.trailingComments=d),this.stack.push({node:f,start:h.start.offset})}},u.prototype.visitComment=function(f,h){var d=f.type[0]==="L"?"Line":"Block",v={type:d,value:f.value};if(f.range&&(v.range=f.range),f.loc&&(v.loc=f.loc),this.comments.push(v),this.attach){var m={comment:{type:d,value:f.value,range:[h.start.offset,h.end.offset]},start:h.start.offset};f.loc&&(m.comment.loc=f.loc),f.type=d,this.leading.push(m),this.trailing.push(m)}},u.prototype.visit=function(f,h){f.type==="LineComment"||f.type==="BlockComment"?this.visitComment(f,h):this.attach&&this.visitNode(f,h)},u}();s.CommentHandler=p},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(o,s,c){var l,p=this&&this.__extends||(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,S){C.__proto__=S}||function(C,S){for(var T in S)S.hasOwnProperty(T)&&(C[T]=S[T])},function(C,S){function T(){this.constructor=C}l(C,S),C.prototype=S===null?Object.create(S):(T.prototype=S.prototype,new T)});Object.defineProperty(s,"__esModule",{value:!0});var u=c(4),f=c(5),h=c(6),d=c(7),v=c(8),m=c(13),x=c(14);function y(C){var S;switch(C.type){case h.JSXSyntax.JSXIdentifier:S=C.name;break;case h.JSXSyntax.JSXNamespacedName:var T=C;S=y(T.namespace)+":"+y(T.name);break;case h.JSXSyntax.JSXMemberExpression:var w=C;S=y(w.object)+"."+y(w.property)}return S}m.TokenName[100]="JSXIdentifier",m.TokenName[101]="JSXText";var g=function(C){function S(T,w,_){return C.call(this,T,w,_)||this}return p(S,C),S.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():C.prototype.parsePrimaryExpression.call(this)},S.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},S.prototype.finishJSX=function(){this.nextToken()},S.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},S.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},S.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},S.prototype.scanXHTMLEntity=function(T){for(var w="&",_=!0,E=!1,D=!1,O=!1;!this.scanner.eof()&&_&&!E;){var M=this.scanner.source[this.scanner.index];if(M===T)break;if(E=M===";",w+=M,++this.scanner.index,!E)switch(w.length){case 2:D=M==="#";break;case 3:D&&(_=(O=M==="x")||u.Character.isDecimalDigit(M.charCodeAt(0)),D=D&&!O);break;default:_=(_=_&&!(D&&!u.Character.isDecimalDigit(M.charCodeAt(0))))&&!(O&&!u.Character.isHexDigit(M.charCodeAt(0)))}}if(_&&E&&w.length>2){var N=w.substr(1,w.length-2);D&&N.length>1?w=String.fromCharCode(parseInt(N.substr(1),10)):O&&N.length>2?w=String.fromCharCode(parseInt("0"+N.substr(1),16)):D||O||!x.XHTMLEntities[N]||(w=x.XHTMLEntities[N])}return w},S.prototype.lexJSX=function(){var T=this.scanner.source.charCodeAt(this.scanner.index);if(T===60||T===62||T===47||T===58||T===61||T===123||T===125)return{type:7,value:M=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(T===34||T===39){for(var w=this.scanner.index,_=this.scanner.source[this.scanner.index++],E="";!this.scanner.eof()&&(N=this.scanner.source[this.scanner.index++])!==_;)E+=N==="&"?this.scanXHTMLEntity(_):N;return{type:8,value:E,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:w,end:this.scanner.index}}if(T===46){var D=this.scanner.source.charCodeAt(this.scanner.index+1),O=this.scanner.source.charCodeAt(this.scanner.index+2),M=D===46&&O===46?"...":".";return w=this.scanner.index,this.scanner.index+=M.length,{type:7,value:M,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:w,end:this.scanner.index}}if(T===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(u.Character.isIdentifierStart(T)&&T!==92){for(w=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var N=this.scanner.source.charCodeAt(this.scanner.index);if(u.Character.isIdentifierPart(N)&&N!==92)++this.scanner.index;else{if(N!==45)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(w,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:w,end:this.scanner.index}}return this.scanner.lex()},S.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var T=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(T)),T},S.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var T=this.scanner.index,w="";!this.scanner.eof();){var _=this.scanner.source[this.scanner.index];if(_==="{"||_==="<")break;++this.scanner.index,w+=_,u.Character.isLineTerminator(_.charCodeAt(0))&&(++this.scanner.lineNumber,_==="\r"&&this.scanner.source[this.scanner.index]===` -`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var E={type:101,value:w,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:T,end:this.scanner.index};return w.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(E)),E},S.prototype.peekJSXToken=function(){var T=this.scanner.saveState();this.scanner.scanComments();var w=this.lexJSX();return this.scanner.restoreState(T),w},S.prototype.expectJSX=function(T){var w=this.nextJSXToken();w.type===7&&w.value===T||this.throwUnexpectedToken(w)},S.prototype.matchJSX=function(T){var w=this.peekJSXToken();return w.type===7&&w.value===T},S.prototype.parseJSXIdentifier=function(){var T=this.createJSXNode(),w=this.nextJSXToken();return w.type!==100&&this.throwUnexpectedToken(w),this.finalize(T,new f.JSXIdentifier(w.value))},S.prototype.parseJSXElementName=function(){var T=this.createJSXNode(),w=this.parseJSXIdentifier();if(this.matchJSX(":")){var _=w;this.expectJSX(":");var E=this.parseJSXIdentifier();w=this.finalize(T,new f.JSXNamespacedName(_,E))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var D=w;this.expectJSX(".");var O=this.parseJSXIdentifier();w=this.finalize(T,new f.JSXMemberExpression(D,O))}return w},S.prototype.parseJSXAttributeName=function(){var T,w=this.createJSXNode(),_=this.parseJSXIdentifier();if(this.matchJSX(":")){var E=_;this.expectJSX(":");var D=this.parseJSXIdentifier();T=this.finalize(w,new f.JSXNamespacedName(E,D))}else T=_;return T},S.prototype.parseJSXStringLiteralAttribute=function(){var T=this.createJSXNode(),w=this.nextJSXToken();w.type!==8&&this.throwUnexpectedToken(w);var _=this.getTokenRaw(w);return this.finalize(T,new d.Literal(w.value,_))},S.prototype.parseJSXExpressionAttribute=function(){var T=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var w=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(T,new f.JSXExpressionContainer(w))},S.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},S.prototype.parseJSXNameValueAttribute=function(){var T=this.createJSXNode(),w=this.parseJSXAttributeName(),_=null;return this.matchJSX("=")&&(this.expectJSX("="),_=this.parseJSXAttributeValue()),this.finalize(T,new f.JSXAttribute(w,_))},S.prototype.parseJSXSpreadAttribute=function(){var T=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var w=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(T,new f.JSXSpreadAttribute(w))},S.prototype.parseJSXAttributes=function(){for(var T=[];!this.matchJSX("/")&&!this.matchJSX(">");){var w=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();T.push(w)}return T},S.prototype.parseJSXOpeningElement=function(){var T=this.createJSXNode();this.expectJSX("<");var w=this.parseJSXElementName(),_=this.parseJSXAttributes(),E=this.matchJSX("/");return E&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(T,new f.JSXOpeningElement(w,E,_))},S.prototype.parseJSXBoundaryElement=function(){var T=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var w=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(T,new f.JSXClosingElement(w))}var _=this.parseJSXElementName(),E=this.parseJSXAttributes(),D=this.matchJSX("/");return D&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(T,new f.JSXOpeningElement(_,D,E))},S.prototype.parseJSXEmptyExpression=function(){var T=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(T,new f.JSXEmptyExpression)},S.prototype.parseJSXExpressionContainer=function(){var T,w=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(T=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),T=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(w,new f.JSXExpressionContainer(T))},S.prototype.parseJSXChildren=function(){for(var T=[];!this.scanner.eof();){var w=this.createJSXChildNode(),_=this.nextJSXText();if(_.start<_.end){var E=this.getTokenRaw(_),D=this.finalize(w,new f.JSXText(_.value,E));T.push(D)}if(this.scanner.source[this.scanner.index]!=="{")break;var O=this.parseJSXExpressionContainer();T.push(O)}return T},S.prototype.parseComplexJSXElement=function(T){for(var w=[];!this.scanner.eof();){T.children=T.children.concat(this.parseJSXChildren());var _=this.createJSXChildNode(),E=this.parseJSXBoundaryElement();if(E.type===h.JSXSyntax.JSXOpeningElement){var D=E;if(D.selfClosing){var O=this.finalize(_,new f.JSXElement(D,[],null));T.children.push(O)}else w.push(T),T={node:_,opening:D,closing:null,children:[]}}if(E.type===h.JSXSyntax.JSXClosingElement){T.closing=E;var M=y(T.opening.name);if(M!==y(T.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",M),!(w.length>0))break;O=this.finalize(T.node,new f.JSXElement(T.opening,T.children,T.closing)),(T=w[w.length-1]).children.push(O),w.pop()}}return T},S.prototype.parseJSXElement=function(){var T=this.createJSXNode(),w=this.parseJSXOpeningElement(),_=[],E=null;if(!w.selfClosing){var D=this.parseComplexJSXElement({node:T,opening:w,closing:E,children:_});_=D.children,E=D.closing}return this.finalize(T,new f.JSXElement(w,_,E))},S.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var T=this.parseJSXElement();return this.finishJSX(),T},S.prototype.isStartOfExpression=function(){return C.prototype.isStartOfExpression.call(this)||this.match("<")},S}(v.Parser);s.JSXParser=g},function(o,s){Object.defineProperty(s,"__esModule",{value:!0});var c={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};s.Character={fromCodePoint:function(l){return l<65536?String.fromCharCode(l):String.fromCharCode(55296+(l-65536>>10))+String.fromCharCode(56320+(l-65536&1023))},isWhiteSpace:function(l){return l===32||l===9||l===11||l===12||l===160||l>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(l)>=0},isLineTerminator:function(l){return l===10||l===13||l===8232||l===8233},isIdentifierStart:function(l){return l===36||l===95||l>=65&&l<=90||l>=97&&l<=122||l===92||l>=128&&c.NonAsciiIdentifierStart.test(s.Character.fromCodePoint(l))},isIdentifierPart:function(l){return l===36||l===95||l>=65&&l<=90||l>=97&&l<=122||l>=48&&l<=57||l===92||l>=128&&c.NonAsciiIdentifierPart.test(s.Character.fromCodePoint(l))},isDecimalDigit:function(l){return l>=48&&l<=57},isHexDigit:function(l){return l>=48&&l<=57||l>=65&&l<=70||l>=97&&l<=102},isOctalDigit:function(l){return l>=48&&l<=55}}},function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(6),p=function(S){this.type=l.JSXSyntax.JSXClosingElement,this.name=S};s.JSXClosingElement=p;var u=function(S,T,w){this.type=l.JSXSyntax.JSXElement,this.openingElement=S,this.children=T,this.closingElement=w};s.JSXElement=u;var f=function(){this.type=l.JSXSyntax.JSXEmptyExpression};s.JSXEmptyExpression=f;var h=function(S){this.type=l.JSXSyntax.JSXExpressionContainer,this.expression=S};s.JSXExpressionContainer=h;var d=function(S){this.type=l.JSXSyntax.JSXIdentifier,this.name=S};s.JSXIdentifier=d;var v=function(S,T){this.type=l.JSXSyntax.JSXMemberExpression,this.object=S,this.property=T};s.JSXMemberExpression=v;var m=function(S,T){this.type=l.JSXSyntax.JSXAttribute,this.name=S,this.value=T};s.JSXAttribute=m;var x=function(S,T){this.type=l.JSXSyntax.JSXNamespacedName,this.namespace=S,this.name=T};s.JSXNamespacedName=x;var y=function(S,T,w){this.type=l.JSXSyntax.JSXOpeningElement,this.name=S,this.selfClosing=T,this.attributes=w};s.JSXOpeningElement=y;var g=function(S){this.type=l.JSXSyntax.JSXSpreadAttribute,this.argument=S};s.JSXSpreadAttribute=g;var C=function(S,T){this.type=l.JSXSyntax.JSXText,this.value=S,this.raw=T};s.JSXText=C},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(2),p=function(ie){this.type=l.Syntax.ArrayExpression,this.elements=ie};s.ArrayExpression=p;var u=function(ie){this.type=l.Syntax.ArrayPattern,this.elements=ie};s.ArrayPattern=u;var f=function(ie,le,Fe){this.type=l.Syntax.ArrowFunctionExpression,this.id=null,this.params=ie,this.body=le,this.generator=!1,this.expression=Fe,this.async=!1};s.ArrowFunctionExpression=f;var h=function(ie,le,Fe){this.type=l.Syntax.AssignmentExpression,this.operator=ie,this.left=le,this.right=Fe};s.AssignmentExpression=h;var d=function(ie,le){this.type=l.Syntax.AssignmentPattern,this.left=ie,this.right=le};s.AssignmentPattern=d;var v=function(ie,le,Fe){this.type=l.Syntax.ArrowFunctionExpression,this.id=null,this.params=ie,this.body=le,this.generator=!1,this.expression=Fe,this.async=!0};s.AsyncArrowFunctionExpression=v;var m=function(ie,le,Fe){this.type=l.Syntax.FunctionDeclaration,this.id=ie,this.params=le,this.body=Fe,this.generator=!1,this.expression=!1,this.async=!0};s.AsyncFunctionDeclaration=m;var x=function(ie,le,Fe){this.type=l.Syntax.FunctionExpression,this.id=ie,this.params=le,this.body=Fe,this.generator=!1,this.expression=!1,this.async=!0};s.AsyncFunctionExpression=x;var y=function(ie){this.type=l.Syntax.AwaitExpression,this.argument=ie};s.AwaitExpression=y;var g=function(ie,le,Fe){var Gt=ie==="||"||ie==="&&";this.type=Gt?l.Syntax.LogicalExpression:l.Syntax.BinaryExpression,this.operator=ie,this.left=le,this.right=Fe};s.BinaryExpression=g;var C=function(ie){this.type=l.Syntax.BlockStatement,this.body=ie};s.BlockStatement=C;var S=function(ie){this.type=l.Syntax.BreakStatement,this.label=ie};s.BreakStatement=S;var T=function(ie,le){this.type=l.Syntax.CallExpression,this.callee=ie,this.arguments=le};s.CallExpression=T;var w=function(ie,le){this.type=l.Syntax.CatchClause,this.param=ie,this.body=le};s.CatchClause=w;var _=function(ie){this.type=l.Syntax.ClassBody,this.body=ie};s.ClassBody=_;var E=function(ie,le,Fe){this.type=l.Syntax.ClassDeclaration,this.id=ie,this.superClass=le,this.body=Fe};s.ClassDeclaration=E;var D=function(ie,le,Fe){this.type=l.Syntax.ClassExpression,this.id=ie,this.superClass=le,this.body=Fe};s.ClassExpression=D;var O=function(ie,le){this.type=l.Syntax.MemberExpression,this.computed=!0,this.object=ie,this.property=le};s.ComputedMemberExpression=O;var M=function(ie,le,Fe){this.type=l.Syntax.ConditionalExpression,this.test=ie,this.consequent=le,this.alternate=Fe};s.ConditionalExpression=M;var N=function(ie){this.type=l.Syntax.ContinueStatement,this.label=ie};s.ContinueStatement=N;var R=function(){this.type=l.Syntax.DebuggerStatement};s.DebuggerStatement=R;var B=function(ie,le){this.type=l.Syntax.ExpressionStatement,this.expression=ie,this.directive=le};s.Directive=B;var I=function(ie,le){this.type=l.Syntax.DoWhileStatement,this.body=ie,this.test=le};s.DoWhileStatement=I;var P=function(){this.type=l.Syntax.EmptyStatement};s.EmptyStatement=P;var L=function(ie){this.type=l.Syntax.ExportAllDeclaration,this.source=ie};s.ExportAllDeclaration=L;var k=function(ie){this.type=l.Syntax.ExportDefaultDeclaration,this.declaration=ie};s.ExportDefaultDeclaration=k;var A=function(ie,le,Fe){this.type=l.Syntax.ExportNamedDeclaration,this.declaration=ie,this.specifiers=le,this.source=Fe};s.ExportNamedDeclaration=A;var j=function(ie,le){this.type=l.Syntax.ExportSpecifier,this.exported=le,this.local=ie};s.ExportSpecifier=j;var H=function(ie){this.type=l.Syntax.ExpressionStatement,this.expression=ie};s.ExpressionStatement=H;var K=function(ie,le,Fe){this.type=l.Syntax.ForInStatement,this.left=ie,this.right=le,this.body=Fe,this.each=!1};s.ForInStatement=K;var Y=function(ie,le,Fe){this.type=l.Syntax.ForOfStatement,this.left=ie,this.right=le,this.body=Fe};s.ForOfStatement=Y;var q=function(ie,le,Fe,Gt){this.type=l.Syntax.ForStatement,this.init=ie,this.test=le,this.update=Fe,this.body=Gt};s.ForStatement=q;var Z=function(ie,le,Fe,Gt){this.type=l.Syntax.FunctionDeclaration,this.id=ie,this.params=le,this.body=Fe,this.generator=Gt,this.expression=!1,this.async=!1};s.FunctionDeclaration=Z;var re=function(ie,le,Fe,Gt){this.type=l.Syntax.FunctionExpression,this.id=ie,this.params=le,this.body=Fe,this.generator=Gt,this.expression=!1,this.async=!1};s.FunctionExpression=re;var ae=function(ie){this.type=l.Syntax.Identifier,this.name=ie};s.Identifier=ae;var ee=function(ie,le,Fe){this.type=l.Syntax.IfStatement,this.test=ie,this.consequent=le,this.alternate=Fe};s.IfStatement=ee;var F=function(ie,le){this.type=l.Syntax.ImportDeclaration,this.specifiers=ie,this.source=le};s.ImportDeclaration=F;var b=function(ie){this.type=l.Syntax.ImportDefaultSpecifier,this.local=ie};s.ImportDefaultSpecifier=b;var G=function(ie){this.type=l.Syntax.ImportNamespaceSpecifier,this.local=ie};s.ImportNamespaceSpecifier=G;var U=function(ie,le){this.type=l.Syntax.ImportSpecifier,this.local=ie,this.imported=le};s.ImportSpecifier=U;var z=function(ie,le){this.type=l.Syntax.LabeledStatement,this.label=ie,this.body=le};s.LabeledStatement=z;var W=function(ie,le){this.type=l.Syntax.Literal,this.value=ie,this.raw=le};s.Literal=W;var $=function(ie,le){this.type=l.Syntax.MetaProperty,this.meta=ie,this.property=le};s.MetaProperty=$;var J=function(ie,le,Fe,Gt,Kc){this.type=l.Syntax.MethodDefinition,this.key=ie,this.computed=le,this.value=Fe,this.kind=Gt,this.static=Kc};s.MethodDefinition=J;var ne=function(ie){this.type=l.Syntax.Program,this.body=ie,this.sourceType="module"};s.Module=ne;var oe=function(ie,le){this.type=l.Syntax.NewExpression,this.callee=ie,this.arguments=le};s.NewExpression=oe;var ue=function(ie){this.type=l.Syntax.ObjectExpression,this.properties=ie};s.ObjectExpression=ue;var Ce=function(ie){this.type=l.Syntax.ObjectPattern,this.properties=ie};s.ObjectPattern=Ce;var ye=function(ie,le,Fe,Gt,Kc,sb){this.type=l.Syntax.Property,this.key=le,this.computed=Fe,this.value=Gt,this.kind=ie,this.method=Kc,this.shorthand=sb};s.Property=ye;var je=function(ie,le,Fe,Gt){this.type=l.Syntax.Literal,this.value=ie,this.raw=le,this.regex={pattern:Fe,flags:Gt}};s.RegexLiteral=je;var Le=function(ie){this.type=l.Syntax.RestElement,this.argument=ie};s.RestElement=Le;var ge=function(ie){this.type=l.Syntax.ReturnStatement,this.argument=ie};s.ReturnStatement=ge;var tt=function(ie){this.type=l.Syntax.Program,this.body=ie,this.sourceType="script"};s.Script=tt;var X=function(ie){this.type=l.Syntax.SequenceExpression,this.expressions=ie};s.SequenceExpression=X;var De=function(ie){this.type=l.Syntax.SpreadElement,this.argument=ie};s.SpreadElement=De;var Oe=function(ie,le){this.type=l.Syntax.MemberExpression,this.computed=!1,this.object=ie,this.property=le};s.StaticMemberExpression=Oe;var de=function(){this.type=l.Syntax.Super};s.Super=de;var te=function(ie,le){this.type=l.Syntax.SwitchCase,this.test=ie,this.consequent=le};s.SwitchCase=te;var ce=function(ie,le){this.type=l.Syntax.SwitchStatement,this.discriminant=ie,this.cases=le};s.SwitchStatement=ce;var he=function(ie,le){this.type=l.Syntax.TaggedTemplateExpression,this.tag=ie,this.quasi=le};s.TaggedTemplateExpression=he;var fe=function(ie,le){this.type=l.Syntax.TemplateElement,this.value=ie,this.tail=le};s.TemplateElement=fe;var ve=function(ie,le){this.type=l.Syntax.TemplateLiteral,this.quasis=ie,this.expressions=le};s.TemplateLiteral=ve;var Ae=function(){this.type=l.Syntax.ThisExpression};s.ThisExpression=Ae;var Se=function(ie){this.type=l.Syntax.ThrowStatement,this.argument=ie};s.ThrowStatement=Se;var Be=function(ie,le,Fe){this.type=l.Syntax.TryStatement,this.block=ie,this.handler=le,this.finalizer=Fe};s.TryStatement=Be;var Ie=function(ie,le){this.type=l.Syntax.UnaryExpression,this.operator=ie,this.argument=le,this.prefix=!0};s.UnaryExpression=Ie;var Tt=function(ie,le,Fe){this.type=l.Syntax.UpdateExpression,this.operator=ie,this.argument=le,this.prefix=Fe};s.UpdateExpression=Tt;var Ft=function(ie,le){this.type=l.Syntax.VariableDeclaration,this.declarations=ie,this.kind=le};s.VariableDeclaration=Ft;var at=function(ie,le){this.type=l.Syntax.VariableDeclarator,this.id=ie,this.init=le};s.VariableDeclarator=at;var $t=function(ie,le){this.type=l.Syntax.WhileStatement,this.test=ie,this.body=le};s.WhileStatement=$t;var ib=function(ie,le){this.type=l.Syntax.WithStatement,this.object=ie,this.body=le};s.WithStatement=ib;var ob=function(ie,le){this.type=l.Syntax.YieldExpression,this.argument=ie,this.delegate=le};s.YieldExpression=ob},function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(9),p=c(10),u=c(11),f=c(7),h=c(12),d=c(2),v=c(13),m=function(){function x(y,g,C){g===void 0&&(g={}),this.config={range:typeof g.range=="boolean"&&g.range,loc:typeof g.loc=="boolean"&&g.loc,source:null,tokens:typeof g.tokens=="boolean"&&g.tokens,comment:typeof g.comment=="boolean"&&g.comment,tolerant:typeof g.tolerant=="boolean"&&g.tolerant},this.config.loc&&g.source&&g.source!==null&&(this.config.source=String(g.source)),this.delegate=C,this.errorHandler=new p.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new h.Scanner(y,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return x.prototype.throwError=function(y){for(var g=[],C=1;C0&&this.delegate)for(var g=0;g>="||y===">>>="||y==="&="||y==="^="||y==="|="},x.prototype.isolateCoverGrammar=function(y){var g=this.context.isBindingElement,C=this.context.isAssignmentTarget,S=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var T=y.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=g,this.context.isAssignmentTarget=C,this.context.firstCoverInitializedNameError=S,T},x.prototype.inheritCoverGrammar=function(y){var g=this.context.isBindingElement,C=this.context.isAssignmentTarget,S=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var T=y.call(this);return this.context.isBindingElement=this.context.isBindingElement&&g,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&C,this.context.firstCoverInitializedNameError=S||this.context.firstCoverInitializedNameError,T},x.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type===2||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},x.prototype.parsePrimaryExpression=function(){var y,g,C,S=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),y=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(S,new f.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,u.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),C=this.getTokenRaw(g),y=this.finalize(S,new f.Literal(g.value,C));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),C=this.getTokenRaw(g),y=this.finalize(S,new f.Literal(g.value==="true",C));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),C=this.getTokenRaw(g),y=this.finalize(S,new f.Literal(null,C));break;case 10:y=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,y=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":y=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":y=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,g=this.nextRegexToken(),C=this.getTokenRaw(g),y=this.finalize(S,new f.RegexLiteral(g.regex,C,g.pattern,g.flags));break;default:y=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?y=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?y=this.finalize(S,new f.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?y=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),y=this.finalize(S,new f.ThisExpression)):y=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:y=this.throwUnexpectedToken(this.nextToken())}return y},x.prototype.parseSpreadElement=function(){var y=this.createNode();this.expect("...");var g=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(y,new f.SpreadElement(g))},x.prototype.parseArrayInitializer=function(){var y=this.createNode(),g=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),g.push(null);else if(this.match("...")){var C=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),g.push(C)}else g.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(y,new f.ArrayExpression(g))},x.prototype.parsePropertyMethod=function(y){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var g=this.context.strict,C=this.context.allowStrictDirective;this.context.allowStrictDirective=y.simple;var S=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&y.firstRestricted&&this.tolerateUnexpectedToken(y.firstRestricted,y.message),this.context.strict&&y.stricted&&this.tolerateUnexpectedToken(y.stricted,y.message),this.context.strict=g,this.context.allowStrictDirective=C,S},x.prototype.parsePropertyMethodFunction=function(){var y=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var C=this.parseFormalParameters(),S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(y,new f.FunctionExpression(null,C.params,S,!1))},x.prototype.parsePropertyMethodAsyncFunction=function(){var y=this.createNode(),g=this.context.allowYield,C=this.context.await;this.context.allowYield=!1,this.context.await=!0;var S=this.parseFormalParameters(),T=this.parsePropertyMethod(S);return this.context.allowYield=g,this.context.await=C,this.finalize(y,new f.AsyncFunctionExpression(null,S.params,T))},x.prototype.parseObjectPropertyKey=function(){var y,g=this.createNode(),C=this.nextToken();switch(C.type){case 8:case 6:this.context.strict&&C.octal&&this.tolerateUnexpectedToken(C,u.Messages.StrictOctalLiteral);var S=this.getTokenRaw(C);y=this.finalize(g,new f.Literal(C.value,S));break;case 3:case 1:case 5:case 4:y=this.finalize(g,new f.Identifier(C.value));break;case 7:C.value==="["?(y=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):y=this.throwUnexpectedToken(C);break;default:y=this.throwUnexpectedToken(C)}return y},x.prototype.isPropertyKey=function(y,g){return y.type===d.Syntax.Identifier&&y.name===g||y.type===d.Syntax.Literal&&y.value===g},x.prototype.parseObjectProperty=function(y){var g,C=this.createNode(),S=this.lookahead,T=null,w=null,_=!1,E=!1,D=!1,O=!1;if(S.type===3){var M=S.value;this.nextToken(),_=this.match("["),T=(O=!(this.hasLineTerminator||M!=="async"||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(C,new f.Identifier(M))}else this.match("*")?this.nextToken():(_=this.match("["),T=this.parseObjectPropertyKey());var N=this.qualifiedPropertyName(this.lookahead);if(S.type===3&&!O&&S.value==="get"&&N)g="get",_=this.match("["),T=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod();else if(S.type===3&&!O&&S.value==="set"&&N)g="set",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseSetterMethod();else if(S.type===7&&S.value==="*"&&N)g="init",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),E=!0;else if(T||this.throwUnexpectedToken(this.lookahead),g="init",this.match(":")&&!O)!_&&this.isPropertyKey(T,"__proto__")&&(y.value&&this.tolerateError(u.Messages.DuplicateProtoProperty),y.value=!0),this.nextToken(),w=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))w=O?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),E=!0;else if(S.type===3)if(M=this.finalize(C,new f.Identifier(S.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),D=!0;var R=this.isolateCoverGrammar(this.parseAssignmentExpression);w=this.finalize(C,new f.AssignmentPattern(M,R))}else D=!0,w=M;else this.throwUnexpectedToken(this.nextToken());return this.finalize(C,new f.Property(g,T,_,w,E,D))},x.prototype.parseObjectInitializer=function(){var y=this.createNode();this.expect("{");for(var g=[],C={value:!1};!this.match("}");)g.push(this.parseObjectProperty(C)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(y,new f.ObjectExpression(g))},x.prototype.parseTemplateHead=function(){l.assert(this.lookahead.head,"Template literal must start with a template head");var y=this.createNode(),g=this.nextToken(),C=g.value,S=g.cooked;return this.finalize(y,new f.TemplateElement({raw:C,cooked:S},g.tail))},x.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var y=this.createNode(),g=this.nextToken(),C=g.value,S=g.cooked;return this.finalize(y,new f.TemplateElement({raw:C,cooked:S},g.tail))},x.prototype.parseTemplateLiteral=function(){var y=this.createNode(),g=[],C=[],S=this.parseTemplateHead();for(C.push(S);!S.tail;)g.push(this.parseExpression()),S=this.parseTemplateElement(),C.push(S);return this.finalize(y,new f.TemplateLiteral(C,g))},x.prototype.reinterpretExpressionAsPattern=function(y){switch(y.type){case d.Syntax.Identifier:case d.Syntax.MemberExpression:case d.Syntax.RestElement:case d.Syntax.AssignmentPattern:break;case d.Syntax.SpreadElement:y.type=d.Syntax.RestElement,this.reinterpretExpressionAsPattern(y.argument);break;case d.Syntax.ArrayExpression:y.type=d.Syntax.ArrayPattern;for(var g=0;g")||this.expect("=>"),y={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var g=this.lookahead,C=[];if(this.match("..."))y=this.parseRestElement(C),this.expect(")"),this.match("=>")||this.expect("=>"),y={type:"ArrowParameterPlaceHolder",params:[y],async:!1};else{var S=!1;if(this.context.isBindingElement=!0,y=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var T=[];for(this.context.isAssignmentTarget=!1,T.push(y);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var w=0;w")||this.expect("=>"),this.context.isBindingElement=!1,w=0;w")&&(y.type===d.Syntax.Identifier&&y.name==="yield"&&(S=!0,y={type:"ArrowParameterPlaceHolder",params:[y],async:!1}),!S)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),y.type===d.Syntax.SequenceExpression)for(w=0;w")){for(var E=0;E<_.length;++E)this.reinterpretExpressionAsPattern(_[E]);y={type:"ArrowParameterPlaceHolder",params:_,async:!0}}}else if(this.match("["))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("["),T=this.isolateCoverGrammar(this.parseExpression),this.expect("]"),y=this.finalize(this.startNode(g),new f.ComputedMemberExpression(y,T));else{if(this.lookahead.type!==10||!this.lookahead.head)break;var D=this.parseTemplateLiteral();y=this.finalize(this.startNode(g),new f.TaggedTemplateExpression(y,D))}return this.context.allowIn=S,y},x.prototype.parseSuper=function(){var y=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(y,new f.Super)},x.prototype.parseLeftHandSideExpression=function(){l.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var y=this.startNode(this.lookahead),g=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var C=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),g=this.finalize(y,new f.ComputedMemberExpression(g,C))}else if(this.match("."))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("."),C=this.parseIdentifierName(),g=this.finalize(y,new f.StaticMemberExpression(g,C));else{if(this.lookahead.type!==10||!this.lookahead.head)break;var S=this.parseTemplateLiteral();g=this.finalize(y,new f.TaggedTemplateExpression(g,S))}return g},x.prototype.parseUpdateExpression=function(){var y,g=this.lookahead;if(this.match("++")||this.match("--")){var C=this.startNode(g),S=this.nextToken();y=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&y.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(y.name)&&this.tolerateError(u.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(u.Messages.InvalidLHSInAssignment);var T=!0;y=this.finalize(C,new f.UpdateExpression(S.value,y,T)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(y=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&y.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(y.name)&&this.tolerateError(u.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(u.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var w=this.nextToken().value;T=!1,y=this.finalize(this.startNode(g),new f.UpdateExpression(w,y,T))}return y},x.prototype.parseAwaitExpression=function(){var y=this.createNode();this.nextToken();var g=this.parseUnaryExpression();return this.finalize(y,new f.AwaitExpression(g))},x.prototype.parseUnaryExpression=function(){var y;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var g=this.startNode(this.lookahead),C=this.nextToken();y=this.inheritCoverGrammar(this.parseUnaryExpression),y=this.finalize(g,new f.UnaryExpression(C.value,y)),this.context.strict&&y.operator==="delete"&&y.argument.type===d.Syntax.Identifier&&this.tolerateError(u.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else y=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return y},x.prototype.parseExponentiationExpression=function(){var y=this.lookahead,g=this.inheritCoverGrammar(this.parseUnaryExpression);if(g.type!==d.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var C=g,S=this.isolateCoverGrammar(this.parseExponentiationExpression);g=this.finalize(this.startNode(y),new f.BinaryExpression("**",C,S))}return g},x.prototype.binaryPrecedence=function(y){var g=y.value;return y.type===7?this.operatorPrecedence[g]||0:y.type===4&&(g==="instanceof"||this.context.allowIn&&g==="in")?7:0},x.prototype.parseBinaryExpression=function(){var y=this.lookahead,g=this.inheritCoverGrammar(this.parseExponentiationExpression),C=this.lookahead,S=this.binaryPrecedence(C);if(S>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var T=[y,this.lookahead],w=g,_=this.isolateCoverGrammar(this.parseExponentiationExpression),E=[w,C.value,_],D=[S];!((S=this.binaryPrecedence(this.lookahead))<=0);){for(;E.length>2&&S<=D[D.length-1];){_=E.pop();var O=E.pop();D.pop(),w=E.pop(),T.pop();var M=this.startNode(T[T.length-1]);E.push(this.finalize(M,new f.BinaryExpression(O,w,_)))}E.push(this.nextToken().value),D.push(S),T.push(this.lookahead),E.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var N=E.length-1;g=E[N];for(var R=T.pop();N>1;){var B=T.pop(),I=R&&R.lineStart;M=this.startNode(B,I),O=E[N-1],g=this.finalize(M,new f.BinaryExpression(O,E[N-2],g)),N-=2,R=B}}return g},x.prototype.parseConditionalExpression=function(){var y=this.lookahead,g=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var C=this.context.allowIn;this.context.allowIn=!0;var S=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=C,this.expect(":");var T=this.isolateCoverGrammar(this.parseAssignmentExpression);g=this.finalize(this.startNode(y),new f.ConditionalExpression(g,S,T)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return g},x.prototype.checkPatternParam=function(y,g){switch(g.type){case d.Syntax.Identifier:this.validateParam(y,g,g.name);break;case d.Syntax.RestElement:this.checkPatternParam(y,g.argument);break;case d.Syntax.AssignmentPattern:this.checkPatternParam(y,g.left);break;case d.Syntax.ArrayPattern:for(var C=0;C")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var T=y.async,w=this.reinterpretAsCoverFormalsList(y);if(w){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var _=this.context.strict,E=this.context.allowStrictDirective;this.context.allowStrictDirective=w.simple;var D=this.context.allowYield,O=this.context.await;this.context.allowYield=!0,this.context.await=T;var M=this.startNode(g);this.expect("=>");var N=void 0;if(this.match("{")){var R=this.context.allowIn;this.context.allowIn=!0,N=this.parseFunctionSourceElements(),this.context.allowIn=R}else N=this.isolateCoverGrammar(this.parseAssignmentExpression);var B=N.type!==d.Syntax.BlockStatement;this.context.strict&&w.firstRestricted&&this.throwUnexpectedToken(w.firstRestricted,w.message),this.context.strict&&w.stricted&&this.tolerateUnexpectedToken(w.stricted,w.message),y=T?this.finalize(M,new f.AsyncArrowFunctionExpression(w.params,N,B)):this.finalize(M,new f.ArrowFunctionExpression(w.params,N,B)),this.context.strict=_,this.context.allowStrictDirective=E,this.context.allowYield=D,this.context.await=O}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(u.Messages.InvalidLHSInAssignment),this.context.strict&&y.type===d.Syntax.Identifier){var I=y;this.scanner.isRestrictedWord(I.name)&&this.tolerateUnexpectedToken(C,u.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(I.name)&&this.tolerateUnexpectedToken(C,u.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(y):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var P=(C=this.nextToken()).value,L=this.isolateCoverGrammar(this.parseAssignmentExpression);y=this.finalize(this.startNode(g),new f.AssignmentExpression(P,y,L)),this.context.firstCoverInitializedNameError=null}}return y},x.prototype.parseExpression=function(){var y=this.lookahead,g=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var C=[];for(C.push(g);this.lookahead.type!==2&&this.match(",");)this.nextToken(),C.push(this.isolateCoverGrammar(this.parseAssignmentExpression));g=this.finalize(this.startNode(y),new f.SequenceExpression(C))}return g},x.prototype.parseStatementListItem=function(){var y;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,u.Messages.IllegalExportDeclaration),y=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,u.Messages.IllegalImportDeclaration),y=this.parseImportDeclaration();break;case"const":y=this.parseLexicalDeclaration({inFor:!1});break;case"function":y=this.parseFunctionDeclaration();break;case"class":y=this.parseClassDeclaration();break;case"let":y=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:y=this.parseStatement()}else y=this.parseStatement();return y},x.prototype.parseBlock=function(){var y=this.createNode();this.expect("{");for(var g=[];!this.match("}");)g.push(this.parseStatementListItem());return this.expect("}"),this.finalize(y,new f.BlockStatement(g))},x.prototype.parseLexicalBinding=function(y,g){var C=this.createNode(),S=this.parsePattern([],y);this.context.strict&&S.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(S.name)&&this.tolerateError(u.Messages.StrictVarName);var T=null;return y==="const"?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),T=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(u.Messages.DeclarationMissingInitializer,"const")):(!g.inFor&&S.type!==d.Syntax.Identifier||this.match("="))&&(this.expect("="),T=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(C,new f.VariableDeclarator(S,T))},x.prototype.parseBindingList=function(y,g){for(var C=[this.parseLexicalBinding(y,g)];this.match(",");)this.nextToken(),C.push(this.parseLexicalBinding(y,g));return C},x.prototype.isLexicalDeclaration=function(){var y=this.scanner.saveState();this.scanner.scanComments();var g=this.scanner.lex();return this.scanner.restoreState(y),g.type===3||g.type===7&&g.value==="["||g.type===7&&g.value==="{"||g.type===4&&g.value==="let"||g.type===4&&g.value==="yield"},x.prototype.parseLexicalDeclaration=function(y){var g=this.createNode(),C=this.nextToken().value;l.assert(C==="let"||C==="const","Lexical declaration must be either let or const");var S=this.parseBindingList(C,y);return this.consumeSemicolon(),this.finalize(g,new f.VariableDeclaration(S,C))},x.prototype.parseBindingRestElement=function(y,g){var C=this.createNode();this.expect("...");var S=this.parsePattern(y,g);return this.finalize(C,new f.RestElement(S))},x.prototype.parseArrayPattern=function(y,g){var C=this.createNode();this.expect("[");for(var S=[];!this.match("]");)if(this.match(","))this.nextToken(),S.push(null);else{if(this.match("...")){S.push(this.parseBindingRestElement(y,g));break}S.push(this.parsePatternWithDefault(y,g)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(C,new f.ArrayPattern(S))},x.prototype.parsePropertyPattern=function(y,g){var C,S,T=this.createNode(),w=!1,_=!1;if(this.lookahead.type===3){var E=this.lookahead;C=this.parseVariableIdentifier();var D=this.finalize(T,new f.Identifier(E.value));if(this.match("=")){y.push(E),_=!0,this.nextToken();var O=this.parseAssignmentExpression();S=this.finalize(this.startNode(E),new f.AssignmentPattern(D,O))}else this.match(":")?(this.expect(":"),S=this.parsePatternWithDefault(y,g)):(y.push(E),_=!0,S=D)}else w=this.match("["),C=this.parseObjectPropertyKey(),this.expect(":"),S=this.parsePatternWithDefault(y,g);return this.finalize(T,new f.Property("init",C,w,S,!1,_))},x.prototype.parseObjectPattern=function(y,g){var C=this.createNode(),S=[];for(this.expect("{");!this.match("}");)S.push(this.parsePropertyPattern(y,g)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(C,new f.ObjectPattern(S))},x.prototype.parsePattern=function(y,g){var C;return this.match("[")?C=this.parseArrayPattern(y,g):this.match("{")?C=this.parseObjectPattern(y,g):(!this.matchKeyword("let")||g!=="const"&&g!=="let"||this.tolerateUnexpectedToken(this.lookahead,u.Messages.LetInLexicalBinding),y.push(this.lookahead),C=this.parseVariableIdentifier(g)),C},x.prototype.parsePatternWithDefault=function(y,g){var C=this.lookahead,S=this.parsePattern(y,g);if(this.match("=")){this.nextToken();var T=this.context.allowYield;this.context.allowYield=!0;var w=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=T,S=this.finalize(this.startNode(C),new f.AssignmentPattern(S,w))}return S},x.prototype.parseVariableIdentifier=function(y){var g=this.createNode(),C=this.nextToken();return C.type===4&&C.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(C,u.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(C):C.type!==3?this.context.strict&&C.type===4&&this.scanner.isStrictModeReservedWord(C.value)?this.tolerateUnexpectedToken(C,u.Messages.StrictReservedWord):(this.context.strict||C.value!=="let"||y!=="var")&&this.throwUnexpectedToken(C):(this.context.isModule||this.context.await)&&C.type===3&&C.value==="await"&&this.tolerateUnexpectedToken(C),this.finalize(g,new f.Identifier(C.value))},x.prototype.parseVariableDeclaration=function(y){var g=this.createNode(),C=this.parsePattern([],"var");this.context.strict&&C.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(C.name)&&this.tolerateError(u.Messages.StrictVarName);var S=null;return this.match("=")?(this.nextToken(),S=this.isolateCoverGrammar(this.parseAssignmentExpression)):C.type===d.Syntax.Identifier||y.inFor||this.expect("="),this.finalize(g,new f.VariableDeclarator(C,S))},x.prototype.parseVariableDeclarationList=function(y){var g={inFor:y.inFor},C=[];for(C.push(this.parseVariableDeclaration(g));this.match(",");)this.nextToken(),C.push(this.parseVariableDeclaration(g));return C},x.prototype.parseVariableStatement=function(){var y=this.createNode();this.expectKeyword("var");var g=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(y,new f.VariableDeclaration(g,"var"))},x.prototype.parseEmptyStatement=function(){var y=this.createNode();return this.expect(";"),this.finalize(y,new f.EmptyStatement)},x.prototype.parseExpressionStatement=function(){var y=this.createNode(),g=this.parseExpression();return this.consumeSemicolon(),this.finalize(y,new f.ExpressionStatement(g))},x.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(u.Messages.StrictFunction),this.parseStatement()},x.prototype.parseIfStatement=function(){var y,g=this.createNode(),C=null;this.expectKeyword("if"),this.expect("(");var S=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new f.EmptyStatement)):(this.expect(")"),y=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),C=this.parseIfClause())),this.finalize(g,new f.IfStatement(S,y,C))},x.prototype.parseDoWhileStatement=function(){var y=this.createNode();this.expectKeyword("do");var g=this.context.inIteration;this.context.inIteration=!0;var C=this.parseStatement();this.context.inIteration=g,this.expectKeyword("while"),this.expect("(");var S=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(y,new f.DoWhileStatement(C,S))},x.prototype.parseWhileStatement=function(){var y,g=this.createNode();this.expectKeyword("while"),this.expect("(");var C=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new f.EmptyStatement);else{this.expect(")");var S=this.context.inIteration;this.context.inIteration=!0,y=this.parseStatement(),this.context.inIteration=S}return this.finalize(g,new f.WhileStatement(C,y))},x.prototype.parseForStatement=function(){var y,g,C,S=null,T=null,w=null,_=!0,E=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){S=this.createNode(),this.nextToken();var D=this.context.allowIn;this.context.allowIn=!1;var O=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=D,O.length===1&&this.matchKeyword("in")){var M=O[0];M.init&&(M.id.type===d.Syntax.ArrayPattern||M.id.type===d.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(u.Messages.ForInOfLoopInitializer,"for-in"),S=this.finalize(S,new f.VariableDeclaration(O,"var")),this.nextToken(),y=S,g=this.parseExpression(),S=null}else O.length===1&&O[0].init===null&&this.matchContextualKeyword("of")?(S=this.finalize(S,new f.VariableDeclaration(O,"var")),this.nextToken(),y=S,g=this.parseAssignmentExpression(),S=null,_=!1):(S=this.finalize(S,new f.VariableDeclaration(O,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){S=this.createNode();var N=this.nextToken().value;this.context.strict||this.lookahead.value!=="in"?(D=this.context.allowIn,this.context.allowIn=!1,O=this.parseBindingList(N,{inFor:!0}),this.context.allowIn=D,O.length===1&&O[0].init===null&&this.matchKeyword("in")?(S=this.finalize(S,new f.VariableDeclaration(O,N)),this.nextToken(),y=S,g=this.parseExpression(),S=null):O.length===1&&O[0].init===null&&this.matchContextualKeyword("of")?(S=this.finalize(S,new f.VariableDeclaration(O,N)),this.nextToken(),y=S,g=this.parseAssignmentExpression(),S=null,_=!1):(this.consumeSemicolon(),S=this.finalize(S,new f.VariableDeclaration(O,N)))):(S=this.finalize(S,new f.Identifier(N)),this.nextToken(),y=S,g=this.parseExpression(),S=null)}else{var R=this.lookahead;if(D=this.context.allowIn,this.context.allowIn=!1,S=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=D,this.matchKeyword("in"))this.context.isAssignmentTarget&&S.type!==d.Syntax.AssignmentExpression||this.tolerateError(u.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(S),y=S,g=this.parseExpression(),S=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&S.type!==d.Syntax.AssignmentExpression||this.tolerateError(u.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(S),y=S,g=this.parseAssignmentExpression(),S=null,_=!1;else{if(this.match(",")){for(var B=[S];this.match(",");)this.nextToken(),B.push(this.isolateCoverGrammar(this.parseAssignmentExpression));S=this.finalize(this.startNode(R),new f.SequenceExpression(B))}this.expect(";")}}if(y===void 0&&(this.match(";")||(T=this.parseExpression()),this.expect(";"),this.match(")")||(w=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),C=this.finalize(this.createNode(),new f.EmptyStatement);else{this.expect(")");var I=this.context.inIteration;this.context.inIteration=!0,C=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=I}return y===void 0?this.finalize(E,new f.ForStatement(S,T,w,C)):_?this.finalize(E,new f.ForInStatement(y,g,C)):this.finalize(E,new f.ForOfStatement(y,g,C))},x.prototype.parseContinueStatement=function(){var y=this.createNode();this.expectKeyword("continue");var g=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var C=this.parseVariableIdentifier();g=C;var S="$"+C.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,S)||this.throwError(u.Messages.UnknownLabel,C.name)}return this.consumeSemicolon(),g!==null||this.context.inIteration||this.throwError(u.Messages.IllegalContinue),this.finalize(y,new f.ContinueStatement(g))},x.prototype.parseBreakStatement=function(){var y=this.createNode();this.expectKeyword("break");var g=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var C=this.parseVariableIdentifier(),S="$"+C.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,S)||this.throwError(u.Messages.UnknownLabel,C.name),g=C}return this.consumeSemicolon(),g!==null||this.context.inIteration||this.context.inSwitch||this.throwError(u.Messages.IllegalBreak),this.finalize(y,new f.BreakStatement(g))},x.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(u.Messages.IllegalReturn);var y=this.createNode();this.expectKeyword("return");var g=(this.match(";")||this.match("}")||this.hasLineTerminator||this.lookahead.type===2)&&this.lookahead.type!==8&&this.lookahead.type!==10?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(y,new f.ReturnStatement(g))},x.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(u.Messages.StrictModeWith);var y,g=this.createNode();this.expectKeyword("with"),this.expect("(");var C=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new f.EmptyStatement)):(this.expect(")"),y=this.parseStatement()),this.finalize(g,new f.WithStatement(C,y))},x.prototype.parseSwitchCase=function(){var y,g=this.createNode();this.matchKeyword("default")?(this.nextToken(),y=null):(this.expectKeyword("case"),y=this.parseExpression()),this.expect(":");for(var C=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)C.push(this.parseStatementListItem());return this.finalize(g,new f.SwitchCase(y,C))},x.prototype.parseSwitchStatement=function(){var y=this.createNode();this.expectKeyword("switch"),this.expect("(");var g=this.parseExpression();this.expect(")");var C=this.context.inSwitch;this.context.inSwitch=!0;var S=[],T=!1;for(this.expect("{");!this.match("}");){var w=this.parseSwitchCase();w.test===null&&(T&&this.throwError(u.Messages.MultipleDefaultsInSwitch),T=!0),S.push(w)}return this.expect("}"),this.context.inSwitch=C,this.finalize(y,new f.SwitchStatement(g,S))},x.prototype.parseLabelledStatement=function(){var y,g=this.createNode(),C=this.parseExpression();if(C.type===d.Syntax.Identifier&&this.match(":")){this.nextToken();var S=C,T="$"+S.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,T)&&this.throwError(u.Messages.Redeclaration,"Label",S.name),this.context.labelSet[T]=!0;var w=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),w=this.parseClassDeclaration();else if(this.matchKeyword("function")){var _=this.lookahead,E=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(_,u.Messages.StrictFunction):E.generator&&this.tolerateUnexpectedToken(_,u.Messages.GeneratorInLegacyContext),w=E}else w=this.parseStatement();delete this.context.labelSet[T],y=new f.LabeledStatement(S,w)}else this.consumeSemicolon(),y=new f.ExpressionStatement(C);return this.finalize(g,y)},x.prototype.parseThrowStatement=function(){var y=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(u.Messages.NewlineAfterThrow);var g=this.parseExpression();return this.consumeSemicolon(),this.finalize(y,new f.ThrowStatement(g))},x.prototype.parseCatchClause=function(){var y=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var g=[],C=this.parsePattern(g),S={},T=0;T0&&this.tolerateError(u.Messages.BadGetterArity);var S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(y,new f.FunctionExpression(null,C.params,S,!1))},x.prototype.parseSetterMethod=function(){var y=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var C=this.parseFormalParameters();C.params.length!==1?this.tolerateError(u.Messages.BadSetterArity):C.params[0]instanceof f.RestElement&&this.tolerateError(u.Messages.BadSetterRestParameter);var S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(y,new f.FunctionExpression(null,C.params,S,!1))},x.prototype.parseGeneratorMethod=function(){var y=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var C=this.parseFormalParameters();this.context.allowYield=!1;var S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(y,new f.FunctionExpression(null,C.params,S,!0))},x.prototype.isStartOfExpression=function(){var y=!0,g=this.lookahead.value;switch(this.lookahead.type){case 7:y=g==="["||g==="("||g==="{"||g==="+"||g==="-"||g==="!"||g==="~"||g==="++"||g==="--"||g==="/"||g==="/=";break;case 4:y=g==="class"||g==="delete"||g==="function"||g==="let"||g==="new"||g==="super"||g==="this"||g==="typeof"||g==="void"||g==="yield"}return y},x.prototype.parseYieldExpression=function(){var y=this.createNode();this.expectKeyword("yield");var g=null,C=!1;if(!this.hasLineTerminator){var S=this.context.allowYield;this.context.allowYield=!1,(C=this.match("*"))?(this.nextToken(),g=this.parseAssignmentExpression()):this.isStartOfExpression()&&(g=this.parseAssignmentExpression()),this.context.allowYield=S}return this.finalize(y,new f.YieldExpression(g,C))},x.prototype.parseClassElement=function(y){var g=this.lookahead,C=this.createNode(),S="",T=null,w=null,_=!1,E=!1,D=!1,O=!1;if(this.match("*"))this.nextToken();else if(_=this.match("["),(T=this.parseObjectPropertyKey()).name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(g=this.lookahead,D=!0,_=this.match("["),this.match("*")?this.nextToken():T=this.parseObjectPropertyKey()),g.type===3&&!this.hasLineTerminator&&g.value==="async"){var M=this.lookahead.value;M!==":"&&M!=="("&&M!=="*"&&(O=!0,g=this.lookahead,T=this.parseObjectPropertyKey(),g.type===3&&g.value==="constructor"&&this.tolerateUnexpectedToken(g,u.Messages.ConstructorIsAsync))}var N=this.qualifiedPropertyName(this.lookahead);return g.type===3?g.value==="get"&&N?(S="get",_=this.match("["),T=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod()):g.value==="set"&&N&&(S="set",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseSetterMethod()):g.type===7&&g.value==="*"&&N&&(S="init",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),E=!0),!S&&T&&this.match("(")&&(S="init",w=O?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),E=!0),S||this.throwUnexpectedToken(this.lookahead),S==="init"&&(S="method"),_||(D&&this.isPropertyKey(T,"prototype")&&this.throwUnexpectedToken(g,u.Messages.StaticPrototype),!D&&this.isPropertyKey(T,"constructor")&&((S!=="method"||!E||w&&w.generator)&&this.throwUnexpectedToken(g,u.Messages.ConstructorSpecialMethod),y.value?this.throwUnexpectedToken(g,u.Messages.DuplicateConstructor):y.value=!0,S="constructor")),this.finalize(C,new f.MethodDefinition(T,_,w,S,D))},x.prototype.parseClassElementList=function(){var y=[],g={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():y.push(this.parseClassElement(g));return this.expect("}"),y},x.prototype.parseClassBody=function(){var y=this.createNode(),g=this.parseClassElementList();return this.finalize(y,new f.ClassBody(g))},x.prototype.parseClassDeclaration=function(y){var g=this.createNode(),C=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var S=y&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),T=null;this.matchKeyword("extends")&&(this.nextToken(),T=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var w=this.parseClassBody();return this.context.strict=C,this.finalize(g,new f.ClassDeclaration(S,T,w))},x.prototype.parseClassExpression=function(){var y=this.createNode(),g=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var C=this.lookahead.type===3?this.parseVariableIdentifier():null,S=null;this.matchKeyword("extends")&&(this.nextToken(),S=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var T=this.parseClassBody();return this.context.strict=g,this.finalize(y,new f.ClassExpression(C,S,T))},x.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var y=this.createNode(),g=this.parseDirectivePrologues();this.lookahead.type!==2;)g.push(this.parseStatementListItem());return this.finalize(y,new f.Module(g))},x.prototype.parseScript=function(){for(var y=this.createNode(),g=this.parseDirectivePrologues();this.lookahead.type!==2;)g.push(this.parseStatementListItem());return this.finalize(y,new f.Script(g))},x.prototype.parseModuleSpecifier=function(){var y=this.createNode();this.lookahead.type!==8&&this.throwError(u.Messages.InvalidModuleSpecifier);var g=this.nextToken(),C=this.getTokenRaw(g);return this.finalize(y,new f.Literal(g.value,C))},x.prototype.parseImportSpecifier=function(){var y,g,C=this.createNode();return this.lookahead.type===3?(g=y=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),g=this.parseVariableIdentifier())):(g=y=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),g=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(C,new f.ImportSpecifier(g,y))},x.prototype.parseNamedImports=function(){this.expect("{");for(var y=[];!this.match("}");)y.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),y},x.prototype.parseImportDefaultSpecifier=function(){var y=this.createNode(),g=this.parseIdentifierName();return this.finalize(y,new f.ImportDefaultSpecifier(g))},x.prototype.parseImportNamespaceSpecifier=function(){var y=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(u.Messages.NoAsAfterImportNamespace),this.nextToken();var g=this.parseIdentifierName();return this.finalize(y,new f.ImportNamespaceSpecifier(g))},x.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(u.Messages.IllegalImportDeclaration);var y,g=this.createNode();this.expectKeyword("import");var C=[];if(this.lookahead.type===8)y=this.parseModuleSpecifier();else{if(this.match("{")?C=C.concat(this.parseNamedImports()):this.match("*")?C.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(C.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?C.push(this.parseImportNamespaceSpecifier()):this.match("{")?C=C.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var S=this.lookahead.value?u.Messages.UnexpectedToken:u.Messages.MissingFromClause;this.throwError(S,this.lookahead.value)}this.nextToken(),y=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(g,new f.ImportDeclaration(C,y))},x.prototype.parseExportSpecifier=function(){var y=this.createNode(),g=this.parseIdentifierName(),C=g;return this.matchContextualKeyword("as")&&(this.nextToken(),C=this.parseIdentifierName()),this.finalize(y,new f.ExportSpecifier(g,C))},x.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(u.Messages.IllegalExportDeclaration);var y,g=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var C=this.parseFunctionDeclaration(!0);y=this.finalize(g,new f.ExportDefaultDeclaration(C))}else this.matchKeyword("class")?(C=this.parseClassDeclaration(!0),y=this.finalize(g,new f.ExportDefaultDeclaration(C))):this.matchContextualKeyword("async")?(C=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),y=this.finalize(g,new f.ExportDefaultDeclaration(C))):(this.matchContextualKeyword("from")&&this.throwError(u.Messages.UnexpectedToken,this.lookahead.value),C=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),y=this.finalize(g,new f.ExportDefaultDeclaration(C)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var S=this.lookahead.value?u.Messages.UnexpectedToken:u.Messages.MissingFromClause;this.throwError(S,this.lookahead.value)}this.nextToken();var T=this.parseModuleSpecifier();this.consumeSemicolon(),y=this.finalize(g,new f.ExportAllDeclaration(T))}else if(this.lookahead.type===4){switch(C=void 0,this.lookahead.value){case"let":case"const":C=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":C=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}y=this.finalize(g,new f.ExportNamedDeclaration(C,[],null))}else if(this.matchAsyncFunction())C=this.parseFunctionDeclaration(),y=this.finalize(g,new f.ExportNamedDeclaration(C,[],null));else{var w=[],_=null,E=!1;for(this.expect("{");!this.match("}");)E=E||this.matchKeyword("default"),w.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),_=this.parseModuleSpecifier(),this.consumeSemicolon()):E?(S=this.lookahead.value?u.Messages.UnexpectedToken:u.Messages.MissingFromClause,this.throwError(S,this.lookahead.value)):this.consumeSemicolon(),y=this.finalize(g,new f.ExportNamedDeclaration(null,w,_))}return y},x}();s.Parser=m},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.assert=function(c,l){if(!c)throw new Error("ASSERT: "+l)}},function(o,s){Object.defineProperty(s,"__esModule",{value:!0});var c=function(){function l(){this.errors=[],this.tolerant=!1}return l.prototype.recordError=function(p){this.errors.push(p)},l.prototype.tolerate=function(p){if(!this.tolerant)throw p;this.recordError(p)},l.prototype.constructError=function(p,u){var f=new Error(p);try{throw f}catch(h){Object.create&&Object.defineProperty&&(f=Object.create(h),Object.defineProperty(f,"column",{value:u}))}return f},l.prototype.createError=function(p,u,f,h){var d="Line "+u+": "+h,v=this.constructError(d,f);return v.index=p,v.lineNumber=u,v.description=h,v},l.prototype.throwError=function(p,u,f,h){throw this.createError(p,u,f,h)},l.prototype.tolerateError=function(p,u,f,h){var d=this.createError(p,u,f,h);if(!this.tolerant)throw d;this.recordError(d)},l}();s.ErrorHandler=c},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(9),p=c(4),u=c(11);function f(v){return"0123456789abcdef".indexOf(v.toLowerCase())}function h(v){return"01234567".indexOf(v)}var d=function(){function v(m,x){this.source=m,this.errorHandler=x,this.trackComment=!1,this.isModule=!1,this.length=m.length,this.index=0,this.lineNumber=m.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return v.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},v.prototype.restoreState=function(m){this.index=m.index,this.lineNumber=m.lineNumber,this.lineStart=m.lineStart},v.prototype.eof=function(){return this.index>=this.length},v.prototype.throwUnexpectedToken=function(m){return m===void 0&&(m=u.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,m)},v.prototype.tolerateUnexpectedToken=function(m){m===void 0&&(m=u.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,m)},v.prototype.skipSingleLineComment=function(m){var x,y,g=[];for(this.trackComment&&(g=[],x=this.index-m,y={start:{line:this.lineNumber,column:this.index-this.lineStart-m},end:{}});!this.eof();){var C=this.source.charCodeAt(this.index);if(++this.index,p.Character.isLineTerminator(C)){if(this.trackComment){y.end={line:this.lineNumber,column:this.index-this.lineStart-1};var S={multiLine:!1,slice:[x+m,this.index-1],range:[x,this.index-1],loc:y};g.push(S)}return C===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,g}}return this.trackComment&&(y.end={line:this.lineNumber,column:this.index-this.lineStart},S={multiLine:!1,slice:[x+m,this.index],range:[x,this.index],loc:y},g.push(S)),g},v.prototype.skipMultiLineComment=function(){var m,x,y=[];for(this.trackComment&&(y=[],m=this.index-2,x={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var g=this.source.charCodeAt(this.index);if(p.Character.isLineTerminator(g))g===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(g===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){x.end={line:this.lineNumber,column:this.index-this.lineStart};var C={multiLine:!0,slice:[m+2,this.index-2],range:[m,this.index],loc:x};y.push(C)}return y}++this.index}else++this.index}return this.trackComment&&(x.end={line:this.lineNumber,column:this.index-this.lineStart},C={multiLine:!0,slice:[m+2,this.index],range:[m,this.index],loc:x},y.push(C)),this.tolerateUnexpectedToken(),y},v.prototype.scanComments=function(){var m;this.trackComment&&(m=[]);for(var x=this.index===0;!this.eof();){var y=this.source.charCodeAt(this.index);if(p.Character.isWhiteSpace(y))++this.index;else if(p.Character.isLineTerminator(y))++this.index,y===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,x=!0;else if(y===47)if((y=this.source.charCodeAt(this.index+1))===47){this.index+=2;var g=this.skipSingleLineComment(2);this.trackComment&&(m=m.concat(g)),x=!0}else{if(y!==42)break;this.index+=2,g=this.skipMultiLineComment(),this.trackComment&&(m=m.concat(g))}else if(x&&y===45){if(this.source.charCodeAt(this.index+1)!==45||this.source.charCodeAt(this.index+2)!==62)break;this.index+=3,g=this.skipSingleLineComment(3),this.trackComment&&(m=m.concat(g))}else{if(y!==60||this.isModule||this.source.slice(this.index+1,this.index+4)!=="!--")break;this.index+=4,g=this.skipSingleLineComment(4),this.trackComment&&(m=m.concat(g))}}return m},v.prototype.isFutureReservedWord=function(m){switch(m){case"enum":case"export":case"import":case"super":return!0;default:return!1}},v.prototype.isStrictModeReservedWord=function(m){switch(m){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},v.prototype.isRestrictedWord=function(m){return m==="eval"||m==="arguments"},v.prototype.isKeyword=function(m){switch(m.length){case 2:return m==="if"||m==="in"||m==="do";case 3:return m==="var"||m==="for"||m==="new"||m==="try"||m==="let";case 4:return m==="this"||m==="else"||m==="case"||m==="void"||m==="with"||m==="enum";case 5:return m==="while"||m==="break"||m==="catch"||m==="throw"||m==="const"||m==="yield"||m==="class"||m==="super";case 6:return m==="return"||m==="typeof"||m==="delete"||m==="switch"||m==="export"||m==="import";case 7:return m==="default"||m==="finally"||m==="extends";case 8:return m==="function"||m==="continue"||m==="debugger";case 10:return m==="instanceof";default:return!1}},v.prototype.codePointAt=function(m){var x=this.source.charCodeAt(m);if(x>=55296&&x<=56319){var y=this.source.charCodeAt(m+1);y>=56320&&y<=57343&&(x=1024*(x-55296)+y-56320+65536)}return x},v.prototype.scanHexEscape=function(m){for(var x=m==="u"?4:2,y=0,g=0;g1114111||m!=="}")&&this.throwUnexpectedToken(),p.Character.fromCodePoint(x)},v.prototype.getIdentifier=function(){for(var m=this.index++;!this.eof();){var x=this.source.charCodeAt(this.index);if(x===92)return this.index=m,this.getComplexIdentifier();if(x>=55296&&x<57343)return this.index=m,this.getComplexIdentifier();if(!p.Character.isIdentifierPart(x))break;++this.index}return this.source.slice(m,this.index)},v.prototype.getComplexIdentifier=function(){var m,x=this.codePointAt(this.index),y=p.Character.fromCodePoint(x);for(this.index+=y.length,x===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,m=this.scanUnicodeCodePointEscape()):(m=this.scanHexEscape("u"))!==null&&m!=="\\"&&p.Character.isIdentifierStart(m.charCodeAt(0))||this.throwUnexpectedToken(),y=m);!this.eof()&&(x=this.codePointAt(this.index),p.Character.isIdentifierPart(x));)y+=m=p.Character.fromCodePoint(x),this.index+=m.length,x===92&&(y=y.substr(0,y.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,m=this.scanUnicodeCodePointEscape()):(m=this.scanHexEscape("u"))!==null&&m!=="\\"&&p.Character.isIdentifierPart(m.charCodeAt(0))||this.throwUnexpectedToken(),y+=m);return y},v.prototype.octalToDecimal=function(m){var x=m!=="0",y=h(m);return!this.eof()&&p.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(x=!0,y=8*y+h(this.source[this.index++]),"0123".indexOf(m)>=0&&!this.eof()&&p.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(y=8*y+h(this.source[this.index++]))),{code:y,octal:x}},v.prototype.scanIdentifier=function(){var m,x=this.index,y=this.source.charCodeAt(x)===92?this.getComplexIdentifier():this.getIdentifier();if((m=y.length===1?3:this.isKeyword(y)?4:y==="null"?5:y==="true"||y==="false"?1:3)!=3&&x+y.length!==this.index){var g=this.index;this.index=x,this.tolerateUnexpectedToken(u.Messages.InvalidEscapedReservedWord),this.index=g}return{type:m,value:y,lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},v.prototype.scanPunctuator=function(){var m=this.index,x=this.source[this.index];switch(x){case"(":case"{":x==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,x="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:(x=this.source.substr(this.index,4))===">>>="?this.index+=4:(x=x.substr(0,3))==="==="||x==="!=="||x===">>>"||x==="<<="||x===">>="||x==="**="?this.index+=3:(x=x.substr(0,2))==="&&"||x==="||"||x==="=="||x==="!="||x==="+="||x==="-="||x==="*="||x==="/="||x==="++"||x==="--"||x==="<<"||x===">>"||x==="&="||x==="|="||x==="^="||x==="%="||x==="<="||x===">="||x==="=>"||x==="**"?this.index+=2:(x=this.source[this.index],"<>=!+-*%&|^/".indexOf(x)>=0&&++this.index)}return this.index===m&&this.throwUnexpectedToken(),{type:7,value:x,lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},v.prototype.scanHexLiteral=function(m){for(var x="";!this.eof()&&p.Character.isHexDigit(this.source.charCodeAt(this.index));)x+=this.source[this.index++];return x.length===0&&this.throwUnexpectedToken(),p.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+x,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},v.prototype.scanBinaryLiteral=function(m){for(var x,y="";!this.eof()&&((x=this.source[this.index])==="0"||x==="1");)y+=this.source[this.index++];return y.length===0&&this.throwUnexpectedToken(),this.eof()||(x=this.source.charCodeAt(this.index),(p.Character.isIdentifierStart(x)||p.Character.isDecimalDigit(x))&&this.throwUnexpectedToken()),{type:6,value:parseInt(y,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},v.prototype.scanOctalLiteral=function(m,x){var y="",g=!1;for(p.Character.isOctalDigit(m.charCodeAt(0))?(g=!0,y="0"+this.source[this.index++]):++this.index;!this.eof()&&p.Character.isOctalDigit(this.source.charCodeAt(this.index));)y+=this.source[this.index++];return g||y.length!==0||this.throwUnexpectedToken(),(p.Character.isIdentifierStart(this.source.charCodeAt(this.index))||p.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(y,8),octal:g,lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},v.prototype.isImplicitOctalLiteral=function(){for(var m=this.index+1;m=0&&(y=y.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(C,S,T){var w=parseInt(S||T,16);return w>1114111&&g.throwUnexpectedToken(u.Messages.InvalidRegExp),w<=65535?String.fromCharCode(w):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(y)}catch{this.throwUnexpectedToken(u.Messages.InvalidRegExp)}try{return new RegExp(m,x)}catch{return null}},v.prototype.scanRegExpBody=function(){var m=this.source[this.index];l.assert(m==="/","Regular expression literal must start with a slash");for(var x=this.source[this.index++],y=!1,g=!1;!this.eof();)if(x+=m=this.source[this.index++],m==="\\")m=this.source[this.index++],p.Character.isLineTerminator(m.charCodeAt(0))&&this.throwUnexpectedToken(u.Messages.UnterminatedRegExp),x+=m;else if(p.Character.isLineTerminator(m.charCodeAt(0)))this.throwUnexpectedToken(u.Messages.UnterminatedRegExp);else if(y)m==="]"&&(y=!1);else{if(m==="/"){g=!0;break}m==="["&&(y=!0)}return g||this.throwUnexpectedToken(u.Messages.UnterminatedRegExp),x.substr(1,x.length-2)},v.prototype.scanRegExpFlags=function(){for(var m="";!this.eof();){var x=this.source[this.index];if(!p.Character.isIdentifierPart(x.charCodeAt(0)))break;if(++this.index,x!=="\\"||this.eof())m+=x;else if((x=this.source[this.index])==="u"){++this.index;var y=this.index,g=this.scanHexEscape("u");if(g!==null)for(m+=g;y=55296&&m<57343&&p.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},v}();s.Scanner=d},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.TokenName={},s.TokenName[1]="Boolean",s.TokenName[2]="",s.TokenName[3]="Identifier",s.TokenName[4]="Keyword",s.TokenName[5]="Null",s.TokenName[6]="Numeric",s.TokenName[7]="Punctuator",s.TokenName[8]="String",s.TokenName[9]="RegularExpression",s.TokenName[10]="Template"},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(o,s,c){Object.defineProperty(s,"__esModule",{value:!0});var l=c(10),p=c(12),u=c(13),f=function(){function d(){this.values=[],this.curly=this.paren=-1}return d.prototype.beforeFunctionExpression=function(v){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(v)>=0},d.prototype.isRegexStart=function(){var v=this.values[this.values.length-1],m=v!==null;switch(v){case"this":case"]":m=!1;break;case")":var x=this.values[this.paren-1];m=x==="if"||x==="while"||x==="for"||x==="with";break;case"}":if(m=!1,this.values[this.curly-3]==="function")m=!!(y=this.values[this.curly-4])&&!this.beforeFunctionExpression(y);else if(this.values[this.curly-4]==="function"){var y;m=!(y=this.values[this.curly-5])||!this.beforeFunctionExpression(y)}}return m},d.prototype.push=function(v){v.type===7||v.type===4?(v.value==="{"?this.curly=this.values.length:v.value==="("&&(this.paren=this.values.length),this.values.push(v.value)):this.values.push(null)},d}(),h=function(){function d(v,m){this.errorHandler=new l.ErrorHandler,this.errorHandler.tolerant=!!m&&typeof m.tolerant=="boolean"&&m.tolerant,this.scanner=new p.Scanner(v,this.errorHandler),this.scanner.trackComment=!!m&&typeof m.comment=="boolean"&&m.comment,this.trackRange=!!m&&typeof m.range=="boolean"&&m.range,this.trackLoc=!!m&&typeof m.loc=="boolean"&&m.loc,this.buffer=[],this.reader=new f}return d.prototype.errors=function(){return this.errorHandler.errors},d.prototype.getNextToken=function(){if(this.buffer.length===0){var v=this.scanner.scanComments();if(this.scanner.trackComment)for(var m=0;m0?R.charCodeAt(k-1):null,re=re&&g(A,j)}else{for(k=0;kP&&R[Z+1]!==" ",Z=k);else if(!y(A))return 5;j=k>0?R.charCodeAt(k-1):null,re=re&&g(A,j)}Y=Y||q&&k-Z-1>P&&R[Z+1]!==" "}return K||Y?I>9&&C(R)?5:Y?4:3:re&&!L(R)?1:2}function T(R,B,I,P){R.dump=function(){if(B.length===0)return"''";if(!R.noCompatMode&&f.indexOf(B)!==-1)return"'"+B+"'";var L=R.indent*Math.max(1,I),k=R.lineWidth===-1?-1:Math.max(Math.min(R.lineWidth,40),R.lineWidth-L),A=P||R.flowLevel>-1&&I>=R.flowLevel;switch(S(B,A,R.indent,k,function(j){return function(H,K){var Y,q;for(Y=0,q=H.implicitTypes.length;Y"+w(B,R.indent)+_(v(function(j,H){for(var K,Y,q=/(\n+)([^\n]*)/g,Z=(ae=j.indexOf(` -`),ae=ae!==-1?ae:j.length,q.lastIndex=ae,E(j.slice(0,ae),H)),re=j[0]===` -`||j[0]===" ",ae;Y=q.exec(j);){var ee=Y[1],F=Y[2];K=F[0]===" ",Z+=ee+(re||K||F===""?"":` -`)+E(F,H),re=K}return Z}(B,k),L));case 5:return'"'+function(j){for(var H,K,Y,q="",Z=0;Z=55296&&H<=56319&&(K=j.charCodeAt(Z+1))>=56320&&K<=57343?(q+=h(1024*(H-55296)+K-56320+65536),Z++):(Y=u[H],q+=!Y&&y(H)?j[Z]:Y||h(H));return q}(B)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function w(R,B){var I=C(R)?String(B):"",P=R[R.length-1]===` -`;return I+(P&&(R[R.length-2]===` -`||R===` +`)},n.stripLeadingAndTrailingASCIIWhitespace=v,n.stripAndCollapseASCIIWhitespace=function(y){return v(y.replace(/[\t\n\f\r ]{2,}/g," "))},n.collectASequenceOfCodePoints=m,n.skipASCIIWhitespace=x,n.strictlySplit=function y(d,g){if(!c.isArray(d))return y(Array.from(d),g);var C={position:0},S=[],T=m(function(w){return g!==w},d,C);for(S.push(T);C.position=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(97);n.abort_add=function(s,u){u._abortedFlag||u._abortAlgorithms.add(s)},n.abort_remove=function(s,u){u._abortAlgorithms.delete(s)},n.abort_signalAbort=function(s){var u,c;if(!s._abortedFlag){s._abortedFlag=!0;try{for(var p=i(s._abortAlgorithms),l=p.next();!l.done;l=p.next())l.value.call(s)}catch(f){u={error:f}}finally{try{l&&!l.done&&(c=p.return)&&c.call(p)}finally{if(u)throw u.error}}s._abortAlgorithms.clear(),o.event_fireAnEvent("abort",s)}}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(150),o=function(){function s(){}return s.asNode=function(u){if(i.Guard.isNode(u))return u;throw new Error("Invalid object. Node expected.")},s}();n.Cast=o},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function s(){}return Object.defineProperty(s.prototype,"size",{get:function(){return 0},enumerable:!0,configurable:!0}),s.prototype.add=function(u){throw new Error("Cannot add to an empty set.")},s.prototype.clear=function(){},s.prototype.delete=function(u){return!1},s.prototype.forEach=function(u,c){},s.prototype.has=function(u){return!1},s.prototype[Symbol.iterator]=function(){return new o},s.prototype.entries=function(){return new o},s.prototype.keys=function(){return new o},s.prototype.values=function(){return new o},Object.defineProperty(s.prototype,Symbol.toStringTag,{get:function(){return"EmptySet"},enumerable:!0,configurable:!0}),s}();n.EmptySet=i;var o=function(){function s(){}return s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){return{done:!0,value:null}},s}()},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),function(i){i[i.SchemeStart=0]="SchemeStart",i[i.Scheme=1]="Scheme",i[i.NoScheme=2]="NoScheme",i[i.SpecialRelativeOrAuthority=3]="SpecialRelativeOrAuthority",i[i.PathOrAuthority=4]="PathOrAuthority",i[i.Relative=5]="Relative",i[i.RelativeSlash=6]="RelativeSlash",i[i.SpecialAuthoritySlashes=7]="SpecialAuthoritySlashes",i[i.SpecialAuthorityIgnoreSlashes=8]="SpecialAuthorityIgnoreSlashes",i[i.Authority=9]="Authority",i[i.Host=10]="Host",i[i.Hostname=11]="Hostname",i[i.Port=12]="Port",i[i.File=13]="File",i[i.FileSlash=14]="FileSlash",i[i.FileHost=15]="FileHost",i[i.PathStart=16]="PathStart",i[i.Path=17]="Path",i[i.CannotBeABaseURLPath=18]="CannotBeABaseURLPath",i[i.Query=19]="Query",i[i.Fragment=20]="Fragment"}(n.ParserState||(n.ParserState={})),n.OpaqueOrigin=["","",null,null]},function(a,n,r){var i=r(245),o=r(247);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=S,n.resolve=function(T,w){return S(T,!1,!0).resolve(w)},n.resolveObject=function(T,w){return T?S(T,!1,!0).resolveObject(w):w},n.format=function(T){return o.isString(T)&&(T=S(T)),T instanceof s?T.format():s.prototype.format.call(T)},n.Url=s;var u=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),f=["'"].concat(l),h=["%","/","?",";","#"].concat(f),v=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,x=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=r(248);function S(T,w,_){if(T&&o.isObject(T)&&T instanceof s)return T;var E=new s;return E.parse(T,w,_),E}s.prototype.parse=function(T,w,_){if(!o.isString(T))throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var E=T.indexOf("?"),D=E!==-1&&E127?Q+="x":Q+=q[ae];if(!Q.match(m)){var ee=X.slice(0,G),V=X.slice(G+1),M=q.match(x);M&&(ee.push(M[1]),V.unshift(M[2])),V.length&&(b="/"+V.join(".")+b),this.hostname=ee.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),H||(this.hostname=i.toASCII(this.hostname));var I=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+I,this.href+=this.host,H&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!=="/"&&(b="/"+b))}if(!y[L])for(G=0,Y=f.length;G0)&&_.host.split("@"))&&(_.auth=M.shift(),_.host=_.hostname=M.shift())),_.search=T.search,_.query=T.query,o.isNull(_.pathname)&&o.isNull(_.search)||(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.href=_.format(),_;if(!q.length)return _.pathname=null,_.search?_.path="/"+_.search:_.path=null,_.href=_.format(),_;for(var ae=q.slice(-1)[0],ne=(_.host||T.host||q.length>1)&&(ae==="."||ae==="..")||ae==="",ee=0,V=q.length;V>=0;V--)(ae=q[V])==="."?q.splice(V,1):ae===".."?(q.splice(V,1),ee++):ee&&(q.splice(V,1),ee--);if(!X&&!Y)for(;ee--;ee)q.unshift("..");!X||q[0]===""||q[0]&&q[0].charAt(0)==="/"||q.unshift(""),ne&&q.join("/").substr(-1)!=="/"&&q.push("");var M,I=q[0]===""||q[0]&&q[0].charAt(0)==="/";return Q&&(_.hostname=_.host=I?"":q.length?q.shift():"",(M=!!(_.host&&_.host.indexOf("@")>0)&&_.host.split("@"))&&(_.auth=M.shift(),_.host=_.hostname=M.shift())),(X=X||_.host&&q.length)&&!I&&q.unshift(""),q.length?_.pathname=q.join("/"):(_.pathname=null,_.path=null),o.isNull(_.pathname)&&o.isNull(_.search)||(_.path=(_.pathname?_.pathname:"")+(_.search?_.search:"")),_.auth=T.auth||_.auth,_.slashes=_.slashes||T.slashes,_.href=_.format(),_},s.prototype.parseHost=function(){var T=this.host,w=c.exec(T);w&&((w=w[0])!==":"&&(this.port=w.substr(1)),T=T.substr(0,T.length-w.length)),T&&(this.hostname=T)}},function(a,n,r){(function(i,o){var s;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(u){n&&n.nodeType,i&&i.nodeType;var c=typeof o=="object"&&o;c.global!==c&&c.window!==c&&c.self;var p,l=2147483647,f=/^xn--/,h=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=Math.floor,y=String.fromCharCode;function d(O){throw new RangeError(m[O])}function g(O,b){for(var R=O.length,N=[];R--;)N[R]=b(O[R]);return N}function C(O,b){var R=O.split("@"),N="";return R.length>1&&(N=R[0]+"@",O=R[1]),N+g((O=O.replace(v,".")).split("."),b).join(".")}function S(O){for(var b,R,N=[],L=0,B=O.length;L=55296&&b<=56319&&L65535&&(R+=y((b-=65536)>>>10&1023|55296),b=56320|1023&b),R+=y(b)}).join("")}function w(O,b){return O+22+75*(O<26)-((b!=0)<<5)}function _(O,b,R){var N=0;for(O=R?x(O/700):O>>1,O+=x(O/b);O>455;N+=36)O=x(O/35);return x(N+36*O/(O+38))}function E(O){var b,R,N,L,B,P,F,k,G,W,H,X=[],Y=O.length,q=0,Q=128,ae=72;for((R=O.lastIndexOf("-"))<0&&(R=0),N=0;N=128&&d("not-basic"),X.push(O.charCodeAt(N));for(L=R>0?R+1:0;L=Y&&d("invalid-input"),((k=(H=O.charCodeAt(L++))-48<10?H-22:H-65<26?H-65:H-97<26?H-97:36)>=36||k>x((l-q)/P))&&d("overflow"),q+=k*P,!(k<(G=F<=ae?1:F>=ae+26?26:F-ae));F+=36)P>x(l/(W=36-G))&&d("overflow"),P*=W;ae=_(q-B,b=X.length+1,B==0),x(q/b)>l-Q&&d("overflow"),Q+=x(q/b),q%=b,X.splice(q++,0,Q)}return T(X)}function D(O){var b,R,N,L,B,P,F,k,G,W,H,X,Y,q,Q,ae=[];for(X=(O=S(O)).length,b=128,R=0,B=72,P=0;P=b&&Hx((l-R)/(Y=N+1))&&d("overflow"),R+=(F-b)*Y,b=F,P=0;Pl&&d("overflow"),H==b){for(k=R,G=36;!(k<(W=G<=B?1:G>=B+26?26:G-B));G+=36)Q=k-W,q=36-W,ae.push(y(w(W+Q%q,0))),k=x(Q/q);ae.push(y(w(k,0))),B=_(R,Y,N==L),R=0,++N}++R,++b}return ae.join("")}p={version:"1.4.1",ucs2:{decode:S,encode:T},decode:E,encode:D,toASCII:function(O){return C(O,function(b){return h.test(b)?"xn--"+D(b):b})},toUnicode:function(O){return C(O,function(b){return f.test(b)?E(b.slice(4).toLowerCase()):b})}},(s=function(){return p}.call(n,r,n,i))===void 0||(i.exports=s)})()}).call(this,r(246)(a),r(78))},function(a,n){a.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(a,n,r){a.exports={isString:function(i){return typeof i=="string"},isObject:function(i){return typeof i=="object"&&i!==null},isNull:function(i){return i===null},isNullOrUndefined:function(i){return i==null}}},function(a,n,r){n.decode=n.parse=r(249),n.encode=n.stringify=r(250)},function(a,n,r){function i(s,u){return Object.prototype.hasOwnProperty.call(s,u)}a.exports=function(s,u,c,p){u=u||"&",c=c||"=";var l={};if(typeof s!="string"||s.length===0)return l;var f=/\+/g;s=s.split(u);var h=1e3;p&&typeof p.maxKeys=="number"&&(h=p.maxKeys);var v=s.length;h>0&&v>h&&(v=h);for(var m=0;m=0?(x=C.substr(0,S),y=C.substr(S+1)):(x=C,y=""),d=decodeURIComponent(x),g=decodeURIComponent(y),i(l,d)?o(l[d])?l[d].push(g):l[d]=[l[d],g]:l[d]=g}return l};var o=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"}},function(a,n,r){var i=function(c){switch(typeof c){case"string":return c;case"boolean":return c?"true":"false";case"number":return isFinite(c)?c:"";default:return""}};a.exports=function(c,p,l,f){return p=p||"&",l=l||"=",c===null&&(c=void 0),typeof c=="object"?s(u(c),function(h){var v=encodeURIComponent(i(h))+l;return o(c[h])?s(c[h],function(m){return v+encodeURIComponent(i(m))}).join(p):v+encodeURIComponent(i(c[h]))}).join(p):f?encodeURIComponent(i(f))+l+encodeURIComponent(i(c)):""};var o=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function s(c,p){if(c.map)return c.map(p);for(var l=[],f=0;f=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(2);function s(u){return o.isBoolean(u)?u:u.capture||!1}n.eventTarget_flatten=s,n.eventTarget_flattenMore=function(u){var c=s(u),p=!1,l=!1;return o.isBoolean(u)||(p=u.once||!1,l=u.passive||!1),[c,l,p]},n.eventTarget_addEventListener=function(u,c){if(c.callback!==null){for(var p=0;p=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(2),s=r(29);n.parentNode_convertNodesIntoANode=function(u,c){for(var p,l,f=null,h=0;h=w.length&&(w=void 0),{value:w&&w[D++],done:!w}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(w,_){var E=typeof Symbol=="function"&&w[Symbol.iterator];if(!E)return w;var D,O,b=E.call(w),R=[];try{for(;(_===void 0||_-- >0)&&!(D=b.next()).done;)R.push(D.value)}catch(N){O={error:N}}finally{try{D&&!D.done&&(E=b.return)&&E.call(b)}finally{if(O)throw O.error}}return R},s=this&&this.__spread||function(){for(var w=[],_=0;_0;q--){var Q;if(S(Q=Y[q],w)){X=Q;break}}var ae,ne,ee=[];try{for(var V=i(k._children),M=V.next();!M.done;M=V.next())if(C(J=M.value,w)){if(p.Guard.isDocumentTypeNode(J))throw new c.HierarchyRequestError;ee.push(J)}}catch(re){D={error:re}}finally{try{M&&!M.done&&(O=V.return)&&O.call(V)}finally{if(D)throw D.error}}if(f.tree_isAncestorOf(P,L,!0))ae=L,ne=B;else{for(var I=L;I._parent!==null&&!f.tree_isAncestorOf(P,I._parent);)I=I._parent;if(I._parent===null)throw new Error("Parent node is null.");ae=I._parent,ne=1+f.tree_index(I)}if(p.Guard.isCharacterDataNode(G))(U=m.node_clone(L))._data=v.characterData_substringData(L,B,f.tree_nodeLength(L)-B),x.mutation_append(U,N),v.characterData_replaceData(L,B,f.tree_nodeLength(L)-B,"");else if(G!==null){var U=m.node_clone(G);x.mutation_append(U,N);var z=T(l.create_range([L,B],[G,f.tree_nodeLength(G)]));x.mutation_append(z,U)}try{for(var j=i(ee),$=j.next();!$.done;$=j.next()){var J=$.value;x.mutation_append(J,N)}}catch(re){b={error:re}}finally{try{$&&!$.done&&(R=j.return)&&R.call(j)}finally{if(b)throw b.error}}return p.Guard.isCharacterDataNode(X)?((U=m.node_clone(P))._data=v.characterData_substringData(P,0,F),x.mutation_append(U,N),v.characterData_replaceData(P,0,F,"")):X!==null&&(U=m.node_clone(X),x.mutation_append(U,N),z=T(l.create_range([X,0],[P,F])),x.mutation_append(z,U)),w._start=[ae,ne],w._end=[ae,ne],N}n.range_collapsed=d,n.range_root=g,n.range_isContained=C,n.range_isPartiallyContained=S,n.range_setTheStart=function(w,_,E){if(p.Guard.isDocumentTypeNode(_))throw new c.InvalidNodeTypeError;if(E>f.tree_nodeLength(_))throw new c.IndexSizeError;var D=[_,E];g(w)===f.tree_rootNode(_)&&h.boundaryPoint_position(D,w._end)!==u.BoundaryPosition.After||(w._end=D),w._start=D},n.range_setTheEnd=function(w,_,E){if(p.Guard.isDocumentTypeNode(_))throw new c.InvalidNodeTypeError;if(E>f.tree_nodeLength(_))throw new c.IndexSizeError;var D=[_,E];g(w)===f.tree_rootNode(_)&&h.boundaryPoint_position(D,w._start)!==u.BoundaryPosition.Before||(w._start=D),w._end=D},n.range_select=function(w,_){var E=w._parent;if(E===null)throw new c.InvalidNodeTypeError;var D=f.tree_index(w);_._start=[E,D],_._end=[E,D+1]},n.range_extract=T,n.range_cloneTheContents=function w(_){var E,D,O,b,R,N,L=l.create_documentFragment(_._startNode._nodeDocument);if(d(_))return L;var B=_._startNode,P=_._startOffset,F=_._endNode,k=_._endOffset;B===F&&p.Guard.isCharacterDataNode(B)&&((M=m.node_clone(B))._data=v.characterData_substringData(B,P,k-P),x.mutation_append(M,L));for(var G=B;!f.tree_isAncestorOf(F,G,!0);){if(G._parent===null)throw new Error("Parent node is null.");G=G._parent}var W=null;if(!f.tree_isAncestorOf(F,B,!0))try{for(var H=i(G._children),X=H.next();!X.done;X=H.next())if(S(ae=X.value,_)){W=ae;break}}catch($){E={error:$}}finally{try{X&&!X.done&&(D=H.return)&&D.call(H)}finally{if(E)throw E.error}}var Y=null;if(!f.tree_isAncestorOf(B,F,!0))for(var q=s(G._children),Q=q.length-1;Q>0;Q--){var ae;if(S(ae=q[Q],_)){Y=ae;break}}var ne=[];try{for(var ee=i(G._children),V=ee.next();!V.done;V=ee.next())if(C(j=V.value,_)){if(p.Guard.isDocumentTypeNode(j))throw new c.HierarchyRequestError;ne.push(j)}}catch($){O={error:$}}finally{try{V&&!V.done&&(b=ee.return)&&b.call(ee)}finally{if(O)throw O.error}}if(p.Guard.isCharacterDataNode(W))(M=m.node_clone(B))._data=v.characterData_substringData(B,P,f.tree_nodeLength(B)-P),x.mutation_append(M,L);else if(W!==null){var M=m.node_clone(W);x.mutation_append(M,L);var I=w(l.create_range([B,P],[W,f.tree_nodeLength(W)]));x.mutation_append(I,M)}try{for(var U=i(ne),z=U.next();!z.done;z=U.next()){var j=z.value,M=m.node_clone(j);x.mutation_append(M,L)}}catch($){R={error:$}}finally{try{z&&!z.done&&(N=U.return)&&N.call(U)}finally{if(R)throw R.error}}return p.Guard.isCharacterDataNode(Y)?((M=m.node_clone(F))._data=v.characterData_substringData(F,0,k),x.mutation_append(M,L)):Y!==null&&(M=m.node_clone(Y),L.append(M),I=T(l.create_range([Y,0],[F,k])),x.mutation_append(I,M)),L},n.range_insert=function(w,_){var E,D;if(p.Guard.isProcessingInstructionNode(_._startNode)||p.Guard.isCommentNode(_._startNode)||p.Guard.isTextNode(_._startNode)&&_._startNode._parent===null||_._startNode===w)throw new c.HierarchyRequestError;var O,b=null;if(p.Guard.isTextNode(_._startNode))b=_._startNode;else{var R=0;try{for(var N=i(_._startNode._children),L=N.next();!L.done;L=N.next()){var B=L.value;if(R===_._startOffset){b=B;break}R++}}catch(F){E={error:F}}finally{try{L&&!L.done&&(D=N.return)&&D.call(N)}finally{if(E)throw E.error}}}if(b===null)O=_._startNode;else{if(b._parent===null)throw new Error("Parent node is null.");O=b._parent}x.mutation_ensurePreInsertionValidity(w,O,b),p.Guard.isTextNode(_._startNode)&&(b=y.text_split(_._startNode,_._startOffset)),w===b&&(b=w._nextSibling),w._parent!==null&&x.mutation_remove(w,w._parent);var P=b===null?f.tree_nodeLength(O):f.tree_index(b);p.Guard.isDocumentFragmentNode(w)?P+=f.tree_nodeLength(w):P++,x.mutation_preInsert(w,O,b),d(_)&&(_._end=[O,P])},n.range_getContainedNodes=function(w){var _;return(_={})[Symbol.iterator]=function(){var E=w.commonAncestorContainer,D=f.tree_getFirstDescendantNode(E);return{next:function(){for(;D&&!C(D,w);)D=f.tree_getNextDescendantNode(E,D);if(D===null)return{done:!0,value:null};var O={done:!1,value:D};return D=f.tree_getNextDescendantNode(E,D),O}}},_},n.range_getPartiallyContainedNodes=function(w){var _;return(_={})[Symbol.iterator]=function(){var E=w.commonAncestorContainer,D=f.tree_getFirstDescendantNode(E);return{next:function(){for(;D&&!S(D,w);)D=f.tree_getNextDescendantNode(E,D);if(D===null)return{done:!0,value:null};var O={done:!1,value:D};return D=f.tree_getNextDescendantNode(E,D),O}}},_}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(9);n.selectors_scopeMatchASelectorsString=function(o,s){throw new i.NotSupportedError}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(1),o=r(105);n.treeWalker_traverseChildren=function(s,u){for(var c=u?s._current._firstChild:s._current._lastChild;c!==null;){var p=o.traversal_filter(s,c);if(p===i.FilterResult.Accept)return s._current=c,c;if(p===i.FilterResult.Skip){var l=u?c._firstChild:c._lastChild;if(l!==null){c=l;continue}}for(;c!==null;){var f=u?c._nextSibling:c._previousSibling;if(f!==null){c=f;break}var h=c._parent;if(h===null||h===s._root||h===s._current)return null;c=h}}return null},n.treeWalker_traverseSiblings=function(s,u){var c=s._current;if(c===s._root)return null;for(;;){for(var p=u?c._nextSibling:c._previousSibling;p!==null;){c=p;var l=o.traversal_filter(s,c);if(l===i.FilterResult.Accept)return s._current=c,c;p=u?c._firstChild:c._lastChild,l!==i.FilterResult.Reject&&p!==null||(p=u?c._nextSibling:c._previousSibling)}if((c=c._parent)===null||c===s._root||o.traversal_filter(s,c)===i.FilterResult.Accept)return null}}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),n.nonEntityAmpersandRegex=/&(?![A-Za-z]+;|#\d+;)/g},function(a,n,r){r(89),r(74);var i,o=this&&this.__extends||(i=function(f,h){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,m){v.__proto__=m}||function(v,m){for(var x in m)m.hasOwnProperty(x)&&(v[x]=m[x])})(f,h)},function(f,h){function v(){this.constructor=f}i(f,h),f.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),u=r(1),c=r(50),p=r(3),l=function(f){function h(v,m){var x=f.call(this,v)||this;return x._indentation={},x._lengthToLastNewline=0,x._writerOptions=s.applyDefaults(m,{wellFormed:!1,headless:!1,prettyPrint:!1,indent:" ",newline:` +`,offset:0,width:0,allowEmptyTags:!1,indentTextOnlyNodes:!1,spaceBeforeSlash:!1}),x}return o(h,f),h.prototype.serialize=function(v){return this._refs={suppressPretty:!1,emptyNode:!1,markup:""},v.nodeType!==u.NodeType.Document||this._writerOptions.headless||this.declaration(this._builderOptions.version,this._builderOptions.encoding,this._builderOptions.standalone),this.serializeNode(v,this._writerOptions.wellFormed),this._writerOptions.prettyPrint&&this._refs.markup.slice(-this._writerOptions.newline.length)===this._writerOptions.newline&&(this._refs.markup=this._refs.markup.slice(0,-this._writerOptions.newline.length)),this._refs.markup},h.prototype.declaration=function(v,m,x){this._beginLine(),this._refs.markup+='",this._endLine()},h.prototype.docType=function(v,m,x){this._beginLine(),this._refs.markup+=m&&x?"':m?"':x?"':"",this._endLine()},h.prototype.openTagBegin=function(v){this._beginLine(),this._refs.markup+="<"+v},h.prototype.openTagEnd=function(v,m,x){if(this._refs.suppressPretty=!1,this._refs.emptyNode=!1,this._writerOptions.prettyPrint&&!m&&!x){for(var y=!0,d=!0,g=this.currentNode.firstChild,C=0,S=0;g;){if(p.Guard.isExclusiveTextNode(g))S++;else{if(!p.Guard.isCDATASectionNode(g)){y=!1,d=!1;break}C++}g.data!==""&&(d=!1),g=g.nextSibling}this._refs.suppressPretty=!this._writerOptions.indentTextOnlyNodes&&y&&(C<=1&&S===0||C===0),this._refs.emptyNode=d}(x||m||this._refs.emptyNode)&&this._writerOptions.allowEmptyTags?this._refs.markup+=">":this._refs.markup+=x?" />":m||this._refs.emptyNode?this._writerOptions.spaceBeforeSlash?" />":"/>":">",this._endLine()},h.prototype.closeTag=function(v){this._refs.emptyNode||(this._beginLine(),this._refs.markup+=""),this._refs.suppressPretty=!1,this._refs.emptyNode=!1,this._endLine()},h.prototype.attribute=function(v,m){var x=v+'="'+m+'"';this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._refs.markup.length-this._lengthToLastNewline+1+x.length>this._writerOptions.width?(this._endLine(),this._beginLine(),this._refs.markup+=this._indent(1)+x):this._refs.markup+=" "+x},h.prototype.text=function(v){v!==""&&(this._beginLine(),this._refs.markup+=v,this._endLine())},h.prototype.cdata=function(v){v!==""&&(this._beginLine(),this._refs.markup+="",this._endLine())},h.prototype.comment=function(v){this._beginLine(),this._refs.markup+="",this._endLine()},h.prototype.instruction=function(v,m){this._beginLine(),this._refs.markup+="",this._endLine()},h.prototype._beginLine=function(){this._writerOptions.prettyPrint&&!this._refs.suppressPretty&&(this._refs.markup+=this._indent(this._writerOptions.offset+this.level))},h.prototype._endLine=function(){this._writerOptions.prettyPrint&&!this._refs.suppressPretty&&(this._refs.markup+=this._writerOptions.newline,this._lengthToLastNewline=this._refs.markup.length)},h.prototype._indent=function(v){if(v<=0)return"";if(this._indentation[v]!==void 0)return this._indentation[v];var m=this._writerOptions.indent.repeat(v);return this._indentation[v]=m,m},h}(c.BaseWriter);n.XMLWriter=l},function(a,n,r){var i=r(47),o=r(35);a.exports="".repeat||function(s){var u=String(o(this)),c="",p=i(s);if(p<0||p==1/0)throw RangeError("Wrong number of repetitions");for(;p>0;(p>>>=1)&&(u+=u))1&p&&(c+=u);return c}},function(a,n,r){r(31),r(32),r(33),r(19),r(178),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),s=this&&this.__values||function(l){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&l[f],v=0;if(h)return h.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&v>=l.length&&(l=void 0),{value:l&&l[v++],done:!l}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(67),c=r(2),p=function(l){function f(h,v){var m=l.call(this,h)||this;return m._writerOptions=c.applyDefaults(v,{wellFormed:!1,prettyPrint:!1,indent:" ",newline:` +`,offset:0,group:!1,verbose:!1}),m}return o(f,l),f.prototype.serialize=function(h){var v=c.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1}),m=new u.ObjectWriter(this._builderOptions,v).serialize(h);return this._beginLine(this._writerOptions,0)+this._convertObject(m,this._writerOptions)},f.prototype._convertObject=function(h,v,m){var x,y,d=this;m===void 0&&(m=0);var g="",C=this._isLeafNode(h);if(c.isArray(h)){g+="[";var S=h.length,T=0;try{for(var w=s(h),_=w.next();!_.done;_=w.next()){var E=_.value;g+=this._endLine(v,m+1)+this._beginLine(v,m+1)+this._convertObject(E,v,m+1),T0?new Array(m).join(h.indent):""},f.prototype._endLine=function(h,v){return h.prettyPrint?h.newline:""},f.prototype._key=function(h){return'"'+h+'":'},f.prototype._val=function(h){return JSON.stringify(h)},f.prototype._isLeafNode=function(h){return this._descendantCount(h)<=1},f.prototype._descendantCount=function(h,v){var m=this;return v===void 0&&(v=0),c.isArray(h)?c.forEachArray(h,function(x){return v+=m._descendantCount(x,v)},this):c.isObject(h)?c.forEachObject(h,function(x,y){return v+=m._descendantCount(y,v)},this):v++,v},f}(r(50).BaseWriter);n.JSONWriter=p},function(a,n,r){r(31),r(32),r(33),r(19),r(178),r(89),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),s=this&&this.__values||function(l){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&l[f],v=0;if(h)return h.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&v>=l.length&&(l=void 0),{value:l&&l[v++],done:!l}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var u=r(67),c=r(2),p=function(l){function f(h,v){var m=l.call(this,h)||this;if(m._writerOptions=c.applyDefaults(v,{wellFormed:!1,indent:" ",newline:` +`,offset:0,group:!1,verbose:!1}),m._writerOptions.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(m._writerOptions.offset<0)throw new Error("YAML offset should be zero or a positive number.");return m}return o(f,l),f.prototype.serialize=function(h){var v=c.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1}),m=new u.ObjectWriter(this._builderOptions,v).serialize(h),x=this._beginLine(this._writerOptions,0)+"---"+this._endLine(this._writerOptions)+this._convertObject(m,this._writerOptions,0);return x.slice(-this._writerOptions.newline.length)===this._writerOptions.newline&&(x=x.slice(0,-this._writerOptions.newline.length)),x},f.prototype._convertObject=function(h,v,m,x){var y,d,g=this;x===void 0&&(x=!1);var C="";if(c.isArray(h))try{for(var S=s(h),T=S.next();!T.done;T=S.next()){var w=T.value;C+=this._beginLine(v,m,!0),c.isObject(w)?c.isEmpty(w)?C+='""'+this._endLine(v):C+=this._convertObject(w,v,m,!0):C+=this._val(w)+this._endLine(v)}}catch(_){y={error:_}}finally{try{T&&!T.done&&(d=S.return)&&d.call(S)}finally{if(y)throw y.error}}else c.forEachObject(h,function(_,E){x?(C+=g._key(_),x=!1):C+=g._beginLine(v,m)+g._key(_),c.isObject(E)?c.isEmpty(E)?C+=' ""'+g._endLine(v):C+=g._endLine(v)+g._convertObject(E,v,m+1):C+=" "+g._val(E)+g._endLine(v)},this);return C},f.prototype._beginLine=function(h,v,m){m===void 0&&(m=!1);var x=h.offset+v+1,y=new Array(x).join(h.indent);return m?y.substr(0,y.length-2)+"-"+y.substr(-1,1):y},f.prototype._endLine=function(h){return h.newline},f.prototype._key=function(h){return'"'+h+'":'},f.prototype._val=function(h){return JSON.stringify(h)},f}(r(50).BaseWriter);n.YAMLWriter=p},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0}),r(110).dom.setFeatures(!0);var i=r(110);n.DOMImplementation=i.DOMImplementation;var o=r(272);n.DOMParser=o.DOMParser;var s=r(275);n.XMLSerializer=s.XMLSerializer},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(3),o=r(0),s=function(){function u(){}return u.prototype.before=function(){for(var c=[],p=0;p=p.length&&(p=void 0),{value:p&&p[h++],done:!p}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(6),s=r(3),u=r(7),c=function(){function p(l){this._nodeList=[],this._recordQueue=[],this._callback=l;var f=o.dom.window;u.set.append(f._mutationObservers,this)}return p.prototype.observe=function(l,f){var h,v;if((f=f||{childList:!1,subtree:!1}).attributeOldValue===void 0&&f.attributeFilter===void 0||f.attributes!==void 0||(f.attributes=!0),f.characterDataOldValue!==void 0&&f.characterData===void 0&&(f.characterData=!0),!f.childList&&!f.attributes&&!f.characterData)throw new TypeError;if(f.attributeOldValue&&!f.attributes)throw new TypeError;if(f.attributeFilter!==void 0&&!f.attributes)throw new TypeError;if(f.characterDataOldValue&&!f.characterData)throw new TypeError;var m=!1,x=f,y=function(S){var T,w;if(S.observer===d){m=!0;try{for(var _=(T=void 0,i(d._nodeList)),E=_.next();!E.done;E=_.next()){var D=E.value;u.list.remove(D._registeredObserverList,function(O){return s.Guard.isTransientRegisteredObserver(O)&&O.source===S})}}catch(O){T={error:O}}finally{try{E&&!E.done&&(w=_.return)&&w.call(_)}finally{if(T)throw T.error}}S.options=x}},d=this;try{for(var g=i(l._registeredObserverList),C=g.next();!C.done;C=g.next())y(C.value)}catch(S){h={error:S}}finally{try{C&&!C.done&&(v=g.return)&&v.call(g)}finally{if(h)throw h.error}}m||(l._registeredObserverList.push({observer:this,options:f}),this._nodeList.push(l))},p.prototype.disconnect=function(){var l,f,h=this;try{for(var v=i(this._nodeList),m=v.next();!m.done;m=v.next()){var x=m.value;u.list.remove(x._registeredObserverList,function(y){return y.observer===h})}}catch(y){l={error:y}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(l)throw l.error}}this._recordQueue=[]},p.prototype.takeRecords=function(){var l=this._recordQueue;return this._recordQueue=[],l},p}();n.MutationObserverImpl=c},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(3),o=function(){function s(){}return Object.defineProperty(s.prototype,"previousElementSibling",{get:function(){for(var u=i.Cast.asNode(this)._previousSibling;u;){if(i.Guard.isElementNode(u))return u;u=u._previousSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"nextElementSibling",{get:function(){for(var u=i.Cast.asNode(this)._nextSibling;u;){if(i.Guard.isElementNode(u))return u;u=u._nextSibling}return null},enumerable:!0,configurable:!0}),s}();n.NonDocumentTypeChildNodeImpl=o},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(3),o=r(0),s=function(){function u(){}return u.prototype.getElementById=function(c){for(var p=o.tree_getFirstDescendantNode(i.Cast.asNode(this),!1,!1,function(l){return i.Guard.isElementNode(l)});p!==null;){if(p._uniqueIdentifier===c)return p;p=o.tree_getNextDescendantNode(i.Cast.asNode(this),p,!1,!1,function(l){return i.Guard.isElementNode(l)})}return null},u}();n.NonElementParentNodeImpl=s},function(a,n,r){var i=this&&this.__values||function(c){var p=typeof Symbol=="function"&&Symbol.iterator,l=p&&c[p],f=0;if(l)return l.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&f>=c.length&&(c=void 0),{value:c&&c[f++],done:!c}}};throw new TypeError(p?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(3),s=r(0),u=function(){function c(){}return Object.defineProperty(c.prototype,"children",{get:function(){return s.create_htmlCollection(o.Cast.asNode(this))},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"firstElementChild",{get:function(){for(var p=o.Cast.asNode(this)._firstChild;p;){if(o.Guard.isElementNode(p))return p;p=p._nextSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"lastElementChild",{get:function(){for(var p=o.Cast.asNode(this)._lastChild;p;){if(o.Guard.isElementNode(p))return p;p=p._previousSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"childElementCount",{get:function(){var p,l,f=0;try{for(var h=i(o.Cast.asNode(this)._children),v=h.next();!v.done;v=h.next()){var m=v.value;o.Guard.isElementNode(m)&&f++}}catch(x){p={error:x}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(p)throw p.error}}return f},enumerable:!0,configurable:!0}),c.prototype.prepend=function(){for(var p=[],l=0;l0)&&!(x=d.next()).done;)g.push(x.value)}catch(C){y={error:C}}finally{try{x&&!x.done&&(m=d.return)&&m.call(d)}finally{if(y)throw y.error}}return g},o=this&&this.__values||function(h){var v=typeof Symbol=="function"&&Symbol.iterator,m=v&&h[v],x=0;if(m)return m.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&x>=h.length&&(h=void 0),{value:h&&h[x++],done:!h}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var s=r(180),u=r(111),c=r(7),p=r(0),l=r(69),f=function(){function h(){}return h.prototype.parse=function(v){for(var m,x,y,d,g=new s.XMLStringLexer(v,{skipWhitespaceOnlyText:!0}),C=p.create_document(),S=C,T=g.nextToken();T.type!==u.TokenType.EOF;){switch(T.type){case u.TokenType.Declaration:var w=T;if(w.version!=="1.0")throw new Error("Invalid xml version: "+w.version);break;case u.TokenType.DocType:var _=T;if(!p.xml_isPubidChar(_.pubId))throw new Error("DocType public identifier does not match PubidChar construct.");if(!p.xml_isLegalChar(_.sysId)||_.sysId.indexOf('"')!==-1&&_.sysId.indexOf("'")!==-1)throw new Error("DocType system identifier contains invalid characters.");S.appendChild(C.implementation.createDocumentType(_.name,_.pubId,_.sysId));break;case u.TokenType.CDATA:var E=T;if(!p.xml_isLegalChar(E.data)||E.data.indexOf("]]>")!==-1)throw new Error("CDATA contains invalid characters.");S.appendChild(C.createCDATASection(E.data));break;case u.TokenType.Comment:var D=T;if(!p.xml_isLegalChar(D.data)||D.data.indexOf("--")!==-1||D.data.endsWith("-"))throw new Error("Comment data contains invalid characters.");S.appendChild(C.createComment(D.data));break;case u.TokenType.PI:var O=T;if(O.target.indexOf(":")!==-1||/^xml$/i.test(O.target))throw new Error("Processing instruction target contains invalid characters.");if(!p.xml_isLegalChar(O.data)||O.data.indexOf("?>")!==-1)throw new Error("Processing instruction data contains invalid characters.");S.appendChild(C.createProcessingInstruction(O.target,O.data));break;case u.TokenType.Text:var b=T;if(!p.xml_isLegalChar(b.data))throw new Error("Text data contains invalid characters.");S.appendChild(C.createTextNode(this._decodeText(b.data)));break;case u.TokenType.Element:var R=T,N=i(p.namespace_extractQName(R.name),2),L=N[0],B=N[1];if(B.indexOf(":")!==-1||!p.xml_isName(B))throw new Error("Node local name contains invalid characters.");if(L==="xmlns")throw new Error("An element cannot have the 'xmlns' prefix.");var P=S.lookupNamespaceURI(L),F={};try{for(var k=(m=void 0,o(R.attributes)),G=k.next();!G.done;G=k.next()){var W=i(G.value,2),H=W[0],X=W[1];if(H==="xmlns")P=X;else{var Y=i(p.namespace_extractQName(H),2),q=Y[0],Q=Y[1];q==="xmlns"&&(Q===L&&(P=X),F[Q]=X)}}}catch(z){m={error:z}}finally{try{G&&!G.done&&(x=k.return)&&x.call(k)}finally{if(m)throw m.error}}var ae=P!==null?C.createElementNS(P,R.name):C.createElement(R.name);S.appendChild(ae);var ne=new l.LocalNameSet;try{for(var ee=(y=void 0,o(R.attributes)),V=ee.next();!V.done;V=ee.next()){var M=i(V.value,2),I=(H=M[0],X=M[1],i(p.namespace_extractQName(H),2)),U=(q=I[0],Q=I[1],null);if(q==="xmlns"||q===null&&Q==="xmlns"?U=c.namespace.XMLNS:(U=ae.lookupNamespaceURI(q))!==null&&ae.isDefaultNamespace(U)?U=null:U===null&&q!==null&&(U=F[q]||null),ne.has(U,Q))throw new Error("Element contains duplicate attributes.");if(ne.set(U,Q),U===c.namespace.XMLNS&&X===c.namespace.XMLNS)throw new Error("XMLNS namespace is reserved.");if(Q.indexOf(":")!==-1||!p.xml_isName(Q))throw new Error("Attribute local name contains invalid characters.");if(q==="xmlns"&&X==="")throw new Error("Empty XML namespace is not allowed.");U!==null?ae.setAttributeNS(U,H,this._decodeAttributeValue(X)):ae.setAttribute(H,this._decodeAttributeValue(X))}}catch(z){y={error:z}}finally{try{V&&!V.done&&(d=ee.return)&&d.call(ee)}finally{if(y)throw y.error}}R.selfClosing||(S=ae);break;case u.TokenType.ClosingTag:if(T.name!==S.nodeName)throw new Error("Closing tag name does not match opening tag name.");S._parent&&(S=S._parent)}T=g.nextToken()}return C},h.prototype._decodeText=function(v){return v==null?v:v.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},h.prototype._decodeAttributeValue=function(v){return v==null?v:v.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},h}();n.XMLParserImpl=f},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(276);n.XMLSerializer=i.XMLSerializerImpl},function(a,n,r){var i=this&&this.__values||function(h){var v=typeof Symbol=="function"&&Symbol.iterator,m=v&&h[v],x=0;if(m)return m.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&x>=h.length&&(h=void 0),{value:h&&h[x++],done:!h}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var o=r(1),s=r(69),u=r(95),c=r(9),p=r(7),l=r(0),f=function(){function h(){}return h.prototype.serializeToString=function(v){return this._xmlSerialization(v,!1)},h.prototype._xmlSerialization=function(v,m){if(v._nodeDocument===void 0||v._nodeDocument._hasNamespaces){var x=new u.NamespacePrefixMap;x.set("xml",p.namespace.XML);try{return this._serializeNodeNS(v,null,x,{value:1},m)}catch{throw new c.InvalidStateError}}else try{return this._serializeNode(v,m)}catch{throw new c.InvalidStateError}},h.prototype._serializeNodeNS=function(v,m,x,y,d){switch(v.nodeType){case o.NodeType.Element:return this._serializeElementNS(v,m,x,y,d);case o.NodeType.Document:return this._serializeDocumentNS(v,m,x,y,d);case o.NodeType.Comment:return this._serializeComment(v,d);case o.NodeType.Text:return this._serializeText(v,d);case o.NodeType.DocumentFragment:return this._serializeDocumentFragmentNS(v,m,x,y,d);case o.NodeType.DocumentType:return this._serializeDocumentType(v,d);case o.NodeType.ProcessingInstruction:return this._serializeProcessingInstruction(v,d);case o.NodeType.CData:return this._serializeCData(v,d);default:throw new Error("Unknown node type: "+v.nodeType)}},h.prototype._serializeNode=function(v,m){switch(v.nodeType){case o.NodeType.Element:return this._serializeElement(v,m);case o.NodeType.Document:return this._serializeDocument(v,m);case o.NodeType.Comment:return this._serializeComment(v,m);case o.NodeType.Text:return this._serializeText(v,m);case o.NodeType.DocumentFragment:return this._serializeDocumentFragment(v,m);case o.NodeType.DocumentType:return this._serializeDocumentType(v,m);case o.NodeType.ProcessingInstruction:return this._serializeProcessingInstruction(v,m);case o.NodeType.CData:return this._serializeCData(v,m);default:throw new Error("Unknown node type: "+v.nodeType)}},h.prototype._serializeElementNS=function(v,m,x,y,d){var g,C;if(d&&(v.localName.indexOf(":")!==-1||!l.xml_isName(v.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var S="<",T="",w=!1,_=!1,E=x.copy(),D={},O=this._recordNamespaceInformation(v,E,D),b=m,R=v.namespaceURI;if(b===R)O!==null&&(_=!0),S+=T=R===p.namespace.XML?"xml:"+v.localName:v.localName;else{var N=v.prefix,L=null;if(N===null&&R===O||(L=E.get(N,R)),N==="xmlns"){if(d)throw new Error("An element cannot have the 'xmlns' prefix (well-formed required).");L=N}L!==null?(T=L+":"+v.localName,O!==null&&O!==p.namespace.XML&&(b=O||null),S+=T):N!==null?(N in D&&(N=this._generatePrefix(R,E,y)),E.set(N,R),S+=T+=N+":"+v.localName,S+=" xmlns:"+N+'="'+this._serializeAttributeValue(R,d)+'"',O!==null&&(b=O||null)):O===null||O!==null&&O!==R?(_=!0,b=R,S+=T+=v.localName,S+=' xmlns="'+this._serializeAttributeValue(R,d)+'"'):(b=R,S+=T+=v.localName)}S+=this._serializeAttributesNS(v,E,y,D,_,d);var B=R===p.namespace.HTML;if(B&&v.childNodes.length===0&&h._VoidElementNames.has(v.localName)?(S+=" /",w=!0):B||v.childNodes.length!==0||(S+="/",w=!0),S+=">",w)return S;if(!(B&&v.localName==="template"))try{for(var P=i(v._children||v.childNodes),F=P.next();!F.done;F=P.next()){var k=F.value;S+=this._serializeNodeNS(k,b,E,y,d)}}catch(G){g={error:G}}finally{try{F&&!F.done&&(C=P.return)&&C.call(P)}finally{if(g)throw g.error}}return S+=""},h.prototype._serializeDocumentNS=function(v,m,x,y,d){var g,C;if(d&&v.documentElement===null)throw new Error("Missing document element (well-formed required).");var S="";try{for(var T=i(v._children||v.childNodes),w=T.next();!w.done;w=T.next()){var _=w.value;S+=this._serializeNodeNS(_,m,x,y,d)}}catch(E){g={error:E}}finally{try{w&&!w.done&&(C=T.return)&&C.call(T)}finally{if(g)throw g.error}}return S},h.prototype._serializeComment=function(v,m){if(m&&(!l.xml_isLegalChar(v.data)||v.data.indexOf("--")!==-1||v.data.endsWith("-")))throw new Error("Comment data contains invalid characters (well-formed required).");return""},h.prototype._serializeText=function(v,m){if(m&&!l.xml_isLegalChar(v.data))throw new Error("Text data contains invalid characters (well-formed required).");for(var x="",y=0;y"?">":d}return x},h.prototype._serializeDocumentFragmentNS=function(v,m,x,y,d){var g,C,S="";try{for(var T=i(v._children||v.childNodes),w=T.next();!w.done;w=T.next()){var _=w.value;S+=this._serializeNodeNS(_,m,x,y,d)}}catch(E){g={error:E}}finally{try{w&&!w.done&&(C=T.return)&&C.call(T)}finally{if(g)throw g.error}}return S},h.prototype._serializeDocumentType=function(v,m){if(m&&!l.xml_isPubidChar(v.publicId))throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");if(m&&(!l.xml_isLegalChar(v.systemId)||v.systemId.indexOf('"')!==-1&&v.systemId.indexOf("'")!==-1))throw new Error("DocType system identifier contains invalid characters (well-formed required).");return v.publicId&&v.systemId?"':v.publicId?"':v.systemId?"':""},h.prototype._serializeProcessingInstruction=function(v,m){if(m&&(v.target.indexOf(":")!==-1||/^xml$/i.test(v.target)))throw new Error("Processing instruction target contains invalid characters (well-formed required).");if(m&&(!l.xml_isLegalChar(v.data)||v.data.indexOf("?>")!==-1))throw new Error("Processing instruction data contains invalid characters (well-formed required).");return""},h.prototype._serializeCData=function(v,m){if(m&&v.data.indexOf("]]>")!==-1)throw new Error("CDATA contains invalid characters (well-formed required).");return""},h.prototype._serializeAttributesNS=function(v,m,x,y,d,g){var C,S,T="",w=g?new s.LocalNameSet:void 0;try{for(var _=i(v.attributes),E=_.next();!E.done;E=_.next()){var D=E.value;if(d||g||D.namespaceURI!==null){if(g&&w&&w.has(D.namespaceURI,D.localName))throw new Error("Element contains duplicate attributes (well-formed required).");g&&w&&w.set(D.namespaceURI,D.localName);var O=D.namespaceURI,b=null;if(O!==null)if(b=m.get(D.prefix,O),O===p.namespace.XMLNS){if(D.value===p.namespace.XML||D.prefix===null&&d||D.prefix!==null&&(!(D.localName in y)||y[D.localName]!==D.value)&&m.has(D.localName,D.value))continue;if(g&&D.value===p.namespace.XMLNS)throw new Error("XMLNS namespace is reserved (well-formed required).");if(g&&D.value==="")throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");D.prefix==="xmlns"&&(b="xmlns")}else b===null&&(T+=" xmlns:"+(b=D.prefix===null||m.hasPrefix(D.prefix)&&!m.has(D.prefix,O)?this._generatePrefix(O,m,x):D.prefix)+'="'+this._serializeAttributeValue(O,g)+'"');if(T+=" ",b!==null&&(T+=b+":"),g&&(D.localName.indexOf(":")!==-1||!l.xml_isName(D.localName)||D.localName==="xmlns"&&O===null))throw new Error("Attribute local name contains invalid characters (well-formed required).");T+=D.localName+'="'+this._serializeAttributeValue(D.value,g)+'"'}else T+=" "+D.localName+'="'+this._serializeAttributeValue(D.value,g)+'"'}}catch(R){C={error:R}}finally{try{E&&!E.done&&(S=_.return)&&S.call(_)}finally{if(C)throw C.error}}return T},h.prototype._recordNamespaceInformation=function(v,m,x){var y,d,g=null;try{for(var C=i(v.attributes),S=C.next();!S.done;S=C.next()){var T=S.value,w=T.namespaceURI,_=T.prefix;if(w===p.namespace.XMLNS){if(_===null){g=T.value;continue}var E=T.localName,D=T.value;if(D===p.namespace.XML||(D===""&&(D=null),m.has(E,D)))continue;m.set(E,D),x[E]=D||""}}}catch(O){y={error:O}}finally{try{S&&!S.done&&(d=C.return)&&d.call(C)}finally{if(y)throw y.error}}return g},h.prototype._generatePrefix=function(v,m,x){var y="ns"+x.value;return x.value++,m.set(y,v),y},h.prototype._serializeAttributeValue=function(v,m){if(m&&v!==null&&!l.xml_isLegalChar(v))throw new Error("Invalid characters in attribute value.");if(v===null)return"";for(var x="",y=0;y"?">":d}return x},h.prototype._serializeElement=function(v,m){var x,y;if(m&&(v.localName.indexOf(":")!==-1||!l.xml_isName(v.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var d=!1,g=v.localName,C="<"+g;if(C+=this._serializeAttributes(v,m),v._children.size===0&&(C+="/",d=!0),C+=">",d)return C;try{for(var S=i(v._children),T=S.next();!T.done;T=S.next()){var w=T.value;C+=this._serializeNode(w,m)}}catch(_){x={error:_}}finally{try{T&&!T.done&&(y=S.return)&&y.call(S)}finally{if(x)throw x.error}}return C+=""},h.prototype._serializeDocument=function(v,m){var x,y;if(m&&v.documentElement===null)throw new Error("Missing document element (well-formed required).");var d="";try{for(var g=i(v._children),C=g.next();!C.done;C=g.next()){var S=C.value;d+=this._serializeNode(S,m)}}catch(T){x={error:T}}finally{try{C&&!C.done&&(y=g.return)&&y.call(g)}finally{if(x)throw x.error}}return d},h.prototype._serializeDocumentFragment=function(v,m){var x,y,d="";try{for(var g=i(v._children),C=g.next();!C.done;C=g.next()){var S=C.value;d+=this._serializeNode(S,m)}}catch(T){x={error:T}}finally{try{C&&!C.done&&(y=g.return)&&y.call(g)}finally{if(x)throw x.error}}return d},h.prototype._serializeAttributes=function(v,m){var x,y,d="",g=m?{}:void 0;try{for(var C=i(v.attributes),S=C.next();!S.done;S=C.next()){var T=S.value;if(m&&g&&T.localName in g)throw new Error("Element contains duplicate attributes (well-formed required).");if(m&&g&&(g[T.localName]=!0),m&&(T.localName.indexOf(":")!==-1||!l.xml_isName(T.localName)))throw new Error("Attribute local name contains invalid characters (well-formed required).");d+=" "+T.localName+'="'+this._serializeAttributeValue(T.value,m)+'"'}}catch(w){x={error:w}}finally{try{S&&!S.done&&(y=C.return)&&y.call(C)}finally{if(x)throw x.error}}return d},h._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),h}();n.XMLSerializerImpl=f},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(278);n.XMLReader=i.XMLReader;var o=r(112);n.ObjectReader=o.ObjectReader;var s=r(281);n.JSONReader=s.JSONReader;var u=r(282);n.YAMLReader=u.YAMLReader},function(a,n,r){r(31),r(32),r(33),r(19),r(65),r(20),r(22),r(23);var i,o=this&&this.__extends||(i=function(m,x){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,d){y.__proto__=d}||function(y,d){for(var g in d)d.hasOwnProperty(g)&&(y[g]=d[g])})(m,x)},function(m,x){function y(){this.constructor=m}i(m,x),m.prototype=x===null?Object.create(x):(y.prototype=x.prototype,new y)}),s=this&&this.__read||function(m,x){var y=typeof Symbol=="function"&&m[Symbol.iterator];if(!y)return m;var d,g,C=y.call(m),S=[];try{for(;(x===void 0||x-- >0)&&!(d=C.next()).done;)S.push(d.value)}catch(T){g={error:T}}finally{try{d&&!d.done&&(y=C.return)&&y.call(C)}finally{if(g)throw g.error}}return S},u=this&&this.__values||function(m){var x=typeof Symbol=="function"&&Symbol.iterator,y=x&&m[x],d=0;if(y)return y.call(m);if(m&&typeof m.length=="number")return{next:function(){return m&&d>=m.length&&(m=void 0),{value:m&&m[d++],done:!m}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var c=r(180),p=r(111),l=r(1),f=r(7),h=r(0),v=function(m){function x(){return m!==null&&m.apply(this,arguments)||this}return o(x,m),x.prototype._parse=function(y,d){for(var g,C,S,T,w=new c.XMLStringLexer(d,{skipWhitespaceOnlyText:this._builderOptions.skipWhitespaceOnlyText}),_=y,E=y,D=w.nextToken();D.type!==p.TokenType.EOF;){switch(D.type){case p.TokenType.Declaration:var O=D,b=this.sanitize(O.version);if(b!=="1.0")throw new Error("Invalid xml version: "+b);var R={version:b};O.encoding&&(R.encoding=this.sanitize(O.encoding)),O.standalone&&(R.standalone=this.sanitize(O.standalone)==="yes"),E.set(R);break;case p.TokenType.DocType:var N=D;E=this.docType(E,this.sanitize(N.name),this.sanitize(N.pubId),this.sanitize(N.sysId))||E;break;case p.TokenType.CDATA:var L=D;E=this.cdata(E,this.sanitize(L.data))||E;break;case p.TokenType.Comment:var B=D;E=this.comment(E,this.sanitize(B.data))||E;break;case p.TokenType.PI:var P=D;E=this.instruction(E,this.sanitize(P.target),this.sanitize(P.data))||E;break;case p.TokenType.Text:if(E.node.nodeType===l.NodeType.Document)break;var F=D;E=this.text(E,this._decodeText(this.sanitize(F.data)))||E;break;case p.TokenType.Element:var k=D,G=this.sanitize(k.name),W=s(h.namespace_extractQName(G),1)[0],H=E.node.lookupNamespaceURI(W),X={};try{for(var Y=(g=void 0,u(k.attributes)),q=Y.next();!q.done;q=Y.next()){var Q=s(q.value,2),ae=Q[0],ne=Q[1];if(ae=this.sanitize(ae),ne=this.sanitize(ne),ae==="xmlns")H=ne;else{var ee=s(h.namespace_extractQName(ae),2),V=ee[0],M=ee[1];V==="xmlns"&&(M===W&&(H=ne),X[M]=ne)}}}catch(re){g={error:re}}finally{try{q&&!q.done&&(C=Y.return)&&C.call(Y)}finally{if(g)throw g.error}}var I=H!==null?this.element(E,H,G):this.element(E,void 0,G);if(I===void 0)break;E.node===y.node&&(_=I);try{for(var U=(S=void 0,u(k.attributes)),z=U.next();!z.done;z=U.next()){var j=s(z.value,2);ae=j[0],ne=j[1],ae=this.sanitize(ae),ne=this.sanitize(ne);var $=s(h.namespace_extractQName(ae),2),J=(V=$[0],M=$[1],null);V==="xmlns"||V===null&&M==="xmlns"?J=f.namespace.XMLNS:(J=I.node.lookupNamespaceURI(V))!==null&&I.node.isDefaultNamespace(J)?J=null:J===null&&V!==null&&(J=X[V]||null),J!==null?this.attribute(I,J,ae,this._decodeAttributeValue(ne)):this.attribute(I,void 0,ae,this._decodeAttributeValue(ne))}}catch(re){S={error:re}}finally{try{z&&!z.done&&(T=U.return)&&T.call(U)}finally{if(S)throw S.error}}k.selfClosing||(E=I);break;case p.TokenType.ClosingTag:E.node.parentNode&&(E=E.up())}D=w.nextToken()}return _},x}(r(75).BaseReader);n.XMLReader=v},function(a,n,r){var i=r(4),o=r(280);i({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(a,n,r){var i=r(16),o=r(8),s=r(61),u=r(85),c=r(79),p=r(27),l=r(41),f=Object.assign,h=Object.defineProperty;a.exports=!f||o(function(){if(i&&f({b:1},f(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},m={},x=Symbol();return v[x]=7,"abcdefghijklmnopqrst".split("").forEach(function(y){m[y]=y}),f({},v)[x]!=7||s(f({},m)).join("")!="abcdefghijklmnopqrst"})?function(v,m){for(var x=p(v),y=arguments.length,d=1,g=u.f,C=c.f;y>d;)for(var S,T=l(arguments[d++]),w=g?s(T).concat(g(T)):s(T),_=w.length,E=0;_>E;)S=w[E++],i&&!C.call(T,S)||(x[S]=T[S]);return x}:f},function(a,n,r){var i,o=this&&this.__extends||(i=function(c,p){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,f){l.__proto__=f}||function(l,f){for(var h in f)f.hasOwnProperty(h)&&(l[h]=f[h])})(c,p)},function(c,p){function l(){this.constructor=c}i(c,p),c.prototype=p===null?Object.create(p):(l.prototype=p.prototype,new l)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(112),u=function(c){function p(){return c!==null&&c.apply(this,arguments)||this}return o(p,c),p.prototype._parse=function(l,f){return new s.ObjectReader(this._builderOptions).parse(l,JSON.parse(f))},p}(r(75).BaseReader);n.JSONReader=u},function(a,n,r){var i,o=this&&this.__extends||(i=function(l,f){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)v.hasOwnProperty(m)&&(h[m]=v[m])})(l,f)},function(l,f){function h(){this.constructor=l}i(l,f),l.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)});Object.defineProperty(n,"__esModule",{value:!0});var s=r(112),u=r(75),c=r(283),p=function(l){function f(){return l!==null&&l.apply(this,arguments)||this}return o(f,l),f.prototype._parse=function(h,v){var m=c.safeLoad(v);if(m===void 0)throw new Error("Unable to parse YAML document.");return new s.ObjectReader(this._builderOptions).parse(h,m)},f}(u.BaseReader);n.YAMLReader=p},function(a,n,r){var i=r(284);a.exports=i},function(a,n,r){var i=r(285),o=r(304);function s(u){return function(){throw new Error("Function "+u+" is deprecated and cannot be used.")}}a.exports.Type=r(10),a.exports.Schema=r(39),a.exports.FAILSAFE_SCHEMA=r(113),a.exports.JSON_SCHEMA=r(182),a.exports.CORE_SCHEMA=r(181),a.exports.DEFAULT_SAFE_SCHEMA=r(54),a.exports.DEFAULT_FULL_SCHEMA=r(76),a.exports.load=i.load,a.exports.loadAll=i.loadAll,a.exports.safeLoad=i.safeLoad,a.exports.safeLoadAll=i.safeLoadAll,a.exports.dump=o.dump,a.exports.safeDump=o.safeDump,a.exports.YAMLException=r(53),a.exports.MINIMAL_SCHEMA=r(113),a.exports.SAFE_SCHEMA=r(54),a.exports.DEFAULT_SCHEMA=r(76),a.exports.scan=s("scan"),a.exports.parse=s("parse"),a.exports.compose=s("compose"),a.exports.addConstructor=s("addConstructor")},function(a,n,r){var i=r(38),o=r(53),s=r(286),u=r(54),c=r(76),p=Object.prototype.hasOwnProperty,l=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,h=/[,\[\]\{\}]/,v=/^(?:!|!!|![a-z\-]+!)$/i,m=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function x(M){return Object.prototype.toString.call(M)}function y(M){return M===10||M===13}function d(M){return M===9||M===32}function g(M){return M===9||M===32||M===10||M===13}function C(M){return M===44||M===91||M===93||M===123||M===125}function S(M){var I;return 48<=M&&M<=57?M-48:97<=(I=32|M)&&I<=102?I-97+10:-1}function T(M){return M===48?"\0":M===97?"\x07":M===98?"\b":M===116||M===9?" ":M===110?` +`:M===118?"\v":M===102?"\f":M===114?"\r":M===101?"\x1B":M===32?" ":M===34?'"':M===47?"/":M===92?"\\":M===78?"…":M===95?" ":M===76?"\u2028":M===80?"\u2029":""}function w(M){return M<=65535?String.fromCharCode(M):String.fromCharCode(55296+(M-65536>>10),56320+(M-65536&1023))}for(var _=new Array(256),E=new Array(256),D=0;D<256;D++)_[D]=T(D)?1:0,E[D]=T(D);function O(M,I){this.input=M,this.filename=I.filename||null,this.schema=I.schema||c,this.onWarning=I.onWarning||null,this.legacy=I.legacy||!1,this.json=I.json||!1,this.listener=I.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=M.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function b(M,I){return new o(I,new s(M.filename,M.input,M.position,M.line,M.position-M.lineStart))}function R(M,I){throw b(M,I)}function N(M,I){M.onWarning&&M.onWarning.call(null,b(M,I))}var L={YAML:function(M,I,U){var z,j,$;M.version!==null&&R(M,"duplication of %YAML directive"),U.length!==1&&R(M,"YAML directive accepts exactly one argument"),(z=/^([0-9]+)\.([0-9]+)$/.exec(U[0]))===null&&R(M,"ill-formed argument of the YAML directive"),j=parseInt(z[1],10),$=parseInt(z[2],10),j!==1&&R(M,"unacceptable YAML version of the document"),M.version=U[0],M.checkLineBreaks=$<2,$!==1&&$!==2&&N(M,"unsupported YAML version of the document")},TAG:function(M,I,U){var z,j;U.length!==2&&R(M,"TAG directive accepts exactly two arguments"),z=U[0],j=U[1],v.test(z)||R(M,"ill-formed tag handle (first argument) of the TAG directive"),p.call(M.tagMap,z)&&R(M,'there is a previously declared suffix for "'+z+'" tag handle'),m.test(j)||R(M,"ill-formed tag prefix (second argument) of the TAG directive"),M.tagMap[z]=j}};function B(M,I,U,z){var j,$,J,re;if(I1&&(M.result+=i.repeat(` +`,I-1))}function X(M,I){var U,z,j=M.tag,$=M.anchor,J=[],re=!1;for(M.anchor!==null&&(M.anchorMap[M.anchor]=J),z=M.input.charCodeAt(M.position);z!==0&&z===45&&g(M.input.charCodeAt(M.position+1));)if(re=!0,M.position++,G(M,!0,-1)&&M.lineIndent<=I)J.push(null),z=M.input.charCodeAt(M.position);else if(U=M.line,Q(M,I,3,!1,!0),J.push(M.result),G(M,!0,-1),z=M.input.charCodeAt(M.position),(M.line===U||M.lineIndent>I)&&z!==0)R(M,"bad indentation of a sequence entry");else if(M.lineIndentI?ke=1:M.lineIndent===I?ke=0:M.lineIndentI?ke=1:M.lineIndent===I?ke=0:M.lineIndentDe)&&(Q(K,De,4,!0,te)&&(it?wt=K.result:Ft=K.result),it||(F(K,Se,Be,Ie,wt,Ft,ce,he),Ie=wt=Ft=null),G(K,!0,-1),fe=K.input.charCodeAt(K.position)),K.lineIndent>De&&fe!==0)R(K,"bad indentation of a mapping entry");else if(K.lineIndent=0))break;te===0?R(K,"bad explicit indentation width of a block scalar; it cannot be less than one"):Ve?R(K,"repeat of an indentation width identifier"):(Se=De+te-1,Ve=!0)}if(d(ce)){do ce=K.input.charCodeAt(++K.position);while(d(ce));if(ce===35)do ce=K.input.charCodeAt(++K.position);while(!y(ce)&&ce!==0)}for(;ce!==0;){for(k(K),K.lineIndent=0,ce=K.input.charCodeAt(K.position);(!Ve||K.lineIndentSe&&(Se=K.lineIndent),y(ce))Be++;else{if(K.lineIndent0){for(te=he,ce=0;te>0;te--)(he=S(fe=K.input.charCodeAt(++K.position)))>=0?ce=(ce<<4)+he:R(K,"expected hexadecimal character");K.result+=w(ce),K.position++}else R(K,"unknown escape sequence");Oe=ve=K.position}else y(fe)?(B(K,Oe,ve,!0),H(K,G(K,!1,De)),Oe=ve=K.position):K.position===K.lineStart&&W(K)?R(K,"unexpected end of the document within a double quoted scalar"):(K.position++,ve=K.position)}R(K,"unexpected end of the stream within a double quoted scalar")}(M,Ce)?nt=!0:function(K){var De,Oe,ve;if((ve=K.input.charCodeAt(K.position))!==42)return!1;for(ve=K.input.charCodeAt(++K.position),De=K.position;ve!==0&&!g(ve)&&!C(ve);)ve=K.input.charCodeAt(++K.position);return K.position===De&&R(K,"name of an alias node must contain at least one character"),Oe=K.input.slice(De,K.position),p.call(K.anchorMap,Oe)||R(K,'unidentified alias "'+Oe+'"'),K.result=K.anchorMap[Oe],G(K,!0,-1),!0}(M)?(nt=!0,M.tag===null&&M.anchor===null||R(M,"alias node should not have any properties")):function(K,De,Oe){var ve,te,ce,he,fe,ye,Ve,Se,Be=K.kind,Ie=K.result;if(g(Se=K.input.charCodeAt(K.position))||C(Se)||Se===35||Se===38||Se===42||Se===33||Se===124||Se===62||Se===39||Se===34||Se===37||Se===64||Se===96||(Se===63||Se===45)&&(g(ve=K.input.charCodeAt(K.position+1))||Oe&&C(ve)))return!1;for(K.kind="scalar",K.result="",te=ce=K.position,he=!1;Se!==0;){if(Se===58){if(g(ve=K.input.charCodeAt(K.position+1))||Oe&&C(ve))break}else if(Se===35){if(g(K.input.charCodeAt(K.position-1)))break}else{if(K.position===K.lineStart&&W(K)||Oe&&C(Se))break;if(y(Se)){if(fe=K.line,ye=K.lineStart,Ve=K.lineIndent,G(K,!1,-1),K.lineIndent>=De){he=!0,Se=K.input.charCodeAt(K.position);continue}K.position=ce,K.line=fe,K.lineStart=ye,K.lineIndent=Ve;break}}he&&(B(K,te,ce,!1),H(K,K.line-fe),te=ce=K.position,he=!1),d(Se)||(ce=K.position+1),Se=K.input.charCodeAt(++K.position)}return B(K,te,ce,!1),!!K.result||(K.kind=Be,K.result=Ie,!1)}(M,Ce,U===1)&&(nt=!0,M.tag===null&&(M.tag="?")),M.anchor!==null&&(M.anchorMap[M.anchor]=M.result)):ke===0&&(nt=re&&X(M,Xe))),M.tag!==null&&M.tag!=="!")if(M.tag==="?"){for(M.result!==null&&M.kind!=="scalar"&&R(M,'unacceptable node kind for ! tag; it should be "scalar", not "'+M.kind+'"'),oe=0,ue=M.implicitTypes.length;oe tag; it should be "'+Te.kind+'", not "'+M.kind+'"'),Te.resolve(M.result)?(M.result=Te.construct(M.result),M.anchor!==null&&(M.anchorMap[M.anchor]=M.result)):R(M,"cannot resolve a node with !<"+M.tag+"> explicit tag")):R(M,"unknown tag !<"+M.tag+">");return M.listener!==null&&M.listener("close",M),M.tag!==null||M.anchor!==null||nt}function ae(M){var I,U,z,j,$=M.position,J=!1;for(M.version=null,M.checkLineBreaks=M.legacy,M.tagMap={},M.anchorMap={};(j=M.input.charCodeAt(M.position))!==0&&(G(M,!0,-1),j=M.input.charCodeAt(M.position),!(M.lineIndent>0||j!==37));){for(J=!0,j=M.input.charCodeAt(++M.position),I=M.position;j!==0&&!g(j);)j=M.input.charCodeAt(++M.position);for(z=[],(U=M.input.slice(I,M.position)).length<1&&R(M,"directive name must not be less than one character in length");j!==0;){for(;d(j);)j=M.input.charCodeAt(++M.position);if(j===35){do j=M.input.charCodeAt(++M.position);while(j!==0&&!y(j));break}if(y(j))break;for(I=M.position;j!==0&&!g(j);)j=M.input.charCodeAt(++M.position);z.push(M.input.slice(I,M.position))}j!==0&&k(M),p.call(L,U)?L[U](M,U,z):N(M,'unknown document directive "'+U+'"')}G(M,!0,-1),M.lineIndent===0&&M.input.charCodeAt(M.position)===45&&M.input.charCodeAt(M.position+1)===45&&M.input.charCodeAt(M.position+2)===45?(M.position+=3,G(M,!0,-1)):J&&R(M,"directives end mark is expected"),Q(M,M.lineIndent-1,4,!1,!0),G(M,!0,-1),M.checkLineBreaks&&f.test(M.input.slice($,M.position))&&N(M,"non-ASCII line breaks are interpreted as content"),M.documents.push(M.result),M.position===M.lineStart&&W(M)?M.input.charCodeAt(M.position)===46&&(M.position+=3,G(M,!0,-1)):M.position0&&`\0\r +…\u2028\u2029`.indexOf(this.buffer.charAt(p-1))===-1;)if(p-=1,this.position-p>u/2-1){c=" ... ",p+=5;break}for(l="",f=this.position;fu/2-1){l=" ... ",f-=5;break}return h=this.buffer.slice(p,f),i.repeat(" ",s)+c+h+l+` +`+i.repeat(" ",s+this.position-p+c.length)+"^"},o.prototype.toString=function(s){var u,c="";return this.name&&(c+='in "'+this.name+'" '),c+="at line "+(this.line+1)+", column "+(this.column+1),s||(u=this.getSnippet())&&(c+=`: +`+u),c},a.exports=o},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(o){return o!==null?o:""}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(o){return o!==null?o:[]}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(o){return o!==null?o:{}}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(o){if(o===null)return!0;var s=o.length;return s===1&&o==="~"||s===4&&(o==="null"||o==="Null"||o==="NULL")},construct:function(){return null},predicate:function(o){return o===null},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(o){if(o===null)return!1;var s=o.length;return s===4&&(o==="true"||o==="True"||o==="TRUE")||s===5&&(o==="false"||o==="False"||o==="FALSE")},construct:function(o){return o==="true"||o==="True"||o==="TRUE"},predicate:function(o){return Object.prototype.toString.call(o)==="[object Boolean]"},represent:{lowercase:function(o){return o?"true":"false"},uppercase:function(o){return o?"TRUE":"FALSE"},camelcase:function(o){return o?"True":"False"}},defaultStyle:"lowercase"})},function(a,n,r){var i=r(38),o=r(10);function s(c){return 48<=c&&c<=55}function u(c){return 48<=c&&c<=57}a.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(c){if(c===null)return!1;var p,l,f=c.length,h=0,v=!1;if(!f)return!1;if((p=c[h])!=="-"&&p!=="+"||(p=c[++h]),p==="0"){if(h+1===f)return!0;if((p=c[++h])==="b"){for(h++;h=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},octal:function(c){return c>=0?"0"+c.toString(8):"-0"+c.toString(8).slice(1)},decimal:function(c){return c.toString(10)},hexadecimal:function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(a,n,r){var i=r(38),o=r(10),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),u=/^[-+]?[0-9]+e/;a.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(c){return c!==null&&!(!s.test(c)||c[c.length-1]==="_")},construct:function(c){var p,l,f,h;return l=(p=c.replace(/_/g,"").toLowerCase())[0]==="-"?-1:1,h=[],"+-".indexOf(p[0])>=0&&(p=p.slice(1)),p===".inf"?l===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:p===".nan"?NaN:p.indexOf(":")>=0?(p.split(":").forEach(function(v){h.unshift(parseFloat(v,10))}),p=0,f=1,h.forEach(function(v){p+=v*f,f*=60}),l*p):l*parseFloat(p,10)},predicate:function(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!=0||i.isNegativeZero(c))},represent:function(c,p){var l;if(isNaN(c))switch(p){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(p){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(p){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(c))return"-0.0";return l=c.toString(10),u.test(l)?l.replace("e",".e"):l},defaultStyle:"lowercase"})},function(a,n,r){var i=r(10),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a.exports=new i("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(u){return u!==null&&(o.exec(u)!==null||s.exec(u)!==null)},construct:function(u){var c,p,l,f,h,v,m,x,y=0,d=null;if((c=o.exec(u))===null&&(c=s.exec(u)),c===null)throw new Error("Date resolve error");if(p=+c[1],l=+c[2]-1,f=+c[3],!c[4])return new Date(Date.UTC(p,l,f));if(h=+c[4],v=+c[5],m=+c[6],c[7]){for(y=c[7].slice(0,3);y.length<3;)y+="0";y=+y}return c[9]&&(d=6e4*(60*+c[10]+ +(c[11]||0)),c[9]==="-"&&(d=-d)),x=new Date(Date.UTC(p,l,f,h,v,m,y)),d&&x.setTime(x.getTime()-d),x},instanceOf:Date,represent:function(u){return u.toISOString()}})},function(a,n,r){var i=r(10);a.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(o){return o==="<<"||o===null}})},function(a,n,r){var i;try{i=r(145).Buffer}catch{}var o=r(10),s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;a.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(u){if(u===null)return!1;var c,p,l=0,f=u.length,h=s;for(p=0;p64)){if(c<0)return!1;l+=6}return l%8==0},construct:function(u){var c,p,l=u.replace(/[\r\n=]/g,""),f=l.length,h=s,v=0,m=[];for(c=0;c>16&255),m.push(v>>8&255),m.push(255&v)),v=v<<6|h.indexOf(l.charAt(c));return(p=f%4*6)===0?(m.push(v>>16&255),m.push(v>>8&255),m.push(255&v)):p===18?(m.push(v>>10&255),m.push(v>>2&255)):p===12&&m.push(v>>4&255),i?i.from?i.from(m):new i(m):m},predicate:function(u){return i&&i.isBuffer(u)},represent:function(u){var c,p,l="",f=0,h=u.length,v=s;for(c=0;c>18&63],l+=v[f>>12&63],l+=v[f>>6&63],l+=v[63&f]),f=(f<<8)+u[c];return(p=h%3)===0?(l+=v[f>>18&63],l+=v[f>>12&63],l+=v[f>>6&63],l+=v[63&f]):p===2?(l+=v[f>>10&63],l+=v[f>>4&63],l+=v[f<<2&63],l+=v[64]):p===1&&(l+=v[f>>2&63],l+=v[f<<4&63],l+=v[64],l+=v[64]),l}})},function(a,n,r){var i=r(10),o=Object.prototype.hasOwnProperty,s=Object.prototype.toString;a.exports=new i("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(u){if(u===null)return!0;var c,p,l,f,h,v=[],m=u;for(c=0,p=m.length;c3||s[s.length-c.length-1]!=="/"))},construct:function(o){var s=o,u=/\/([gim]*)$/.exec(o),c="";return s[0]==="/"&&(u&&(c=u[1]),s=s.slice(1,s.length-c.length-1)),new RegExp(s,c)},predicate:function(o){return Object.prototype.toString.call(o)==="[object RegExp]"},represent:function(o){var s="/"+o.source+"/";return o.global&&(s+="g"),o.multiline&&(s+="m"),o.ignoreCase&&(s+="i"),s}})},function(a,n,r){var i;try{i=r(303)}catch{typeof window<"u"&&(i=window.esprima)}var o=r(10);a.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(s){if(s===null)return!1;try{var u="("+s+")",c=i.parse(u,{range:!0});return c.type==="Program"&&c.body.length===1&&c.body[0].type==="ExpressionStatement"&&(c.body[0].expression.type==="ArrowFunctionExpression"||c.body[0].expression.type==="FunctionExpression")}catch{return!1}},construct:function(s){var u,c="("+s+")",p=i.parse(c,{range:!0}),l=[];if(p.type!=="Program"||p.body.length!==1||p.body[0].type!=="ExpressionStatement"||p.body[0].expression.type!=="ArrowFunctionExpression"&&p.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return p.body[0].expression.params.forEach(function(f){l.push(f.name)}),u=p.body[0].expression.body.range,p.body[0].expression.body.type==="BlockStatement"?new Function(l,c.slice(u[0]+1,u[1]-1)):new Function(l,"return "+c.slice(u[0],u[1]))},predicate:function(s){return Object.prototype.toString.call(s)==="[object Function]"},represent:function(s){return s.toString()}})},function(a,n,r){var i;i=function(){return function(o){var s={};function u(c){if(s[c])return s[c].exports;var p=s[c]={exports:{},id:c,loaded:!1};return o[c].call(p.exports,p,p.exports,u),p.loaded=!0,p.exports}return u.m=o,u.c=s,u.p="",u(0)}([function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(1),p=u(3),l=u(8),f=u(15);function h(m,x,y){var d=null,g=function(D,O){y&&y(D,O),d&&d.visit(D,O)},C=typeof y=="function"?g:null,S=!1;if(x){S=typeof x.comment=="boolean"&&x.comment;var T=typeof x.attachComment=="boolean"&&x.attachComment;(S||T)&&((d=new c.CommentHandler).attach=T,x.comment=!0,C=g)}var w,_=!1;x&&typeof x.sourceType=="string"&&(_=x.sourceType==="module"),w=x&&typeof x.jsx=="boolean"&&x.jsx?new p.JSXParser(m,x,C):new l.Parser(m,x,C);var E=_?w.parseModule():w.parseScript();return S&&d&&(E.comments=d.comments),w.config.tokens&&(E.tokens=w.tokens),w.config.tolerant&&(E.errors=w.errorHandler.errors),E}s.parse=h,s.parseModule=function(m,x,y){var d=x||{};return d.sourceType="module",h(m,d,y)},s.parseScript=function(m,x,y){var d=x||{};return d.sourceType="script",h(m,d,y)},s.tokenize=function(m,x,y){var d,g=new f.Tokenizer(m,x);d=[];try{for(;;){var C=g.getNextToken();if(!C)break;y&&(C=y(C)),d.push(C)}}catch(S){g.errorHandler.tolerate(S)}return g.errorHandler.tolerant&&(d.errors=g.errors()),d};var v=u(2);s.Syntax=v.Syntax,s.version="4.0.1"},function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(2),p=function(){function l(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return l.prototype.insertInnerComments=function(f,h){if(f.type===c.Syntax.BlockStatement&&f.body.length===0){for(var v=[],m=this.leading.length-1;m>=0;--m){var x=this.leading[m];h.end.offset>=x.start&&(v.unshift(x.comment),this.leading.splice(m,1),this.trailing.splice(m,1))}v.length&&(f.innerComments=v)}},l.prototype.findTrailingComments=function(f){var h=[];if(this.trailing.length>0){for(var v=this.trailing.length-1;v>=0;--v){var m=this.trailing[v];m.start>=f.end.offset&&h.unshift(m.comment)}return this.trailing.length=0,h}var x=this.stack[this.stack.length-1];if(x&&x.node.trailingComments){var y=x.node.trailingComments[0];y&&y.range[0]>=f.end.offset&&(h=x.node.trailingComments,delete x.node.trailingComments)}return h},l.prototype.findLeadingComments=function(f){for(var h,v=[];this.stack.length>0&&(y=this.stack[this.stack.length-1])&&y.start>=f.start.offset;)h=y.node,this.stack.pop();if(h){for(var m=(h.leadingComments?h.leadingComments.length:0)-1;m>=0;--m){var x=h.leadingComments[m];x.range[1]<=f.start.offset&&(v.unshift(x),h.leadingComments.splice(m,1))}return h.leadingComments&&h.leadingComments.length===0&&delete h.leadingComments,v}for(m=this.leading.length-1;m>=0;--m){var y;(y=this.leading[m]).start<=f.start.offset&&(v.unshift(y.comment),this.leading.splice(m,1))}return v},l.prototype.visitNode=function(f,h){if(!(f.type===c.Syntax.Program&&f.body.length>0)){this.insertInnerComments(f,h);var v=this.findTrailingComments(h),m=this.findLeadingComments(h);m.length>0&&(f.leadingComments=m),v.length>0&&(f.trailingComments=v),this.stack.push({node:f,start:h.start.offset})}},l.prototype.visitComment=function(f,h){var v=f.type[0]==="L"?"Line":"Block",m={type:v,value:f.value};if(f.range&&(m.range=f.range),f.loc&&(m.loc=f.loc),this.comments.push(m),this.attach){var x={comment:{type:v,value:f.value,range:[h.start.offset,h.end.offset]},start:h.start.offset};f.loc&&(x.comment.loc=f.loc),f.type=v,this.leading.push(x),this.trailing.push(x)}},l.prototype.visit=function(f,h){f.type==="LineComment"||f.type==="BlockComment"?this.visitComment(f,h):this.attach&&this.visitNode(f,h)},l}();s.CommentHandler=p},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(o,s,u){var c,p=this&&this.__extends||(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,S){C.__proto__=S}||function(C,S){for(var T in S)S.hasOwnProperty(T)&&(C[T]=S[T])},function(C,S){function T(){this.constructor=C}c(C,S),C.prototype=S===null?Object.create(S):(T.prototype=S.prototype,new T)});Object.defineProperty(s,"__esModule",{value:!0});var l=u(4),f=u(5),h=u(6),v=u(7),m=u(8),x=u(13),y=u(14);function d(C){var S;switch(C.type){case h.JSXSyntax.JSXIdentifier:S=C.name;break;case h.JSXSyntax.JSXNamespacedName:var T=C;S=d(T.namespace)+":"+d(T.name);break;case h.JSXSyntax.JSXMemberExpression:var w=C;S=d(w.object)+"."+d(w.property)}return S}x.TokenName[100]="JSXIdentifier",x.TokenName[101]="JSXText";var g=function(C){function S(T,w,_){return C.call(this,T,w,_)||this}return p(S,C),S.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():C.prototype.parsePrimaryExpression.call(this)},S.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},S.prototype.finishJSX=function(){this.nextToken()},S.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},S.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},S.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},S.prototype.scanXHTMLEntity=function(T){for(var w="&",_=!0,E=!1,D=!1,O=!1;!this.scanner.eof()&&_&&!E;){var b=this.scanner.source[this.scanner.index];if(b===T)break;if(E=b===";",w+=b,++this.scanner.index,!E)switch(w.length){case 2:D=b==="#";break;case 3:D&&(_=(O=b==="x")||l.Character.isDecimalDigit(b.charCodeAt(0)),D=D&&!O);break;default:_=(_=_&&!(D&&!l.Character.isDecimalDigit(b.charCodeAt(0))))&&!(O&&!l.Character.isHexDigit(b.charCodeAt(0)))}}if(_&&E&&w.length>2){var R=w.substr(1,w.length-2);D&&R.length>1?w=String.fromCharCode(parseInt(R.substr(1),10)):O&&R.length>2?w=String.fromCharCode(parseInt("0"+R.substr(1),16)):D||O||!y.XHTMLEntities[R]||(w=y.XHTMLEntities[R])}return w},S.prototype.lexJSX=function(){var T=this.scanner.source.charCodeAt(this.scanner.index);if(T===60||T===62||T===47||T===58||T===61||T===123||T===125)return{type:7,value:b=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(T===34||T===39){for(var w=this.scanner.index,_=this.scanner.source[this.scanner.index++],E="";!this.scanner.eof()&&(R=this.scanner.source[this.scanner.index++])!==_;)E+=R==="&"?this.scanXHTMLEntity(_):R;return{type:8,value:E,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:w,end:this.scanner.index}}if(T===46){var D=this.scanner.source.charCodeAt(this.scanner.index+1),O=this.scanner.source.charCodeAt(this.scanner.index+2),b=D===46&&O===46?"...":".";return w=this.scanner.index,this.scanner.index+=b.length,{type:7,value:b,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:w,end:this.scanner.index}}if(T===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(l.Character.isIdentifierStart(T)&&T!==92){for(w=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var R=this.scanner.source.charCodeAt(this.scanner.index);if(l.Character.isIdentifierPart(R)&&R!==92)++this.scanner.index;else{if(R!==45)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(w,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:w,end:this.scanner.index}}return this.scanner.lex()},S.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var T=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(T)),T},S.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var T=this.scanner.index,w="";!this.scanner.eof();){var _=this.scanner.source[this.scanner.index];if(_==="{"||_==="<")break;++this.scanner.index,w+=_,l.Character.isLineTerminator(_.charCodeAt(0))&&(++this.scanner.lineNumber,_==="\r"&&this.scanner.source[this.scanner.index]===` +`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var E={type:101,value:w,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:T,end:this.scanner.index};return w.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(E)),E},S.prototype.peekJSXToken=function(){var T=this.scanner.saveState();this.scanner.scanComments();var w=this.lexJSX();return this.scanner.restoreState(T),w},S.prototype.expectJSX=function(T){var w=this.nextJSXToken();w.type===7&&w.value===T||this.throwUnexpectedToken(w)},S.prototype.matchJSX=function(T){var w=this.peekJSXToken();return w.type===7&&w.value===T},S.prototype.parseJSXIdentifier=function(){var T=this.createJSXNode(),w=this.nextJSXToken();return w.type!==100&&this.throwUnexpectedToken(w),this.finalize(T,new f.JSXIdentifier(w.value))},S.prototype.parseJSXElementName=function(){var T=this.createJSXNode(),w=this.parseJSXIdentifier();if(this.matchJSX(":")){var _=w;this.expectJSX(":");var E=this.parseJSXIdentifier();w=this.finalize(T,new f.JSXNamespacedName(_,E))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var D=w;this.expectJSX(".");var O=this.parseJSXIdentifier();w=this.finalize(T,new f.JSXMemberExpression(D,O))}return w},S.prototype.parseJSXAttributeName=function(){var T,w=this.createJSXNode(),_=this.parseJSXIdentifier();if(this.matchJSX(":")){var E=_;this.expectJSX(":");var D=this.parseJSXIdentifier();T=this.finalize(w,new f.JSXNamespacedName(E,D))}else T=_;return T},S.prototype.parseJSXStringLiteralAttribute=function(){var T=this.createJSXNode(),w=this.nextJSXToken();w.type!==8&&this.throwUnexpectedToken(w);var _=this.getTokenRaw(w);return this.finalize(T,new v.Literal(w.value,_))},S.prototype.parseJSXExpressionAttribute=function(){var T=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var w=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(T,new f.JSXExpressionContainer(w))},S.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},S.prototype.parseJSXNameValueAttribute=function(){var T=this.createJSXNode(),w=this.parseJSXAttributeName(),_=null;return this.matchJSX("=")&&(this.expectJSX("="),_=this.parseJSXAttributeValue()),this.finalize(T,new f.JSXAttribute(w,_))},S.prototype.parseJSXSpreadAttribute=function(){var T=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var w=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(T,new f.JSXSpreadAttribute(w))},S.prototype.parseJSXAttributes=function(){for(var T=[];!this.matchJSX("/")&&!this.matchJSX(">");){var w=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();T.push(w)}return T},S.prototype.parseJSXOpeningElement=function(){var T=this.createJSXNode();this.expectJSX("<");var w=this.parseJSXElementName(),_=this.parseJSXAttributes(),E=this.matchJSX("/");return E&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(T,new f.JSXOpeningElement(w,E,_))},S.prototype.parseJSXBoundaryElement=function(){var T=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var w=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(T,new f.JSXClosingElement(w))}var _=this.parseJSXElementName(),E=this.parseJSXAttributes(),D=this.matchJSX("/");return D&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(T,new f.JSXOpeningElement(_,D,E))},S.prototype.parseJSXEmptyExpression=function(){var T=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(T,new f.JSXEmptyExpression)},S.prototype.parseJSXExpressionContainer=function(){var T,w=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(T=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),T=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(w,new f.JSXExpressionContainer(T))},S.prototype.parseJSXChildren=function(){for(var T=[];!this.scanner.eof();){var w=this.createJSXChildNode(),_=this.nextJSXText();if(_.start<_.end){var E=this.getTokenRaw(_),D=this.finalize(w,new f.JSXText(_.value,E));T.push(D)}if(this.scanner.source[this.scanner.index]!=="{")break;var O=this.parseJSXExpressionContainer();T.push(O)}return T},S.prototype.parseComplexJSXElement=function(T){for(var w=[];!this.scanner.eof();){T.children=T.children.concat(this.parseJSXChildren());var _=this.createJSXChildNode(),E=this.parseJSXBoundaryElement();if(E.type===h.JSXSyntax.JSXOpeningElement){var D=E;if(D.selfClosing){var O=this.finalize(_,new f.JSXElement(D,[],null));T.children.push(O)}else w.push(T),T={node:_,opening:D,closing:null,children:[]}}if(E.type===h.JSXSyntax.JSXClosingElement){T.closing=E;var b=d(T.opening.name);if(b!==d(T.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",b),!(w.length>0))break;O=this.finalize(T.node,new f.JSXElement(T.opening,T.children,T.closing)),(T=w[w.length-1]).children.push(O),w.pop()}}return T},S.prototype.parseJSXElement=function(){var T=this.createJSXNode(),w=this.parseJSXOpeningElement(),_=[],E=null;if(!w.selfClosing){var D=this.parseComplexJSXElement({node:T,opening:w,closing:E,children:_});_=D.children,E=D.closing}return this.finalize(T,new f.JSXElement(w,_,E))},S.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var T=this.parseJSXElement();return this.finishJSX(),T},S.prototype.isStartOfExpression=function(){return C.prototype.isStartOfExpression.call(this)||this.match("<")},S}(m.Parser);s.JSXParser=g},function(o,s){Object.defineProperty(s,"__esModule",{value:!0});var u={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};s.Character={fromCodePoint:function(c){return c<65536?String.fromCharCode(c):String.fromCharCode(55296+(c-65536>>10))+String.fromCharCode(56320+(c-65536&1023))},isWhiteSpace:function(c){return c===32||c===9||c===11||c===12||c===160||c>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(c)>=0},isLineTerminator:function(c){return c===10||c===13||c===8232||c===8233},isIdentifierStart:function(c){return c===36||c===95||c>=65&&c<=90||c>=97&&c<=122||c===92||c>=128&&u.NonAsciiIdentifierStart.test(s.Character.fromCodePoint(c))},isIdentifierPart:function(c){return c===36||c===95||c>=65&&c<=90||c>=97&&c<=122||c>=48&&c<=57||c===92||c>=128&&u.NonAsciiIdentifierPart.test(s.Character.fromCodePoint(c))},isDecimalDigit:function(c){return c>=48&&c<=57},isHexDigit:function(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102},isOctalDigit:function(c){return c>=48&&c<=55}}},function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(6),p=function(S){this.type=c.JSXSyntax.JSXClosingElement,this.name=S};s.JSXClosingElement=p;var l=function(S,T,w){this.type=c.JSXSyntax.JSXElement,this.openingElement=S,this.children=T,this.closingElement=w};s.JSXElement=l;var f=function(){this.type=c.JSXSyntax.JSXEmptyExpression};s.JSXEmptyExpression=f;var h=function(S){this.type=c.JSXSyntax.JSXExpressionContainer,this.expression=S};s.JSXExpressionContainer=h;var v=function(S){this.type=c.JSXSyntax.JSXIdentifier,this.name=S};s.JSXIdentifier=v;var m=function(S,T){this.type=c.JSXSyntax.JSXMemberExpression,this.object=S,this.property=T};s.JSXMemberExpression=m;var x=function(S,T){this.type=c.JSXSyntax.JSXAttribute,this.name=S,this.value=T};s.JSXAttribute=x;var y=function(S,T){this.type=c.JSXSyntax.JSXNamespacedName,this.namespace=S,this.name=T};s.JSXNamespacedName=y;var d=function(S,T,w){this.type=c.JSXSyntax.JSXOpeningElement,this.name=S,this.selfClosing=T,this.attributes=w};s.JSXOpeningElement=d;var g=function(S){this.type=c.JSXSyntax.JSXSpreadAttribute,this.argument=S};s.JSXSpreadAttribute=g;var C=function(S,T){this.type=c.JSXSyntax.JSXText,this.value=S,this.raw=T};s.JSXText=C},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(2),p=function(ie){this.type=c.Syntax.ArrayExpression,this.elements=ie};s.ArrayExpression=p;var l=function(ie){this.type=c.Syntax.ArrayPattern,this.elements=ie};s.ArrayPattern=l;var f=function(ie,le,Le){this.type=c.Syntax.ArrowFunctionExpression,this.id=null,this.params=ie,this.body=le,this.generator=!1,this.expression=Le,this.async=!1};s.ArrowFunctionExpression=f;var h=function(ie,le,Le){this.type=c.Syntax.AssignmentExpression,this.operator=ie,this.left=le,this.right=Le};s.AssignmentExpression=h;var v=function(ie,le){this.type=c.Syntax.AssignmentPattern,this.left=ie,this.right=le};s.AssignmentPattern=v;var m=function(ie,le,Le){this.type=c.Syntax.ArrowFunctionExpression,this.id=null,this.params=ie,this.body=le,this.generator=!1,this.expression=Le,this.async=!0};s.AsyncArrowFunctionExpression=m;var x=function(ie,le,Le){this.type=c.Syntax.FunctionDeclaration,this.id=ie,this.params=le,this.body=Le,this.generator=!1,this.expression=!1,this.async=!0};s.AsyncFunctionDeclaration=x;var y=function(ie,le,Le){this.type=c.Syntax.FunctionExpression,this.id=ie,this.params=le,this.body=Le,this.generator=!1,this.expression=!1,this.async=!0};s.AsyncFunctionExpression=y;var d=function(ie){this.type=c.Syntax.AwaitExpression,this.argument=ie};s.AwaitExpression=d;var g=function(ie,le,Le){var It=ie==="||"||ie==="&&";this.type=It?c.Syntax.LogicalExpression:c.Syntax.BinaryExpression,this.operator=ie,this.left=le,this.right=Le};s.BinaryExpression=g;var C=function(ie){this.type=c.Syntax.BlockStatement,this.body=ie};s.BlockStatement=C;var S=function(ie){this.type=c.Syntax.BreakStatement,this.label=ie};s.BreakStatement=S;var T=function(ie,le){this.type=c.Syntax.CallExpression,this.callee=ie,this.arguments=le};s.CallExpression=T;var w=function(ie,le){this.type=c.Syntax.CatchClause,this.param=ie,this.body=le};s.CatchClause=w;var _=function(ie){this.type=c.Syntax.ClassBody,this.body=ie};s.ClassBody=_;var E=function(ie,le,Le){this.type=c.Syntax.ClassDeclaration,this.id=ie,this.superClass=le,this.body=Le};s.ClassDeclaration=E;var D=function(ie,le,Le){this.type=c.Syntax.ClassExpression,this.id=ie,this.superClass=le,this.body=Le};s.ClassExpression=D;var O=function(ie,le){this.type=c.Syntax.MemberExpression,this.computed=!0,this.object=ie,this.property=le};s.ComputedMemberExpression=O;var b=function(ie,le,Le){this.type=c.Syntax.ConditionalExpression,this.test=ie,this.consequent=le,this.alternate=Le};s.ConditionalExpression=b;var R=function(ie){this.type=c.Syntax.ContinueStatement,this.label=ie};s.ContinueStatement=R;var N=function(){this.type=c.Syntax.DebuggerStatement};s.DebuggerStatement=N;var L=function(ie,le){this.type=c.Syntax.ExpressionStatement,this.expression=ie,this.directive=le};s.Directive=L;var B=function(ie,le){this.type=c.Syntax.DoWhileStatement,this.body=ie,this.test=le};s.DoWhileStatement=B;var P=function(){this.type=c.Syntax.EmptyStatement};s.EmptyStatement=P;var F=function(ie){this.type=c.Syntax.ExportAllDeclaration,this.source=ie};s.ExportAllDeclaration=F;var k=function(ie){this.type=c.Syntax.ExportDefaultDeclaration,this.declaration=ie};s.ExportDefaultDeclaration=k;var G=function(ie,le,Le){this.type=c.Syntax.ExportNamedDeclaration,this.declaration=ie,this.specifiers=le,this.source=Le};s.ExportNamedDeclaration=G;var W=function(ie,le){this.type=c.Syntax.ExportSpecifier,this.exported=le,this.local=ie};s.ExportSpecifier=W;var H=function(ie){this.type=c.Syntax.ExpressionStatement,this.expression=ie};s.ExpressionStatement=H;var X=function(ie,le,Le){this.type=c.Syntax.ForInStatement,this.left=ie,this.right=le,this.body=Le,this.each=!1};s.ForInStatement=X;var Y=function(ie,le,Le){this.type=c.Syntax.ForOfStatement,this.left=ie,this.right=le,this.body=Le};s.ForOfStatement=Y;var q=function(ie,le,Le,It){this.type=c.Syntax.ForStatement,this.init=ie,this.test=le,this.update=Le,this.body=It};s.ForStatement=q;var Q=function(ie,le,Le,It){this.type=c.Syntax.FunctionDeclaration,this.id=ie,this.params=le,this.body=Le,this.generator=It,this.expression=!1,this.async=!1};s.FunctionDeclaration=Q;var ae=function(ie,le,Le,It){this.type=c.Syntax.FunctionExpression,this.id=ie,this.params=le,this.body=Le,this.generator=It,this.expression=!1,this.async=!1};s.FunctionExpression=ae;var ne=function(ie){this.type=c.Syntax.Identifier,this.name=ie};s.Identifier=ne;var ee=function(ie,le,Le){this.type=c.Syntax.IfStatement,this.test=ie,this.consequent=le,this.alternate=Le};s.IfStatement=ee;var V=function(ie,le){this.type=c.Syntax.ImportDeclaration,this.specifiers=ie,this.source=le};s.ImportDeclaration=V;var M=function(ie){this.type=c.Syntax.ImportDefaultSpecifier,this.local=ie};s.ImportDefaultSpecifier=M;var I=function(ie){this.type=c.Syntax.ImportNamespaceSpecifier,this.local=ie};s.ImportNamespaceSpecifier=I;var U=function(ie,le){this.type=c.Syntax.ImportSpecifier,this.local=ie,this.imported=le};s.ImportSpecifier=U;var z=function(ie,le){this.type=c.Syntax.LabeledStatement,this.label=ie,this.body=le};s.LabeledStatement=z;var j=function(ie,le){this.type=c.Syntax.Literal,this.value=ie,this.raw=le};s.Literal=j;var $=function(ie,le){this.type=c.Syntax.MetaProperty,this.meta=ie,this.property=le};s.MetaProperty=$;var J=function(ie,le,Le,It,tu){this.type=c.Syntax.MethodDefinition,this.key=ie,this.computed=le,this.value=Le,this.kind=It,this.static=tu};s.MethodDefinition=J;var re=function(ie){this.type=c.Syntax.Program,this.body=ie,this.sourceType="module"};s.Module=re;var oe=function(ie,le){this.type=c.Syntax.NewExpression,this.callee=ie,this.arguments=le};s.NewExpression=oe;var ue=function(ie){this.type=c.Syntax.ObjectExpression,this.properties=ie};s.ObjectExpression=ue;var Te=function(ie){this.type=c.Syntax.ObjectPattern,this.properties=ie};s.ObjectPattern=Te;var Ce=function(ie,le,Le,It,tu,cM){this.type=c.Syntax.Property,this.key=le,this.computed=Le,this.value=It,this.kind=ie,this.method=tu,this.shorthand=cM};s.Property=Ce;var Xe=function(ie,le,Le,It){this.type=c.Syntax.Literal,this.value=ie,this.raw=le,this.regex={pattern:Le,flags:It}};s.RegexLiteral=Xe;var ke=function(ie){this.type=c.Syntax.RestElement,this.argument=ie};s.RestElement=ke;var ge=function(ie){this.type=c.Syntax.ReturnStatement,this.argument=ie};s.ReturnStatement=ge;var nt=function(ie){this.type=c.Syntax.Program,this.body=ie,this.sourceType="script"};s.Script=nt;var K=function(ie){this.type=c.Syntax.SequenceExpression,this.expressions=ie};s.SequenceExpression=K;var De=function(ie){this.type=c.Syntax.SpreadElement,this.argument=ie};s.SpreadElement=De;var Oe=function(ie,le){this.type=c.Syntax.MemberExpression,this.computed=!1,this.object=ie,this.property=le};s.StaticMemberExpression=Oe;var ve=function(){this.type=c.Syntax.Super};s.Super=ve;var te=function(ie,le){this.type=c.Syntax.SwitchCase,this.test=ie,this.consequent=le};s.SwitchCase=te;var ce=function(ie,le){this.type=c.Syntax.SwitchStatement,this.discriminant=ie,this.cases=le};s.SwitchStatement=ce;var he=function(ie,le){this.type=c.Syntax.TaggedTemplateExpression,this.tag=ie,this.quasi=le};s.TaggedTemplateExpression=he;var fe=function(ie,le){this.type=c.Syntax.TemplateElement,this.value=ie,this.tail=le};s.TemplateElement=fe;var ye=function(ie,le){this.type=c.Syntax.TemplateLiteral,this.quasis=ie,this.expressions=le};s.TemplateLiteral=ye;var Ve=function(){this.type=c.Syntax.ThisExpression};s.ThisExpression=Ve;var Se=function(ie){this.type=c.Syntax.ThrowStatement,this.argument=ie};s.ThrowStatement=Se;var Be=function(ie,le,Le){this.type=c.Syntax.TryStatement,this.block=ie,this.handler=le,this.finalizer=Le};s.TryStatement=Be;var Ie=function(ie,le){this.type=c.Syntax.UnaryExpression,this.operator=ie,this.argument=le,this.prefix=!0};s.UnaryExpression=Ie;var wt=function(ie,le,Le){this.type=c.Syntax.UpdateExpression,this.operator=ie,this.argument=le,this.prefix=Le};s.UpdateExpression=wt;var Ft=function(ie,le){this.type=c.Syntax.VariableDeclaration,this.declarations=ie,this.kind=le};s.VariableDeclaration=Ft;var it=function(ie,le){this.type=c.Syntax.VariableDeclarator,this.id=ie,this.init=le};s.VariableDeclarator=it;var Ht=function(ie,le){this.type=c.Syntax.WhileStatement,this.test=ie,this.body=le};s.WhileStatement=Ht;var oM=function(ie,le){this.type=c.Syntax.WithStatement,this.object=ie,this.body=le};s.WithStatement=oM;var sM=function(ie,le){this.type=c.Syntax.YieldExpression,this.argument=ie,this.delegate=le};s.YieldExpression=sM},function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(9),p=u(10),l=u(11),f=u(7),h=u(12),v=u(2),m=u(13),x=function(){function y(d,g,C){g===void 0&&(g={}),this.config={range:typeof g.range=="boolean"&&g.range,loc:typeof g.loc=="boolean"&&g.loc,source:null,tokens:typeof g.tokens=="boolean"&&g.tokens,comment:typeof g.comment=="boolean"&&g.comment,tolerant:typeof g.tolerant=="boolean"&&g.tolerant},this.config.loc&&g.source&&g.source!==null&&(this.config.source=String(g.source)),this.delegate=C,this.errorHandler=new p.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new h.Scanner(d,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return y.prototype.throwError=function(d){for(var g=[],C=1;C0&&this.delegate)for(var g=0;g>="||d===">>>="||d==="&="||d==="^="||d==="|="},y.prototype.isolateCoverGrammar=function(d){var g=this.context.isBindingElement,C=this.context.isAssignmentTarget,S=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var T=d.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=g,this.context.isAssignmentTarget=C,this.context.firstCoverInitializedNameError=S,T},y.prototype.inheritCoverGrammar=function(d){var g=this.context.isBindingElement,C=this.context.isAssignmentTarget,S=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var T=d.call(this);return this.context.isBindingElement=this.context.isBindingElement&&g,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&C,this.context.firstCoverInitializedNameError=S||this.context.firstCoverInitializedNameError,T},y.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type===2||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},y.prototype.parsePrimaryExpression=function(){var d,g,C,S=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),d=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(S,new f.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,l.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),C=this.getTokenRaw(g),d=this.finalize(S,new f.Literal(g.value,C));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),C=this.getTokenRaw(g),d=this.finalize(S,new f.Literal(g.value==="true",C));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),C=this.getTokenRaw(g),d=this.finalize(S,new f.Literal(null,C));break;case 10:d=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,d=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":d=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":d=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,g=this.nextRegexToken(),C=this.getTokenRaw(g),d=this.finalize(S,new f.RegexLiteral(g.regex,C,g.pattern,g.flags));break;default:d=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?d=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?d=this.finalize(S,new f.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?d=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),d=this.finalize(S,new f.ThisExpression)):d=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:d=this.throwUnexpectedToken(this.nextToken())}return d},y.prototype.parseSpreadElement=function(){var d=this.createNode();this.expect("...");var g=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(d,new f.SpreadElement(g))},y.prototype.parseArrayInitializer=function(){var d=this.createNode(),g=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),g.push(null);else if(this.match("...")){var C=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),g.push(C)}else g.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(d,new f.ArrayExpression(g))},y.prototype.parsePropertyMethod=function(d){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var g=this.context.strict,C=this.context.allowStrictDirective;this.context.allowStrictDirective=d.simple;var S=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&d.firstRestricted&&this.tolerateUnexpectedToken(d.firstRestricted,d.message),this.context.strict&&d.stricted&&this.tolerateUnexpectedToken(d.stricted,d.message),this.context.strict=g,this.context.allowStrictDirective=C,S},y.prototype.parsePropertyMethodFunction=function(){var d=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var C=this.parseFormalParameters(),S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(d,new f.FunctionExpression(null,C.params,S,!1))},y.prototype.parsePropertyMethodAsyncFunction=function(){var d=this.createNode(),g=this.context.allowYield,C=this.context.await;this.context.allowYield=!1,this.context.await=!0;var S=this.parseFormalParameters(),T=this.parsePropertyMethod(S);return this.context.allowYield=g,this.context.await=C,this.finalize(d,new f.AsyncFunctionExpression(null,S.params,T))},y.prototype.parseObjectPropertyKey=function(){var d,g=this.createNode(),C=this.nextToken();switch(C.type){case 8:case 6:this.context.strict&&C.octal&&this.tolerateUnexpectedToken(C,l.Messages.StrictOctalLiteral);var S=this.getTokenRaw(C);d=this.finalize(g,new f.Literal(C.value,S));break;case 3:case 1:case 5:case 4:d=this.finalize(g,new f.Identifier(C.value));break;case 7:C.value==="["?(d=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):d=this.throwUnexpectedToken(C);break;default:d=this.throwUnexpectedToken(C)}return d},y.prototype.isPropertyKey=function(d,g){return d.type===v.Syntax.Identifier&&d.name===g||d.type===v.Syntax.Literal&&d.value===g},y.prototype.parseObjectProperty=function(d){var g,C=this.createNode(),S=this.lookahead,T=null,w=null,_=!1,E=!1,D=!1,O=!1;if(S.type===3){var b=S.value;this.nextToken(),_=this.match("["),T=(O=!(this.hasLineTerminator||b!=="async"||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(C,new f.Identifier(b))}else this.match("*")?this.nextToken():(_=this.match("["),T=this.parseObjectPropertyKey());var R=this.qualifiedPropertyName(this.lookahead);if(S.type===3&&!O&&S.value==="get"&&R)g="get",_=this.match("["),T=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod();else if(S.type===3&&!O&&S.value==="set"&&R)g="set",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseSetterMethod();else if(S.type===7&&S.value==="*"&&R)g="init",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),E=!0;else if(T||this.throwUnexpectedToken(this.lookahead),g="init",this.match(":")&&!O)!_&&this.isPropertyKey(T,"__proto__")&&(d.value&&this.tolerateError(l.Messages.DuplicateProtoProperty),d.value=!0),this.nextToken(),w=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))w=O?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),E=!0;else if(S.type===3)if(b=this.finalize(C,new f.Identifier(S.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),D=!0;var N=this.isolateCoverGrammar(this.parseAssignmentExpression);w=this.finalize(C,new f.AssignmentPattern(b,N))}else D=!0,w=b;else this.throwUnexpectedToken(this.nextToken());return this.finalize(C,new f.Property(g,T,_,w,E,D))},y.prototype.parseObjectInitializer=function(){var d=this.createNode();this.expect("{");for(var g=[],C={value:!1};!this.match("}");)g.push(this.parseObjectProperty(C)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(d,new f.ObjectExpression(g))},y.prototype.parseTemplateHead=function(){c.assert(this.lookahead.head,"Template literal must start with a template head");var d=this.createNode(),g=this.nextToken(),C=g.value,S=g.cooked;return this.finalize(d,new f.TemplateElement({raw:C,cooked:S},g.tail))},y.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var d=this.createNode(),g=this.nextToken(),C=g.value,S=g.cooked;return this.finalize(d,new f.TemplateElement({raw:C,cooked:S},g.tail))},y.prototype.parseTemplateLiteral=function(){var d=this.createNode(),g=[],C=[],S=this.parseTemplateHead();for(C.push(S);!S.tail;)g.push(this.parseExpression()),S=this.parseTemplateElement(),C.push(S);return this.finalize(d,new f.TemplateLiteral(C,g))},y.prototype.reinterpretExpressionAsPattern=function(d){switch(d.type){case v.Syntax.Identifier:case v.Syntax.MemberExpression:case v.Syntax.RestElement:case v.Syntax.AssignmentPattern:break;case v.Syntax.SpreadElement:d.type=v.Syntax.RestElement,this.reinterpretExpressionAsPattern(d.argument);break;case v.Syntax.ArrayExpression:d.type=v.Syntax.ArrayPattern;for(var g=0;g")||this.expect("=>"),d={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var g=this.lookahead,C=[];if(this.match("..."))d=this.parseRestElement(C),this.expect(")"),this.match("=>")||this.expect("=>"),d={type:"ArrowParameterPlaceHolder",params:[d],async:!1};else{var S=!1;if(this.context.isBindingElement=!0,d=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var T=[];for(this.context.isAssignmentTarget=!1,T.push(d);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var w=0;w")||this.expect("=>"),this.context.isBindingElement=!1,w=0;w")&&(d.type===v.Syntax.Identifier&&d.name==="yield"&&(S=!0,d={type:"ArrowParameterPlaceHolder",params:[d],async:!1}),!S)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),d.type===v.Syntax.SequenceExpression)for(w=0;w")){for(var E=0;E<_.length;++E)this.reinterpretExpressionAsPattern(_[E]);d={type:"ArrowParameterPlaceHolder",params:_,async:!0}}}else if(this.match("["))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("["),T=this.isolateCoverGrammar(this.parseExpression),this.expect("]"),d=this.finalize(this.startNode(g),new f.ComputedMemberExpression(d,T));else{if(this.lookahead.type!==10||!this.lookahead.head)break;var D=this.parseTemplateLiteral();d=this.finalize(this.startNode(g),new f.TaggedTemplateExpression(d,D))}return this.context.allowIn=S,d},y.prototype.parseSuper=function(){var d=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(d,new f.Super)},y.prototype.parseLeftHandSideExpression=function(){c.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var d=this.startNode(this.lookahead),g=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var C=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),g=this.finalize(d,new f.ComputedMemberExpression(g,C))}else if(this.match("."))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("."),C=this.parseIdentifierName(),g=this.finalize(d,new f.StaticMemberExpression(g,C));else{if(this.lookahead.type!==10||!this.lookahead.head)break;var S=this.parseTemplateLiteral();g=this.finalize(d,new f.TaggedTemplateExpression(g,S))}return g},y.prototype.parseUpdateExpression=function(){var d,g=this.lookahead;if(this.match("++")||this.match("--")){var C=this.startNode(g),S=this.nextToken();d=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&d.type===v.Syntax.Identifier&&this.scanner.isRestrictedWord(d.name)&&this.tolerateError(l.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(l.Messages.InvalidLHSInAssignment);var T=!0;d=this.finalize(C,new f.UpdateExpression(S.value,d,T)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(d=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&d.type===v.Syntax.Identifier&&this.scanner.isRestrictedWord(d.name)&&this.tolerateError(l.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(l.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var w=this.nextToken().value;T=!1,d=this.finalize(this.startNode(g),new f.UpdateExpression(w,d,T))}return d},y.prototype.parseAwaitExpression=function(){var d=this.createNode();this.nextToken();var g=this.parseUnaryExpression();return this.finalize(d,new f.AwaitExpression(g))},y.prototype.parseUnaryExpression=function(){var d;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var g=this.startNode(this.lookahead),C=this.nextToken();d=this.inheritCoverGrammar(this.parseUnaryExpression),d=this.finalize(g,new f.UnaryExpression(C.value,d)),this.context.strict&&d.operator==="delete"&&d.argument.type===v.Syntax.Identifier&&this.tolerateError(l.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else d=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return d},y.prototype.parseExponentiationExpression=function(){var d=this.lookahead,g=this.inheritCoverGrammar(this.parseUnaryExpression);if(g.type!==v.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var C=g,S=this.isolateCoverGrammar(this.parseExponentiationExpression);g=this.finalize(this.startNode(d),new f.BinaryExpression("**",C,S))}return g},y.prototype.binaryPrecedence=function(d){var g=d.value;return d.type===7?this.operatorPrecedence[g]||0:d.type===4&&(g==="instanceof"||this.context.allowIn&&g==="in")?7:0},y.prototype.parseBinaryExpression=function(){var d=this.lookahead,g=this.inheritCoverGrammar(this.parseExponentiationExpression),C=this.lookahead,S=this.binaryPrecedence(C);if(S>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var T=[d,this.lookahead],w=g,_=this.isolateCoverGrammar(this.parseExponentiationExpression),E=[w,C.value,_],D=[S];!((S=this.binaryPrecedence(this.lookahead))<=0);){for(;E.length>2&&S<=D[D.length-1];){_=E.pop();var O=E.pop();D.pop(),w=E.pop(),T.pop();var b=this.startNode(T[T.length-1]);E.push(this.finalize(b,new f.BinaryExpression(O,w,_)))}E.push(this.nextToken().value),D.push(S),T.push(this.lookahead),E.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var R=E.length-1;g=E[R];for(var N=T.pop();R>1;){var L=T.pop(),B=N&&N.lineStart;b=this.startNode(L,B),O=E[R-1],g=this.finalize(b,new f.BinaryExpression(O,E[R-2],g)),R-=2,N=L}}return g},y.prototype.parseConditionalExpression=function(){var d=this.lookahead,g=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var C=this.context.allowIn;this.context.allowIn=!0;var S=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=C,this.expect(":");var T=this.isolateCoverGrammar(this.parseAssignmentExpression);g=this.finalize(this.startNode(d),new f.ConditionalExpression(g,S,T)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return g},y.prototype.checkPatternParam=function(d,g){switch(g.type){case v.Syntax.Identifier:this.validateParam(d,g,g.name);break;case v.Syntax.RestElement:this.checkPatternParam(d,g.argument);break;case v.Syntax.AssignmentPattern:this.checkPatternParam(d,g.left);break;case v.Syntax.ArrayPattern:for(var C=0;C")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var T=d.async,w=this.reinterpretAsCoverFormalsList(d);if(w){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var _=this.context.strict,E=this.context.allowStrictDirective;this.context.allowStrictDirective=w.simple;var D=this.context.allowYield,O=this.context.await;this.context.allowYield=!0,this.context.await=T;var b=this.startNode(g);this.expect("=>");var R=void 0;if(this.match("{")){var N=this.context.allowIn;this.context.allowIn=!0,R=this.parseFunctionSourceElements(),this.context.allowIn=N}else R=this.isolateCoverGrammar(this.parseAssignmentExpression);var L=R.type!==v.Syntax.BlockStatement;this.context.strict&&w.firstRestricted&&this.throwUnexpectedToken(w.firstRestricted,w.message),this.context.strict&&w.stricted&&this.tolerateUnexpectedToken(w.stricted,w.message),d=T?this.finalize(b,new f.AsyncArrowFunctionExpression(w.params,R,L)):this.finalize(b,new f.ArrowFunctionExpression(w.params,R,L)),this.context.strict=_,this.context.allowStrictDirective=E,this.context.allowYield=D,this.context.await=O}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(l.Messages.InvalidLHSInAssignment),this.context.strict&&d.type===v.Syntax.Identifier){var B=d;this.scanner.isRestrictedWord(B.name)&&this.tolerateUnexpectedToken(C,l.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(B.name)&&this.tolerateUnexpectedToken(C,l.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(d):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var P=(C=this.nextToken()).value,F=this.isolateCoverGrammar(this.parseAssignmentExpression);d=this.finalize(this.startNode(g),new f.AssignmentExpression(P,d,F)),this.context.firstCoverInitializedNameError=null}}return d},y.prototype.parseExpression=function(){var d=this.lookahead,g=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var C=[];for(C.push(g);this.lookahead.type!==2&&this.match(",");)this.nextToken(),C.push(this.isolateCoverGrammar(this.parseAssignmentExpression));g=this.finalize(this.startNode(d),new f.SequenceExpression(C))}return g},y.prototype.parseStatementListItem=function(){var d;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,l.Messages.IllegalExportDeclaration),d=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,l.Messages.IllegalImportDeclaration),d=this.parseImportDeclaration();break;case"const":d=this.parseLexicalDeclaration({inFor:!1});break;case"function":d=this.parseFunctionDeclaration();break;case"class":d=this.parseClassDeclaration();break;case"let":d=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:d=this.parseStatement()}else d=this.parseStatement();return d},y.prototype.parseBlock=function(){var d=this.createNode();this.expect("{");for(var g=[];!this.match("}");)g.push(this.parseStatementListItem());return this.expect("}"),this.finalize(d,new f.BlockStatement(g))},y.prototype.parseLexicalBinding=function(d,g){var C=this.createNode(),S=this.parsePattern([],d);this.context.strict&&S.type===v.Syntax.Identifier&&this.scanner.isRestrictedWord(S.name)&&this.tolerateError(l.Messages.StrictVarName);var T=null;return d==="const"?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),T=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(l.Messages.DeclarationMissingInitializer,"const")):(!g.inFor&&S.type!==v.Syntax.Identifier||this.match("="))&&(this.expect("="),T=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(C,new f.VariableDeclarator(S,T))},y.prototype.parseBindingList=function(d,g){for(var C=[this.parseLexicalBinding(d,g)];this.match(",");)this.nextToken(),C.push(this.parseLexicalBinding(d,g));return C},y.prototype.isLexicalDeclaration=function(){var d=this.scanner.saveState();this.scanner.scanComments();var g=this.scanner.lex();return this.scanner.restoreState(d),g.type===3||g.type===7&&g.value==="["||g.type===7&&g.value==="{"||g.type===4&&g.value==="let"||g.type===4&&g.value==="yield"},y.prototype.parseLexicalDeclaration=function(d){var g=this.createNode(),C=this.nextToken().value;c.assert(C==="let"||C==="const","Lexical declaration must be either let or const");var S=this.parseBindingList(C,d);return this.consumeSemicolon(),this.finalize(g,new f.VariableDeclaration(S,C))},y.prototype.parseBindingRestElement=function(d,g){var C=this.createNode();this.expect("...");var S=this.parsePattern(d,g);return this.finalize(C,new f.RestElement(S))},y.prototype.parseArrayPattern=function(d,g){var C=this.createNode();this.expect("[");for(var S=[];!this.match("]");)if(this.match(","))this.nextToken(),S.push(null);else{if(this.match("...")){S.push(this.parseBindingRestElement(d,g));break}S.push(this.parsePatternWithDefault(d,g)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(C,new f.ArrayPattern(S))},y.prototype.parsePropertyPattern=function(d,g){var C,S,T=this.createNode(),w=!1,_=!1;if(this.lookahead.type===3){var E=this.lookahead;C=this.parseVariableIdentifier();var D=this.finalize(T,new f.Identifier(E.value));if(this.match("=")){d.push(E),_=!0,this.nextToken();var O=this.parseAssignmentExpression();S=this.finalize(this.startNode(E),new f.AssignmentPattern(D,O))}else this.match(":")?(this.expect(":"),S=this.parsePatternWithDefault(d,g)):(d.push(E),_=!0,S=D)}else w=this.match("["),C=this.parseObjectPropertyKey(),this.expect(":"),S=this.parsePatternWithDefault(d,g);return this.finalize(T,new f.Property("init",C,w,S,!1,_))},y.prototype.parseObjectPattern=function(d,g){var C=this.createNode(),S=[];for(this.expect("{");!this.match("}");)S.push(this.parsePropertyPattern(d,g)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(C,new f.ObjectPattern(S))},y.prototype.parsePattern=function(d,g){var C;return this.match("[")?C=this.parseArrayPattern(d,g):this.match("{")?C=this.parseObjectPattern(d,g):(!this.matchKeyword("let")||g!=="const"&&g!=="let"||this.tolerateUnexpectedToken(this.lookahead,l.Messages.LetInLexicalBinding),d.push(this.lookahead),C=this.parseVariableIdentifier(g)),C},y.prototype.parsePatternWithDefault=function(d,g){var C=this.lookahead,S=this.parsePattern(d,g);if(this.match("=")){this.nextToken();var T=this.context.allowYield;this.context.allowYield=!0;var w=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=T,S=this.finalize(this.startNode(C),new f.AssignmentPattern(S,w))}return S},y.prototype.parseVariableIdentifier=function(d){var g=this.createNode(),C=this.nextToken();return C.type===4&&C.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(C,l.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(C):C.type!==3?this.context.strict&&C.type===4&&this.scanner.isStrictModeReservedWord(C.value)?this.tolerateUnexpectedToken(C,l.Messages.StrictReservedWord):(this.context.strict||C.value!=="let"||d!=="var")&&this.throwUnexpectedToken(C):(this.context.isModule||this.context.await)&&C.type===3&&C.value==="await"&&this.tolerateUnexpectedToken(C),this.finalize(g,new f.Identifier(C.value))},y.prototype.parseVariableDeclaration=function(d){var g=this.createNode(),C=this.parsePattern([],"var");this.context.strict&&C.type===v.Syntax.Identifier&&this.scanner.isRestrictedWord(C.name)&&this.tolerateError(l.Messages.StrictVarName);var S=null;return this.match("=")?(this.nextToken(),S=this.isolateCoverGrammar(this.parseAssignmentExpression)):C.type===v.Syntax.Identifier||d.inFor||this.expect("="),this.finalize(g,new f.VariableDeclarator(C,S))},y.prototype.parseVariableDeclarationList=function(d){var g={inFor:d.inFor},C=[];for(C.push(this.parseVariableDeclaration(g));this.match(",");)this.nextToken(),C.push(this.parseVariableDeclaration(g));return C},y.prototype.parseVariableStatement=function(){var d=this.createNode();this.expectKeyword("var");var g=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(d,new f.VariableDeclaration(g,"var"))},y.prototype.parseEmptyStatement=function(){var d=this.createNode();return this.expect(";"),this.finalize(d,new f.EmptyStatement)},y.prototype.parseExpressionStatement=function(){var d=this.createNode(),g=this.parseExpression();return this.consumeSemicolon(),this.finalize(d,new f.ExpressionStatement(g))},y.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(l.Messages.StrictFunction),this.parseStatement()},y.prototype.parseIfStatement=function(){var d,g=this.createNode(),C=null;this.expectKeyword("if"),this.expect("(");var S=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),d=this.finalize(this.createNode(),new f.EmptyStatement)):(this.expect(")"),d=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),C=this.parseIfClause())),this.finalize(g,new f.IfStatement(S,d,C))},y.prototype.parseDoWhileStatement=function(){var d=this.createNode();this.expectKeyword("do");var g=this.context.inIteration;this.context.inIteration=!0;var C=this.parseStatement();this.context.inIteration=g,this.expectKeyword("while"),this.expect("(");var S=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(d,new f.DoWhileStatement(C,S))},y.prototype.parseWhileStatement=function(){var d,g=this.createNode();this.expectKeyword("while"),this.expect("(");var C=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),d=this.finalize(this.createNode(),new f.EmptyStatement);else{this.expect(")");var S=this.context.inIteration;this.context.inIteration=!0,d=this.parseStatement(),this.context.inIteration=S}return this.finalize(g,new f.WhileStatement(C,d))},y.prototype.parseForStatement=function(){var d,g,C,S=null,T=null,w=null,_=!0,E=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){S=this.createNode(),this.nextToken();var D=this.context.allowIn;this.context.allowIn=!1;var O=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=D,O.length===1&&this.matchKeyword("in")){var b=O[0];b.init&&(b.id.type===v.Syntax.ArrayPattern||b.id.type===v.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(l.Messages.ForInOfLoopInitializer,"for-in"),S=this.finalize(S,new f.VariableDeclaration(O,"var")),this.nextToken(),d=S,g=this.parseExpression(),S=null}else O.length===1&&O[0].init===null&&this.matchContextualKeyword("of")?(S=this.finalize(S,new f.VariableDeclaration(O,"var")),this.nextToken(),d=S,g=this.parseAssignmentExpression(),S=null,_=!1):(S=this.finalize(S,new f.VariableDeclaration(O,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){S=this.createNode();var R=this.nextToken().value;this.context.strict||this.lookahead.value!=="in"?(D=this.context.allowIn,this.context.allowIn=!1,O=this.parseBindingList(R,{inFor:!0}),this.context.allowIn=D,O.length===1&&O[0].init===null&&this.matchKeyword("in")?(S=this.finalize(S,new f.VariableDeclaration(O,R)),this.nextToken(),d=S,g=this.parseExpression(),S=null):O.length===1&&O[0].init===null&&this.matchContextualKeyword("of")?(S=this.finalize(S,new f.VariableDeclaration(O,R)),this.nextToken(),d=S,g=this.parseAssignmentExpression(),S=null,_=!1):(this.consumeSemicolon(),S=this.finalize(S,new f.VariableDeclaration(O,R)))):(S=this.finalize(S,new f.Identifier(R)),this.nextToken(),d=S,g=this.parseExpression(),S=null)}else{var N=this.lookahead;if(D=this.context.allowIn,this.context.allowIn=!1,S=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=D,this.matchKeyword("in"))this.context.isAssignmentTarget&&S.type!==v.Syntax.AssignmentExpression||this.tolerateError(l.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(S),d=S,g=this.parseExpression(),S=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&S.type!==v.Syntax.AssignmentExpression||this.tolerateError(l.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(S),d=S,g=this.parseAssignmentExpression(),S=null,_=!1;else{if(this.match(",")){for(var L=[S];this.match(",");)this.nextToken(),L.push(this.isolateCoverGrammar(this.parseAssignmentExpression));S=this.finalize(this.startNode(N),new f.SequenceExpression(L))}this.expect(";")}}if(d===void 0&&(this.match(";")||(T=this.parseExpression()),this.expect(";"),this.match(")")||(w=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),C=this.finalize(this.createNode(),new f.EmptyStatement);else{this.expect(")");var B=this.context.inIteration;this.context.inIteration=!0,C=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=B}return d===void 0?this.finalize(E,new f.ForStatement(S,T,w,C)):_?this.finalize(E,new f.ForInStatement(d,g,C)):this.finalize(E,new f.ForOfStatement(d,g,C))},y.prototype.parseContinueStatement=function(){var d=this.createNode();this.expectKeyword("continue");var g=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var C=this.parseVariableIdentifier();g=C;var S="$"+C.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,S)||this.throwError(l.Messages.UnknownLabel,C.name)}return this.consumeSemicolon(),g!==null||this.context.inIteration||this.throwError(l.Messages.IllegalContinue),this.finalize(d,new f.ContinueStatement(g))},y.prototype.parseBreakStatement=function(){var d=this.createNode();this.expectKeyword("break");var g=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var C=this.parseVariableIdentifier(),S="$"+C.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,S)||this.throwError(l.Messages.UnknownLabel,C.name),g=C}return this.consumeSemicolon(),g!==null||this.context.inIteration||this.context.inSwitch||this.throwError(l.Messages.IllegalBreak),this.finalize(d,new f.BreakStatement(g))},y.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(l.Messages.IllegalReturn);var d=this.createNode();this.expectKeyword("return");var g=(this.match(";")||this.match("}")||this.hasLineTerminator||this.lookahead.type===2)&&this.lookahead.type!==8&&this.lookahead.type!==10?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(d,new f.ReturnStatement(g))},y.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(l.Messages.StrictModeWith);var d,g=this.createNode();this.expectKeyword("with"),this.expect("(");var C=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),d=this.finalize(this.createNode(),new f.EmptyStatement)):(this.expect(")"),d=this.parseStatement()),this.finalize(g,new f.WithStatement(C,d))},y.prototype.parseSwitchCase=function(){var d,g=this.createNode();this.matchKeyword("default")?(this.nextToken(),d=null):(this.expectKeyword("case"),d=this.parseExpression()),this.expect(":");for(var C=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)C.push(this.parseStatementListItem());return this.finalize(g,new f.SwitchCase(d,C))},y.prototype.parseSwitchStatement=function(){var d=this.createNode();this.expectKeyword("switch"),this.expect("(");var g=this.parseExpression();this.expect(")");var C=this.context.inSwitch;this.context.inSwitch=!0;var S=[],T=!1;for(this.expect("{");!this.match("}");){var w=this.parseSwitchCase();w.test===null&&(T&&this.throwError(l.Messages.MultipleDefaultsInSwitch),T=!0),S.push(w)}return this.expect("}"),this.context.inSwitch=C,this.finalize(d,new f.SwitchStatement(g,S))},y.prototype.parseLabelledStatement=function(){var d,g=this.createNode(),C=this.parseExpression();if(C.type===v.Syntax.Identifier&&this.match(":")){this.nextToken();var S=C,T="$"+S.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,T)&&this.throwError(l.Messages.Redeclaration,"Label",S.name),this.context.labelSet[T]=!0;var w=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),w=this.parseClassDeclaration();else if(this.matchKeyword("function")){var _=this.lookahead,E=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(_,l.Messages.StrictFunction):E.generator&&this.tolerateUnexpectedToken(_,l.Messages.GeneratorInLegacyContext),w=E}else w=this.parseStatement();delete this.context.labelSet[T],d=new f.LabeledStatement(S,w)}else this.consumeSemicolon(),d=new f.ExpressionStatement(C);return this.finalize(g,d)},y.prototype.parseThrowStatement=function(){var d=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(l.Messages.NewlineAfterThrow);var g=this.parseExpression();return this.consumeSemicolon(),this.finalize(d,new f.ThrowStatement(g))},y.prototype.parseCatchClause=function(){var d=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var g=[],C=this.parsePattern(g),S={},T=0;T0&&this.tolerateError(l.Messages.BadGetterArity);var S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(d,new f.FunctionExpression(null,C.params,S,!1))},y.prototype.parseSetterMethod=function(){var d=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var C=this.parseFormalParameters();C.params.length!==1?this.tolerateError(l.Messages.BadSetterArity):C.params[0]instanceof f.RestElement&&this.tolerateError(l.Messages.BadSetterRestParameter);var S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(d,new f.FunctionExpression(null,C.params,S,!1))},y.prototype.parseGeneratorMethod=function(){var d=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var C=this.parseFormalParameters();this.context.allowYield=!1;var S=this.parsePropertyMethod(C);return this.context.allowYield=g,this.finalize(d,new f.FunctionExpression(null,C.params,S,!0))},y.prototype.isStartOfExpression=function(){var d=!0,g=this.lookahead.value;switch(this.lookahead.type){case 7:d=g==="["||g==="("||g==="{"||g==="+"||g==="-"||g==="!"||g==="~"||g==="++"||g==="--"||g==="/"||g==="/=";break;case 4:d=g==="class"||g==="delete"||g==="function"||g==="let"||g==="new"||g==="super"||g==="this"||g==="typeof"||g==="void"||g==="yield"}return d},y.prototype.parseYieldExpression=function(){var d=this.createNode();this.expectKeyword("yield");var g=null,C=!1;if(!this.hasLineTerminator){var S=this.context.allowYield;this.context.allowYield=!1,(C=this.match("*"))?(this.nextToken(),g=this.parseAssignmentExpression()):this.isStartOfExpression()&&(g=this.parseAssignmentExpression()),this.context.allowYield=S}return this.finalize(d,new f.YieldExpression(g,C))},y.prototype.parseClassElement=function(d){var g=this.lookahead,C=this.createNode(),S="",T=null,w=null,_=!1,E=!1,D=!1,O=!1;if(this.match("*"))this.nextToken();else if(_=this.match("["),(T=this.parseObjectPropertyKey()).name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(g=this.lookahead,D=!0,_=this.match("["),this.match("*")?this.nextToken():T=this.parseObjectPropertyKey()),g.type===3&&!this.hasLineTerminator&&g.value==="async"){var b=this.lookahead.value;b!==":"&&b!=="("&&b!=="*"&&(O=!0,g=this.lookahead,T=this.parseObjectPropertyKey(),g.type===3&&g.value==="constructor"&&this.tolerateUnexpectedToken(g,l.Messages.ConstructorIsAsync))}var R=this.qualifiedPropertyName(this.lookahead);return g.type===3?g.value==="get"&&R?(S="get",_=this.match("["),T=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod()):g.value==="set"&&R&&(S="set",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseSetterMethod()):g.type===7&&g.value==="*"&&R&&(S="init",_=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),E=!0),!S&&T&&this.match("(")&&(S="init",w=O?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),E=!0),S||this.throwUnexpectedToken(this.lookahead),S==="init"&&(S="method"),_||(D&&this.isPropertyKey(T,"prototype")&&this.throwUnexpectedToken(g,l.Messages.StaticPrototype),!D&&this.isPropertyKey(T,"constructor")&&((S!=="method"||!E||w&&w.generator)&&this.throwUnexpectedToken(g,l.Messages.ConstructorSpecialMethod),d.value?this.throwUnexpectedToken(g,l.Messages.DuplicateConstructor):d.value=!0,S="constructor")),this.finalize(C,new f.MethodDefinition(T,_,w,S,D))},y.prototype.parseClassElementList=function(){var d=[],g={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():d.push(this.parseClassElement(g));return this.expect("}"),d},y.prototype.parseClassBody=function(){var d=this.createNode(),g=this.parseClassElementList();return this.finalize(d,new f.ClassBody(g))},y.prototype.parseClassDeclaration=function(d){var g=this.createNode(),C=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var S=d&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),T=null;this.matchKeyword("extends")&&(this.nextToken(),T=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var w=this.parseClassBody();return this.context.strict=C,this.finalize(g,new f.ClassDeclaration(S,T,w))},y.prototype.parseClassExpression=function(){var d=this.createNode(),g=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var C=this.lookahead.type===3?this.parseVariableIdentifier():null,S=null;this.matchKeyword("extends")&&(this.nextToken(),S=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var T=this.parseClassBody();return this.context.strict=g,this.finalize(d,new f.ClassExpression(C,S,T))},y.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var d=this.createNode(),g=this.parseDirectivePrologues();this.lookahead.type!==2;)g.push(this.parseStatementListItem());return this.finalize(d,new f.Module(g))},y.prototype.parseScript=function(){for(var d=this.createNode(),g=this.parseDirectivePrologues();this.lookahead.type!==2;)g.push(this.parseStatementListItem());return this.finalize(d,new f.Script(g))},y.prototype.parseModuleSpecifier=function(){var d=this.createNode();this.lookahead.type!==8&&this.throwError(l.Messages.InvalidModuleSpecifier);var g=this.nextToken(),C=this.getTokenRaw(g);return this.finalize(d,new f.Literal(g.value,C))},y.prototype.parseImportSpecifier=function(){var d,g,C=this.createNode();return this.lookahead.type===3?(g=d=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),g=this.parseVariableIdentifier())):(g=d=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),g=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(C,new f.ImportSpecifier(g,d))},y.prototype.parseNamedImports=function(){this.expect("{");for(var d=[];!this.match("}");)d.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),d},y.prototype.parseImportDefaultSpecifier=function(){var d=this.createNode(),g=this.parseIdentifierName();return this.finalize(d,new f.ImportDefaultSpecifier(g))},y.prototype.parseImportNamespaceSpecifier=function(){var d=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(l.Messages.NoAsAfterImportNamespace),this.nextToken();var g=this.parseIdentifierName();return this.finalize(d,new f.ImportNamespaceSpecifier(g))},y.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(l.Messages.IllegalImportDeclaration);var d,g=this.createNode();this.expectKeyword("import");var C=[];if(this.lookahead.type===8)d=this.parseModuleSpecifier();else{if(this.match("{")?C=C.concat(this.parseNamedImports()):this.match("*")?C.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(C.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?C.push(this.parseImportNamespaceSpecifier()):this.match("{")?C=C.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var S=this.lookahead.value?l.Messages.UnexpectedToken:l.Messages.MissingFromClause;this.throwError(S,this.lookahead.value)}this.nextToken(),d=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(g,new f.ImportDeclaration(C,d))},y.prototype.parseExportSpecifier=function(){var d=this.createNode(),g=this.parseIdentifierName(),C=g;return this.matchContextualKeyword("as")&&(this.nextToken(),C=this.parseIdentifierName()),this.finalize(d,new f.ExportSpecifier(g,C))},y.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(l.Messages.IllegalExportDeclaration);var d,g=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var C=this.parseFunctionDeclaration(!0);d=this.finalize(g,new f.ExportDefaultDeclaration(C))}else this.matchKeyword("class")?(C=this.parseClassDeclaration(!0),d=this.finalize(g,new f.ExportDefaultDeclaration(C))):this.matchContextualKeyword("async")?(C=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),d=this.finalize(g,new f.ExportDefaultDeclaration(C))):(this.matchContextualKeyword("from")&&this.throwError(l.Messages.UnexpectedToken,this.lookahead.value),C=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),d=this.finalize(g,new f.ExportDefaultDeclaration(C)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var S=this.lookahead.value?l.Messages.UnexpectedToken:l.Messages.MissingFromClause;this.throwError(S,this.lookahead.value)}this.nextToken();var T=this.parseModuleSpecifier();this.consumeSemicolon(),d=this.finalize(g,new f.ExportAllDeclaration(T))}else if(this.lookahead.type===4){switch(C=void 0,this.lookahead.value){case"let":case"const":C=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":C=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}d=this.finalize(g,new f.ExportNamedDeclaration(C,[],null))}else if(this.matchAsyncFunction())C=this.parseFunctionDeclaration(),d=this.finalize(g,new f.ExportNamedDeclaration(C,[],null));else{var w=[],_=null,E=!1;for(this.expect("{");!this.match("}");)E=E||this.matchKeyword("default"),w.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),_=this.parseModuleSpecifier(),this.consumeSemicolon()):E?(S=this.lookahead.value?l.Messages.UnexpectedToken:l.Messages.MissingFromClause,this.throwError(S,this.lookahead.value)):this.consumeSemicolon(),d=this.finalize(g,new f.ExportNamedDeclaration(null,w,_))}return d},y}();s.Parser=x},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.assert=function(u,c){if(!u)throw new Error("ASSERT: "+c)}},function(o,s){Object.defineProperty(s,"__esModule",{value:!0});var u=function(){function c(){this.errors=[],this.tolerant=!1}return c.prototype.recordError=function(p){this.errors.push(p)},c.prototype.tolerate=function(p){if(!this.tolerant)throw p;this.recordError(p)},c.prototype.constructError=function(p,l){var f=new Error(p);try{throw f}catch(h){Object.create&&Object.defineProperty&&(f=Object.create(h),Object.defineProperty(f,"column",{value:l}))}return f},c.prototype.createError=function(p,l,f,h){var v="Line "+l+": "+h,m=this.constructError(v,f);return m.index=p,m.lineNumber=l,m.description=h,m},c.prototype.throwError=function(p,l,f,h){throw this.createError(p,l,f,h)},c.prototype.tolerateError=function(p,l,f,h){var v=this.createError(p,l,f,h);if(!this.tolerant)throw v;this.recordError(v)},c}();s.ErrorHandler=u},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(9),p=u(4),l=u(11);function f(m){return"0123456789abcdef".indexOf(m.toLowerCase())}function h(m){return"01234567".indexOf(m)}var v=function(){function m(x,y){this.source=x,this.errorHandler=y,this.trackComment=!1,this.isModule=!1,this.length=x.length,this.index=0,this.lineNumber=x.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return m.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},m.prototype.restoreState=function(x){this.index=x.index,this.lineNumber=x.lineNumber,this.lineStart=x.lineStart},m.prototype.eof=function(){return this.index>=this.length},m.prototype.throwUnexpectedToken=function(x){return x===void 0&&(x=l.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,x)},m.prototype.tolerateUnexpectedToken=function(x){x===void 0&&(x=l.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,x)},m.prototype.skipSingleLineComment=function(x){var y,d,g=[];for(this.trackComment&&(g=[],y=this.index-x,d={start:{line:this.lineNumber,column:this.index-this.lineStart-x},end:{}});!this.eof();){var C=this.source.charCodeAt(this.index);if(++this.index,p.Character.isLineTerminator(C)){if(this.trackComment){d.end={line:this.lineNumber,column:this.index-this.lineStart-1};var S={multiLine:!1,slice:[y+x,this.index-1],range:[y,this.index-1],loc:d};g.push(S)}return C===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,g}}return this.trackComment&&(d.end={line:this.lineNumber,column:this.index-this.lineStart},S={multiLine:!1,slice:[y+x,this.index],range:[y,this.index],loc:d},g.push(S)),g},m.prototype.skipMultiLineComment=function(){var x,y,d=[];for(this.trackComment&&(d=[],x=this.index-2,y={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var g=this.source.charCodeAt(this.index);if(p.Character.isLineTerminator(g))g===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(g===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){y.end={line:this.lineNumber,column:this.index-this.lineStart};var C={multiLine:!0,slice:[x+2,this.index-2],range:[x,this.index],loc:y};d.push(C)}return d}++this.index}else++this.index}return this.trackComment&&(y.end={line:this.lineNumber,column:this.index-this.lineStart},C={multiLine:!0,slice:[x+2,this.index],range:[x,this.index],loc:y},d.push(C)),this.tolerateUnexpectedToken(),d},m.prototype.scanComments=function(){var x;this.trackComment&&(x=[]);for(var y=this.index===0;!this.eof();){var d=this.source.charCodeAt(this.index);if(p.Character.isWhiteSpace(d))++this.index;else if(p.Character.isLineTerminator(d))++this.index,d===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,y=!0;else if(d===47)if((d=this.source.charCodeAt(this.index+1))===47){this.index+=2;var g=this.skipSingleLineComment(2);this.trackComment&&(x=x.concat(g)),y=!0}else{if(d!==42)break;this.index+=2,g=this.skipMultiLineComment(),this.trackComment&&(x=x.concat(g))}else if(y&&d===45){if(this.source.charCodeAt(this.index+1)!==45||this.source.charCodeAt(this.index+2)!==62)break;this.index+=3,g=this.skipSingleLineComment(3),this.trackComment&&(x=x.concat(g))}else{if(d!==60||this.isModule||this.source.slice(this.index+1,this.index+4)!=="!--")break;this.index+=4,g=this.skipSingleLineComment(4),this.trackComment&&(x=x.concat(g))}}return x},m.prototype.isFutureReservedWord=function(x){switch(x){case"enum":case"export":case"import":case"super":return!0;default:return!1}},m.prototype.isStrictModeReservedWord=function(x){switch(x){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},m.prototype.isRestrictedWord=function(x){return x==="eval"||x==="arguments"},m.prototype.isKeyword=function(x){switch(x.length){case 2:return x==="if"||x==="in"||x==="do";case 3:return x==="var"||x==="for"||x==="new"||x==="try"||x==="let";case 4:return x==="this"||x==="else"||x==="case"||x==="void"||x==="with"||x==="enum";case 5:return x==="while"||x==="break"||x==="catch"||x==="throw"||x==="const"||x==="yield"||x==="class"||x==="super";case 6:return x==="return"||x==="typeof"||x==="delete"||x==="switch"||x==="export"||x==="import";case 7:return x==="default"||x==="finally"||x==="extends";case 8:return x==="function"||x==="continue"||x==="debugger";case 10:return x==="instanceof";default:return!1}},m.prototype.codePointAt=function(x){var y=this.source.charCodeAt(x);if(y>=55296&&y<=56319){var d=this.source.charCodeAt(x+1);d>=56320&&d<=57343&&(y=1024*(y-55296)+d-56320+65536)}return y},m.prototype.scanHexEscape=function(x){for(var y=x==="u"?4:2,d=0,g=0;g1114111||x!=="}")&&this.throwUnexpectedToken(),p.Character.fromCodePoint(y)},m.prototype.getIdentifier=function(){for(var x=this.index++;!this.eof();){var y=this.source.charCodeAt(this.index);if(y===92)return this.index=x,this.getComplexIdentifier();if(y>=55296&&y<57343)return this.index=x,this.getComplexIdentifier();if(!p.Character.isIdentifierPart(y))break;++this.index}return this.source.slice(x,this.index)},m.prototype.getComplexIdentifier=function(){var x,y=this.codePointAt(this.index),d=p.Character.fromCodePoint(y);for(this.index+=d.length,y===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,x=this.scanUnicodeCodePointEscape()):(x=this.scanHexEscape("u"))!==null&&x!=="\\"&&p.Character.isIdentifierStart(x.charCodeAt(0))||this.throwUnexpectedToken(),d=x);!this.eof()&&(y=this.codePointAt(this.index),p.Character.isIdentifierPart(y));)d+=x=p.Character.fromCodePoint(y),this.index+=x.length,y===92&&(d=d.substr(0,d.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,x=this.scanUnicodeCodePointEscape()):(x=this.scanHexEscape("u"))!==null&&x!=="\\"&&p.Character.isIdentifierPart(x.charCodeAt(0))||this.throwUnexpectedToken(),d+=x);return d},m.prototype.octalToDecimal=function(x){var y=x!=="0",d=h(x);return!this.eof()&&p.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(y=!0,d=8*d+h(this.source[this.index++]),"0123".indexOf(x)>=0&&!this.eof()&&p.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(d=8*d+h(this.source[this.index++]))),{code:d,octal:y}},m.prototype.scanIdentifier=function(){var x,y=this.index,d=this.source.charCodeAt(y)===92?this.getComplexIdentifier():this.getIdentifier();if((x=d.length===1?3:this.isKeyword(d)?4:d==="null"?5:d==="true"||d==="false"?1:3)!=3&&y+d.length!==this.index){var g=this.index;this.index=y,this.tolerateUnexpectedToken(l.Messages.InvalidEscapedReservedWord),this.index=g}return{type:x,value:d,lineNumber:this.lineNumber,lineStart:this.lineStart,start:y,end:this.index}},m.prototype.scanPunctuator=function(){var x=this.index,y=this.source[this.index];switch(y){case"(":case"{":y==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,y="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:(y=this.source.substr(this.index,4))===">>>="?this.index+=4:(y=y.substr(0,3))==="==="||y==="!=="||y===">>>"||y==="<<="||y===">>="||y==="**="?this.index+=3:(y=y.substr(0,2))==="&&"||y==="||"||y==="=="||y==="!="||y==="+="||y==="-="||y==="*="||y==="/="||y==="++"||y==="--"||y==="<<"||y===">>"||y==="&="||y==="|="||y==="^="||y==="%="||y==="<="||y===">="||y==="=>"||y==="**"?this.index+=2:(y=this.source[this.index],"<>=!+-*%&|^/".indexOf(y)>=0&&++this.index)}return this.index===x&&this.throwUnexpectedToken(),{type:7,value:y,lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},m.prototype.scanHexLiteral=function(x){for(var y="";!this.eof()&&p.Character.isHexDigit(this.source.charCodeAt(this.index));)y+=this.source[this.index++];return y.length===0&&this.throwUnexpectedToken(),p.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+y,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},m.prototype.scanBinaryLiteral=function(x){for(var y,d="";!this.eof()&&((y=this.source[this.index])==="0"||y==="1");)d+=this.source[this.index++];return d.length===0&&this.throwUnexpectedToken(),this.eof()||(y=this.source.charCodeAt(this.index),(p.Character.isIdentifierStart(y)||p.Character.isDecimalDigit(y))&&this.throwUnexpectedToken()),{type:6,value:parseInt(d,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},m.prototype.scanOctalLiteral=function(x,y){var d="",g=!1;for(p.Character.isOctalDigit(x.charCodeAt(0))?(g=!0,d="0"+this.source[this.index++]):++this.index;!this.eof()&&p.Character.isOctalDigit(this.source.charCodeAt(this.index));)d+=this.source[this.index++];return g||d.length!==0||this.throwUnexpectedToken(),(p.Character.isIdentifierStart(this.source.charCodeAt(this.index))||p.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(d,8),octal:g,lineNumber:this.lineNumber,lineStart:this.lineStart,start:y,end:this.index}},m.prototype.isImplicitOctalLiteral=function(){for(var x=this.index+1;x=0&&(d=d.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(C,S,T){var w=parseInt(S||T,16);return w>1114111&&g.throwUnexpectedToken(l.Messages.InvalidRegExp),w<=65535?String.fromCharCode(w):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(d)}catch{this.throwUnexpectedToken(l.Messages.InvalidRegExp)}try{return new RegExp(x,y)}catch{return null}},m.prototype.scanRegExpBody=function(){var x=this.source[this.index];c.assert(x==="/","Regular expression literal must start with a slash");for(var y=this.source[this.index++],d=!1,g=!1;!this.eof();)if(y+=x=this.source[this.index++],x==="\\")x=this.source[this.index++],p.Character.isLineTerminator(x.charCodeAt(0))&&this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),y+=x;else if(p.Character.isLineTerminator(x.charCodeAt(0)))this.throwUnexpectedToken(l.Messages.UnterminatedRegExp);else if(d)x==="]"&&(d=!1);else{if(x==="/"){g=!0;break}x==="["&&(d=!0)}return g||this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),y.substr(1,y.length-2)},m.prototype.scanRegExpFlags=function(){for(var x="";!this.eof();){var y=this.source[this.index];if(!p.Character.isIdentifierPart(y.charCodeAt(0)))break;if(++this.index,y!=="\\"||this.eof())x+=y;else if((y=this.source[this.index])==="u"){++this.index;var d=this.index,g=this.scanHexEscape("u");if(g!==null)for(x+=g;d=55296&&x<57343&&p.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},m}();s.Scanner=v},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.TokenName={},s.TokenName[1]="Boolean",s.TokenName[2]="",s.TokenName[3]="Identifier",s.TokenName[4]="Keyword",s.TokenName[5]="Null",s.TokenName[6]="Numeric",s.TokenName[7]="Punctuator",s.TokenName[8]="String",s.TokenName[9]="RegularExpression",s.TokenName[10]="Template"},function(o,s){Object.defineProperty(s,"__esModule",{value:!0}),s.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(o,s,u){Object.defineProperty(s,"__esModule",{value:!0});var c=u(10),p=u(12),l=u(13),f=function(){function v(){this.values=[],this.curly=this.paren=-1}return v.prototype.beforeFunctionExpression=function(m){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(m)>=0},v.prototype.isRegexStart=function(){var m=this.values[this.values.length-1],x=m!==null;switch(m){case"this":case"]":x=!1;break;case")":var y=this.values[this.paren-1];x=y==="if"||y==="while"||y==="for"||y==="with";break;case"}":if(x=!1,this.values[this.curly-3]==="function")x=!!(d=this.values[this.curly-4])&&!this.beforeFunctionExpression(d);else if(this.values[this.curly-4]==="function"){var d;x=!(d=this.values[this.curly-5])||!this.beforeFunctionExpression(d)}}return x},v.prototype.push=function(m){m.type===7||m.type===4?(m.value==="{"?this.curly=this.values.length:m.value==="("&&(this.paren=this.values.length),this.values.push(m.value)):this.values.push(null)},v}(),h=function(){function v(m,x){this.errorHandler=new c.ErrorHandler,this.errorHandler.tolerant=!!x&&typeof x.tolerant=="boolean"&&x.tolerant,this.scanner=new p.Scanner(m,this.errorHandler),this.scanner.trackComment=!!x&&typeof x.comment=="boolean"&&x.comment,this.trackRange=!!x&&typeof x.range=="boolean"&&x.range,this.trackLoc=!!x&&typeof x.loc=="boolean"&&x.loc,this.buffer=[],this.reader=new f}return v.prototype.errors=function(){return this.errorHandler.errors},v.prototype.getNextToken=function(){if(this.buffer.length===0){var m=this.scanner.scanComments();if(this.scanner.trackComment)for(var x=0;x0?N.charCodeAt(k-1):null,ae=ae&&g(G,W)}else{for(k=0;kP&&N[Q+1]!==" ",Q=k);else if(!d(G))return 5;W=k>0?N.charCodeAt(k-1):null,ae=ae&&g(G,W)}Y=Y||q&&k-Q-1>P&&N[Q+1]!==" "}return X||Y?B>9&&C(N)?5:Y?4:3:ae&&!F(N)?1:2}function T(N,L,B,P){N.dump=function(){if(L.length===0)return"''";if(!N.noCompatMode&&f.indexOf(L)!==-1)return"'"+L+"'";var F=N.indent*Math.max(1,B),k=N.lineWidth===-1?-1:Math.max(Math.min(N.lineWidth,40),N.lineWidth-F),G=P||N.flowLevel>-1&&B>=N.flowLevel;switch(S(L,G,N.indent,k,function(W){return function(H,X){var Y,q;for(Y=0,q=H.implicitTypes.length;Y"+w(L,N.indent)+_(m(function(W,H){for(var X,Y,q=/(\n+)([^\n]*)/g,Q=(ne=W.indexOf(` +`),ne=ne!==-1?ne:W.length,q.lastIndex=ne,E(W.slice(0,ne),H)),ae=W[0]===` +`||W[0]===" ",ne;Y=q.exec(W);){var ee=Y[1],V=Y[2];X=V[0]===" ",Q+=ee+(ae||X||V===""?"":` +`)+E(V,H),ae=X}return Q}(L,k),F));case 5:return'"'+function(W){for(var H,X,Y,q="",Q=0;Q=55296&&H<=56319&&(X=W.charCodeAt(Q+1))>=56320&&X<=57343?(q+=h(1024*(H-55296)+X-56320+65536),Q++):(Y=l[H],q+=!Y&&d(H)?W[Q]:Y||h(H));return q}(L)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function w(N,L){var B=C(N)?String(L):"",P=N[N.length-1]===` +`;return B+(P&&(N[N.length-2]===` +`||N===` `)?"+":P?"":"-")+` -`}function _(R){return R[R.length-1]===` -`?R.slice(0,-1):R}function E(R,B){if(R===""||R[0]===" ")return R;for(var I,P,L=/ [^ ]/g,k=0,A=0,j=0,H="";I=L.exec(R);)(j=I.index)-k>B&&(P=A>k?A:j,H+=` -`+R.slice(k,P),k=P+1),A=j;return H+=` -`,R.length-k>B&&A>k?H+=R.slice(k,A)+` -`+R.slice(A+1):H+=R.slice(k),H.slice(1)}function D(R,B,I){var P,L,k,A,j,H;for(k=0,A=(L=I?R.explicitTypes:R.implicitTypes).length;k tag resolver accepts not "'+H+'" style');P=j.represent[H](B,H)}R.dump=P}return!0}return!1}function O(R,B,I,P,L,k){R.tag=null,R.dump=I,D(R,I,!1)||D(R,I,!0);var A=l.call(R.dump);P&&(P=R.flowLevel<0||R.flowLevel>B);var j,H,K=A==="[object Object]"||A==="[object Array]";if(K&&(H=(j=R.duplicates.indexOf(I))!==-1),(R.tag!==null&&R.tag!=="?"||H||R.indent!==2&&B>0)&&(L=!1),H&&R.usedDuplicates[j])R.dump="*ref_"+j;else{if(K&&H&&!R.usedDuplicates[j]&&(R.usedDuplicates[j]=!0),A==="[object Object]")P&&Object.keys(R.dump).length!==0?(function(q,Z,re,ae){var ee,F,b,G,U,z,W="",$=q.tag,J=Object.keys(re);if(q.sortKeys===!0)J.sort();else if(typeof q.sortKeys=="function")J.sort(q.sortKeys);else if(q.sortKeys)throw new o("sortKeys must be a boolean or a function");for(ee=0,F=J.length;ee1024)&&(q.dump&&q.dump.charCodeAt(0)===10?z+="?":z+="? "),z+=q.dump,U&&(z+=m(q,Z)),O(q,Z+1,G,!0,U)&&(q.dump&&q.dump.charCodeAt(0)===10?z+=":":z+=": ",W+=z+=q.dump));q.tag=$,q.dump=W||"{}"}(R,B,R.dump,L),H&&(R.dump="&ref_"+j+R.dump)):(function(q,Z,re){var ae,ee,F,b,G,U="",z=q.tag,W=Object.keys(re);for(ae=0,ee=W.length;ae1024&&(G+="? "),G+=q.dump+(q.condenseFlow?'"':"")+":"+(q.condenseFlow?"":" "),O(q,Z,b,!1,!1)&&(U+=G+=q.dump));q.tag=z,q.dump="{"+U+"}"}(R,B,R.dump),H&&(R.dump="&ref_"+j+" "+R.dump));else if(A==="[object Array]"){var Y=R.noArrayIndent&&B>0?B-1:B;P&&R.dump.length!==0?(function(q,Z,re,ae){var ee,F,b="",G=q.tag;for(ee=0,F=re.length;ee "+R.dump)}return!0}function M(R,B){var I,P,L=[],k=[];for(function A(j,H,K){var Y,q,Z;if(j!==null&&typeof j=="object")if((q=H.indexOf(j))!==-1)K.indexOf(q)===-1&&K.push(q);else if(H.push(j),Array.isArray(j))for(q=0,Z=j.length;q=S.length&&(S=void 0),{value:S&&S[_++],done:!S}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")},c=this&&this.__read||function(S,T){var w=typeof Symbol=="function"&&S[Symbol.iterator];if(!w)return S;var _,E,D=w.call(S),O=[];try{for(;(T===void 0||T-- >0)&&!(_=D.next()).done;)O.push(_.value)}catch(M){E={error:M}}finally{try{_&&!_.done&&(w=D.return)&&w.call(D)}finally{if(E)throw E.error}}return O};Object.defineProperty(n,"__esModule",{value:!0});var l=r(91),p=r(1),u=r(183),f=r(0),h=r(7),d=r(95),v=r(69),m=r(3),x=r(305),y=r(306),g=r(307),C=function(S){function T(w,_){_===void 0&&(_=!1);var E=S.call(this)||this;return E._hasDeclaration=!1,E._docTypeName="",E._hasDocumentElement=!1,E._currentElementSerialized=!1,E._openTags=[],E._ended=!1,E._fragment=_,E._options=p.applyDefaults(w||{},l.DefaultXMLBuilderCBOptions),E._builderOptions={defaultNamespace:E._options.defaultNamespace,namespaceAlias:E._options.namespaceAlias},E._options.format==="json"?E._writer=new y.JSONCBWriter(E._options):E._options.format==="yaml"?E._writer=new g.YAMLCBWriter(E._options):E._writer=new x.XMLCBWriter(E._options),E._options.data!==void 0&&E.on("data",E._options.data),E._options.end!==void 0&&E.on("end",E._options.end),E._options.error!==void 0&&E.on("error",E._options.error),E._prefixMap=new d.NamespacePrefixMap,E._prefixMap.set("xml",h.namespace.XML),E._prefixIndex={value:1},E._push(E._writer.frontMatter()),E}return o(T,S),T.prototype.ele=function(w,_,E){var D,O;if(p.isObject(w)||p.isString(w)&&(/^\s*/g,">");return this._push(this._writer.text(E)),this},T.prototype.ins=function(w,_){var E;_===void 0&&(_=""),this._serializeOpenTag(!0);try{E=u.fragment(this._builderOptions).ins(w,_).first().node}catch(D){return this.emit("error",D),this}return this._options.wellFormed&&(E.target.indexOf(":")!==-1||/^xml$/i.test(E.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!f.xml_isLegalChar(E.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(E.target,E.data)),this)},T.prototype.dat=function(w){var _;this._serializeOpenTag(!0);try{_=u.fragment(this._builderOptions).dat(w).first().node}catch(E){return this.emit("error",E),this}return this._push(this._writer.cdata(_.data)),this},T.prototype.dec=function(w){return w===void 0&&(w={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(w.version||"1.0",w.encoding,w.standalone)),this._hasDeclaration=!0,this)},T.prototype.dtd=function(w){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(this._docTypeName!=="")return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var _;try{_=u.create().dtd(w).first().node}catch(E){return this.emit("error",E),this}return this._options.wellFormed&&!f.xml_isPubidChar(_.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!f.xml_isLegalChar(_.systemId)||_.systemId.indexOf('"')!==-1&&_.systemId.indexOf("'")!==-1)?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=w.name,this._push(this._writer.docType(w.name,_.publicId,_.systemId)),this)},T.prototype.import=function(w){var _,E,D=u.fragment().set(this._options);try{D.import(w)}catch(R){return this.emit("error",R),this}try{for(var O=s(D.node.childNodes),M=O.next();!M.done;M=O.next()){var N=M.value;this._fromNode(N)}}catch(R){_={error:R}}finally{try{M&&!M.done&&(E=O.return)&&E.call(O)}finally{if(_)throw _.error}}return this},T.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},T.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},T.prototype._serializeOpenTag=function(w){if(!this._currentElementSerialized&&this._currentElement!==void 0){var _=this._currentElement.node;if(!this._options.wellFormed||_.localName.indexOf(":")===-1&&f.xml_isName(_.localName)){var E="",D=!1,O=this._prefixMap.copy(),M={},N=this._recordNamespaceInformation(_,O,M),R=this._openTags.length===0?null:this._openTags[this._openTags.length-1][1],B=_.namespaceURI;if(B===null&&(B=R),R===B)N!==null&&(D=!0),E=B===h.namespace.XML?"xml:"+_.localName:_.localName,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E));else{var I=_.prefix,P=null;if(I===null&&B===N||(P=O.get(I,B)),I==="xmlns"){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));P=I}P!==null?(E=P+":"+_.localName,N!==null&&N!==h.namespace.XML&&(R=N||null),this._writer.beginElement(E),this._push(this._writer.openTagBegin(E))):I!==null?(I in M&&(I=this._generatePrefix(B,O,this._prefixIndex)),O.set(I,B),E+=I+":"+_.localName,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E)),this._push(this._writer.attribute("xmlns:"+I,this._serializeAttributeValue(B,this._options.wellFormed))),N!==null&&(R=N||null)):N===null||N!==null&&N!==B?(D=!0,E+=_.localName,R=B,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(B,this._options.wellFormed)))):(E+=_.localName,R=B,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E)))}this._serializeAttributes(_,O,this._prefixIndex,M,D,this._options.wellFormed);var L=B===h.namespace.HTML;L&&!w&&T._VoidElementNames.has(_.localName)?(this._push(this._writer.openTagEnd(E,!0,!0)),this._writer.endElement(E)):L||w?this._push(this._writer.openTagEnd(E,!1,!1)):(this._push(this._writer.openTagEnd(E,!0,!1)),this._writer.endElement(E)),this._currentElementSerialized=!0,this._openTags.push([E,R,this._prefixMap,w]),this._isPrefixMapModified(this._prefixMap,O)&&(this._prefixMap=O),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},T.prototype._serializeCloseTag=function(){this._writer.level--;var w=this._openTags.pop();if(w!==void 0){var _=c(w,4),E=_[0],D=(_[1],_[2]),O=_[3];this._prefixMap=D,O&&(this._push(this._writer.closeTag(E)),this._writer.endElement(E))}else this.emit("error",new Error("Last element is undefined."))},T.prototype._push=function(w){w===null?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):w.length!==0&&(this._writer.hasData=!0,this.emit("data",w,this._writer.level))},T.prototype._fromNode=function(w){var _,E,D,O;if(m.Guard.isElementNode(w)){var M=w.prefix?w.prefix+":"+w.localName:w.localName;w.namespaceURI!==null?this.ele(w.namespaceURI,M):this.ele(M);try{for(var N=s(w.attributes),R=N.next();!R.done;R=N.next()){var B=R.value,I=B.prefix?B.prefix+":"+B.localName:B.localName;B.namespaceURI!==null?this.att(B.namespaceURI,I,B.value):this.att(I,B.value)}}catch(A){_={error:A}}finally{try{R&&!R.done&&(E=N.return)&&E.call(N)}finally{if(_)throw _.error}}try{for(var P=s(w.childNodes),L=P.next();!L.done;L=P.next()){var k=L.value;this._fromNode(k)}}catch(A){D={error:A}}finally{try{L&&!L.done&&(O=P.return)&&O.call(P)}finally{if(D)throw D.error}}this.up()}else m.Guard.isExclusiveTextNode(w)&&w.data?this.txt(w.data):m.Guard.isCommentNode(w)?this.com(w.data):m.Guard.isCDATASectionNode(w)?this.dat(w.data):m.Guard.isProcessingInstructionNode(w)&&this.ins(w.target,w.data)},T.prototype._serializeAttributes=function(w,_,E,D,O,M){var N,R,B=M?new v.LocalNameSet:void 0;try{for(var I=s(w.attributes),P=I.next();!P.done;P=I.next()){var L=P.value;if(M||O||L.namespaceURI!==null){if(M&&B&&B.has(L.namespaceURI,L.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));M&&B&&B.set(L.namespaceURI,L.localName);var k=L.namespaceURI,A=null;if(k!==null)if(A=_.get(L.prefix,k),k===h.namespace.XMLNS){if(L.value===h.namespace.XML||L.prefix===null&&O||L.prefix!==null&&(!(L.localName in D)||D[L.localName]!==L.value)&&_.has(L.localName,L.value))continue;if(M&&L.value===h.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(M&&L.value==="")return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));L.prefix==="xmlns"&&(A="xmlns")}else A===null&&(A=L.prefix===null||_.hasPrefix(L.prefix)&&!_.has(L.prefix,k)?this._generatePrefix(k,_,E):L.prefix,this._push(this._writer.attribute("xmlns:"+A,this._serializeAttributeValue(k,this._options.wellFormed))));if(M&&(L.localName.indexOf(":")!==-1||!f.xml_isName(L.localName)||L.localName==="xmlns"&&k===null))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((A!==null?A+":":"")+L.localName,this._serializeAttributeValue(L.value,this._options.wellFormed)))}else this._push(this._writer.attribute(L.localName,this._serializeAttributeValue(L.value,this._options.wellFormed)))}}catch(j){N={error:j}}finally{try{P&&!P.done&&(R=I.return)&&R.call(I)}finally{if(N)throw N.error}}},T.prototype._serializeAttributeValue=function(w,_){return _&&w!==null&&!f.xml_isLegalChar(w)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):w===null?"":w.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&").replace(//g,">").replace(/"/g,""")},T.prototype._recordNamespaceInformation=function(w,_,E){var D,O,M=null;try{for(var N=s(w.attributes),R=N.next();!R.done;R=N.next()){var B=R.value,I=B.namespaceURI,P=B.prefix;if(I===h.namespace.XMLNS){if(P===null){M=B.value;continue}var L=B.localName,k=B.value;if(k===h.namespace.XML||(k===""&&(k=null),_.has(L,k)))continue;_.set(L,k),E[L]=k||""}}}catch(A){D={error:A}}finally{try{R&&!R.done&&(O=N.return)&&O.call(N)}finally{if(D)throw D.error}}return M},T.prototype._generatePrefix=function(w,_,E){var D="ns"+E.value;return E.value++,_.set(D,w),D},T.prototype._isPrefixMapModified=function(w,_){var E=w._items,D=_._items,O=w._nullItems,M=_._nullItems;for(var N in D){var R=E[N];if(R===void 0)return!0;var B=D[N];if(R.length!==B.length)return!0;for(var I=0;I':u?"':f?"':""},l.prototype.comment=function(p){return this._beginLine()+""},l.prototype.text=function(p){return this._beginLine()+p},l.prototype.instruction=function(p,u){return u?this._beginLine()+"":this._beginLine()+""},l.prototype.cdata=function(p){return this._beginLine()+""},l.prototype.openTagBegin=function(p){return this._lineLength+=1+p.length,this._beginLine()+"<"+p},l.prototype.openTagEnd=function(p,u,f){return f?" />":u?this._writerOptions.allowEmptyTags?">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},l.prototype.closeTag=function(p){return this._beginLine()+""},l.prototype.attribute=function(p,u){var f=p+'="'+u+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+f.length>this._writerOptions.width?(f=this._beginLine()+this._indent(1)+f,this._lineLength=f.length,f):(this._lineLength+=1+f.length," "+f)},l.prototype.beginElement=function(p){},l.prototype.endElement=function(p){},l.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var p=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=p.length,p}return""},l.prototype._indent=function(p){return p<=0?"":this._writerOptions.indent.repeat(p)},l}(r(114).BaseCBWriter);n.XMLCBWriter=s},function(a,n,r){r(74);var i,o=this&&this.__extends||(i=function(c,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,u){p.__proto__=u}||function(p,u){for(var f in u)u.hasOwnProperty(f)&&(p[f]=u[f])})(c,l)},function(c,l){function p(){this.constructor=c}i(c,l),c.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(c){function l(p){var u=c.call(this,p)||this;return u._hasChildren=[],u._additionalLevel=0,u}return o(l,c),l.prototype.frontMatter=function(){return""},l.prototype.declaration=function(p,u,f){return""},l.prototype.docType=function(p,u,f){return""},l.prototype.comment=function(p){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(p)+this._sep()+"}"},l.prototype.text=function(p){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(p)+this._sep()+"}"},l.prototype.instruction=function(p,u){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(u?p+" "+u:p)+this._sep()+"}"},l.prototype.cdata=function(p){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(p)+this._sep()+"}"},l.prototype.attribute=function(p,u){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+p)+this._sep()+this._val(u)+this._sep()+"}"},l.prototype.openTagBegin=function(p){var u=this._comma()+this._beginLine()+"{"+this._sep()+this._key(p)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,u+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),u},l.prototype.openTagEnd=function(p,u,f){if(u){var h=this._sep()+"]";return this._additionalLevel--,h+=this._beginLine()+"}"+this._sep()+"}"}return""},l.prototype.closeTag=function(p){var u=this._beginLine()+"]";return this._additionalLevel--,u+=this._beginLine()+"}"+this._sep()+"}"},l.prototype.beginElement=function(p){},l.prototype.endElement=function(p){this._hasChildren.pop()},l.prototype._beginLine=function(p){return p===void 0&&(p=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+p):""},l.prototype._indent=function(p){return p+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(p+this._additionalLevel)},l.prototype._comma=function(){var p=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),p},l.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},l.prototype._key=function(p){return'"'+p+'":'},l.prototype._val=function(p){return JSON.stringify(p)},l}(r(114).BaseCBWriter);n.JSONCBWriter=s},function(a,n,r){r(74);var i,o=this&&this.__extends||(i=function(c,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,u){p.__proto__=u}||function(p,u){for(var f in u)u.hasOwnProperty(f)&&(p[f]=u[f])})(c,l)},function(c,l){function p(){this.constructor=c}i(c,l),c.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(c){function l(p){var u=c.call(this,p)||this;if(u._rootWritten=!1,u._additionalLevel=0,p.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(p.offset<0)throw new Error("YAML offset should be zero or a positive number.");return u}return o(l,c),l.prototype.frontMatter=function(){return this._beginLine()+"---"},l.prototype.declaration=function(p,u,f){return""},l.prototype.docType=function(p,u,f){return""},l.prototype.comment=function(p){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(p)},l.prototype.text=function(p){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(p)},l.prototype.instruction=function(p,u){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(u?p+" "+u:p)},l.prototype.cdata=function(p){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(p)},l.prototype.attribute=function(p,u){this._additionalLevel++;var f=this._beginLine()+this._key(this._builderOptions.convert.att+p)+" "+this._val(u);return this._additionalLevel--,f},l.prototype.openTagBegin=function(p){var u=this._beginLine()+this._key(p);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,u+=this._beginLine(!0)+this._key(this._builderOptions.convert.text)},l.prototype.openTagEnd=function(p,u,f){return u?" "+this._val(""):""},l.prototype.closeTag=function(p){return this._additionalLevel--,""},l.prototype.beginElement=function(p){},l.prototype.endElement=function(p){},l.prototype._beginLine=function(p){return p===void 0&&(p=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,p)},l.prototype._indent=function(p,u){if(p+this._additionalLevel<=0)return"";var f=this._writerOptions.indent.repeat(p+this._additionalLevel);return!u&&this._rootWritten?f.substr(0,f.length-2)+"-"+f.substr(-1,1):f},l.prototype._key=function(p){return'"'+p+'":'},l.prototype._val=function(p){return JSON.stringify(p)},l}(r(114).BaseCBWriter);n.YAMLCBWriter=s},function(a,n,r){var i,o=typeof Reflect=="object"?Reflect:null,s=o&&typeof o.apply=="function"?o.apply:function(g,C,S){return Function.prototype.apply.call(g,C,S)};i=o&&typeof o.ownKeys=="function"?o.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var c=Number.isNaN||function(g){return g!=g};function l(){l.init.call(this)}a.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var p=10;function u(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function f(g){return g._maxListeners===void 0?l.defaultMaxListeners:g._maxListeners}function h(g,C,S,T){var w,_,E,D;if(u(S),(_=g._events)===void 0?(_=g._events=Object.create(null),g._eventsCount=0):(_.newListener!==void 0&&(g.emit("newListener",C,S.listener?S.listener:S),_=g._events),E=_[C]),E===void 0)E=_[C]=S,++g._eventsCount;else if(typeof E=="function"?E=_[C]=T?[S,E]:[E,S]:T?E.unshift(S):E.push(S),(w=f(g))>0&&E.length>w&&!E.warned){E.warned=!0;var O=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");O.name="MaxListenersExceededWarning",O.emitter=g,O.type=C,O.count=E.length,D=O,console&&console.warn&&console.warn(D)}return g}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(g,C,S){var T={fired:!1,wrapFn:void 0,target:g,type:C,listener:S},w=d.bind(T);return w.listener=S,T.wrapFn=w,w}function m(g,C,S){var T=g._events;if(T===void 0)return[];var w=T[C];return w===void 0?[]:typeof w=="function"?S?[w.listener||w]:[w]:S?function(_){for(var E=new Array(_.length),D=0;D0&&(_=C[0]),_ instanceof Error)throw _;var E=new Error("Unhandled error."+(_?" ("+_.message+")":""));throw E.context=_,E}var D=w[g];if(D===void 0)return!1;if(typeof D=="function")s(D,this,C);else{var O=D.length,M=y(D,O);for(S=0;S=0;_--)if(S[_]===C||S[_].listener===C){E=S[_].listener,w=_;break}if(w<0)return this;w===0?S.shift():function(D,O){for(;O+1=0;T--)this.removeListener(g,C[T]);return this},l.prototype.listeners=function(g){return m(this,g,!0)},l.prototype.rawListeners=function(g){return m(this,g,!1)},l.listenerCount=function(g,C){return typeof g.listenerCount=="function"?g.listenerCount(C):x.call(g,C)},l.prototype.listenerCount=x,l.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(77);n.createCB=function(o){return new i.XMLBuilderCBImpl(o)},n.fragmentCB=function(o){return new i.XMLBuilderCBImpl(o,!0)}}])})})(YT);function JT(t,e){e.classHierarchy.push("vtkStringArray"),t.getComponent=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.values[a*e.numberOfComponents+n]},t.setComponent=(a,n,r)=>{r!==e.values[a*e.numberOfComponents+n]&&(e.values[a*e.numberOfComponents+n]=r,t.modified())},t.getData=()=>e.values,t.getTuple=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=e.numberOfComponents||1;n.length&&(n.length=r);const i=a*r;for(let o=0;o0&&arguments[0]!==void 0?arguments[0]:1)*e.numberOfComponents},t.getNumberOfComponents=()=>e.numberOfComponents,t.getNumberOfValues=()=>e.values.length,t.getNumberOfTuples=()=>e.values.length/e.numberOfComponents,t.getDataType=()=>e.dataType,t.newClone=()=>x1({name:e.name,numberOfComponents:e.numberOfComponents,empty:!0}),t.getName=()=>(e.name||t.setName(`vtkStringArray${t.getMTime()}`),e.name),t.setData=(a,n)=>{e.values=a,e.size=a.length,n&&(e.numberOfComponents=n),e.size%e.numberOfComponents!==0&&(e.numberOfComponents=1),t.modified()}}const ZT={name:"",numberOfComponents:1,size:0,dataType:"string"};function m1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(Object.assign(e,ZT,a),!e.empty&&!e.values&&!e.size)throw new TypeError("Cannot create vtkStringArray object without: size > 0, values");e.values?Array.isArray(e.values)&&(e.values=[...e.values]):e.values=[],e.values&&(e.size=e.values.length),V.obj(t,e),V.set(t,e,["name"]),JT(t,e)}const x1=V.newInstance(m1,"vtkStringArray");var QT={newInstance:x1,extend:m1};function ew(t,e){return[...t.getElementsByTagName(e)]}function C1(t,e){return ew(t,e)[0]}function tw(t){return fc.create(t)}function nw(t){const e=/^\s*\s*_/m,a=/\n\s*<\/AppendedData>/m;return ni.extractBinary(t,e,a)}const Kn={Int8:Int8Array,UInt8:Uint8Array,Int16:Int16Array,UInt16:Uint16Array,Int32:Int32Array,UInt32:Uint32Array,Int64:Int32Array,UInt64:Uint32Array,Float32:Float32Array,Float64:Float64Array},ri={Int8:1,UInt8:1,Int16:2,UInt16:2,Int32:4,UInt32:4,Int64:8,UInt64:8,Float32:4,Float64:8};function pc(t){const e=t.length-1;return t.filter((a,n)=>n0&&(i===0?o=n*r:o=(n-1)*r+i);const s=new ArrayBuffer(o),c={offset:0,uint8:new Uint8Array(s)};let l=aw(a);for(;l{f.trim().length&&(p[u++]=Number(f))})}else if(c==="binary"){const u=new Uint8Array(Rr.toArrayBuffer(e.firstChild.nodeValue.trim()));if(a==="vtkZLibDataCompressor"){const f=gc(u,r);p=new Kn[o](f.buffer),/^U?Int64$/.test(o)&&(p=pc(p))}else p=new Kn[o](u.buffer,ri[r]),o.indexOf("Int64")!==-1&&(p=pc(p))}else if(c==="appended"){const u=Number(e.getAttribute("offset"));p=hc(new Uint8Array(i,u),o,r)}else console.error("Format not supported",c);return{name:s,values:p,numberOfComponents:l}}function dc(t){return new TextDecoder().decode(t).split("\0").slice(0,-1)}function ow(t,e,a,n,r){const i=t.getAttribute("Name"),o=t.getAttribute("format"),s=Number(t.getAttribute("NumberOfComponents")||"1"),l=Number(t.getAttribute("NumberOfTuples")||"1")*s,p=[];if(o==="ascii"){const u=t.firstChild.nodeValue.trim().split(/\s+/);let f=0;const h=[];for(;p.length{const v=d-h;u[f++]=v;for(let m=0;m{const f=e.getAttribute(u);f&&(c[f]=a[`set${u}`])});const l=e.getElementsByTagName("DataArray"),p=l.length;for(let u=0;upe.newInstance(ai(Number(s.getAttribute("NumberOfTuples")),s,e,a,n,r))),o=[...t.getElementsByTagName("Array")].filter(s=>s.getAttribute("type")==="String").map(s=>QT.newInstance(ow(s,e,a,n,r)));return[...i,...o]}function lw(t,e){e.classHierarchy.push("vtkXMLReader"),e.dataAccessHelper||(e.dataAccessHelper=aa.get("http"));function a(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.dataAccessHelper.fetchBinary(n,r)}t.setUrl=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.url=n;const i=n.split("/");return i.pop(),e.baseURL=i.join("/"),t.loadData(r)},t.loadData=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return a(e.url,n).then(t.parseAsArrayBuffer)},t.parseAsArrayBuffer=n=>{if(!n)return!1;if(n!==e.rawDataBuffer)t.modified();else return!0;const{text:r,binaryBuffer:i}=nw(n);e.rawDataBuffer=n,e.binaryBuffer=i;const s=tw(r).root(),c=s.node,l=c.getAttribute("type"),p=c.getAttribute("compressor"),u=c.getAttribute("byte_order"),f=c.getAttribute("header_type")||"UInt32";if(p&&p!=="vtkZLibDataCompressor")return console.error("Invalid compressor",p),!1;if(u&&u!=="LittleEndian")return console.error("Only LittleEndian encoding is supported"),!1;if(l!==e.dataType)return console.error("Invalid data type",l,"expecting",e.dataType),!1;if(C1(c,"AppendedData")){const v=C1(c,"AppendedData"),m=v.getAttribute("encoding"),x=s.filter(w=>{const{node:_}=w;return _.nodeType===Node.ELEMENT_NODE&&_.getAttribute("format")==="appended"&&_.hasAttribute("offset")},!1,!0).map(w=>({node:w.node,offset:Number(w.node.getAttribute("offset"))}));x.sort((w,_)=>w.offset-_.offset);let y=e.binaryBuffer;m==="base64"&&(y=v.textContent.trim().substr(1));const g=[];for(let w=0;ww+_.length,0),S=new ArrayBuffer(C),T=new Uint8Array(S);for(let w=0,_=0;w{t.parseAsArrayBuffer(e.rawDataBuffer)}}const fw={};function pw(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,fw,a),V.obj(t,e),V.get(t,e,["url","baseURL"]),V.setGet(t,e,["dataAccessHelper"]),V.algo(t,e,0,1),lw(t,e)}var Xn={extend:pw,processDataArray:ai,processFieldData:cw,processCells:sw};function hw(t,e){e.classHierarchy.push("vtkXMLImageDataReader"),t.parseXML=(a,n,r,i,o)=>{var h;const s=a.getElementsByTagName(e.dataType)[0],c=s.getAttribute("Origin").split(" ").map(d=>Number(d)),l=s.getAttribute("Spacing").split(" ").map(d=>Number(d)),p=(h=s.getAttribute("Direction"))==null?void 0:h.split(" ").map(d=>Number(d)),u=s.getElementsByTagName("Piece"),f=u.length;for(let d=0;dNumber(y)),x=_0.newInstance({origin:c,spacing:l,direction:p,extent:m});Xn.processFieldData(x.getNumberOfPoints(),v.getElementsByTagName("PointData")[0],x.getPointData(),r,i,o,e.binaryBuffer),Xn.processFieldData(x.getNumberOfCells(),v.getElementsByTagName("CellData")[0],x.getCellData(),r,i,o,e.binaryBuffer),e.output[d]=x}}}const gw={dataType:"ImageData"};function dw(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,gw,a),Xn.extend(t,e,a),hw(t,e)}V.newInstance(dw,"vtkXMLImageDataReader");function vw(t,e,a,n,r,i,o){const s=Number(a.getAttribute(`NumberOf${e}`));if(s>0){const c=a.getElementsByTagName(e)[0].getElementsByTagName("DataArray")[0],{values:l,numberOfComponents:p}=Xn.processDataArray(s,c,n,r,i,o);t[`get${e}`]().setData(l,p)}return s}function yw(t,e,a,n,r,i,o){const s=Number(a.getAttribute(`NumberOf${e}`));if(s>0){const c=Xn.processCells(s,a.getElementsByTagName(e)[0],n,r,i,o);t[`get${e}`]().setData(c)}return s}function mw(t,e){e.classHierarchy.push("vtkXMLPolyDataReader"),t.parseXML=(a,n,r,i,o)=>{const c=a.getElementsByTagName(e.dataType)[0].getElementsByTagName("Piece"),l=c.length;for(let p=0;p{d+=yw(u,v,f,r,i,o,e.binaryBuffer)}),Xn.processFieldData(h,f.getElementsByTagName("PointData")[0],u.getPointData(),r,i,o,e.binaryBuffer),Xn.processFieldData(d,f.getElementsByTagName("CellData")[0],u.getCellData(),r,i,o,e.binaryBuffer),e.output[p]=u}}}const xw={dataType:"PolyData"};function Cw(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,xw,a),Xn.extend(t,e,a),mw(t,e)}V.newInstance(Cw,"vtkXMLPolyDataReader");const Sw={props:{port:{type:Number,default:0},vtkClass:{type:String,default:"vtkConeSource"},state:{type:Object,default:()=>({})}},setup(t){const e=se.ref(null),a=se.inject("downstream"),n=se.inject("representation");se.provide("downstream",e),se.onMounted(()=>{e.value=wt({vtkClass:t.vtkClass,...t.state}),a.value.setInputConnection(e.value.getOutputPort(),t.port)}),se.onBeforeUnmount(()=>{e.value&&(e.value.delete(),e.value=null)}),se.watch(()=>t.vtkClass,r=>{e.value=wt({vtkClass:r,...t.state}),a.setInputConnection(e.value.getOutputPort(),t.port)}),se.watch(()=>t.state,r=>{e.value.set(r),n&&n.dataChanged()})},template:'
'},{vtkWarningMacro:Io}=V;function Tw(t,e){e.classHierarchy.push("vtkCalculator"),t.setFormula=a=>a===e.formula?!1:(e.formula=a,t.modified(),!0),t.getFormula=()=>e.formula,t.augmentInputArrays=(a,n)=>{const r=n.slice(0);return(a===lt.POINT||a===lt.VERTEX)&&r.push({location:lt.COORDINATE}),r},t.createSimpleFormulaObject=function(a,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};return{getArrays:s=>{var c;return{input:(c=s[0])!=null&&c.isA("vtkImageData")?n.map(l=>({location:a,name:l})):t.augmentInputArrays(a,n.map(l=>({location:a,name:l}))),output:[{location:a,name:r,attribute:"outputAttributeType"in o?o.outputAttributeType:jf.SCALARS,numberOfComponents:"numberOfOutputComponents"in o?o.numberOfOutputComponents:1}]}},evaluate:(s,c)=>{const l=new Array(s.length),p=s.map((v,m)=>{const x=v.getNumberOfComponents(),y=v.getData();return x===1?g=>y[g]:g=>v.getTuple(g,l[m])}),u=c[0],f=u.getData(),h=u.getNumberOfComponents();let d=new Array(h);if(h===1)f.forEach((v,m)=>{f[m]=i(...p.map(x=>x(m)),m,d)});else{const v=u.getNumberOfTuples();for(let m=0;mx(m)),m,d),u.setTuple(m,d)}}}},t.setFormulaSimple=function(a,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};return t.setFormula(t.createSimpleFormulaObject(a,n,r,i,o))},t.prepareArrays=(a,n,r)=>{const i=[],o=[];return a.input.forEach(s=>{if(s.location===lt.COORDINATE)i.push(n.getPoints());else{const c=[[lt.UNIFORM,p=>p.getFieldData()],[lt.POINT,p=>p.getPointData()],[lt.CELL,p=>p.getCellData()],[lt.VERTEX,p=>p.getVertexData()],[lt.EDGE,p=>p.getEdgeData()],[lt.ROW,p=>p.getRowData()]].reduce((p,u)=>(p[u[0]]=u[1],p),{}),l="location"in s&&s.location in c?c[s.location](n):null;l?s.name?i.push(l.getArrayByName(s.name)):"index"in s?i.push(l.getArrayByIndex(s.index)):"attribute"in s&&s.location!==lt.UNIFORM?i.push(l.getActiveAttribute(s.attribute)):(Io(`No matching array for specifier "${JSON.stringify(s)}".`),i.push(null)):(Io(`Specifier "${JSON.stringify(s)}" did not provide a usable location.`),i.push(null))}}),a.output.forEach(s=>{const c={...s},l="numberOfComponents"in c?c.numberOfComponents:1;if(s.location===lt.UNIFORM&&"tuples"in c&&(c.size=l*c.tuples),s.location===lt.COORDINATE){const p=n.getPoints(),u=dn.newInstance({dataType:p.getDataType()});u.setNumberOfPoints(p.getNumberOfPoints(),p.getNumberOfComponents()),r.setPoints(u),o.push(u)}else{const p=[[lt.UNIFORM,h=>h.getFieldData(),(h,d)=>"tuples"in d?d.tuples:0],[lt.POINT,h=>h.getPointData(),h=>h.getNumberOfPoints()],[lt.CELL,h=>h.getCellData(),h=>h.getNumberOfCells()],[lt.VERTEX,h=>h.getVertexData(),h=>h.getNumberOfVertices()],[lt.EDGE,h=>h.getEdgeData(),h=>h.getNumberOfEdges()],[lt.ROW,h=>h.getRowData(),h=>h.getNumberOfRows()]].reduce((h,d)=>(h[d[0]]={getData:d[1],getSize:d[2]},h),{});let u=null,f=0;if("location"in s&&s.location in p&&(u=p[s.location].getData(r),f=p[s.location].getSize(n,c)),f<=0)Io(`Output array size could not be determined for ${JSON.stringify(s)}.`),o.push(null);else if(u){c.size=l*f;const h=pe.newInstance(c),d=u.addArray(h);"attribute"in c&&s.location!==lt.UNIFORM&&u.setActiveAttributeByIndex(d,c.attribute),o.push(h)}else Io(`Specifier "${JSON.stringify(s)}" did not provide a usable location.`),o.push(null)}}),{arraysIn:i,arraysOut:o}},t.requestData=(a,n)=>{var s;if(!e.formula)return 0;const r=e.formula.getArrays(a),i=((s=n[0])==null?void 0:s.initialize())||wt({vtkClass:a[0].getClassName()});i.shallowCopy(a[0]),n[0]=i;const o=t.prepareArrays(r,a[0],n[0]);return e.formula.evaluate(o.arraysIn,o.arraysOut),1}}const ww={formula:{getArrays:()=>({input:[],output:[]}),evaluate:()=>null}};function S1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,ww,a),V.obj(t,e),V.algo(t,e,1,1),Tw(t,e)}var _w={newInstance:V.newInstance(S1,"vtkCalculator"),extend:S1};const{FieldDataTypes:T1}=dr,Ew={props:{port:{type:Number,default:0},name:{type:String,default:"scalars"},location:{type:String,default:"POINT"},arrays:{type:Array,default:()=>[]},formula:{type:Function,default:t=>t[0]}},setup(t){const e=se.ref(_w.newInstance()),a=se.inject("downstream");se.provide("downstream",e),se.onMounted(()=>{e.value.setFormulaSimple(T1[t.location],t.arrays,t.name,t.formula),a.value.setInputConnection(e.value.getOutputPort(),t.port)}),se.onBeforeUnmount(()=>{e.value&&(e.value.delete(),e.value=null)}),se.onUpdated(()=>{e.value.setFormulaSimple(T1[t.location],t.arrays,t.name,t.formula)})},template:'
'},w1={setup(){const t=se.inject("dataset");se.provide("fields",t==null?void 0:t.getCellData())},template:'
'},Dw={int32:Int32Array,int16:Int16Array,int8:Int8Array,uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array,float32:Float32Array,float64:Float64Array};function _1(t,e){if(!t)return null;if(Array.isArray(t))return e.from(t);if(t.dtype){const{bvals:a,dtype:n}=t,r=Rr.toArrayBuffer(a);return new Dw[n](r)}return t}const E1={props:{name:{type:String,default:"scalars"},registration:{type:String,default:"addArray"},type:{type:String,default:"Float32Array"},values:{type:[Array,Object,Uint8Array,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]},numberOfComponents:{type:Number,default:1}},setup(t){const e=se.inject("dataset"),a=se.inject("fields"),n=se.inject("representation"),r=pe.newInstance({empty:!0}),i=wn(()=>{const p=xt[t.type];r.setData(_1(t.values,p),t.numberOfComponents),e&&e.modified(),n&&n.dataChanged()},1),{name:o,type:s,values:c,numberOfComponents:l}=se.toRefs(t);se.watch(o,r.setName),se.watch(s,i),se.watch(c,i),se.watch(l,i),se.onMounted(()=>{a&&a[t.registration](r),t.name&&r.setName(t.name),t.values&&(t.values.bvals||t.values.length)&&i()}),se.onBeforeUnmount(()=>{a&&a.removeArray(r),r.delete()}),se.provide("array",r)},template:'
'},Ow={setup(){const t=se.inject("dataset");se.provide("fields",t==null?void 0:t.getFieldData())},template:'
'};var bw=[{Name:"KAAMS",IndexedColors:[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,.63,.63,1,.67,.5,.33,1,.5,.75,.53,.35,.7,1,.75,.5],Annotations:[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{ColorSpace:"Diverging",Name:"Cool to Warm",NanColor:[1,1,0],RGBPoints:[0,.23137254902,.298039215686,.752941176471,.5,.865,.865,.865,1,.705882352941,.0156862745098,.149019607843]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Cool to Warm (Extended)",NanColor:[.25,0,0],RGBPoints:[0,0,0,.34902,.03125,.039216,.062745,.380392,.0625,.062745,.117647,.411765,.09375,.090196,.184314,.45098,.125,.12549,.262745,.501961,.15625,.160784,.337255,.541176,.1875,.2,.396078,.568627,.21875,.239216,.454902,.6,.25,.286275,.521569,.65098,.28125,.337255,.592157,.701961,.3125,.388235,.654902,.74902,.34375,.466667,.737255,.819608,.375,.572549,.819608,.878431,.40625,.654902,.866667,.909804,.4375,.752941,.917647,.941176,.46875,.823529,.956863,.968627,.5,.988235,.960784,.901961,.5,.941176,.984314,.988235,.52,.988235,.945098,.85098,.54,.980392,.898039,.784314,.5625,.968627,.835294,.698039,.59375,.94902,.733333,.588235,.625,.929412,.65098,.509804,.65625,.909804,.564706,.435294,.6875,.878431,.458824,.352941,.71875,.839216,.388235,.286275,.75,.760784,.294118,.211765,.78125,.701961,.211765,.168627,.8125,.65098,.156863,.129412,.84375,.6,.094118,.094118,.875,.54902,.066667,.098039,.90625,.501961,.05098,.12549,.9375,.45098,.054902,.172549,.96875,.4,.054902,.192157,1,.34902,.070588,.211765]},{ColorSpace:"Diverging",Name:"Warm to Cool",NanColor:[1,1,0],RGBPoints:[0,.705882352941,.0156862745098,.149019607843,.5,.865,.865,.865,1,.23137254902,.298039215686,.752941176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Warm to Cool (Extended)",NanColor:[.250004,0,0],RGBPoints:[0,.34902,0,.129412,.025,.4,.00392157,.101961,.05,.470588,.0156863,.0901961,.075,.54902,.027451,.0705882,.1,.619608,.0627451,.0431373,.125,.690196,.12549,.0627451,.15,.741176,.184314,.0745098,.175,.788235,.266667,.0941176,.2,.811765,.345098,.113725,.225,.831373,.411765,.133333,.25,.85098,.47451,.145098,.275,.870588,.54902,.156863,.3,.878431,.619608,.168627,.325,.890196,.658824,.196078,.35,.909804,.717647,.235294,.375,.929412,.776471,.278431,.395522,.94902,.823529,.321569,.418905,.968627,.87451,.407843,.444278,.980392,.917647,.509804,.470149,.988235,.956863,.643137,.483582,.992157,.964706,.713725,.499,.988235,.980392,.870588,.5,1,1,1,.501,.913725,.988235,.937255,.516418,.827451,.980392,.886275,.531343,.764706,.980392,.866667,.546766,.658824,.980392,.843137,.564179,.572549,.964706,.835294,.587562,.423529,.941176,.87451,.60597,.262745,.901961,.862745,.629851,.0705882,.854902,.870588,.651741,.0509804,.8,.85098,.681592,.0235294,.709804,.831373,.712935,.0313725,.615686,.811765,.75,.0313725,.537255,.788235,.775,.0392157,.466667,.768627,.8,.0509804,.396078,.741176,.825,.054902,.317647,.709804,.85,.054902,.243137,.678431,.875,.0431373,.164706,.639216,.9,.0313725,.0980392,.6,.925,.0392157,.0392157,.560784,.95,.105882,.0509804,.509804,.975,.113725,.0235294,.45098,1,.12549,0,.380392]},{ColorSpace:"RGB",Name:"Rainbow Desaturated",NanColor:[1,1,0],RGBPoints:[0,.278431372549,.278431372549,.858823529412,.143,0,0,.360784313725,.285,0,1,1,.429,0,.501960784314,0,.571,1,1,0,.714,1,.380392156863,0,.857,.419607843137,0,0,1,.878431372549,.301960784314,.301960784314]},{ColorSpace:"RGB",Name:"Cold and Hot",NanColor:[1,1,0],RGBPoints:[0,0,1,1,.45,0,0,1,.5,0,0,.501960784314,.55,1,0,0,1,1,1,0]},{ColorSpace:"RGB",Name:"Black-Body Radiation",NanColor:[0,.498039215686,1],RGBPoints:[0,0,0,0,.4,.901960784314,0,0,.8,.901960784314,.901960784314,0,1,1,1,1]},{ColorSpace:"RGB",Name:"X Ray",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Grayscale",NanColor:[1,0,0],RGBPoints:[0,0,0,0,1,1,1,1]},{ColorSpace:"RGB",Name:"Grayscale-DICOM-sigmoid",Notes:"This is a 16 point sample of a sigmoid grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2",NanColor:[1,0,0],BelowRangeColor:[0,0,0],AboveRangeColor:[1,1,1],RGBPoints:[-1,.01798620996209156,.01798620996209156,.01798620996209156,-.8666666666666667,.030275691986950463,.030275691986950463,.030275691986950463,-.7333333333333334,.05053016223541345,.05053016223541345,.05053016223541345,-.6,.08317269649392238,.08317269649392238,.08317269649392238,-.4666666666666667,.13392788832407365,.13392788832407365,.13392788832407365,-.33333333333333337,.2086085273260449,.2086085273260449,.2086085273260449,-.19999999999999996,.31002551887238755,.31002551887238755,.31002551887238755,-.06666666666666665,.4337256058045608,.4337256058045608,.4337256058045608,.06666666666666665,.5662743941954392,.5662743941954392,.5662743941954392,.19999999999999996,.6899744811276125,.6899744811276125,.6899744811276125,.33333333333333326,.791391472673955,.791391472673955,.791391472673955,.46666666666666656,.8660721116759263,.8660721116759263,.8660721116759263,.6000000000000001,.9168273035060777,.9168273035060777,.9168273035060777,.7333333333333334,.9494698377645865,.9494698377645865,.9494698377645865,.8666666666666667,.9697243080130495,.9697243080130495,.9697243080130495,1,.9820137900379085,.9820137900379085,.9820137900379085]},{ColorSpace:"RGB",Name:"Inverted-Grayscale",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Inverted-Grayscale-DICOM-sigmoid",Notes:"This is a 16 point sample of a sigmoid inverted-grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2",BelowRangeColor:[1,1,1],AboveRangeColor:[0,0,0],NanColor:[1,0,0],RGBPoints:[-1,.9820137900379085,.9820137900379085,.9820137900379085,-.8666666666666667,.9697243080130495,.9697243080130495,.9697243080130495,-.7333333333333334,.9494698377645866,.9494698377645866,.9494698377645866,-.6,.9168273035060777,.9168273035060777,.9168273035060777,-.4666666666666667,.8660721116759263,.8660721116759263,.8660721116759263,-.33333333333333337,.791391472673955,.791391472673955,.791391472673955,-.19999999999999996,.6899744811276125,.6899744811276125,.6899744811276125,-.06666666666666665,.5662743941954391,.5662743941954391,.5662743941954391,.06666666666666665,.43372560580456077,.43372560580456077,.43372560580456077,.19999999999999996,.3100255188723875,.3100255188723875,.3100255188723875,.33333333333333326,.20860852732604496,.20860852732604496,.20860852732604496,.46666666666666656,.13392788832407365,.13392788832407365,.13392788832407365,.6000000000000001,.08317269649392234,.08317269649392234,.08317269649392234,.7333333333333334,.05053016223541351,.05053016223541351,.05053016223541351,.8666666666666667,.03027569198695046,.03027569198695046,.03027569198695046,1,.01798620996209155,.01798620996209155,.01798620996209155]},{ColorSpace:"RGB",Name:"BkRd",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,1,0,0]},{ColorSpace:"RGB",Name:"BkGn",NanColor:[1,0,1],RGBPoints:[0,0,0,0,1,0,1,0]},{ColorSpace:"RGB",Name:"BkBu",NanColor:[1,1,0],RGBPoints:[0,0,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"BkMa",NanColor:[0,1,0],RGBPoints:[0,0,0,0,1,1,0,1]},{ColorSpace:"RGB",Name:"BkCy",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,0,1,1]},{ColorSpace:"RGB",Name:"Black, Blue and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,0,0,.501960784314,.666,0,.501960784314,1,1,1,1,1]},{ColorSpace:"RGB",Name:"Black, Orange and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,.501960784314,0,0,.666,1,.501960784314,0,1,1,1,1]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear YGB 1211g",NanColor:[.25,0,0],RGBPoints:[0,1,.988235,.968627,.02,1,.952941,.878431,.05,.968627,.905882,.776471,.1,.94902,.898039,.647059,.15,.901961,.878431,.556863,.2,.847059,.858824,.482353,.25,.690196,.819608,.435294,.3,.513725,.768627,.384314,.35,.337255,.721569,.337255,.4,.278431,.658824,.392157,.45,.231373,.639216,.435294,.5,.203922,.6,.486275,.55,.172549,.568627,.537255,.6,.141176,.517647,.54902,.65,.133333,.458824,.541176,.7,.12549,.396078,.529412,.75,.117647,.321569,.521569,.8,.121569,.258824,.509804,.85,.133333,.227451,.501961,.9,.145098,.192157,.490196,.95,.188235,.164706,.470588,1,.258824,.196078,.439216]},{ColorSpace:"CIELAB",Creator:"Francesca Samsel",Name:"Linear Green (Gr4L)",NanColor:[.25,0,0],RGBPoints:[0,.054902,.109804,.121569,.05,.07451,.172549,.180392,.1,.086275,.231373,.219608,.15,.094118,.278431,.25098,.2,.109804,.34902,.278431,.25,.113725,.4,.278431,.3,.117647,.45098,.270588,.35,.117647,.490196,.243137,.4,.113725,.521569,.203922,.45,.109804,.54902,.152941,.5,.082353,.588235,.082353,.55,.109804,.631373,.05098,.6,.211765,.678431,.082353,.65,.317647,.721569,.113725,.7,.431373,.760784,.160784,.75,.556863,.8,.239216,.8,.666667,.839216,.294118,.85,.784314,.878431,.396078,.9,.886275,.921569,.533333,.95,.960784,.94902,.670588,1,1,.984314,.901961]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear Blue (8_31f)",NanColor:[.25,0,0],RGBPoints:[0,.960784,1,.980392,.05,.815686,.960784,.913725,.1,.670588,.929412,.870588,.15,.556863,.901961,.843137,.2,.478431,.870588,.823529,.25,.439216,.831373,.803922,.3,.4,.8,.788235,.35,.376471,.768627,.768627,.4,.34902,.709804,.729412,.45,.32549,.654902,.690196,.5,.301961,.607843,.658824,.55,.247059,.545098,.619608,.6,.239216,.494118,.580392,.65,.227451,.439216,.541176,.7,.227451,.403922,.521569,.75,.231373,.368627,.501961,.8,.227451,.321569,.470588,.85,.219608,.282353,.439216,.9,.192157,.235294,.4,.95,.160784,.184314,.34902,1,.133333,.12549,.301961]},{ColorSpace:"HSV",Name:"Blue to Red Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,0,0,1,1,1,0,0]},{ColorSpace:"HSV",Name:"Red to Blue Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,1,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended White",NanColor:[1,1,0],RGBPoints:[0,1,1,1,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Grey",NanColor:[1,1,0],RGBPoints:[0,.317647058824,.341176470588,.43137254902,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Black",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Blue to Yellow",NanColor:[1,0,0],RGBPoints:[0,.0392156862745,.0392156862745,.949019607843,1,.949019607843,.949019607843,.0392156862745]},{ColorSpace:"HSV",Name:"blot",RGBPoints:[0,0,0,1,.166,0,0,1,.167,1,0,1,.332,1,0,1,.333,0,1,1,.5,0,1,1,.501,0,1,0,.666,0,1,0,.667,1,1,0,.832,1,1,0,.833,1,0,0,1,1,0,0]},{ColorSpace:"Lab",Name:"CIELab Blue to Red",NanColor:[1,1,0],RGBPoints:[0,0,.6,.749019607843,1,.76862745098,.466666666667,.341176470588]},{ColorSpace:"RGB",Name:"jet",RGBPoints:[-1,0,0,.5625,-.777778,0,0,1,-.269841,0,1,1,-.015873,.5,1,.5,.238095,1,1,0,.746032,1,0,0,1,.5,0,0]},{ColorSpace:"RGB",Name:"rainbow",RGBPoints:[-1,0,0,1,-.5,0,1,1,0,0,1,0,.5,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"erdc_rainbow_bright",RGBPoints:[-1,.32549,.14902,.960784,-.866221,.297047,.375586,.963836,-.732441,.180302,.536818,.964627,-.598662,.1302,.649207,.929647,-.464883,.0445143,.749654,.855998,-.331104,.0271325,.830713,.721527,-.197324,.259504,.866145,.543555,-.0635452,.428364,.890725,.329819,.0702341,.568503,.898508,.187623,.204013,.738259,.890317,.0825461,.337793,.84546,.86136,.0147555,.471572,.912191,.808018,0,.605351,.962848,.710445,0,.73913,.999469,.600258,.0176284,.87291,.994156,.445975,.193912,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"erdc_rainbow_dark",RGBPoints:[-1,0,0,.423499,-.866221,0,.119346,.529237,-.732441,0,.238691,.634976,-.598662,0,.346852,.68788,-.464883,0,.45022,.718141,-.331104,0,.553554,.664839,-.197324,0,.651082,.519303,-.0635452,.115841,.72479,.352857,.0702341,.326771,.781195,.140187,.204013,.522765,.798524,.0284624,.337793,.703162,.788685,.00885756,.471572,.845118,.751133,0,.605351,.955734,.690825,0,.73913,.995402,.567916,.0618524,.87291,.987712,.403398,.164851,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"nic_CubicL",RGBPoints:[-1,.479965,.0118108,.5307,-.87451,.522213,.0551282,.706919,-.74902,.50839,.237278,.867764,-.623529,.451617,.373834,.987255,-.498039,.39365,.497255,.97506,-.372549,.328631,.599639,.891843,-.247059,.250043,.690286,.778553,-.121569,.249656,.764905,.645857,.00392157,.297954,.821466,.50449,.129412,.337509,.872595,.358447,.254902,.430011,.913789,.297079,.380392,.587191,.931381,.333353,.505882,.727937,.93591,.353742,.631373,.826403,.921081,.365066,.756863,.893201,.846317,.372662,.882353,.965347,.73884,.378506,1,.983235,.597451,.366856]},{ColorSpace:"Lab",Name:"nic_CubicYF",RGBPoints:[-1,.5151,.0482,.6697,-.87451,.520711,.168955,.800574,-.74902,.493694,.278596,.911824,-.623529,.440026,.369475,.984978,-.498039,.398932,.457593,.987053,-.372549,.350651,.540644,.929608,-.247059,.298827,.615625,.857729,-.121569,.239928,.685061,.769531,.00392157,.228832,.739349,.673287,.129412,.263297,.78608,.569988,.254902,.298107,.828337,.460214,.380392,.33092,.864071,.352674,.505882,.38306,.898169,.287309,.631373,.49023,.917481,.307961,.756863,.62372,.926026,.332309,.882353,.717458,.92527,.342476,1,.8,.9255,.3529]},{ColorSpace:"Lab",Name:"gist_earth",RGBPoints:[-1,0,0,0,-.87451,.239216,.027451,.415686,-.74902,.0901961,.254902,.556863,-.623529,.0941176,.352941,.54902,-.498039,.105882,.435294,.533333,-.372549,.12549,.52549,.501961,-.247059,.156863,.596078,.443137,-.121569,.196078,.65098,.380392,.00392157,.282353,.717647,.301961,.129412,.466667,.772549,.27451,.254902,.678431,.784314,.309804,.380392,.901961,.756863,.376471,.505882,.992157,.705882,.521569,.631373,1,.721569,.701961,.756863,1,.784314,.784314,.882353,1,.866667,.866667,1,1,1,1]},{ColorSpace:"Lab",Name:"2hot",RGBPoints:[-1,.0416667,0,0,-.873016,.208333,0,0,-.746032,.375,0,0,-.619048,.541667,0,0,-.492063,.708333,0,0,-.365079,.854137,0,0,-.238095,.937488,.039062,0,-.111111,1,.208333,0,.015873,1,.375,0,.142857,1,.541667,0,.269841,1,.708333,0,.396825,1,.858805,.03125,.52381,1,.947392,.15625,.650794,1,1,.3125,.777778,1,1,.5625,.904762,1,1,.8125,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_red2yellow_BW",RGBPoints:[-1,754296e-12,0,109827e-10,-.87451,.18285,.0264094,0,-.74902,.3066,0,0,-.623529,.422841,0,0,-.498039,.522945,0,0,-.372549,.605721,0,0,-.247059,.672502,.14168,0,-.121569,.728167,.244025,0,.00392157,.781215,.333454,0,.129412,.825,.423586,0,.254902,.855893,.516793,0,.380392,.880491,.608846,0,.505882,.910305,.695505,0,.631373,.94109,.779067,.223528,.756863,.967873,.858572,.473521,.882353,.986815,.933211,.751583,1,1,1,.999997]},{ColorSpace:"Lab",Name:"erdc_marine2gold_BW",RGBPoints:[-1,111641e-12,0,162551e-11,-.87451,.0413146,.0619808,.209857,-.74902,.0185557,.101341,.350684,-.623529,.00486405,.149847,.461054,-.498039,.0836345,.210845,.517906,-.372549,.173222,.276134,.541793,-.247059,.259857,.343877,.535869,-.121569,.362299,.408124,.504293,.00392157,.468266,.468276,.468257,.129412,.582781,.527545,.374914,.254902,.691591,.585251,.274266,.380392,.784454,.645091,.247332,.505882,.862299,.710383,.27518,.631373,.920863,.782923,.351563,.756863,.955792,.859699,.533541,.882353,.976162,.93433,.780671,1,1,1,.999983]},{ColorSpace:"Lab",Name:"erdc_blue2gold_BW",RGBPoints:[-1,0,0,0,-.87451,.0742735,.0440331,.230013,-.74902,.125276,.0258685,.415826,-.623529,.143879,.0163031,.591346,-.498039,.212261,.0627855,.705239,-.372549,.306048,.141178,.763636,-.247059,.391537,.232286,.773263,-.121569,.461734,.336633,.708321,.00392157,.54209,.427581,.590007,.129412,.61704,.508623,.460978,.254902,.702703,.579586,.309117,.380392,.790336,.644811,.170397,.505882,.870173,.710733,.117134,.631373,.93656,.781991,.157144,.756863,.965672,.862068,.409836,.882353,.985751,.936296,.714162,1,1,1,.999999]},{ColorSpace:"Lab",Name:"erdc_sapphire2gold_BW",RGBPoints:[-1,.107704,.107708,.107694,-.87451,.1851,.112354,.308554,-.74902,.236782,.114233,.48788,-.623529,.28296,.126187,.639464,-.498039,.344787,.171643,.739713,-.372549,.413325,.242371,.76913,-.247059,.481863,.3131,.719841,-.121569,.550402,.383829,.612222,.00392157,.61894,.454558,.51126,.129412,.687478,.525287,.39993,.254902,.756017,.596016,.289923,.380392,.824555,.666745,.255498,.505882,.892979,.736822,.27696,.631373,.938851,.804966,.351734,.756863,.966491,.874853,.53572,.882353,.982105,.94153,.782579,1,1,1,.999986]},{ColorSpace:"Lab",Name:"erdc_red2purple_BW",RGBPoints:[-1,0,0,0,-.87451,.167793,.0166271,.0431278,-.74902,.262608,.0107595,.0791181,-.623529,.351902,.0101858,.100926,-.498039,.441257,.0160835,.131919,-.372549,.5221,.0555972,.195625,-.247059,.593852,.104294,.310234,-.121569,.654628,.158115,.448486,.00392157,.707443,.220914,.570253,.129412,.749504,.293268,.67897,.254902,.781587,.370517,.779269,.380392,.809951,.451099,.855831,.505882,.84424,.531462,.900451,.631373,.865174,.620901,.91606,.756863,.875041,.714054,.910284,.882353,.880764,.80554,.896276,1,.887572,.887591,.887556]},{ColorSpace:"Lab",Name:"erdc_purple2pink_BW",RGBPoints:[-1,0,0,0,-.87451,.117562,.0291202,.175876,-.74902,.178368,.0458476,.285454,-.623529,.237731,.0680173,.387717,-.498039,.300877,.0956291,.484802,-.372549,.370929,.136858,.554985,-.247059,.449033,.189273,.58863,-.121569,.529971,.245796,.598587,.00392157,.609914,.300643,.610244,.129412,.697079,.351286,.616371,.254902,.785858,.401991,.617376,.380392,.862517,.45745,.64463,.505882,.91359,.525462,.705336,.631373,.932583,.61064,.767412,.756863,.922478,.706966,.817522,.882353,.901302,.803071,.856311,1,.887571,.887591,.887549]},{ColorSpace:"Lab",Name:"erdc_pbj_lin",RGBPoints:[-1,0,0,0,-.87451,.091821,.0611476,.10617,-.74902,.160311,.0900022,.192713,-.623529,.22484,.12126,.272128,-.498039,.291263,.157469,.340828,-.372549,.360015,.200388,.388903,-.247059,.437497,.250058,.387201,-.121569,.512636,.304969,.355955,.00392157,.582603,.360874,.33488,.129412,.655126,.416374,.306351,.254902,.725889,.473329,.279051,.380392,.778125,.537928,.302697,.505882,.815894,.606931,.382431,.631373,.839159,.679308,.497608,.756863,.854748,.751666,.631792,.882353,.869483,.822508,.768592,1,.887572,.887589,.887565]},{ColorSpace:"Lab",Name:"erdc_blue2green_muted",RGBPoints:[-1,.107704,.107708,.107695,-.87451,.141522,.13066,.270741,-.74902,.180123,.146119,.42308,-.623529,.210161,.169674,.551795,-.498039,.239701,.212939,.634969,-.372549,.253916,.282947,.653641,-.247059,.242791,.366933,.608521,-.121569,.226302,.446776,.52693,.00392157,.236237,.514689,.458798,.129412,.274641,.577589,.376069,.254902,.349625,.633993,.288131,.380392,.4437,.683677,.260497,.505882,.536247,.731214,.285424,.631373,.628472,.777128,.349151,.756863,.718259,.819287,.496825,.882353,.804768,.856164,.703299,1,.887571,.887591,.887548]},{ColorSpace:"Lab",Name:"erdc_blue2green_BW",RGBPoints:[-1,363578e-12,0,529374e-11,-.87451,.0539915,.0577948,.212806,-.74902,.0620393,.0758942,.388959,-.623529,.0697499,.102032,.54177,-.498039,.113295,.156156,.64334,-.372549,.152047,.243196,.670283,-.247059,.158096,.344084,.622864,-.121569,.151142,.43922,.532767,.00392157,.17155,.521588,.457719,.129412,.225861,.599141,.363997,.254902,.32328,.67007,.259083,.380392,.442344,.733697,.223754,.505882,.558409,.794941,.257411,.631373,.673875,.854344,.340822,.756863,.787244,.909326,.524717,.882353,.896483,.958063,.775914,1,1,1,.999982]},{ColorSpace:"Lab",Name:"GREEN-WHITE_LINEAR",RGBPoints:[-1,0,0,0,-.87451,0,.062745,0,-.74902,0,.12549,0,-.623529,0,.188235,0,-.498039,0,.25098,0,-.372549,0,.313725,0,-.247059,0,.376471,0,-.121569,.094118,.439216,0,.00392157,.196078,.501961,0,.129412,.294118,.564706,0,.254902,.396078,.627451,0,.380392,.498039,.690196,0,.505882,.6,.752941,.145098,.631373,.701961,.815686,.364706,.756863,.8,.878431,.580392,.882353,.901961,.941176,.796078,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_green2yellow_BW",RGBPoints:[-1,0,0,0,-.87451,0,.105542,.0603919,-.74902,0,.159454,.104148,-.623529,0,.219502,.15542,-.498039,0,.282276,.203811,-.372549,0,.346331,.235652,-.247059,0,.411765,.235428,-.121569,0,.477177,.217977,.00392157,.0593644,.541635,.21361,.129412,.233081,.604722,.210591,.254902,.369803,.664942,.226536,.380392,.498446,.722367,.288237,.505882,.601929,.782244,.380815,.631373,.703207,.840497,.512134,.756863,.803186,.896433,.674462,.882353,.903834,.950266,.846715,1,1,1,.999981]},{ColorSpace:"Lab",Name:"blue2cyan",RGBPoints:[-1,0,0,0,-.87451,0,.152941,.364706,-.74902,0,.254902,.470588,-.623529,0,.34902,.572549,-.498039,0,.443137,.670588,-.372549,0,.537255,.772549,-.247059,0,.627451,.870588,-.121569,0,.717647,.964706,.00392157,.0784314,.772549,1,.129412,.207843,.858824,1,.254902,.32549,.941176,1,.380392,.45098,1,1,.505882,.560784,1,1,.631373,.662745,1,1,.756863,.760784,1,1,.882353,.870588,1,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_blue2cyan_BW",RGBPoints:[-1,405298e-12,0,59012e-10,-.87451,.0207526,.0740933,.18093,-.74902,0,.121033,.30343,-.623529,0,.166892,.416095,-.498039,0,.216768,.524796,-.372549,.0164769,.275471,.608585,-.247059,.0544527,.344824,.659267,-.121569,.0880643,.419118,.688675,.00392157,.127938,.492556,.720256,.129412,.149476,.566946,.756918,.254902,.188961,.641333,.792122,.380392,.245482,.715336,.827609,.505882,.329216,.786235,.874761,.631373,.453558,.852803,.918466,.756863,.626281,.910493,.954,.882353,.82257,.958709,.980146,1,1,1,.999989]},{ColorSpace:"Lab",Name:"erdc_blue_BW",RGBPoints:[-1,0,0,0,-.87451,.0425591,.0763529,.150682,-.74902,.0569472,.119154,.275403,-.623529,.0635978,.164772,.395427,-.498039,.0774342,.213851,.510014,-.372549,.106815,.267034,.615102,-.247059,.122093,.324649,.720068,-.121569,.160851,.387068,.806956,.00392157,.213754,.453516,.878012,.129412,.26722,.524656,.932436,.254902,.326844,.599279,.968038,.380392,.403403,.674712,.984784,.505882,.499703,.745519,1,.631373,.615055,.813983,1,.756863,.74405,.879228,1,.882353,.877909,.941913,1,1,1,1,.999996]},{ColorSpace:"Lab",Name:"BLUE-WHITE",RGBPoints:[-1,0,0,0,-.87451,0,0,.082353,-.74902,0,0,.168627,-.623529,0,0,.254902,-.498039,0,0,.337255,-.372549,0,0,.423529,-.247059,0,0,.509804,-.121569,0,.101961,.592157,.00392157,0,.203922,.678431,.129412,0,.301961,.764706,.254902,0,.403922,.85098,.380392,0,.505882,.933333,.505882,0,.603922,1,.631373,.254902,.705882,1,.756863,.509804,.807843,1,.882353,.764706,.905882,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_purple_BW",RGBPoints:[-1,4264e-11,0,620844e-12,-.87451,.100579,.0593111,.145666,-.74902,.167794,.0889224,.254953,-.623529,.231446,.123339,.360511,-.498039,.296699,.163027,.461278,-.372549,.363211,.209286,.55306,-.247059,.431136,.260776,.637195,-.121569,.498202,.320012,.705799,.00392157,.567456,.380459,.778091,.129412,.629381,.445284,.8448,.254902,.688373,.517374,.895694,.380392,.74891,.590906,.93976,.505882,.805017,.667956,.977626,.631373,.850914,.752618,.992396,.756863,.89724,.838454,.994093,.882353,.948461,.922603,.994449,1,1,1,.999967]},{ColorSpace:"Lab",Name:"erdc_magenta_BW",RGBPoints:[-1,0,0,254023e-10,-.87451,.128696,.0456782,.11635,-.74902,.228133,.0476299,.201452,-.623529,.327273,.0374065,.282107,-.498039,.420953,.0408166,.35709,-.372549,.511562,.0642203,.430511,-.247059,.599552,.102686,.504257,-.121569,.684646,.150536,.579429,.00392157,.765817,.205978,.656062,.129412,.839176,.27229,.731807,.254902,.89536,.357594,.797309,.380392,.930238,.457825,.846984,.505882,.945921,.564536,.880571,.631373,.948995,.670753,.902279,.756863,.947124,.772819,.918171,.882353,.947265,.869424,.934352,1,.954719,.95475,.954726]},{ColorSpace:"Lab",Name:"magenta",RGBPoints:[-1,0,0,0,-.87451,.364706,0,.152941,-.74902,.470588,0,.254902,-.623529,.572549,0,.34902,-.498039,.670588,0,.443137,-.372549,.772549,0,.537255,-.247059,.870588,0,.627451,-.121569,.964706,0,.717647,.00392157,1,.0784314,.772549,.129412,1,.207843,.858824,.254902,1,.32549,.941176,.380392,1,.45098,1,.505882,1,.560784,1,.631373,1,.662745,1,.756863,1,.760784,1,.882353,1,.870588,1,1,1,1,1]},{ColorSpace:"Lab",Name:"RED-PURPLE",RGBPoints:[-1,0,0,0,-.87451,.188235,0,.007843,-.74902,.345098,0,.035294,-.623529,.439216,0,.098039,-.498039,.533333,0,.152941,-.372549,.627451,.015686,.211765,-.247059,.721569,.031373,.266667,-.121569,.8,.047059,.329412,.00392157,.862745,.047059,.403922,.129412,.941176,.062745,.466667,.254902,.988235,.078431,.54902,.380392,.988235,.141176,.643137,.505882,.988235,.25098,.729412,.631373,.988235,.376471,.811765,.756863,.988235,.54902,.886275,.882353,.988235,.752941,.952941,1,.996078,.996078,.996078]},{ColorSpace:"Lab",Name:"erdc_red_BW",RGBPoints:[-1,0,0,0,-.87451,.147204,.0480135,.0401815,-.74902,.253411,.0617478,.0301333,-.623529,.356059,.0746331,.0446897,-.498039,.457731,.0934935,.0636931,-.372549,.557199,.122714,.0860013,-.247059,.665179,.144238,.105585,-.121569,.763833,.187056,.138326,.00392157,.847035,.254558,.189407,.129412,.905663,.345937,.258215,.254902,.941431,.447111,.346277,.380392,.962608,.546927,.457571,.505882,.987833,.637276,.569944,.631373,.994202,.732176,.687958,.756863,.993304,.826268,.800567,.882353,.994413,.917205,.906393,1,1,1,.999979]},{ColorSpace:"Lab",Name:"RED_TEMPERATURE",RGBPoints:[-1,0,0,0,-.87451,.090196,0,0,-.74902,.180392,0,0,-.623529,.270588,0,0,-.498039,.360784,0,0,-.372549,.45098,0,0,-.247059,.545098,0,0,-.121569,.635294,0,0,.00392157,.72549,.058824,0,.129412,.815686,.176471,0,.254902,.905882,.294118,0,.380392,1,.411765,0,.505882,1,.533333,.027451,.631373,1,.65098,.27451,.756863,1,.768627,.521569,.882353,1,.886275,.768627,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_orange_BW",RGBPoints:[-1,0,0,253806e-10,-.87451,.135871,.0593824,0,-.74902,.224328,.0907216,0,-.623529,.318083,.119647,0,-.498039,.414443,.150246,0,-.372549,.511077,.184884,0,-.247059,.605501,.226033,0,-.121569,.695274,.275491,0,.00392157,.777826,.334445,0,.129412,.851498,.402441,0,.254902,.915899,.47759,602975e-9,.380392,.971984,.557882,.0361443,.505882,1,.641287,.135967,.631373,1,.725198,.27997,.756863,1,.808205,.438135,.882353,1,.89306,.587036,1,1,.977928,.721599]},{ColorSpace:"Lab",Name:"heated_object",RGBPoints:[-1,0,0,0,-.87451,.34902,.0862745,0,-.74902,.45098,.172549,0,-.623529,.52549,.231373,0,-.498039,.580392,.278431,0,-.372549,.623529,.313725,0,-.247059,.670588,.352941,0,-.121569,.717647,.392157,0,.00392157,.772549,.439216,0,.129412,.839216,.494118,0,.254902,.901961,.541176,0,.380392,.968627,.6,0,.505882,1,.658824,0,.631373,1,.721569,0,.756863,1,.827451,.298039,.882353,1,.976471,.72549,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_gold_BW",RGBPoints:[-1,0,0,190933e-10,-.87451,.128363,.0636265,0,-.74902,.193795,.111057,0,-.623529,.25976,.15987,0,-.498039,.328546,.210589,0,-.372549,.399726,.26332,0,-.247059,.472969,.318261,0,-.121569,.546245,.375827,0,.00392157,.61745,.436719,0,.129412,.685545,.501113,0,.254902,.749578,.568799,0,.380392,.80962,.6394,0,.505882,.865572,.712699,.10257,.631373,.917709,.787569,.233665,.756863,.966914,.863138,.369608,.882353,1,.939405,.496104,1,.999225,1,.612275]},{ColorSpace:"Lab",Name:"erdc_brown_BW",RGBPoints:[-1,33216e-11,0,483629e-11,-.87451,.14693,.0518172,0,-.74902,.225806,.0814996,0,-.623529,.301681,.111452,0,-.498039,.370487,.150664,0,-.372549,.43108,.199477,0,-.247059,.4849,.255107,0,-.121569,.536798,.313486,0,.00392157,.59286,.371167,0,.129412,.653119,.428135,0,.254902,.714589,.485917,.0379541,.380392,.774667,.54565,.116634,.505882,.831222,.608047,.183895,.631373,.880305,.674199,.260298,.756863,.922314,.742472,.367086,.882353,.959408,.811222,.497258,1,.993548,.875183,.622093]},{ColorSpace:"Lab",Name:"copper_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0784314,.0501961,.0313725,-.74902,.156863,.100392,.0627451,-.623529,.235294,.150588,.0941176,-.498039,.313725,.200784,.12549,-.372549,.392157,.25098,.156863,-.247059,.470588,.301176,.188235,-.121569,.54902,.351373,.219608,.00392157,.627451,.401569,.25098,.129412,.705882,.451765,.282353,.254902,.784314,.501961,.313725,.380392,.862745,.552157,.345098,.505882,.941176,.602353,.376471,.631373,1,.652549,.407843,.756863,1,.702745,.439216,.882353,1,.752941,.470588,1,1,.8,.5]},{ColorSpace:"Lab",Name:"pink_Matlab",RGBPoints:[-1,0,0,0,-.87451,.312416,.204524,.204524,-.74902,.441822,.289241,.289241,-.623529,.54112,.354246,.354246,-.498039,.624831,.409048,.409048,-.372549,.698582,.45733,.45733,-.247059,.764404,.502282,.500979,-.121569,.791292,.591516,.54112,.00392157,.817297,.66895,.578481,.129412,.842499,.738308,.613572,.254902,.866968,.801687,.646762,.380392,.890766,.86041,.678329,.505882,.913944,.913944,.711254,.631373,.936549,.936549,.79459,.756863,.958621,.958621,.869979,.882353,.980196,.980196,.939336,1,1,1,1]},{ColorSpace:"Lab",Name:"bone_Matlab",RGBPoints:[-1,0,0,0,-.87451,.054902,.054902,.075817,-.74902,.109804,.109804,.151634,-.623529,.164706,.164706,.227451,-.498039,.219608,.219608,.303268,-.372549,.27451,.27451,.379085,-.247059,.329412,.329902,.454412,-.121569,.384314,.405719,.509314,.00392157,.439216,.481536,.564216,.129412,.494118,.557353,.619118,.254902,.54902,.63317,.67402,.380392,.603922,.708987,.728922,.505882,.660294,.783824,.783824,.631373,.746569,.838725,.838725,.756863,.832843,.893627,.893627,.882353,.919118,.948529,.948529,1,1,1,1]},{ColorSpace:"Lab",Name:"gray_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0627451,.0627451,.0627451,-.74902,.12549,.12549,.12549,-.623529,.188235,.188235,.188235,-.498039,.25098,.25098,.25098,-.372549,.313725,.313725,.313725,-.247059,.376471,.376471,.376471,-.121569,.439216,.439216,.439216,.00392157,.501961,.501961,.501961,.129412,.564706,.564706,.564706,.254902,.627451,.627451,.627451,.380392,.690196,.690196,.690196,.505882,.752941,.752941,.752941,.631373,.815686,.815686,.815686,.756863,.878431,.878431,.878431,.882353,.941176,.941176,.941176,1,1,1,1]},{ColorSpace:"Lab",Name:"Purples",RGBPoints:[-1,.247059,0,.490196,-.87451,.288397,.07677,.525629,-.74902,.32975,.153587,.561092,-.623529,.373057,.236263,.600461,-.498039,.416363,.319,.639923,-.372549,.459669,.405613,.685198,-.247059,.503345,.491534,.730058,-.121569,.562399,.54862,.757616,.00392157,.621453,.606075,.785544,.129412,.680508,.674971,.824914,.254902,.739562,.743406,.863899,.380392,.798616,.800492,.893426,.505882,.85684,.856655,.922491,.631373,.898178,.894056,.942176,.756863,.938654,.930919,.961646,.882353,.964245,.958478,.977393,1,.988235,.984314,.992157]},{ColorSpace:"Lab",Name:"Blues",RGBPoints:[-1,.031373,.188235,.419608,-.87451,.031373,.253195,.516063,-.74902,.031757,.318139,.612149,-.623529,.080969,.38113,.661361,-.498039,.130427,.444152,.710327,-.372549,.195386,.509112,.743791,-.247059,.260715,.573841,.777209,-.121569,.341423,.628958,.808704,.00392157,.422745,.684075,.839892,.129412,.523137,.739193,.861546,.254902,.622684,.793464,.883429,.380392,.701423,.826928,.910988,.505882,.778685,.8603,.937993,.631373,.825928,.891795,.953741,.756863,.87328,.923291,.969489,.882353,.922491,.954787,.985236,1,.968627,.984314,1]},{ColorSpace:"Lab",Name:"Greens",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546082,.271326,-.372549,.197232,.609073,.31857,-.247059,.257255,.671742,.365859,-.121569,.357647,.720953,.415071,.00392157,.45767,.769919,.465021,.129412,.546251,.811257,.537855,.254902,.634295,.852211,.610688,.380392,.709097,.883706,.683522,.505882,.78316,.914833,.755894,.631373,.842215,.938454,.818885,.756863,.899977,.961538,.880692,.882353,.935409,.975317,.92203,1,.968627,.988235,.960784]},{ColorSpace:"Lab",Name:"PuBu",RGBPoints:[-1,.301961,0,.294118,-.87451,.404321,.029527,.390573,-.74902,.50599,.059592,.486782,-.623529,.519769,.158016,.551742,-.498039,.533456,.256194,.616301,-.372549,.54133,.33887,.655671,-.247059,.54902,.421592,.695087,-.121569,.54902,.506236,.736424,.00392157,.550127,.590573,.777701,.129412,.585559,.665375,.81707,.254902,.622145,.739023,.855825,.380392,.687105,.784298,.879446,.505882,.752065,.829758,.903253,.631373,.817024,.87897,.930811,.756863,.880907,.927213,.957832,.882353,.926182,.958708,.975548,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"BuPu",RGBPoints:[-1,.007843,.219608,.345098,-.87451,.01178,.286536,.449427,-.74902,.015702,.35328,.553479,-.623529,.01767,.396586,.622376,-.498039,.021115,.4402,.690688,-.372549,.11757,.503191,.722184,-.247059,.214625,.565859,.753633,-.121569,.336671,.615071,.78316,.00392157,.457978,.663975,.812503,.129412,.556401,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821638,.903068,.631373,.873387,.864944,.92669,.756863,.927536,.907605,.949988,.882353,.964937,.9391,.967705,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGn",RGBPoints:[-1,.031373,.25098,.505882,-.87451,.031373,.329719,.590527,-.74902,.031911,.408397,.674787,-.623529,.100807,.479262,.710219,-.498039,.169704,.550219,.745744,-.372549,.238601,.62699,.787082,-.247059,.307958,.703114,.826759,-.121569,.39654,.752326,.797232,.00392157,.485121,.801046,.767705,.129412,.573702,.83451,.738178,.254902,.661592,.867743,.711034,.380392,.732457,.895302,.74253,.505882,.801845,.922307,.774579,.631373,.841215,.938055,.817885,.756863,.880907,.95391,.861084,.882353,.926182,.971626,.902422,1,.968627,.988235,.941176]},{ColorSpace:"Lab",Name:"GnBu",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546175,.272095,-.372549,.197232,.615071,.368551,-.247059,.256609,.683276,.464867,-.121569,.329443,.722645,.555417,.00392157,.403137,.762138,.645413,.129412,.503529,.805444,.718247,.254902,.603922,.848597,.790465,.380392,.704314,.887966,.847551,.505882,.802307,.926321,.903714,.631373,.851519,.944037,.941115,.756863,.899977,.961538,.976901,.882353,.935409,.975317,.984775,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"GnBuPu",RGBPoints:[-1,.003922,.27451,.211765,-.87451,.003922,.349312,.280661,-.74902,.003937,.423852,.349773,-.623529,.005905,.46519,.446228,-.498039,.009443,.506344,.542837,-.372549,.111803,.535871,.649135,-.247059,.214025,.565859,.753633,-.121569,.310481,.615071,.78316,.00392157,.407797,.663975,.812503,.129412,.531811,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821176,.902884,.631373,.873387,.854641,.922568,.756863,.927536,.888535,.942361,.882353,.964937,.929873,.964014,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGnYl",RGBPoints:[-1,.031373,.113725,.345098,-.87451,.088458,.159,.463206,-.74902,.145052,.204567,.5807,-.623529,.139146,.287243,.620069,-.498039,.13318,.370196,.659562,-.372549,.123337,.470588,.706805,-.247059,.115386,.570335,.753126,-.121569,.186251,.643168,.761,.00392157,.258716,.71514,.768074,.129412,.380761,.760415,.750358,.254902,.503576,.806075,.732795,.380392,.645306,.861192,.719016,.505882,.783899,.91511,.705606,.631373,.858701,.944637,.6997,.756863,.931349,.973303,.698424,.882353,.966782,.987082,.777163,1,1,1,.85098]},{ColorSpace:"Lab",Name:"PuRd",RGBPoints:[-1,.286275,0,.415686,-.87451,.38273,.001968,.441276,-.74902,.479231,.003922,.466774,-.623529,.581592,.003922,.480554,-.498039,.683799,.00549,.494887,-.372549,.776317,.105882,.544098,-.247059,.867866,.206321,.592618,-.121569,.919047,.308681,.612303,.00392157,.968812,.411226,.632603,.129412,.974717,.519493,.671972,.254902,.980546,.626451,.71065,.380392,.984483,.701253,.732303,.505882,.988328,.77504,.755617,.631373,.990296,.828189,.812703,.756863,.992372,.880907,.869035,.882353,.996309,.926182,.912341,1,1,.968627,.952941]},{ColorSpace:"Lab",Name:"RdPu",RGBPoints:[-1,.403922,0,.121569,-.87451,.500377,0,.192434,-.74902,.596909,277e-6,.263037,-.623529,.703206,.035709,.300438,-.498039,.808612,.071296,.338854,-.372549,.857824,.116571,.441215,-.247059,.905513,.163552,.54293,-.121569,.889765,.281661,.617732,.00392157,.873156,.39897,.691611,.129412,.82985,.491488,.736886,.254902,.789081,.583237,.781853,.380392,.810734,.656071,.819254,.505882,.833126,.729181,.85684,.631373,.870527,.80792,.898178,.756863,.907605,.884398,.938331,.882353,.9391,.921799,.958016,1,.968627,.956863,.976471]},{ColorSpace:"Lab",Name:"Oranges",RGBPoints:[-1,.498039,.152941,.015686,-.87451,.57481,.182468,.013718,-.74902,.651765,.212042,.011734,-.623529,.752157,.247474,.007797,-.498039,.851719,.283368,.004475,-.372549,.898962,.348328,.039908,-.247059,.945652,.413426,.076401,-.121569,.969273,.484291,.157109,.00392157,.992157,.554971,.238185,.129412,.992157,.619931,.330704,.254902,.992157,.684967,.423837,.380392,.992157,.751895,.532103,.505882,.992249,.817716,.639354,.631373,.994218,.861023,.725967,.756863,.996186,.903576,.810965,.882353,.998155,.933103,.868051,1,1,.960784,.921569]},{ColorSpace:"Lab",Name:"Reds",RGBPoints:[-1,.403922,0,.05098,-.87451,.525967,.029527,.066728,-.74902,.647643,.058962,.082476,-.623529,.722445,.076678,.098224,-.498039,.797186,.095194,.114187,-.372549,.868051,.164091,.143714,-.247059,.937809,.233541,.173933,-.121569,.96143,.326059,.232987,.00392157,.984375,.418147,.292657,.129412,.986344,.496886,.371396,.254902,.988235,.575702,.450673,.380392,.988235,.656409,.543191,.505882,.98842,.736747,.635894,.631373,.992357,.809581,.732349,.756863,.996186,.880692,.826759,.882353,.998155,.92203,.885813,1,1,.960784,.941176]},{ColorSpace:"Lab",Name:"RdOr",RGBPoints:[-1,.498039,0,0,-.87451,.6004,0,0,-.74902,.702514,738e-6,477e-6,-.623529,.773379,.095225,.061499,-.498039,.843875,.189865,.12283,-.372549,.891119,.294195,.203537,-.247059,.937855,.397924,.283137,-.121569,.963445,.476663,.316601,.00392157,.988297,.555771,.351665,.129412,.990265,.646321,.436309,.254902,.992157,.735256,.519646,.380392,.992157,.784468,.570827,.505882,.992249,.833218,.623483,.631373,.994218,.872587,.706159,.756863,.996186,.911419,.788189,.882353,.998155,.940946,.859054,1,1,.968627,.92549]},{ColorSpace:"Lab",Name:"BrOrYl",RGBPoints:[-1,.4,.145098,.023529,-.87451,.500392,.174625,.019592,-.74902,.600784,.204291,.015656,-.623529,.701176,.251534,.011719,-.498039,.800984,.299146,.008397,-.372549,.863975,.370012,.043829,-.247059,.926321,.441107,.0794,-.121569,.961753,.521815,.120738,.00392157,.996078,.602645,.163122,.129412,.996078,.68729,.237924,.254902,.996078,.771011,.314879,.380392,.996078,.832034,.444798,.505882,.996171,.892042,.572595,.631373,.998139,.931411,.65724,.756863,1,.969489,.741669,.882353,1,.985236,.822376,1,1,1,.898039]},{ColorSpace:"Lab",Name:"RdOrYl",RGBPoints:[-1,.501961,0,.14902,-.87451,.622038,0,.14902,-.74902,.741761,4e-4,.148866,-.623529,.816563,.05158,.129181,-.498039,.890965,.10356,.110235,-.372549,.940177,.205921,.137793,-.247059,.988281,.308789,.165536,-.121569,.99025,.432803,.200969,.00392157,.992218,.555217,.236278,.129412,.994187,.628051,.267774,.254902,.996078,.701038,.301269,.380392,.996078,.777809,.383945,.505882,.996171,.852826,.466621,.631373,.998139,.892195,.549296,.756863,1,.931349,.632188,.882353,1,.966782,.7188,1,1,1,.8]},{ColorSpace:"Lab",Name:"CIELab_blue2red",RGBPoints:[-1,0,.6,.74902,1,.76863,.46667,.34118]},{ColorSpace:"Lab",Name:"blue2yellow",RGBPoints:[-1,0,0,1,0,.5,.5,.5,1,1,1,0]},{ColorSpace:"Lab",Name:"erdc_blue2gold",RGBPoints:[-1,.175119,.0438468,1,-.874016,.22383,.159771,.94557,-.748031,.27254,.233611,.891216,-.622047,.321251,.296526,.836857,-.496063,.369962,.354296,.782359,-.370079,.418672,.409139,.72754,-.244094,.467383,.462152,.672148,-.11811,.51609,.51396,.615825,.00787402,.572863,.55452,.559172,.133858,.630269,.593822,.517729,.259843,.689588,.624668,.47446,.385827,.745394,.656113,.428638,.511811,.798624,.688104,.379105,.637795,.849926,.720593,.323834,.76378,.899765,.753543,.258657,.889764,.948487,.78692,.171778,1,.990413,.816451,.00729848]},{ColorSpace:"Lab",Name:"erdc_blue2yellow",RGBPoints:[-1,.0830122,0,.495617,-.87451,.141973,.0551288,.57363,-.74902,.193048,.110258,.604561,-.623529,.234231,.165386,.57643,-.498039,.275413,.220515,.548299,-.372549,.316596,.275644,.520169,-.247059,.357778,.330773,.492038,-.121569,.398961,.385901,.463908,.00392157,.449929,.438487,.426815,.129412,.511572,.488299,.379944,.254902,.581222,.53603,.325741,.380392,.650871,.583761,.271538,.505882,.720521,.631493,.217335,.631373,.79017,.679224,.163132,.756863,.85982,.726955,.108929,.882353,.910254,.774159,.14112,1,.927513,.81759,.306289]},{ColorSpace:"Lab",Name:"erdc_cyan2orange",RGBPoints:[-1,.0471513,.213874,.414329,-.87451,.0674702,.256648,.439027,-.74902,.0959957,.299331,.462089,-.623529,.132428,.341872,.483212,-.498039,.188743,.38277,.500597,-.372549,.268511,.420229,.512179,-.247059,.352945,.455602,.519101,-.121569,.43893,.489368,.521538,.00392157,.522445,.522495,.522436,.129412,.600089,.555682,.53205,.254902,.67988,.587981,.539163,.380392,.761011,.619586,.544439,.505882,.84278,.650741,.548567,.631373,.910713,.687347,.557822,.756863,.952232,.734972,.577775,.882353,.975642,.789858,.604868,1,.990752,.843643,.632857]},{ColorSpace:"Lab",Name:"erdc_purple2green",RGBPoints:[-1,.235006,.0483128,.530899,-.87451,.302968,.108419,.552391,-.74902,.360241,.166059,.569502,-.623529,.406746,.226782,.579373,-.498039,.444073,.28964,.582094,-.372549,.473648,.353774,.577947,-.247059,.497636,.418154,.567911,-.121569,.519086,.481741,.553968,.00392157,.542884,.542914,.542875,.129412,.566303,.603989,.527499,.254902,.595218,.662965,.516857,.380392,.628641,.720701,.510673,.505882,.665373,.777849,.508165,.631373,.704182,.834921,.508303,.756863,.743846,.892328,.50999,.882353,.783158,.950422,.512181,1,.818617,1,.513888]},{ColorSpace:"Lab",Name:"erdc_purple2green_dark",RGBPoints:[-1,.107656,0,.428682,-.87451,.1924,0,.449799,-.74902,.255118,.0648939,.466726,-.623529,.304256,.133066,.476703,-.498039,.343202,.19716,.479793,-.372549,.373876,.260353,.476241,-.247059,.398497,.322872,.466953,-.121569,.420016,.384252,.453785,.00392157,.44319,.443216,.443186,.129412,.465553,.502139,.428233,.254902,.492959,.559151,.417591,.380392,.524654,.615092,.411016,.505882,.55959,.670583,.40779,.631373,.596614,.726102,.406948,.756863,.634544,.782032,.407439,.882353,.672183,.838703,.408237,1,.706131,.892759,.408452]},{ColorSpace:"Lab",Name:"coolwarm",RGBPoints:[-1,.229806,.298718,.753683,-.875,.303869,.406535,.844959,-.75,.383013,.509419,.917388,-.625,.466667,.604563,.968155,-.5,.552953,.688929,.995376,-.375,.639176,.7596,.998151,-.25,.722193,.813953,.976575,-.125,.798692,.849786,.931689,0,.865395,.86541,.865396,.125,.924128,.827385,.774508,.25,.958853,.769768,.678008,.375,.969954,.694267,.579375,.5,.958003,.602842,.481776,.625,.923945,.497309,.38797,.75,.869187,.378313,.300267,.875,.795632,.241284,.220526,1,.705673,.0155562,.150233]},{ColorSpace:"Lab",Name:"BuRd",RGBPoints:[-1,.019608,.188235,.380392,-.87451,.088504,.321107,.564937,-.74902,.163399,.444983,.697501,-.623529,.247059,.555709,.754095,-.498039,.420684,.676432,.818685,-.372549,.606459,.789773,.880277,-.247059,.761476,.868512,.924567,-.121569,.878047,.925721,.951942,.00392157,.969089,.966474,.964937,.129412,.983852,.897578,.846828,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"Spectral_lowBlue",RGBPoints:[-1,.368627,.309804,.635294,-.87451,.260361,.450058,.70173,-.74902,.248058,.591311,.717186,-.623529,.376009,.734025,.658132,-.498039,.537947,.814764,.64506,-.372549,.702345,.879585,.636678,-.247059,.84752,.938639,.607151,-.121569,.940408,.976163,.656055,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.937793,.398539,.270127,.756863,.861515,.282891,.299654,.882353,.746482,.144637,.288812,1,.619608,.003922,.258824]},{ColorSpace:"Lab",Name:"GnRP",RGBPoints:[-1,0,.266667,.105882,-.87451,.066436,.394617,.174779,-.74902,.168858,.524567,.25767,-.623529,.323875,.657439,.361015,-.498039,.504883,.772318,.506344,-.372549,.678431,.870127,.654902,-.247059,.803922,.921799,.780392,-.121569,.897116,.951942,.882814,.00392157,.967397,.965936,.967474,.129412,.928028,.879815,.930565,.254902,.866052,.780777,.882891,.380392,.77501,.665129,.821376,.505882,.675663,.537024,.737024,.631373,.57847,.396155,.645982,.756863,.492349,.223914,.547559,.882353,.375548,.096886,.423299,1,.25098,0,.294118]},{ColorSpace:"Lab",Name:"GYPi",RGBPoints:[-1,.152941,.392157,.098039,-.87451,.246444,.505344,.117724,-.74902,.351942,.614533,.161399,-.623529,.474971,.717878,.240138,-.498039,.611995,.811226,.392849,-.372549,.746328,.893118,.565321,-.247059,.859516,.94233,.747405,-.121569,.928105,.96386,.875663,.00392157,.969089,.966859,.968012,.129412,.983852,.910265,.948328,.254902,.979239,.833218,.914648,.380392,.949712,.729873,.862976,.505882,.905652,.58293,.763552,.631373,.85521,.410073,.652211,.756863,.793695,.183699,.531642,.882353,.683737,.063899,.420761,1,.556863,.003922,.321569]},{ColorSpace:"Lab",Name:"GnYlRd",RGBPoints:[-1,0,.407843,.215686,-.87451,.063975,.525952,.277201,-.74902,.177932,.633064,.332718,-.623529,.364937,.724106,.379469,-.498039,.527951,.797155,.40223,-.372549,.678431,.862822,.433449,-.247059,.803922,.916955,.514648,-.121569,.909419,.961861,.625067,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.939023,.389927,.245521,.756863,.867666,.239831,.176624,.882353,.762399,.110727,.151326,1,.647059,0,.14902]},{ColorSpace:"Lab",Name:"GBBr",RGBPoints:[-1,0,.235294,.188235,-.87451,.002461,.338639,.301423,-.74902,.055902,.448981,.417609,-.623529,.183852,.56955,.538178,-.498039,.357785,.700115,.660746,-.372549,.540177,.819531,.77624,-.247059,.714879,.890888,.864821,-.121569,.851134,.934564,.922645,.00392157,.960861,.959785,.95694,.129412,.963322,.927797,.83391,.254902,.939946,.868897,.68935,.380392,.883353,.775394,.517109,.505882,.808074,.625836,.324106,.631373,.717647,.476355,.15494,.756863,.592157,.358247,.06882,.882353,.458593,.26436,.031142,1,.329412,.188235,.019608]},{ColorSpace:"Lab",Name:"PuOr",RGBPoints:[-1,.498039,.231373,.031373,-.87451,.62599,.30273,.026451,-.74902,.746943,.387082,.037524,-.623529,.85767,.490427,.071972,-.498039,.936409,.617762,.236371,-.372549,.992695,.743099,.43291,-.247059,.995156,.841523,.63714,-.121569,.985313,.913802,.813687,.00392157,.966244,.966398,.967705,.129412,.889965,.89504,.938178,.254902,.806151,.804306,.894656,.380392,.712649,.688658,.833141,.505882,.594233,.554325,.744637,.631373,.474894,.404229,.652364,.756863,.366628,.217224,.563783,.882353,.266436,.089965,.434833,1,.176471,0,.294118]},{ColorSpace:"Lab",Name:"PRGn",RGBPoints:[-1,.25098,0,.294118,-.87451,.383852,.103345,.431911,-.74902,.497732,.234679,.55371,-.623529,.583852,.40692,.652134,-.498039,.681968,.545175,.742561,-.372549,.7807,.672357,.825221,-.247059,.871742,.788005,.886736,-.121569,.930488,.885198,.932872,.00392157,.966321,.968089,.965859,.129412,.892503,.950865,.877278,.254902,.796078,.91857,.772549,.380392,.670588,.866897,.647059,.505882,.493195,.765398,.496655,.631373,.314187,.649135,.354556,.756863,.15917,.516263,.251211,.882353,.062284,.386621,.170473,1,0,.266667,.105882]},{ColorSpace:"Lab",Name:"PiYG",RGBPoints:[-1,.556863,.003922,.321569,-.87451,.692195,.067897,.427374,-.74902,.797539,.197847,.539177,-.623529,.859054,.424221,.659746,-.498039,.908574,.592618,.770319,-.372549,.951557,.736332,.866205,-.247059,.981084,.839677,.917878,-.121569,.98293,.913802,.949558,.00392157,.96732,.968474,.965629,.129412,.92549,.963552,.869666,.254902,.852441,.939254,.736025,.380392,.739254,.890042,.553941,.505882,.60323,.805536,.382238,.631373,.467282,.711419,.235217,.756863,.344252,.608074,.156478,.882353,.2406,.49827,.116494,1,.152941,.392157,.098039]},{ColorSpace:"Lab",Name:"OrPu",RGBPoints:[-1,.176471,0,.294118,-.87451,.272434,.095963,.444214,-.74902,.373395,.228912,.56932,-.623529,.481661,.415917,.657901,-.498039,.601922,.562937,.750481,-.372549,.718493,.695886,.836986,-.247059,.811995,.811534,.898501,-.121569,.894733,.8995,.940023,.00392157,.969166,.966859,.963629,.129412,.98639,.910265,.803691,.254902,.995002,.835371,.624375,.380392,.992541,.736947,.420146,.505882,.931949,.609458,.224221,.631373,.85075,.483968,.069819,.756863,.740023,.380623,.035371,.882353,.617993,.29827,.026759,1,.498039,.231373,.031373]},{ColorSpace:"Lab",Name:"BrBG",RGBPoints:[-1,.329412,.188235,.019608,-.87451,.467205,.269435,.031911,-.74902,.6,.365629,.074202,-.623529,.72549,.483737,.160323,-.498039,.812995,.635832,.336409,-.372549,.88689,.781238,.527874,-.247059,.943483,.87474,.700115,-.121569,.963168,.929796,.841599,.00392157,.957247,.959938,.959554,.129412,.84406,.932872,.920185,.254902,.70396,.886428,.859285,.380392,.529258,.815071,.770704,.505882,.346251,.691811,.653057,.631373,.175855,.562015,.530642,.756863,.047905,.441446,.410073,.882353,.002307,.33218,.294348,1,0,.235294,.188235]},{ColorSpace:"Lab",Name:"GyRd",RGBPoints:[-1,.101961,.101961,.101961,-.87451,.227451,.227451,.227451,-.74902,.359939,.359939,.359939,-.623529,.502653,.502653,.502653,-.498039,.631373,.631373,.631373,-.372549,.749865,.749865,.749865,-.247059,.843368,.843368,.843368,-.121569,.926105,.926105,.926105,.00392157,.999846,.997232,.995694,.129412,.994925,.908651,.857901,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen",RGBPoints:[-1,.297553,0,.489074,-.87451,.40259,.151146,.567754,-.74902,.516038,.284843,.658231,-.623529,.629783,.423646,.750938,-.498039,.735198,.563697,.835956,-.372549,.82408,.695541,.903582,-.247059,.889091,.807454,.944862,-.121569,.92334,.886917,.951839,.00392157,.921045,.921084,.921003,.129412,.877324,.907455,.845381,.254902,.797649,.849713,.734695,.380392,.691646,.75964,.600532,.505882,.568981,.649159,.453807,.631373,.438945,.529756,.304259,.756863,.30973,.412001,.158303,.882353,.187078,.305111,.00251458,1,.101655,.220836,0]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen_dim",RGBPoints:[-1,.404088,.131038,.592767,-.87451,.486469,.230957,.651243,-.74902,.575165,.339335,.717723,-.623529,.662741,.454332,.784263,-.498039,.742071,.570213,.842918,-.372549,.806935,.678992,.886227,-.247059,.852219,.771315,.90763,-.121569,.873345,.837327,.901572,.00392157,.866783,.86682,.866745,.129412,.82839,.858225,.796812,.254902,.762578,.814287,.700202,.380392,.676429,.744229,.585735,.505882,.577033,.65732,.461526,.631373,.47128,.562476,.33476,.756863,.365461,.467957,.21076,.882353,.264758,.381138,.0878313,1,.182591,.312249,0]},{ColorSpace:"Lab",Name:"erdc_divLow_icePeach",RGBPoints:[-1,.480048,.817441,.998056,-.87451,.425898,.726921,.883187,-.74902,.366682,.629445,.761936,-.623529,.308756,.531002,.640217,-.498039,.258021,.43705,.523433,-.372549,.219244,.352381,.416348,-.247059,.195127,.281032,.322979,-.121569,.186286,.22627,.246525,.00392157,.192352,.19236,.192364,.129412,.255927,.214469,.191756,.254902,.340459,.254426,.206666,.380392,.444655,.309315,.234029,.505882,.565353,.376004,.270969,.631373,.697917,.450748,.314293,.756863,.836657,.529064,.360227,.882353,.972695,.614884,.413123,1,1,.705904,.472699]},{ColorSpace:"Lab",Name:"erdc_divLow_purpleGreen",RGBPoints:[-1,.956034,.666487,.952663,-.87451,.874457,.572698,.936352,-.74902,.753465,.488253,.909063,-.623529,.63309,.413507,.763833,-.498039,.514491,.345878,.620015,-.372549,.405008,.288141,.484376,-.247059,.311388,.241986,.363556,-.121569,.238722,.209044,.263449,.00392157,.192352,.192366,.192362,.129412,.200379,.233201,.168618,.254902,.230151,.291737,.165227,.380392,.279481,.366076,.178607,.505882,.344927,.453267,.205703,.631373,.421554,.549449,.242643,.756863,.503334,.649999,.284377,.882353,.583497,.749672,.324969,1,.650705,.837228,.356264]},{ColorSpace:"Lab",Name:"Haze_green",RGBPoints:[-1,1,.835294,.886275,-.87451,.937255,.756863,.870443,-.74902,.875817,.666376,.857807,-.623529,.778359,.583007,.808134,-.498039,.676253,.494118,.745098,-.372549,.561365,.390123,.682353,-.247059,.438344,.262745,.621496,-.121569,.321133,.141031,.558751,.00392157,.203922,.0217865,.495861,.129412,.265505,.129412,.433261,.254902,.311692,.255338,.37008,.380392,.356282,.377342,.310821,.505882,.39971,.488889,.258243,.631373,.442556,.604357,.205519,.756863,.48671,.71968,.152941,.882353,.529847,.830356,.100944,1,.572549,.933333,.054902]},{ColorSpace:"Lab",Name:"Haze_lime",RGBPoints:[-1,.704034,.784196,1,-.87451,.633111,.691418,.956078,-.74902,.564021,.600606,.912157,-.623529,.496827,.51189,.868235,-.498039,.43157,.425416,.824314,-.372549,.368248,.341347,.780392,-.247059,.306767,.259855,.736471,-.121569,.246862,.181069,.692549,.00392157,.191619,.109542,.648627,.129412,.257404,.194031,.604706,.254902,.321794,.278775,.560784,.380392,.387909,.364617,.516863,.505882,.456569,.451881,.472941,.631373,.527424,.540773,.42902,.756863,.599759,.631427,.385098,.882353,.673065,.723898,.341176,1,.742751,.812252,.3]},{ColorSpace:"RGB",Name:"Haze",RGBPoints:[-1,1,.835294,.996078,-.00392157,.023529,.141176,.498039,.00392157,.015686,.137255,.494118,1,.984314,.764706,0]},{ColorSpace:"Lab",Name:"Haze_cyan",RGBPoints:[-1,.956863,1,.835294,-.87451,.933188,.921714,.760784,-.74902,.870588,.803486,.671605,-.623529,.807843,.684096,.583297,-.498039,.745098,.569208,.494118,-.372549,.682353,.437763,.390123,-.247059,.621496,.288163,.262745,-.121569,.558751,.144517,.141031,.00392157,.495861,.0217865,.0413943,.129412,.433261,.137255,.129412,.254902,.37008,.263181,.255338,.380392,.306318,.381845,.372694,.505882,.243137,.503994,.494263,.631373,.180392,.629484,.619753,.756863,.117647,.754975,.747131,.882353,.054902,.876398,.866812,1,0,.988235,.976471]},{ColorSpace:"Lab",Name:"nic_Edge",RGBPoints:[-1,.191208,.191208,.191208,-.87451,.239484,.00545035,.614821,-.74902,.220593,.0617459,.863547,-.623529,.17509,.278988,.97794,-.498039,.143526,.576069,.998553,-.372549,.166456,.871883,.96594,-.247059,.376202,.993555,.981833,-.121569,.681996,.991297,.999239,.00392157,.954172,.952734,.94374,.129412,.999735,.99301,.662896,.254902,.979399,.991466,.357973,.380392,.968771,.854967,.162659,.505882,.999245,.556697,.144323,.631373,.973959,.26223,.177946,.756863,.852358,.0526707,.222974,.882353,.593889,.00912724,.238855,1,.191208,.191208,.191208]},{ColorSpace:"Lab",Name:"erdc_iceFire_H",RGBPoints:[-1,405432e-12,0,590122e-11,-.87451,0,.120401,.302675,-.74902,0,.216583,.524574,-.623529,.0552475,.345025,.6595,-.498039,.128047,.492588,.720288,-.372549,.188955,.641309,.792092,-.247059,.327673,.784935,.873434,-.121569,.60824,.892164,.935547,.00392157,.881371,.912178,.818099,.129412,.951407,.835621,.449279,.254902,.904481,.690489,0,.380392,.85407,.510864,0,.505882,.777093,.33018,88199e-8,.631373,.672862,.139087,.00269398,.756863,.508815,0,0,.882353,.299417,366289e-9,547829e-9,1,.0157519,.00332021,455569e-13]},{ColorSpace:"Lab",Name:"erdc_iceFire_L",RGBPoints:[-1,.870485,.913768,.832905,-.87451,.586919,.887865,.934003,-.74902,.31583,.776442,.867858,-.623529,.18302,.632034,.787722,-.498039,.117909,.484134,.713825,-.372549,.0507239,.335979,.654741,-.247059,0,.209874,.511832,-.121569,0,.114689,.28935,.00392157,.0157519,.00332021,455569e-13,.129412,.312914,0,0,.254902,.520865,0,0,.380392,.680105,.15255,.0025996,.505882,.785109,.339479,797922e-9,.631373,.857354,.522494,0,.756863,.910974,.699774,0,.882353,.951921,.842817,.478545,1,.881371,.912178,.818099]},{ColorSpace:"RGB",Name:"hsv",RGBPoints:[-1,1,0,0,-.666666,1,0,1,-.333333,0,0,1,0,0,1,1,.33333,0,1,0,.66666,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"hue_L60",RGBPoints:[-1,.964784,.400592,.349549,-.87451,.964915,.372498,.53785,-.74902,.892353,.401039,.759569,-.623529,.79263,.446956,.903017,-.498039,.682208,.49954,.966673,-.372549,.56392,.553082,.968836,-.247059,.442031,.606396,.901601,-.121569,.305499,.65701,.765784,.00392157,.197251,.687914,.620914,.129412,.193882,.701887,.472654,.254902,.249866,.706123,.320005,.380392,.35132,.697417,.202919,.505882,.498097,.669467,.125232,.631373,.637477,.626239,.107431,.756863,.762115,.56872,.155812,.882353,.889434,.481116,.240445,1,.964784,.400592,.349549]},{IndexedColors:[0,0,0,.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,.6509803921568628,.3372549019607843,.1568627450980392],Name:"Spectrum",NanColor:[.6509803921568628,.3372549019607843,.1568627450980392]},{IndexedColors:[.4745098039215686,.09019607843137255,.09019607843137255,.7098039215686275,.00392156862745098,.00392156862745098,.9372549019607843,.2784313725490196,.09803921568627451,.9764705882352941,.5137254901960784,.1411764705882353,1,.7058823529411765,0,1,.8980392156862745,.02352941176470588],Name:"Warm",NanColor:[1,.8980392156862745,.02352941176470588]},{IndexedColors:[.4588235294117647,.6941176470588235,.00392156862745098,.3450980392156863,.5019607843137255,.1607843137254902,.3137254901960784,.8431372549019608,.7490196078431373,.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.6039215686274509,.407843137254902,1,.3725490196078431,.2,.5019607843137255],Name:"Cool",NanColor:[.3725490196078431,.2,.5019607843137255]},{IndexedColors:[.2313725490196079,.407843137254902,.6705882352941176,.1098039215686274,.5843137254901961,.803921568627451,.3058823529411765,.8509803921568627,.9176470588235294,.4509803921568628,.6039215686274509,.8352941176470589,.2588235294117647,.2392156862745098,.6627450980392157,.3137254901960784,.3294117647058823,.5294117647058824,.06274509803921569,.1647058823529412,.3215686274509804],Name:"Blues",NanColor:[.06274509803921569,.1647058823529412,.3215686274509804]},{IndexedColors:[.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.4,.2431372549019608,.7176470588235294,.6352941176470588,.3294117647058823,.8117647058823529,.8705882352941177,.3803921568627451,.807843137254902,.8627450980392157,.3803921568627451,.5843137254901961,.2392156862745098,.06274509803921569,.3215686274509804],Name:"Wild Flower",NanColor:[.2392156862745098,.06274509803921569,.3215686274509804]},{IndexedColors:[.396078431372549,.4862745098039216,.2156862745098039,.4588235294117647,.6941176470588235,.00392156862745098,.6980392156862745,.7294117647058823,.1882352941176471,1,.8980392156862745,.02352941176470588,1,.7058823529411765,0,.9764705882352941,.5137254901960784,.1411764705882353],Name:"Citrus",NanColor:[.9764705882352941,.5137254901960784,.1411764705882353]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (11)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (10)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (9)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (8)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (7)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (6)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.9686274509803922,.9686274509803922,.9686274509803922,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (5)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (4)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9450980392156862,.6392156862745098,.2509803921568627,.9686274509803922,.9686274509803922,.9686274509803922,.6,.5568627450980392,.7647058823529411],Name:"Brewer Diverging Purple-Orange (3)",NanColor:[.6,.5568627450980392,.7647058823529411]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (11)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (10)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (9)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (8)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (7)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (6)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,1,1,.7490196078431373,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (5)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (4)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.9882352941176471,.5529411764705883,.3490196078431372,1,1,.7490196078431373,.6,.8352941176470589,.5803921568627451],Name:"Brewer Diverging Spectral (3)",NanColor:[.6,.8352941176470589,.5803921568627451]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (11)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (10)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (9)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (8)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (7)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (6)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.9607843137254902,.9607843137254902,.9607843137254902,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (5)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (4)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.8470588235294118,.7019607843137254,.396078431372549,.9607843137254902,.9607843137254902,.9607843137254902,.3529411764705883,.7058823529411765,.6745098039215687],Name:"Brewer Diverging Brown-Blue-Green (3)",NanColor:[.3529411764705883,.7058823529411765,.6745098039215687]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.4274509803921568,.1725490196078431,0,.2666666666666667,.1058823529411765],Name:"Brewer Sequential Blue-Green (9)",NanColor:[0,.2666666666666667,.1058823529411765]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (8)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.8,.9254901960784314,.9019607843137255,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (7)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (6)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (5)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1372549019607843,.5450980392156862,.2705882352941176],Name:"Brewer Sequential Blue-Green (4)",NanColor:[.1372549019607843,.5450980392156862,.2705882352941176]},{IndexedColors:[.8980392156862745,.9607843137254902,.9764705882352941,.6,.8470588235294118,.788235294117647,.1725490196078431,.6352941176470588,.3725490196078431],Name:"Brewer Sequential Blue-Green (3)",NanColor:[.1725490196078431,.6352941176470588,.3725490196078431]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.6,.203921568627451,.01568627450980392,.4,.1450980392156863,.02352941176470588],Name:"Brewer Sequential Yellow-Orange-Brown (9)",NanColor:[.4,.1450980392156863,.02352941176470588]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (8)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (7)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (6)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (5)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8,.2980392156862745,.00784313725490196],Name:"Brewer Sequential Yellow-Orange-Brown (4)",NanColor:[.8,.2980392156862745,.00784313725490196]},{IndexedColors:[1,.9686274509803922,.7372549019607844,.996078431372549,.7686274509803922,.3098039215686275,.8509803921568627,.3725490196078431,.05490196078431372],Name:"Brewer Sequential Yellow-Orange-Brown (3)",NanColor:[.8509803921568627,.3725490196078431,.05490196078431372]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.5058823529411764,.05882352941176471,.4862745098039216,.3019607843137255,0,.2941176470588235],Name:"Brewer Sequential Blue-Purple (9)",NanColor:[.3019607843137255,0,.2941176470588235]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (8)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (7)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (6)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (5)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.2549019607843137,.615686274509804],Name:"Brewer Sequential Blue-Purple (4)",NanColor:[.5333333333333333,.2549019607843137,.615686274509804]},{IndexedColors:[.8784313725490196,.9254901960784314,.9568627450980393,.6196078431372549,.7372549019607844,.8549019607843137,.5333333333333333,.3372549019607843,.6549019607843137],Name:"Brewer Sequential Blue-Purple (3)",NanColor:[.5333333333333333,.3372549019607843,.6549019607843137]},{IndexedColors:[.4980392156862745,.788235294117647,.4980392156862745,.7450980392156863,.6823529411764706,.8313725490196079,.9921568627450981,.7529411764705882,.5254901960784314,1,1,.6,.2196078431372549,.4235294117647059,.6901960784313725,.9411764705882353,.00784313725490196,.4980392156862745,.7490196078431373,.3568627450980392,.09019607843137255,.4,.4,.4],Name:"Brewer Qualitative Accent",NanColor:[.4,.4,.4]},{IndexedColors:[.1058823529411765,.6196078431372549,.4666666666666667,.8509803921568627,.3725490196078431,.00784313725490196,.4588235294117647,.4392156862745098,.7019607843137254,.9058823529411765,.1607843137254902,.5411764705882353,.4,.6509803921568628,.1176470588235294,.9019607843137255,.6705882352941176,.00784313725490196,.6509803921568628,.4627450980392157,.1137254901960784,.4,.4,.4],Name:"Brewer Qualitative Dark2",NanColor:[.4,.4,.4]},{IndexedColors:[.4,.7607843137254902,.6470588235294118,.9882352941176471,.5529411764705883,.3843137254901961,.5529411764705883,.6274509803921569,.796078431372549,.9058823529411765,.5411764705882353,.7647058823529411,.6509803921568628,.8470588235294118,.3294117647058823,1,.8509803921568627,.1843137254901961,.8980392156862745,.7686274509803922,.5803921568627451,.7019607843137254,.7019607843137254,.7019607843137254],Name:"Brewer Qualitative Set2",NanColor:[.7019607843137254,.7019607843137254,.7019607843137254]},{IndexedColors:[.7019607843137254,.8862745098039215,.803921568627451,.9921568627450981,.803921568627451,.6745098039215687,.796078431372549,.8352941176470589,.9098039215686274,.9568627450980393,.792156862745098,.8941176470588236,.9019607843137255,.9607843137254902,.788235294117647,1,.9490196078431372,.6823529411764706,.9450980392156862,.8862745098039215,.8,.8,.8,.8],Name:"Brewer Qualitative Pastel2",NanColor:[.8,.8,.8]},{IndexedColors:[.984313725490196,.7058823529411765,.6823529411764706,.7019607843137254,.803921568627451,.8901960784313725,.8,.9215686274509803,.7725490196078432,.8705882352941177,.796078431372549,.8941176470588236,.996078431372549,.8509803921568627,.6509803921568628,1,1,.8,.8980392156862745,.8470588235294118,.7411764705882353,.9921568627450981,.8549019607843137,.9254901960784314,.9490196078431372,.9490196078431372,.9490196078431372],Name:"Brewer Qualitative Pastel1",NanColor:[.9490196078431372,.9490196078431372,.9490196078431372]},{IndexedColors:[.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,1,1,.2,.6509803921568628,.3372549019607843,.1568627450980392,.9686274509803922,.5058823529411764,.7490196078431373,.6,.6,.6],Name:"Brewer Qualitative Set1",NanColor:[.6,.6,.6]},{IndexedColors:[.6509803921568628,.807843137254902,.8901960784313725,.1215686274509804,.4705882352941176,.7058823529411765,.6980392156862745,.8745098039215686,.5411764705882353,.2,.6274509803921569,.1725490196078431,.984313725490196,.6039215686274509,.6,.8901960784313725,.1019607843137255,.1098039215686274,.9921568627450981,.7490196078431373,.4352941176470588,1,.4980392156862745,0,.792156862745098,.6980392156862745,.8392156862745098,.4156862745098039,.2392156862745098,.6039215686274509,1,1,.6],Name:"Brewer Qualitative Paired",NanColor:[1,1,.6]},{IndexedColors:[.5529411764705883,.8274509803921568,.7803921568627451,1,1,.7019607843137254,.7450980392156863,.7294117647058823,.8549019607843137,.984313725490196,.5019607843137255,.4470588235294118,.5019607843137255,.6941176470588235,.8274509803921568,.9921568627450981,.7058823529411765,.3843137254901961,.7019607843137254,.8705882352941177,.4117647058823529,.9882352941176471,.803921568627451,.8980392156862745,.8509803921568627,.8509803921568627,.8509803921568627,.7372549019607844,.5019607843137255,.7411764705882353,.8,.9215686274509803,.7725490196078432,1,.9294117647058824,.4352941176470588],Name:"Brewer Qualitative Set3",NanColor:[1,.9294117647058824,.4352941176470588]},{IndexedColors:[1,0,0,1,.862745,0,0,.695201,0],Name:"Traffic Lights",NanColor:[.803922,0,.803922]},{IndexedColors:[.908659,.604013,.581857,1,.862745,0,0,.695201,0],Name:"Traffic Lights For Deuteranopes",NanColor:[.803922,0,.803922]},{IndexedColors:[.4196078431372549,0,.07058823529411765,.9019607843137255,.9411764705882353,.0196078431372549,.01568627450980392,.6196078431372549,.00784313725490196],Name:"Traffic Lights For Deuteranopes 2",NanColor:[.803922,0,.803922]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Muted Blue-Green",NanColor:[.25,0,0],RGBPoints:[0,.109804,.27451,.301961,.02,.129412,.309804,.341176,.05,.14902,.341176,.380392,.1,.188235,.403922,.458824,.15,.227451,.447059,.521569,.2,.290196,.494118,.588235,.25,.368627,.552941,.670588,.3,.458824,.619608,.74902,.35,.588235,.713725,.85098,.4,.72549,.815686,.941176,.45,.831373,.882353,.980392,.475,.909804,.933333,1,.5,.980392,.984314,1,.5,.996078,1,.94902,.5,1,1,.980392,.5,.980392,.984314,1,.525,.972549,.988235,.890196,.55,.917647,.960784,.835294,.6,.835294,.921569,.772549,.65,.768627,.901961,.737255,.7,.670588,.831373,.654902,.75,.576471,.760784,.584314,.8,.498039,.678431,.521569,.85,.392157,.560784,.427451,.9,.294118,.45098,.333333,.95,.211765,.34902,.254902,1,.152941,.278431,.196078]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Green-Blue Asymmetric Divergent (62Blbc)",NanColor:[.25,0,0],RGBPoints:[0,.121569,.2,.145098,.05,.196078,.301961,.223529,.1,.258824,.4,.278431,.2,.341176,.54902,.341176,.25,.419608,.619608,.376471,.3,.545098,.701961,.392157,.35,.643137,.780392,.403922,.4,.729412,.819608,.45098,.45,.811765,.870588,.521569,.5,.898039,.909804,.564706,.55,.941176,.92549,.686275,.6,.960784,.94902,.776471,.64,1,1,1,.65,.890196,.988235,.972549,.7,.721569,.894118,.901961,.75,.631373,.823529,.839216,.8,.517647,.662745,.701961,.85,.384314,.494118,.54902,.9,.298039,.360784,.45098,.95,.223529,.25098,.34902,.99,.156863,.172549,.25098,1,.137255,.137255,.188235]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Asymmtrical Earth Tones (6_21b)",NanColor:[.25,0,0],RGBPoints:[0,.141176,.14902,.2,.05,.215686,.258824,.321569,.1,.243137,.368627,.380392,.15,.27451,.439216,.4,.2,.32549,.501961,.384314,.25,.403922,.6,.419608,.3,.486275,.701961,.454902,.35,.556863,.74902,.494118,.4,.670588,.8,.545098,.5,.854902,.901961,.631373,.55,.92549,.941176,.694118,.6,.960784,.94902,.776471,.65,.988235,.968627,.909804,.7,.839216,.815686,.772549,.75,.701961,.662745,.615686,.8,.6,.529412,.478431,.85,.501961,.403922,.360784,.9,.439216,.313725,.290196,1,.301961,.164706,.176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Yellow 15",NanColor:[.25,0,0],RGBPoints:[0,1,1,.988235,.002,1,1,.988235,.05,.984314,.988235,.843137,.1,.988235,.988235,.741176,.15,.980392,.968627,.654902,.2,.980392,.945098,.576471,.25,.968627,.905882,.486275,.3,.968627,.862745,.388235,.35,.960784,.803922,.286275,.4,.94902,.741176,.219608,.45,.941176,.678431,.14902,.5,.929412,.607843,.094118,.55,.921569,.545098,.054902,.6,.909804,.486275,.035294,.65,.890196,.411765,.019608,.7,.8,.305882,0,.75,.760784,.239216,0,.8,.678431,.180392,.011765,.85,.6,.121569,.023529,.9,.501961,.054902,.031373,.95,.4,.039216,.058824,1,.301961,.047059,.090196]},{ColorSpace:"Diverging",Name:"Magma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002258,.001295,.018331,.007843,.003279,.002305,.023708,.011765,.004512,.00349,.029965,.015686,.00595,.004843,.03713,.019608,.007588,.006356,.044973,.023529,.009426,.008022,.052844,.027451,.011465,.009828,.06075,.031373,.013708,.011771,.068667,.035294,.016156,.01384,.076603,.039216,.018815,.016026,.084584,.043137,.021692,.01832,.09261,.047059,.024792,.020715,.100676,.05098,.028123,.023201,.108787,.054902,.031696,.025765,.116965,.058824,.03552,.028397,.125209,.062745,.039608,.03109,.133515,.066667,.04383,.03383,.141886,.070588,.048062,.036607,.150327,.07451,.05232,.039407,.158841,.078431,.056615,.04216,.167446,.082353,.060949,.044794,.176129,.086275,.06533,.047318,.184892,.090196,.069764,.049726,.193735,.094118,.074257,.052017,.20266,.098039,.078815,.054184,.211667,.101961,.083446,.056225,.220755,.105882,.088155,.058133,.229922,.109804,.092949,.059904,.239164,.113725,.097833,.061531,.248477,.117647,.102815,.06301,.257854,.121569,.107899,.064335,.267289,.12549,.113094,.065492,.276784,.129412,.118405,.066479,.286321,.133333,.123833,.067295,.295879,.137255,.12938,.067935,.305443,.141176,.135053,.068391,.315,.145098,.140858,.068654,.324538,.14902,.146785,.068738,.334011,.152941,.152839,.068637,.343404,.156863,.159018,.068354,.352688,.160784,.165308,.067911,.361816,.164706,.171713,.067305,.370771,.168627,.178212,.066576,.379497,.172549,.184801,.065732,.387973,.176471,.19146,.064818,.396152,.180392,.198177,.063862,.404009,.184314,.204935,.062907,.411514,.188235,.211718,.061992,.418647,.192157,.218512,.061158,.425392,.196078,.225302,.060445,.431742,.2,.232077,.059889,.437695,.203922,.238826,.059517,.443256,.207843,.245543,.059352,.448436,.211765,.25222,.059415,.453248,.215686,.258857,.059706,.45771,.219608,.265447,.060237,.46184,.223529,.271994,.060994,.46566,.227451,.278493,.061978,.46919,.231373,.284951,.063168,.472451,.235294,.291366,.064553,.475462,.239216,.29774,.066117,.478243,.243137,.304081,.067835,.480812,.247059,.310382,.069702,.483186,.25098,.316654,.07169,.48538,.254902,.322899,.073782,.487408,.258824,.329114,.075972,.489287,.262745,.335308,.078236,.491024,.266667,.341482,.080564,.492631,.270588,.347636,.082946,.494121,.27451,.353773,.085373,.495501,.278431,.359898,.087831,.496778,.282353,.366012,.090314,.49796,.286275,.372116,.092816,.499053,.290196,.378211,.095332,.500067,.294118,.384299,.097855,.501002,.298039,.390384,.100379,.501864,.301961,.396467,.102902,.502658,.305882,.402548,.10542,.503386,.309804,.408629,.10793,.504052,.313725,.414709,.110431,.504662,.317647,.420791,.11292,.505215,.321569,.426877,.115395,.505714,.32549,.432967,.117855,.50616,.329412,.439062,.120298,.506555,.333333,.445163,.122724,.506901,.337255,.451271,.125132,.507198,.341176,.457386,.127522,.507448,.345098,.463508,.129893,.507652,.34902,.46964,.132245,.507809,.352941,.47578,.134577,.507921,.356863,.481929,.136891,.507989,.360784,.488088,.139186,.508011,.364706,.494258,.141462,.507988,.368627,.500438,.143719,.50792,.372549,.506629,.145958,.507806,.376471,.512831,.148179,.507648,.380392,.519045,.150383,.507443,.384314,.52527,.152569,.507192,.388235,.531507,.154739,.506895,.392157,.537755,.156894,.506551,.396078,.544015,.159033,.506159,.4,.550287,.161158,.505719,.403922,.556571,.163269,.50523,.407843,.562866,.165368,.504692,.411765,.569172,.167454,.504105,.415686,.57549,.16953,.503466,.419608,.581819,.171596,.502777,.423529,.588158,.173652,.502035,.427451,.594508,.175701,.501241,.431373,.600868,.177743,.500394,.435294,.607238,.179779,.499492,.439216,.613617,.181811,.498536,.443137,.620005,.18384,.497524,.447059,.626401,.185867,.496456,.45098,.632805,.187893,.495332,.454902,.639216,.189921,.49415,.458824,.645633,.191952,.49291,.462745,.652056,.193986,.491611,.466667,.658483,.196027,.490253,.470588,.664915,.198075,.488836,.47451,.671349,.200133,.487358,.478431,.677786,.202203,.485819,.482353,.684224,.204286,.484219,.486275,.690661,.206384,.482558,.490196,.697098,.208501,.480835,.494118,.703532,.210638,.479049,.498039,.709962,.212797,.477201,.501961,.716387,.214982,.47529,.505882,.722805,.217194,.473316,.509804,.729216,.219437,.471279,.513725,.735616,.221713,.46918,.517647,.742004,.224025,.467018,.521569,.748378,.226377,.464794,.52549,.754737,.228772,.462509,.529412,.761077,.231214,.460162,.533333,.767398,.233705,.457755,.537255,.773695,.236249,.455289,.541176,.779968,.238851,.452765,.545098,.786212,.241514,.450184,.54902,.792427,.244242,.447543,.552941,.798608,.24704,.444848,.556863,.804752,.249911,.442102,.560784,.810855,.252861,.439305,.564706,.816914,.255895,.436461,.568627,.822926,.259016,.433573,.572549,.828886,.262229,.430644,.576471,.834791,.26554,.427671,.580392,.840636,.268953,.424666,.584314,.846416,.272473,.421631,.588235,.852126,.276106,.418573,.592157,.857763,.279857,.415496,.596078,.86332,.283729,.412403,.6,.868793,.287728,.409303,.603922,.874176,.291859,.406205,.607843,.879464,.296125,.403118,.611765,.884651,.30053,.400047,.615686,.889731,.305079,.397002,.619608,.8947,.309773,.393995,.623529,.899552,.314616,.391037,.627451,.904281,.31961,.388137,.631373,.908884,.324755,.385308,.635294,.913354,.330052,.382563,.639216,.917689,.3355,.379915,.643137,.921884,.341098,.377376,.647059,.925937,.346844,.374959,.65098,.929845,.352734,.372677,.654902,.933606,.358764,.370541,.658824,.937221,.364929,.368567,.662745,.940687,.371224,.366762,.666667,.944006,.377643,.365136,.670588,.94718,.384178,.363701,.67451,.95021,.39082,.362468,.678431,.953099,.397563,.361438,.682353,.955849,.4044,.360619,.686275,.958464,.411324,.360014,.690196,.960949,.418323,.35963,.694118,.96331,.42539,.359469,.698039,.965549,.432519,.359529,.701961,.967671,.439703,.35981,.705882,.96968,.446936,.360311,.709804,.971582,.45421,.36103,.713725,.973381,.46152,.361965,.717647,.975082,.468861,.363111,.721569,.97669,.476226,.364466,.72549,.97821,.483612,.366025,.729412,.979645,.491014,.367783,.733333,.981,.498428,.369734,.737255,.982279,.505851,.371874,.741176,.983485,.51328,.374198,.745098,.984622,.520713,.376698,.74902,.985693,.528148,.379371,.752941,.9867,.535582,.38221,.756863,.987646,.543015,.38521,.760784,.988533,.550446,.388365,.764706,.989363,.557873,.391671,.768627,.990138,.565296,.395122,.772549,.990871,.572706,.398714,.776471,.991558,.580107,.402441,.780392,.992196,.587502,.406299,.784314,.992785,.594891,.410283,.788235,.993326,.602275,.41439,.792157,.993834,.609644,.418613,.796078,.994309,.616999,.42295,.8,.994738,.62435,.427397,.803922,.995122,.631696,.431951,.807843,.99548,.639027,.436607,.811765,.99581,.646344,.441361,.815686,.996096,.653659,.446213,.819608,.996341,.660969,.45116,.823529,.99658,.668256,.456192,.827451,.996775,.675541,.461314,.831373,.996925,.682828,.466526,.835294,.997077,.690088,.471811,.839216,.997186,.697349,.477182,.843137,.997254,.704611,.482635,.847059,.997325,.711848,.488154,.85098,.997351,.719089,.493755,.854902,.997351,.726324,.499428,.858824,.997341,.733545,.505167,.862745,.997285,.740772,.510983,.866667,.997228,.747981,.516859,.870588,.997138,.75519,.522806,.87451,.997019,.762398,.528821,.878431,.996898,.769591,.534892,.882353,.996727,.776795,.541039,.886275,.996571,.783977,.547233,.890196,.996369,.791167,.553499,.894118,.996162,.798348,.55982,.898039,.995932,.805527,.566202,.901961,.99568,.812706,.572645,.905882,.995424,.819875,.57914,.909804,.995131,.827052,.585701,.913725,.994851,.834213,.592307,.917647,.994524,.841387,.598983,.921569,.994222,.84854,.605696,.92549,.993866,.855711,.612482,.929412,.993545,.862859,.619299,.933333,.99317,.870024,.626189,.937255,.992831,.877168,.633109,.941176,.99244,.88433,.640099,.945098,.992089,.89147,.647116,.94902,.991688,.898627,.654202,.952941,.991332,.905763,.661309,.956863,.99093,.912915,.668481,.960784,.99057,.920049,.675675,.964706,.990175,.927196,.682926,.968627,.989815,.934329,.690198,.972549,.989434,.94147,.697519,.976471,.989077,.948604,.704863,.980392,.988717,.955742,.712242,.984314,.988367,.962878,.719649,.988235,.988033,.970012,.727077,.992157,.987691,.977154,.734536,.996078,.987387,.984288,.742002,1,.987053,.991438,.749504]},{ColorSpace:"Diverging",Name:"Inferno (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002267,.00127,.01857,.007843,.003299,.002249,.024239,.011765,.004547,.003392,.030909,.015686,.006006,.004692,.038558,.019608,.007676,.006136,.046836,.023529,.009561,.007713,.055143,.027451,.011663,.009417,.06346,.031373,.013995,.011225,.071862,.035294,.016561,.013136,.080282,.039216,.019373,.015133,.088767,.043137,.022447,.017199,.097327,.047059,.025793,.019331,.10593,.05098,.029432,.021503,.114621,.054902,.033385,.023702,.123397,.058824,.037668,.025921,.132232,.062745,.042253,.028139,.141141,.066667,.046915,.030324,.150164,.070588,.051644,.032474,.159254,.07451,.056449,.034569,.168414,.078431,.06134,.03659,.177642,.082353,.066331,.038504,.186962,.086275,.071429,.040294,.196354,.090196,.076637,.041905,.205799,.094118,.081962,.043328,.215289,.098039,.087411,.044556,.224813,.101961,.09299,.045583,.234358,.105882,.098702,.046402,.243904,.109804,.104551,.047008,.25343,.113725,.110536,.047399,.262912,.117647,.116656,.047574,.272321,.121569,.122908,.047536,.281624,.12549,.129285,.047293,.290788,.129412,.135778,.046856,.299776,.133333,.142378,.046242,.308553,.137255,.149073,.045468,.317085,.141176,.15585,.044559,.325338,.145098,.162689,.043554,.333277,.14902,.169575,.042489,.340874,.152941,.176493,.041402,.348111,.156863,.183429,.040329,.354971,.160784,.190367,.039309,.361447,.164706,.197297,.0384,.367535,.168627,.204209,.037632,.373238,.172549,.211095,.03703,.378563,.176471,.217949,.036615,.383522,.180392,.224763,.036405,.388129,.184314,.231538,.036405,.3924,.188235,.238273,.036621,.396353,.192157,.244967,.037055,.400007,.196078,.25162,.037705,.403378,.2,.258234,.038571,.406485,.203922,.26481,.039647,.409345,.207843,.271347,.040922,.411976,.211765,.27785,.042353,.414392,.215686,.284321,.043933,.416608,.219608,.290763,.045644,.418637,.223529,.297178,.04747,.420491,.227451,.303568,.049396,.422182,.231373,.309935,.051407,.423721,.235294,.316282,.05349,.425116,.239216,.32261,.055634,.426377,.243137,.328921,.057827,.427511,.247059,.335217,.06006,.428524,.25098,.3415,.062325,.429425,.254902,.347771,.064616,.430217,.258824,.354032,.066925,.430906,.262745,.360284,.069247,.431497,.266667,.366529,.071579,.431994,.270588,.372768,.073915,.4324,.27451,.379001,.076253,.432719,.278431,.385228,.078591,.432955,.282353,.391453,.080927,.433109,.286275,.397674,.083257,.433183,.290196,.403894,.08558,.433179,.294118,.410113,.087896,.433098,.298039,.416331,.090203,.432943,.301961,.422549,.092501,.432714,.305882,.428768,.09479,.432412,.309804,.434987,.097069,.432039,.313725,.441207,.099338,.431594,.317647,.447428,.101597,.43108,.321569,.453651,.103848,.430498,.32549,.459875,.106089,.429846,.329412,.4661,.108322,.429125,.333333,.472328,.110547,.428334,.337255,.478558,.112764,.427475,.341176,.484789,.114974,.426548,.345098,.491022,.117179,.425552,.34902,.497257,.119379,.424488,.352941,.503493,.121575,.423356,.356863,.50973,.123769,.422156,.360784,.515967,.12596,.420887,.364706,.522206,.12815,.419549,.368627,.528444,.130341,.418142,.372549,.534683,.132534,.416667,.376471,.54092,.134729,.415123,.380392,.547157,.136929,.413511,.384314,.553392,.139134,.411829,.388235,.559624,.141346,.410078,.392157,.565854,.143567,.408258,.396078,.572081,.145797,.406369,.4,.578304,.148039,.404411,.403922,.584521,.150294,.402385,.407843,.590734,.152563,.40029,.411765,.59694,.154848,.398125,.415686,.603139,.157151,.395891,.419608,.60933,.159474,.393589,.423529,.615513,.161817,.391219,.427451,.621685,.164184,.388781,.431373,.627847,.166575,.386276,.435294,.633998,.168992,.383704,.439216,.640135,.171438,.381065,.443137,.64626,.173914,.378359,.447059,.652369,.176421,.375586,.45098,.658463,.178962,.372748,.454902,.66454,.181539,.369846,.458824,.670599,.184153,.366879,.462745,.676638,.186807,.363849,.466667,.682656,.189501,.360757,.470588,.688653,.192239,.357603,.47451,.694627,.195021,.354388,.478431,.700576,.197851,.351113,.482353,.7065,.200728,.347777,.486275,.712396,.203656,.344383,.490196,.718264,.206636,.340931,.494118,.724103,.20967,.337424,.498039,.729909,.212759,.333861,.501961,.735683,.215906,.330245,.505882,.741423,.219112,.326576,.509804,.747127,.222378,.322856,.513725,.752794,.225706,.319085,.517647,.758422,.229097,.315266,.521569,.76401,.232554,.311399,.52549,.769556,.236077,.307485,.529412,.775059,.239667,.303526,.533333,.780517,.243327,.299523,.537255,.785929,.247056,.295477,.541176,.791293,.250856,.29139,.545098,.796607,.254728,.287264,.54902,.801871,.258674,.283099,.552941,.807082,.262692,.278898,.556863,.812239,.266786,.274661,.560784,.817341,.270954,.27039,.564706,.822386,.275197,.266085,.568627,.827372,.279517,.26175,.572549,.832299,.283913,.257383,.576471,.837165,.288385,.252988,.580392,.841969,.292933,.248564,.584314,.846709,.297559,.244113,.588235,.851384,.30226,.239636,.592157,.855992,.307038,.235133,.596078,.860533,.311892,.230606,.6,.865006,.316822,.226055,.603922,.869409,.321827,.221482,.607843,.873741,.326906,.216886,.611765,.878001,.33206,.212268,.615686,.882188,.337287,.207628,.619608,.886302,.342586,.202968,.623529,.890341,.347957,.198286,.627451,.894305,.353399,.193584,.631373,.898192,.358911,.18886,.635294,.902003,.364492,.184116,.639216,.905735,.37014,.17935,.643137,.90939,.375856,.174563,.647059,.912966,.381636,.169755,.65098,.916462,.387481,.164924,.654902,.919879,.393389,.16007,.658824,.923215,.399359,.155193,.662745,.92647,.405389,.150292,.666667,.929644,.411479,.145367,.670588,.932737,.417627,.140417,.67451,.935747,.423831,.13544,.678431,.938675,.430091,.130438,.682353,.941521,.436405,.125409,.686275,.944285,.442772,.120354,.690196,.946965,.449191,.115272,.694118,.949562,.45566,.110164,.698039,.952075,.462178,.105031,.701961,.954506,.468744,.099874,.705882,.956852,.475356,.094695,.709804,.959114,.482014,.089499,.713725,.961293,.488716,.084289,.717647,.963387,.495462,.079073,.721569,.965397,.502249,.073859,.72549,.967322,.509078,.068659,.729412,.969163,.515946,.063488,.733333,.970919,.522853,.058367,.737255,.97259,.529798,.053324,.741176,.974176,.53678,.048392,.745098,.975677,.543798,.043618,.74902,.977092,.55085,.03905,.752941,.978422,.557937,.034931,.756863,.979666,.565057,.031409,.760784,.980824,.572209,.028508,.764706,.981895,.579392,.02625,.768627,.982881,.586606,.024661,.772549,.983779,.593849,.02377,.776471,.984591,.601122,.023606,.780392,.985315,.608422,.024202,.784314,.985952,.61575,.025592,.788235,.986502,.623105,.027814,.792157,.986964,.630485,.030908,.796078,.987337,.63789,.034916,.8,.987622,.64532,.039886,.803922,.987819,.652773,.045581,.807843,.987926,.66025,.05175,.811765,.987945,.667748,.058329,.815686,.987874,.675267,.065257,.819608,.987714,.682807,.072489,.823529,.987464,.690366,.07999,.827451,.987124,.697944,.087731,.831373,.986694,.70554,.095694,.835294,.986175,.713153,.103863,.839216,.985566,.720782,.112229,.843137,.984865,.728427,.120785,.847059,.984075,.736087,.129527,.85098,.983196,.743758,.138453,.854902,.982228,.751442,.147565,.858824,.981173,.759135,.156863,.862745,.980032,.766837,.166353,.866667,.978806,.774545,.176037,.870588,.977497,.782258,.185923,.87451,.976108,.789974,.196018,.878431,.974638,.797692,.206332,.882353,.973088,.805409,.216877,.886275,.971468,.813122,.227658,.890196,.969783,.820825,.238686,.894118,.968041,.828515,.249972,.898039,.966243,.836191,.261534,.901961,.964394,.843848,.273391,.905882,.962517,.851476,.285546,.909804,.960626,.859069,.29801,.913725,.95872,.866624,.31082,.917647,.956834,.874129,.323974,.921569,.954997,.881569,.337475,.92549,.953215,.888942,.351369,.929412,.951546,.896226,.365627,.933333,.950018,.903409,.380271,.937255,.948683,.910473,.395289,.941176,.947594,.917399,.410665,.945098,.946809,.924168,.426373,.94902,.946392,.930761,.442367,.952941,.946403,.937159,.458592,.956863,.946903,.943348,.47497,.960784,.947937,.949318,.491426,.964706,.949545,.955063,.50786,.968627,.95174,.960587,.524203,.972549,.954529,.965896,.540361,.976471,.957896,.971003,.556275,.980392,.961812,.975924,.571925,.984314,.966249,.980678,.587206,.988235,.971162,.985282,.602154,.992157,.976511,.989753,.61676,.996078,.982257,.994109,.631017,1,.988362,.998364,.644924]},{ColorSpace:"Diverging",Name:"Plasma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.050383,.029803,.527975,.003922,.063536,.028426,.533124,.007843,.075353,.027206,.538007,.011765,.086222,.026125,.542658,.015686,.096379,.025165,.547103,.019608,.10598,.024309,.551368,.023529,.115124,.023556,.555468,.027451,.123903,.022878,.559423,.031373,.132381,.022258,.56325,.035294,.140603,.021687,.566959,.039216,.148607,.021154,.570562,.043137,.156421,.020651,.574065,.047059,.16407,.020171,.577478,.05098,.171574,.019706,.580806,.054902,.17895,.019252,.584054,.058824,.186213,.018803,.587228,.062745,.193374,.018354,.59033,.066667,.200445,.017902,.593364,.070588,.207435,.017442,.596333,.07451,.21435,.016973,.599239,.078431,.221197,.016497,.602083,.082353,.227983,.016007,.604867,.086275,.234715,.015502,.607592,.090196,.241396,.014979,.610259,.094118,.248032,.014439,.612868,.098039,.254627,.013882,.615419,.101961,.261183,.013308,.617911,.105882,.267703,.012716,.620346,.109804,.274191,.012109,.622722,.113725,.280648,.011488,.625038,.117647,.287076,.010855,.627295,.121569,.293478,.010213,.62949,.12549,.299855,.009561,.631624,.129412,.30621,.008902,.633694,.133333,.312543,.008239,.6357,.137255,.318856,.007576,.63764,.141176,.32515,.006915,.639512,.145098,.331426,.006261,.641316,.14902,.337683,.005618,.643049,.152941,.343925,.004991,.64471,.156863,.35015,.004382,.646298,.160784,.356359,.003798,.64781,.164706,.362553,.003243,.649245,.168627,.368733,.002724,.650601,.172549,.374897,.002245,.651876,.176471,.381047,.001814,.653068,.180392,.387183,.001434,.654177,.184314,.393304,.001114,.655199,.188235,.399411,859e-6,.656133,.192157,.405503,678e-6,.656977,.196078,.41158,577e-6,.65773,.2,.417642,564e-6,.65839,.203922,.423689,646e-6,.658956,.207843,.429719,831e-6,.659425,.211765,.435734,.001127,.659797,.215686,.441732,.00154,.660069,.219608,.447714,.00208,.66024,.223529,.453677,.002755,.66031,.227451,.459623,.003574,.660277,.231373,.46555,.004545,.660139,.235294,.471457,.005678,.659897,.239216,.477344,.00698,.659549,.243137,.48321,.00846,.659095,.247059,.489055,.010127,.658534,.25098,.494877,.01199,.657865,.254902,.500678,.014055,.657088,.258824,.506454,.016333,.656202,.262745,.512206,.018833,.655209,.266667,.517933,.021563,.654109,.270588,.523633,.024532,.652901,.27451,.529306,.027747,.651586,.278431,.534952,.031217,.650165,.282353,.54057,.03495,.64864,.286275,.546157,.038954,.64701,.290196,.551715,.043136,.645277,.294118,.557243,.047331,.643443,.298039,.562738,.051545,.641509,.301961,.568201,.055778,.639477,.305882,.573632,.060028,.637349,.309804,.579029,.064296,.635126,.313725,.584391,.068579,.632812,.317647,.589719,.072878,.630408,.321569,.595011,.07719,.627917,.32549,.600266,.081516,.625342,.329412,.605485,.085854,.622686,.333333,.610667,.090204,.619951,.337255,.615812,.094564,.61714,.341176,.620919,.098934,.614257,.345098,.625987,.103312,.611305,.34902,.631017,.107699,.608287,.352941,.636008,.112092,.605205,.356863,.640959,.116492,.602065,.360784,.645872,.120898,.598867,.364706,.650746,.125309,.595617,.368627,.65558,.129725,.592317,.372549,.660374,.134144,.588971,.376471,.665129,.138566,.585582,.380392,.669845,.142992,.582154,.384314,.674522,.147419,.578688,.388235,.67916,.151848,.575189,.392157,.683758,.156278,.57166,.396078,.688318,.160709,.568103,.4,.69284,.165141,.564522,.403922,.697324,.169573,.560919,.407843,.701769,.174005,.557296,.411765,.706178,.178437,.553657,.415686,.710549,.182868,.550004,.419608,.714883,.187299,.546338,.423529,.719181,.191729,.542663,.427451,.723444,.196158,.538981,.431373,.72767,.200586,.535293,.435294,.731862,.205013,.531601,.439216,.736019,.209439,.527908,.443137,.740143,.213864,.524216,.447059,.744232,.218288,.520524,.45098,.748289,.222711,.516834,.454902,.752312,.227133,.513149,.458824,.756304,.231555,.509468,.462745,.760264,.235976,.505794,.466667,.764193,.240396,.502126,.470588,.76809,.244817,.498465,.47451,.771958,.249237,.494813,.478431,.775796,.253658,.491171,.482353,.779604,.258078,.487539,.486275,.783383,.2625,.483918,.490196,.787133,.266922,.480307,.494118,.790855,.271345,.476706,.498039,.794549,.27577,.473117,.501961,.798216,.280197,.469538,.505882,.801855,.284626,.465971,.509804,.805467,.289057,.462415,.513725,.809052,.293491,.45887,.517647,.812612,.297928,.455338,.521569,.816144,.302368,.451816,.52549,.819651,.306812,.448306,.529412,.823132,.311261,.444806,.533333,.826588,.315714,.441316,.537255,.830018,.320172,.437836,.541176,.833422,.324635,.434366,.545098,.836801,.329105,.430905,.54902,.840155,.33358,.427455,.552941,.843484,.338062,.424013,.556863,.846788,.342551,.420579,.560784,.850066,.347048,.417153,.564706,.853319,.351553,.413734,.568627,.856547,.356066,.410322,.572549,.85975,.360588,.406917,.576471,.862927,.365119,.403519,.580392,.866078,.36966,.400126,.584314,.869203,.374212,.396738,.588235,.872303,.378774,.393355,.592157,.875376,.383347,.389976,.596078,.878423,.387932,.3866,.6,.881443,.392529,.383229,.603922,.884436,.397139,.37986,.607843,.887402,.401762,.376494,.611765,.89034,.406398,.37313,.615686,.89325,.411048,.369768,.619608,.896131,.415712,.366407,.623529,.898984,.420392,.363047,.627451,.901807,.425087,.359688,.631373,.904601,.429797,.356329,.635294,.907365,.434524,.35297,.639216,.910098,.439268,.34961,.643137,.9128,.444029,.346251,.647059,.915471,.448807,.34289,.65098,.918109,.453603,.339529,.654902,.920714,.458417,.336166,.658824,.923287,.463251,.332801,.662745,.925825,.468103,.329435,.666667,.928329,.472975,.326067,.670588,.930798,.477867,.322697,.67451,.933232,.48278,.319325,.678431,.93563,.487712,.315952,.682353,.93799,.492667,.312575,.686275,.940313,.497642,.309197,.690196,.942598,.502639,.305816,.694118,.944844,.507658,.302433,.698039,.947051,.512699,.299049,.701961,.949217,.517763,.295662,.705882,.951344,.52285,.292275,.709804,.953428,.52796,.288883,.713725,.95547,.533093,.28549,.717647,.957469,.53825,.282096,.721569,.959424,.543431,.278701,.72549,.961336,.548636,.275305,.729412,.963203,.553865,.271909,.733333,.965024,.559118,.268513,.737255,.966798,.564396,.265118,.741176,.968526,.5697,.261721,.745098,.970205,.575028,.258325,.74902,.971835,.580382,.254931,.752941,.973416,.585761,.25154,.756863,.974947,.591165,.248151,.760784,.976428,.596595,.244767,.764706,.977856,.602051,.241387,.768627,.979233,.607532,.238013,.772549,.980556,.613039,.234646,.776471,.981826,.618572,.231287,.780392,.983041,.624131,.227937,.784314,.984199,.629718,.224595,.788235,.985301,.63533,.221265,.792157,.986345,.640969,.217948,.796078,.987332,.646633,.214648,.8,.98826,.652325,.211364,.803922,.989128,.658043,.2081,.807843,.989935,.663787,.204859,.811765,.990681,.669558,.201642,.815686,.991365,.675355,.198453,.819608,.991985,.681179,.195295,.823529,.992541,.68703,.19217,.827451,.993032,.692907,.189084,.831373,.993456,.69881,.186041,.835294,.993814,.704741,.183043,.839216,.994103,.710698,.180097,.843137,.994324,.716681,.177208,.847059,.994474,.722691,.174381,.85098,.994553,.728728,.171622,.854902,.994561,.734791,.168938,.858824,.994495,.74088,.166335,.862745,.994355,.746995,.163821,.866667,.994141,.753137,.161404,.870588,.993851,.759304,.159092,.87451,.993482,.765499,.156891,.878431,.993033,.77172,.154808,.882353,.992505,.777967,.152855,.886275,.991897,.784239,.151042,.890196,.991209,.790537,.149377,.894118,.990439,.796859,.14787,.898039,.989587,.803205,.146529,.901961,.988648,.809579,.145357,.905882,.987621,.815978,.144363,.909804,.986509,.822401,.143557,.913725,.985314,.828846,.142945,.917647,.984031,.835315,.142528,.921569,.982653,.841812,.142303,.92549,.98119,.848329,.142279,.929412,.979644,.854866,.142453,.933333,.977995,.861432,.142808,.937255,.976265,.868016,.143351,.941176,.974443,.874622,.144061,.945098,.97253,.88125,.144923,.94902,.970533,.887896,.145919,.952941,.968443,.894564,.147014,.956863,.966271,.901249,.14818,.960784,.964021,.90795,.14937,.964706,.961681,.914672,.15052,.968627,.959276,.921407,.151566,.972549,.956808,.928152,.152409,.976471,.954287,.934908,.152921,.980392,.951726,.941671,.152925,.984314,.949151,.948435,.152178,.988235,.946602,.95519,.150328,.992157,.944152,.961916,.146861,.996078,.941896,.96859,.140956,1,.940015,.975158,.131326]},{ColorSpace:"Diverging",Name:"Viridis (matplotlib)",NanColor:[1,0,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Eric Firing",RGBPoints:[0,.267004,.004874,.329415,.003922,.26851,.009605,.335427,.007843,.269944,.014625,.341379,.011765,.271305,.019942,.347269,.015686,.272594,.025563,.353093,.019608,.273809,.031497,.358853,.023529,.274952,.037752,.364543,.027451,.276022,.044167,.370164,.031373,.277018,.050344,.375715,.035294,.277941,.056324,.381191,.039216,.278791,.062145,.386592,.043137,.279566,.067836,.391917,.047059,.280267,.073417,.397163,.05098,.280894,.078907,.402329,.054902,.281446,.08432,.407414,.058824,.281924,.089666,.412415,.062745,.282327,.094955,.417331,.066667,.282656,.100196,.42216,.070588,.28291,.105393,.426902,.07451,.283091,.110553,.431554,.078431,.283197,.11568,.436115,.082353,.283229,.120777,.440584,.086275,.283187,.125848,.44496,.090196,.283072,.130895,.449241,.094118,.282884,.13592,.453427,.098039,.282623,.140926,.457517,.101961,.28229,.145912,.46151,.105882,.281887,.150881,.465405,.109804,.281412,.155834,.469201,.113725,.280868,.160771,.472899,.117647,.280255,.165693,.476498,.121569,.279574,.170599,.479997,.12549,.278826,.17549,.483397,.129412,.278012,.180367,.486697,.133333,.277134,.185228,.489898,.137255,.276194,.190074,.493001,.141176,.275191,.194905,.496005,.145098,.274128,.199721,.498911,.14902,.273006,.20452,.501721,.152941,.271828,.209303,.504434,.156863,.270595,.214069,.507052,.160784,.269308,.218818,.509577,.164706,.267968,.223549,.512008,.168627,.26658,.228262,.514349,.172549,.265145,.232956,.516599,.176471,.263663,.237631,.518762,.180392,.262138,.242286,.520837,.184314,.260571,.246922,.522828,.188235,.258965,.251537,.524736,.192157,.257322,.25613,.526563,.196078,.255645,.260703,.528312,.2,.253935,.265254,.529983,.203922,.252194,.269783,.531579,.207843,.250425,.27429,.533103,.211765,.248629,.278775,.534556,.215686,.246811,.283237,.535941,.219608,.244972,.287675,.53726,.223529,.243113,.292092,.538516,.227451,.241237,.296485,.539709,.231373,.239346,.300855,.540844,.235294,.237441,.305202,.541921,.239216,.235526,.309527,.542944,.243137,.233603,.313828,.543914,.247059,.231674,.318106,.544834,.25098,.229739,.322361,.545706,.254902,.227802,.326594,.546532,.258824,.225863,.330805,.547314,.262745,.223925,.334994,.548053,.266667,.221989,.339161,.548752,.270588,.220057,.343307,.549413,.27451,.21813,.347432,.550038,.278431,.21621,.351535,.550627,.282353,.214298,.355619,.551184,.286275,.212395,.359683,.55171,.290196,.210503,.363727,.552206,.294118,.208623,.367752,.552675,.298039,.206756,.371758,.553117,.301961,.204903,.375746,.553533,.305882,.203063,.379716,.553925,.309804,.201239,.38367,.554294,.313725,.19943,.387607,.554642,.317647,.197636,.391528,.554969,.321569,.19586,.395433,.555276,.32549,.1941,.399323,.555565,.329412,.192357,.403199,.555836,.333333,.190631,.407061,.556089,.337255,.188923,.41091,.556326,.341176,.187231,.414746,.556547,.345098,.185556,.41857,.556753,.34902,.183898,.422383,.556944,.352941,.182256,.426184,.55712,.356863,.180629,.429975,.557282,.360784,.179019,.433756,.55743,.364706,.177423,.437527,.557565,.368627,.175841,.44129,.557685,.372549,.174274,.445044,.557792,.376471,.172719,.448791,.557885,.380392,.171176,.45253,.557965,.384314,.169646,.456262,.55803,.388235,.168126,.459988,.558082,.392157,.166617,.463708,.558119,.396078,.165117,.467423,.558141,.4,.163625,.471133,.558148,.403922,.162142,.474838,.55814,.407843,.160665,.47854,.558115,.411765,.159194,.482237,.558073,.415686,.157729,.485932,.558013,.419608,.15627,.489624,.557936,.423529,.154815,.493313,.55784,.427451,.153364,.497,.557724,.431373,.151918,.500685,.557587,.435294,.150476,.504369,.55743,.439216,.149039,.508051,.55725,.443137,.147607,.511733,.557049,.447059,.14618,.515413,.556823,.45098,.144759,.519093,.556572,.454902,.143343,.522773,.556295,.458824,.141935,.526453,.555991,.462745,.140536,.530132,.555659,.466667,.139147,.533812,.555298,.470588,.13777,.537492,.554906,.47451,.136408,.541173,.554483,.478431,.135066,.544853,.554029,.482353,.133743,.548535,.553541,.486275,.132444,.552216,.553018,.490196,.131172,.555899,.552459,.494118,.129933,.559582,.551864,.498039,.128729,.563265,.551229,.501961,.127568,.566949,.550556,.505882,.126453,.570633,.549841,.509804,.125394,.574318,.549086,.513725,.124395,.578002,.548287,.517647,.123463,.581687,.547445,.521569,.122606,.585371,.546557,.52549,.121831,.589055,.545623,.529412,.121148,.592739,.544641,.533333,.120565,.596422,.543611,.537255,.120092,.600104,.54253,.541176,.119738,.603785,.5414,.545098,.119512,.607464,.540218,.54902,.119423,.611141,.538982,.552941,.119483,.614817,.537692,.556863,.119699,.61849,.536347,.560784,.120081,.622161,.534946,.564706,.120638,.625828,.533488,.568627,.12138,.629492,.531973,.572549,.122312,.633153,.530398,.576471,.123444,.636809,.528763,.580392,.12478,.640461,.527068,.584314,.126326,.644107,.525311,.588235,.128087,.647749,.523491,.592157,.130067,.651384,.521608,.596078,.132268,.655014,.519661,.6,.134692,.658636,.517649,.603922,.137339,.662252,.515571,.607843,.14021,.665859,.513427,.611765,.143303,.669459,.511215,.615686,.146616,.67305,.508936,.619608,.150148,.676631,.506589,.623529,.153894,.680203,.504172,.627451,.157851,.683765,.501686,.631373,.162016,.687316,.499129,.635294,.166383,.690856,.496502,.639216,.170948,.694384,.493803,.643137,.175707,.6979,.491033,.647059,.180653,.701402,.488189,.65098,.185783,.704891,.485273,.654902,.19109,.708366,.482284,.658824,.196571,.711827,.479221,.662745,.202219,.715272,.476084,.666667,.20803,.718701,.472873,.670588,.214,.722114,.469588,.67451,.220124,.725509,.466226,.678431,.226397,.728888,.462789,.682353,.232815,.732247,.459277,.686275,.239374,.735588,.455688,.690196,.24607,.73891,.452024,.694118,.252899,.742211,.448284,.698039,.259857,.745492,.444467,.701961,.266941,.748751,.440573,.705882,.274149,.751988,.436601,.709804,.281477,.755203,.432552,.713725,.288921,.758394,.428426,.717647,.296479,.761561,.424223,.721569,.304148,.764704,.419943,.72549,.311925,.767822,.415586,.729412,.319809,.770914,.411152,.733333,.327796,.77398,.40664,.737255,.335885,.777018,.402049,.741176,.344074,.780029,.397381,.745098,.35236,.783011,.392636,.74902,.360741,.785964,.387814,.752941,.369214,.788888,.382914,.756863,.377779,.791781,.377939,.760784,.386433,.794644,.372886,.764706,.395174,.797475,.367757,.768627,.404001,.800275,.362552,.772549,.412913,.803041,.357269,.776471,.421908,.805774,.35191,.780392,.430983,.808473,.346476,.784314,.440137,.811138,.340967,.788235,.449368,.813768,.335384,.792157,.458674,.816363,.329727,.796078,.468053,.818921,.323998,.8,.477504,.821444,.318195,.803922,.487026,.823929,.312321,.807843,.496615,.826376,.306377,.811765,.506271,.828786,.300362,.815686,.515992,.831158,.294279,.819608,.525776,.833491,.288127,.823529,.535621,.835785,.281908,.827451,.545524,.838039,.275626,.831373,.555484,.840254,.269281,.835294,.565498,.84243,.262877,.839216,.575563,.844566,.256415,.843137,.585678,.846661,.249897,.847059,.595839,.848717,.243329,.85098,.606045,.850733,.236712,.854902,.616293,.852709,.230052,.858824,.626579,.854645,.223353,.862745,.636902,.856542,.21662,.866667,.647257,.8584,.209861,.870588,.657642,.860219,.203082,.87451,.668054,.861999,.196293,.878431,.678489,.863742,.189503,.882353,.688944,.865448,.182725,.886275,.699415,.867117,.175971,.890196,.709898,.868751,.169257,.894118,.720391,.87035,.162603,.898039,.730889,.871916,.156029,.901961,.741388,.873449,.149561,.905882,.751884,.874951,.143228,.909804,.762373,.876424,.137064,.913725,.772852,.877868,.131109,.917647,.783315,.879285,.125405,.921569,.79376,.880678,.120005,.92549,.804182,.882046,.114965,.929412,.814576,.883393,.110347,.933333,.82494,.88472,.106217,.937255,.83527,.886029,.102646,.941176,.845561,.887322,.099702,.945098,.85581,.888601,.097452,.94902,.866013,.889868,.095953,.952941,.876168,.891125,.09525,.956863,.886271,.892374,.095374,.960784,.89632,.893616,.096335,.964706,.906311,.894855,.098125,.968627,.916242,.896091,.100717,.972549,.926106,.89733,.104071,.976471,.935904,.89857,.108131,.980392,.945636,.899815,.112838,.984314,.9553,.901065,.118128,.988235,.964894,.902323,.123941,.992157,.974417,.90359,.130215,.996078,.983868,.904867,.136897,1,.993248,.906157,.143936]},{ShowIndexedColorActiveValues:1,IndexedColors:[.07,.5,.7,1,1,1,.85,1,1,.8,.5,1,.76,1,0,1,.71,.71,.5,.5,.5,.05,.05,1,1,.05,.05,.7,1,1,.7,.89,.96,.67,.36,.95,.54,1,0,.75,.65,.65,.5,.6,.6,1,.5,0,1,1,.19,.12,.94,.12,.5,.82,.89,.56,.25,.83,.24,1,0,.9,.9,.9,.75,.76,.78,.65,.65,.67,.54,.6,.78,.61,.48,.78,.5,.48,.78,.44,.48,.78,.36,.48,.76,1,.48,.38,.49,.5,.69,.76,.56,.56,.4,.56,.56,.74,.5,.89,1,.63,0,.65,.16,.16,.36,.72,.82,.44,.18,.69,0,1,0,.58,1,1,.58,.88,.88,.45,.76,.79,.33,.71,.71,.23,.62,.62,.14,.56,.56,.04,.49,.55,0,.41,.52,.88,.88,1,1,.85,.56,.65,.46,.45,.4,.5,.5,.62,.39,.71,.83,.48,0,.58,0,.58,.26,.62,.69,.34,.09,.56,0,.79,0,.44,.83,1,1,1,.78,.85,1,.78,.78,1,.78,.64,1,.78,.56,1,.78,.38,1,.78,.27,1,.78,.19,1,.78,.12,1,.78,0,1,.61,0,.9,.46,0,.83,.32,0,.75,.22,0,.67,.14,.3,.76,1,.3,.65,1,.13,.58,.84,.15,.49,.67,.15,.4,.59,.09,.33,.53,.96,.93,.82,.8,.82,.12,.71,.71,.76,.65,.33,.3,.34,.35,.38,.62,.31,.71,.67,.36,0,.46,.31,.27,.26,.51,.59,.26,0,.4,0,.49,0,.44,.67,.98,0,.73,1,0,.63,1,0,.56,1,0,.5,1,0,.42,1,.33,.36,.95,.47,.36,.89,.54,.31,.89,.63,.21,.83,.7,.12,.83,.7,.12,.73,.7,.05,.65,.74,.05,.53,.78,0,.4,.8,0,.35,.82,0,.31,.85,0,.27,.88,0,.22,.9,0,.18,.91,0,.15,.92,0,.14,.93,0,.13,.94,0,.12,.95,0,.11,.96,0,.1,.97,0,.09,.98,0,.08,.99,0,.07,1,0,.06],Annotations:[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],Name:"BlueObeliskElements"}];const ua=Object.create(null);bw.filter(t=>t.RGBPoints).filter(t=>t.ColorSpace!=="CIELAB").forEach(t=>{ua[t.Name]=t});const la=Object.keys(ua);la.sort();function Mw(t){return ua[t]}function Nw(t){!t.RGBPoints||t.ColorSpace==="CIELAB"||(ua[t.Name]||(la.push(t.Name),la.sort()),ua[t.Name]=t)}function Rw(t){const e=la.indexOf(t);e>-1&&la.splice(e,1),delete ua[t]}var vc={addPreset:Nw,removePresetByName:Rw,getPresetByName:Mw,rgbPresetNames:la},D1={ColorSpace:{RGB:0,HSV:1,LAB:2,DIVERGING:3},Scale:{LINEAR:0,LOG10:1}};const{ColorSpace:Wt,Scale:yc}=D1,{ScalarMappingTarget:Po}=ho,{vtkDebugMacro:Lw,vtkErrorMacro:Rn,vtkWarningMacro:Fw}=V;function O1(t,e){const a=t[0],n=t[1],r=t[2],i=Math.sqrt(a*a+n*n+r*r),o=i>.001?Math.acos(a/i):0,s=o>.001?Math.atan2(r,n):0;e[0]=i,e[1]=o,e[2]=s}function kw(t,e){const a=t[0],n=t[1],r=t[2];e[0]=a*Math.cos(n),e[1]=a*Math.sin(n)*Math.cos(r),e[2]=a*Math.sin(n)*Math.sin(r)}function b1(t,e){if(t[0]>=e-.1)return t[2];const a=t[1]*Math.sqrt(e*e-t[0]*t[0])/(t[0]*Math.sin(t[1]));return t[2]>-.3*Math.PI?t[2]+a:t[2]-a}function Vw(t,e){let a=t-e;for(a<0&&(a=-a);a>=2*Math.PI;)a-=2*Math.PI;return a>Math.PI&&(a=2*Math.PI-a),a}function M1(t,e,a,n){const r=[],i=[];fr(e,r),fr(a,i);const o=[],s=[];O1(r,o),O1(i,s);let c=t;if(o[1]>.05&&s[1]>.05&&Vw(o[2],s[2])>.33*Math.PI){let u=Math.max(o[0],s[0]);u=Math.max(88,u),t<.5?(s[0]=u,s[1]=0,s[2]=0,c*=2):(o[0]=u,o[1]=0,o[2]=0,c=2*c-1)}o[1]<.05&&s[1]>.05?o[2]=b1(s,o[0]):s[1]<.05&&o[1]>.05&&(s[2]=b1(o,s[0]));const l=[];l[0]=(1-c)*o[0]+c*s[0],l[1]=(1-c)*o[1]+c*s[1],l[2]=(1-c)*o[2]+c*s[2];const p=[];kw(l,p),Qi(p,n)}function Aw(t,e){e.classHierarchy.push("vtkColorTransferFunction"),t.getSize=()=>e.nodes.length,t.addRGBPoint=(a,n,r,i)=>t.addRGBPointLong(a,n,r,i,.5,0),t.addRGBPointLong=function(a,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:.5,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(o<0||o>1)return Rn("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Rn("Sharpness outside range [0.0, 1.0]"),-1;e.allowDuplicateScalars||t.removePoint(a);const c={x:a,r:n,g:r,b:i,midpoint:o,sharpness:s};e.nodes.push(c),t.sortAndUpdateRange();let l=0;for(;lt.addHSVPointLong(a,n,r,i,.5,0),t.addHSVPointLong=function(a,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:.5,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;const c=[];return lr([n,r,i],c),t.addRGBPoint(a,c[0],c[1],c[2],o,s)},t.setNodes=a=>{if(e.nodes!==a){const n=JSON.stringify(e.nodes);e.nodes=a;const r=JSON.stringify(e.nodes);if(t.sortAndUpdateRange()||n!==r)return t.modified(),!0}return!1},t.sortAndUpdateRange=()=>{const a=JSON.stringify(e.nodes);e.nodes.sort((i,o)=>i.x-o.x);const n=JSON.stringify(e.nodes),r=t.updateRange();return!r&&a!==n?(t.modified(),!0):r},t.updateRange=()=>{const a=[2];a[0]=e.mappingRange[0],a[1]=e.mappingRange[1];const n=e.nodes.length;return n?(e.mappingRange[0]=e.nodes[0].x,e.mappingRange[1]=e.nodes[n-1].x):(e.mappingRange[0]=0,e.mappingRange[1]=0),a[0]===e.mappingRange[0]&&a[1]===e.mappingRange[1]?!1:(t.modified(),!0)},t.removePoint=a=>{let n=0;for(;n=e.nodes.length)return-1;let i=!1;return e.nodes.splice(n,1),(n===0||n===e.nodes.length)&&(i=t.updateRange()),i||t.modified(),r},t.movePoint=(a,n)=>{if(a!==n){t.removePoint(n);for(let r=0;r{e.nodes=[],t.sortAndUpdateRange()},t.addRGBSegment=(a,n,r,i,o,s,c,l)=>{t.sortAndUpdateRange();for(let p=0;p=a&&e.nodes[p].x<=o?e.nodes.splice(p,1):p++;t.addRGBPointLong(a,n,r,i,.5,0),t.addRGBPointLong(o,s,c,l,.5,0),t.modified()},t.addHSVSegment=(a,n,r,i,o,s,c,l)=>{const p=[n,r,i],u=[s,c,l],f=[],h=[];lr(p,f),lr(u,h),t.addRGBSegment(a,f[0],f[1],f[2],o,h[0],h[1],h[2])},t.mapValue=a=>{const n=[];return t.getColor(a,n),[Math.floor(255*n[0]+.5),Math.floor(255*n[1]+.5),Math.floor(255*n[2]+.5),255]},t.getColor=(a,n)=>{if(e.indexedLookup){const r=t.getSize(),i=t.getAnnotatedValueIndexInternal(a);if(i<0||r===0){const o=t.getNanColorByReference();n[0]=o[0],n[1]=o[1],n[2]=o[2]}else{const o=[];t.getNodeValue(i%r,o),n[0]=o[1],n[1]=o[2],n[2]=o[3]}return}t.getTable(a,a,1,n)},t.getRedValue=a=>{const n=[];return t.getColor(a,n),n[0]},t.getGreenValue=a=>{const n=[];return t.getColor(a,n),n[1]},t.getBlueValue=a=>{const n=[];return t.getColor(a,n),n[2]},t.logScaleEnabled=()=>e.scale===yc.LOG10,t.usingLogScale=()=>t.logScaleEnabled()&&e.mappingRange[0]>0,t.getTable=(a,n,r,i)=>{const o=t.usingLogScale(),s=o?Math.log10(Number(a)):Number(a),c=o?Math.log10(Number(n)):Number(n);if(to(s)||to(c)){for(let w=0;w1?d=s+w/(r-1)*(c-s):d=.5*(s+c),e.discretize){const E=T;if(d>=E[0]&&d<=E[1]){const D=e.numberOfValues,O=E[1]-E[0];if(D<=1)d=E[0]+O/2;else{const M=(d-E[0])/O,N=Ys(D*M);d=E[0]+N/(D-1)*O}}}for(;le.nodes[l].x;)l++,l.99999&&(g=.99999));if(d>T[1])i[_]=0,i[_+1]=0,i[_+2]=0,e.clamping&&(t.getUseAboveRangeColor()?(i[_]=e.aboveRangeColor[0],i[_+1]=e.aboveRangeColor[1],i[_+2]=e.aboveRangeColor[2]):(i[_]=u,i[_+1]=f,i[_+2]=h));else if(d0&&(i[_]=e.nodes[0].r,i[_+1]=e.nodes[0].g,i[_+2]=e.nodes[0].b));else if(l===0&&(Math.abs(d-s)<1e-6||e.discretize))p>0?(i[_]=e.nodes[0].r,i[_+1]=e.nodes[0].g,i[_+2]=e.nodes[0].b):(i[_]=0,i[_+1]=0,i[_+2]=0);else{let E=0;if(E=(d-v)/(m-v),E.99)if(E<.5){i[_]=x[0],i[_+1]=x[1],i[_+2]=x[2];continue}else{i[_]=y[0],i[_+1]=y[1],i[_+2]=y[2];continue}if(C<.01){if(e.colorSpace===Wt.RGB)i[_]=(1-E)*x[0]+E*y[0],i[_+1]=(1-E)*x[1]+E*y[1],i[_+2]=(1-E)*x[2]+E*y[2];else if(e.colorSpace===Wt.HSV){const L=[],k=[];Va(x,L),Va(y,k),e.hSVWrap&&(L[0]-k[0]>.5||k[0]-L[0]>.5)&&(L[0]>k[0]?L[0]-=1:k[0]-=1);const A=[];A[0]=(1-E)*L[0]+E*k[0],A[0]<0&&(A[0]+=1),A[1]=(1-E)*L[1]+E*k[1],A[2]=(1-E)*L[2]+E*k[2],lr(A,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else if(e.colorSpace===Wt.LAB){const L=[],k=[];fr(x,L),fr(y,k);const A=[];A[0]=(1-E)*L[0]+E*k[0],A[1]=(1-E)*L[1]+E*k[1],A[2]=(1-E)*L[2]+E*k[2],Qi(A,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else e.colorSpace===Wt.DIVERGING?(M1(E,x,y,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]):Rn("ColorSpace set to invalid value.",e.colorSpace);continue}E<.5?E=.5*(E*2)**(1+10*C):E>.5&&(E=1-.5*((1-E)*2)**(1+10*C));const D=E*E,O=D*E,M=2*O-3*D+1,N=-2*O+3*D,R=O-2*D+E,B=O-D;let I,P;if(e.colorSpace===Wt.RGB)for(let L=0;L<3;L++)I=y[L]-x[L],P=(1-C)*I,i[_+L]=M*x[L]+N*y[L]+R*P+B*P;else if(e.colorSpace===Wt.HSV){const L=[],k=[];Va(x,L),Va(y,k),e.hSVWrap&&(L[0]-k[0]>.5||k[0]-L[0]>.5)&&(L[0]>k[0]?L[0]-=1:k[0]-=1);const A=[];for(let j=0;j<3;j++)I=k[j]-L[j],P=(1-C)*I,A[j]=M*L[j]+N*k[j]+R*P+B*P,j===0&&A[j]<0&&(A[j]+=1);lr(A,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else if(e.colorSpace===Wt.LAB){const L=[],k=[];fr(x,L),fr(y,k);const A=[];for(let j=0;j<3;j++)I=k[j]-L[j],P=(1-C)*I,A[j]=M*L[j]+N*k[j]+R*P+B*P;Qi(A,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else e.colorSpace===Wt.DIVERGING?(M1(E,x,y,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]):Rn("ColorSpace set to invalid value.");for(let L=0;L<3;L++)i[_+L]=i[_+L]<0?0:i[_+L],i[_+L]=i[_+L]>1?1:i[_+L]}}},t.getUint8Table=function(a,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t.getMTime()<=e.buildTime&&e.tableSize===r&&e.tableWithAlpha!==i)return e.table;if(e.nodes.length===0)return Rn("Attempting to lookup a value with no points in the function"),e.table;const o=i?4:3;(e.tableSize!==r||e.tableWithAlpha!==i)&&(e.table=new Uint8Array(r*o),e.tableSize=r,e.tableWithAlpha=i);const s=[];t.getTable(a,n,r,s);for(let c=0;c{t.removeAllPoints();const n=a.getNumberOfComponents();for(let r=0;r{let o=0;t.removeAllPoints(),r>1&&(o=(n-a)/(r-1));for(let s=0;sa<0||a>=e.nodes.length?(Rn("Index out of range!"),-1):(n[0]=e.nodes[a].x,n[1]=e.nodes[a].r,n[2]=e.nodes[a].g,n[3]=e.nodes[a].b,n[4]=e.nodes[a].midpoint,n[5]=e.nodes[a].sharpness,1),t.setNodeValue=(a,n)=>{if(a<0||a>=e.nodes.length)return Rn("Index out of range!"),-1;const r=e.nodes[a].x;return e.nodes[a].x=n[0],e.nodes[a].r=n[1],e.nodes[a].g=n[2],e.nodes[a].b=n[3],e.nodes[a].midpoint=n[4],e.nodes[a].sharpness=n[5],r!==n[0]?t.sortAndUpdateRange():t.modified(),1},t.getNumberOfAvailableColors=()=>{var n;if(e.indexedLookup&&t.getSize())return t.getSize();if(e.tableSize)return e.tableSize;const a=((n=e.nodes)==null?void 0:n.length)??0;return Math.max(4094,a)},t.getIndexedColor=(a,n)=>{const r=t.getSize();if(r>0&&a>=0){const o=[];t.getNodeValue(a%r,o);for(let s=0;s<3;++s)n[s]=o[s+1];n[3]=1;return}const i=t.getNanColorByReference();n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=1},t.fillFromDataPointer=(a,n)=>{if(!(a<=0||!n)){t.removeAllPoints();for(let r=0;r{const r=[a,n],i=[a,n],o=t.getRange(),s=t.logScaleEnabled();if(o[1]===r[1]&&o[0]===r[0])return;if(r[1]===r[0]){Rn("attempt to set zero width color range");return}s&&(r[0]<=0?console.warn("attempt to set log scale color range with non-positive minimum"):(i[0]=Math.log10(r[0]),i[1]=Math.log10(r[1])));const c=(i[1]-i[0])/(o[1]-o[0]),l=i[0]-o[0]*c;for(let p=0;p{const n=t.getRange(),r=[];n[0]a[1]?(t.getColor(a[1],r),t.addRGBPoint(a[1],r[0],r[1],r[2])):(t.getColor(n[1],r),t.addRGBPoint(a[1],r[0],r[1],r[2])),t.sortAndUpdateRange();for(let i=0;i=a[0]&&e.nodes[i].x<=a[1]?e.nodes.splice(i,1):++i;return 1},t.estimateMinNumberOfSamples=(a,n)=>{const r=t.findMinimumXDistance();return Math.ceil((n-a)/r)},t.findMinimumXDistance=()=>{if(e.nodes.length<2)return-1;let a=Number.MAX_VALUE;for(let n=0;n{if(t.getSize()===0){Lw("Transfer Function Has No Points!");return}e.indexedLookup?t.mapDataIndexed(a,n,r,i):t.mapData(a,n,r,i)},t.mapData=(a,n,r,i)=>{if(t.getSize()===0){Fw("Transfer Function Has No Points!");return}const o=Math.floor(t.getAlpha()*255+.5),s=a.getNumberOfTuples(),c=a.getNumberOfComponents(),l=n.getData(),p=a.getData(),u=[];if(r===Po.RGBA)for(let f=0;f{const n=JSON.stringify(e.colorSpace);a.ColorSpace&&(e.colorSpace=Wt[a.ColorSpace.toUpperCase()],e.colorSpace===void 0&&(Rn(`ColorSpace ${a.ColorSpace} not supported, using RGB instead`),e.colorSpace=Wt.RGB));let r=n!==JSON.stringify(e.colorSpace);const i=r||JSON.stringify(e.nanColor);if(a.NanColor)for(e.nanColor=[].concat(a.NanColor);e.nanColor.length<4;)e.nanColor.push(1);r=r||i!==JSON.stringify(e.nanColor);const o=r||JSON.stringify(e.nodes);if(a.RGBPoints){const l=a.RGBPoints.length;e.nodes=[];const p=.5,u=0;for(let f=0;f2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Bw,a),ho.extend(t,e,a),e.table=[],e.nodes=[],e.nanColor=[.5,0,0,1],e.belowRangeColor=[0,0,0,1],e.aboveRangeColor=[1,1,1,1],e.buildTime={},V.obj(e.buildTime),V.get(t,e,["buildTime","mappingRange"]),V.setGet(t,e,["useAboveRangeColor","useBelowRangeColor","discretize","numberOfValues",{type:"enum",name:"colorSpace",enum:Wt},{type:"enum",name:"scale",enum:yc}]),V.setArray(t,e,["nanColor","belowRangeColor","aboveRangeColor"],4),V.getArray(t,e,["nanColor","belowRangeColor","aboveRangeColor"]),Aw(t,e)}var mc={newInstance:V.newInstance(N1,"vtkColorTransferFunction"),extend:N1,...D1};const R1={id:{type:String},colorMapPreset:{type:String,default:"erdc_rainbow_bright"},colorDataRange:{type:Array,default:()=>[0,1]},actor:{type:Object},mapper:{type:Object},property:{type:Object}};let Uw=class{constructor(e,a,n,r){this.refs={presetName:a,colorRange:n},this.view=r,this.actor=pn.newInstance(),this.lookupTable=mc.newInstance(),this.mapper=e({lookupTable:this.lookupTable,useLookupTableScalarRange:!0}),this.actor.setMapper(this.mapper),this.property=this.actor.getProperty()}updateColorMapPreset(){const e=vc.getPresetByName(this.refs.presetName.value);this.lookupTable.applyColorMap(e),this.updateColorDataRange()}updateColorDataRange(){this.lookupTable.setMappingRange(...this.refs.colorRange.value),this.lookupTable.updateRange(),this.dataChanged()}dataChanged(){this.view&&se.nextTick(this.view.render)}};function L1(t,e){const a=se.inject("view"),{colorMapPreset:n,colorDataRange:r}=se.toRefs(t),i=new Uw(e,n,r,a),o=se.ref(i.mapper);se.provide("representation",i),se.provide("downstream",o),se.onMounted(()=>{["actor","mapper","property"].forEach(s=>{i[s].set(t[s])}),i.actor.set({representationId:t.id},!0),i.updateColorMapPreset(),a.renderer.addActor(i.actor)}),se.onBeforeUnmount(()=>{var s;(s=a==null?void 0:a.renderer)==null||s.removeActor(i.actor),i.actor.delete(),i.actor=null,i.mapper.delete(),i.mapper=null,i.lookupTable.delete(),i.lookupTable=null}),["actor","mapper","property"].forEach(s=>{se.watch(()=>t[s],c=>{i[s].set(c)&&i.dataChanged()})}),["colorMapPreset","colorDataRange"].forEach(s=>{se.watch(()=>t[s],()=>i[`update${$r(s)}`]())}),se.watch(()=>t.id,s=>i.actor.set({representationId:s},!0))}const Gw={props:R1,setup(t){L1(t,gn.newInstance)},template:'
'};var F1={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};const{OrientationModes:qn,ScaleModes:Ln}=F1,{vtkErrorMacro:Iw}=V;function Pw(t,e){e.classHierarchy.push("vtkGlyph3DMapper"),t.getOrientationModeAsString=()=>V.enumToString(qn,e.orientationMode),t.setOrientationModeToDirection=()=>t.setOrientationMode(qn.DIRECTION),t.setOrientationModeToRotation=()=>t.setOrientationMode(qn.ROTATION),t.setOrientationModeToMatrix=()=>t.setOrientationMode(qn.MATRIX),t.getOrientationArrayData=()=>{const a=t.getInputData(0);return!a||!a.getPointData()?null:e.orientationArray?a.getPointData().getArray(e.orientationArray):a.getPointData().getVectors()},t.getScaleModeAsString=()=>V.enumToString(Ln,e.scaleMode),t.setScaleModeToScaleByMagnitude=()=>t.setScaleMode(Ln.SCALE_BY_MAGNITUDE),t.setScaleModeToScaleByComponents=()=>t.setScaleMode(Ln.SCALE_BY_COMPONENTS),t.setScaleModeToScaleByConstant=()=>t.setScaleMode(Ln.SCALE_BY_CONSTANT),t.getScaleArrayData=()=>{const a=t.getInputData(0);return!a||!a.getPointData()?null:e.scaleArray?a.getPointData().getArray(e.scaleArray):a.getPointData().getScalars()},t.getBounds=()=>{const a=t.getInputData(0),n=t.getInputData(1);return!a||!n?In():(t.buildArrays(),e.bounds)},t.buildArrays=()=>{const a=t.getInputData(0),n=t.getInputData(1);if(e.buildTime.getMTime()e.bounds[1]&&(e.bounds[1]=p[0]),p[1]>e.bounds[3]&&(e.bounds[3]=p[1]),p[2]>e.bounds[5]&&(e.bounds[5]=p[2]);const _=new Float32Array(x,T*36,9);Vn(_,w),Tn(_,_),Br(_,_)}const C=t.getAbstractScalars(a,e.scalarMode,e.arrayAccessMode,e.arrayId,e.colorByArrayName).scalars;e.useLookupTableScalarRange||t.getLookupTable().setRange(e.scalarRange[0],e.scalarRange[1]),e.colorArray=null;const S=t.getLookupTable();S&&C&&(S.build(),e.colorArray=S.mapScalars(C,e.colorMode,0)),e.buildTime.modified()}},t.getPrimitiveCount=()=>{const a=t.getInputData(1),n=t.getInputData().getPoints().getNumberOfValues()/3;return{points:n*a.getPoints().getNumberOfValues()/3,verts:n*(a.getVerts().getNumberOfValues()-a.getVerts().getNumberOfCells()),lines:n*(a.getLines().getNumberOfValues()-2*a.getLines().getNumberOfCells()),triangles:n*(a.getPolys().getNumberOfValues()-3*a.getLines().getNumberOfCells())}},t.setSourceConnection=a=>t.setInputConnection(a,1)}const zw={orient:!0,orientationMode:qn.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:Ln.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function k1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,zw,a),gn.extend(t,e,a),V.algo(t,e,2,0),e.buildTime={},V.obj(e.buildTime,{mtime:0}),e.boundsTime={},V.obj(e.boundsTime,{mtime:0}),V.setGet(t,e,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),V.get(t,e,["colorArray","matrixArray","normalArray","buildTime"]),Pw(t,e)}var V1={newInstance:V.newInstance(k1,"vtkGlyph3DMapper"),extend:k1,...F1};const jw={props:R1,setup(t){L1(t,V1.newInstance)},template:'
'},Ww=[Array,Float32Array,Float64Array,Object],zo=[Array,Uint8Array,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Object],A1={props:{port:{type:Number,default:0},points:{type:Ww},verts:{type:zo},lines:{type:zo},polys:{type:zo},strips:{type:zo},connectivity:{type:String,default:"manual"}},setup(t){const e=se.computed(()=>t.points&&t.points.length>196608?Uint32Array:Uint16Array),a=se.inject("downstream"),n=se.inject("representation"),r=Xe.newInstance(),i=wn(()=>{if(t.connectivity!=="manual"){const f=t.points.length/3;switch(t.connectivity){case"points":{const h=new Uint32Array(f+1);h[0]=f;for(let d=0;do(f,"getPoints",Float64Array,3)),se.watch(c,f=>o(f,"getVerts",e.value)),se.watch(l,f=>o(f,"getLines",e.value)),se.watch(p,f=>o(f,"getPolys",e.value)),se.watch(u,f=>o(f,"getStrips",e.value)),se.watch(a,()=>{a.value&&a.value.setInputData(r,t.port)}),se.onMounted(()=>{o(t.points,"getPoints",Float64Array,3),o(t.verts,"getVerts",e.value),o(t.lines,"getLines",e.value),o(t.polys,"getPolys",e.value),o(t.strips,"getStrips",e.value),a.value&&a.value.setInputData(r,t.port)}),se.onBeforeUnmount(()=>{r.delete()}),se.provide("dataset",r)},template:'
'},B1={setup(){const t=se.inject("dataset");se.provide("fields",t==null?void 0:t.getPointData())},template:'
'},$w={props:{port:{type:Number,default:0},state:{type:Object}},components:{VtkPolydata:A1,VtkCellData:w1,VtkPointData:B1,VtkDataArray:E1},template:` +`}function _(N){return N[N.length-1]===` +`?N.slice(0,-1):N}function E(N,L){if(N===""||N[0]===" ")return N;for(var B,P,F=/ [^ ]/g,k=0,G=0,W=0,H="";B=F.exec(N);)(W=B.index)-k>L&&(P=G>k?G:W,H+=` +`+N.slice(k,P),k=P+1),G=W;return H+=` +`,N.length-k>L&&G>k?H+=N.slice(k,G)+` +`+N.slice(G+1):H+=N.slice(k),H.slice(1)}function D(N,L,B){var P,F,k,G,W,H;for(k=0,G=(F=B?N.explicitTypes:N.implicitTypes).length;k tag resolver accepts not "'+H+'" style');P=W.represent[H](L,H)}N.dump=P}return!0}return!1}function O(N,L,B,P,F,k){N.tag=null,N.dump=B,D(N,B,!1)||D(N,B,!0);var G=c.call(N.dump);P&&(P=N.flowLevel<0||N.flowLevel>L);var W,H,X=G==="[object Object]"||G==="[object Array]";if(X&&(H=(W=N.duplicates.indexOf(B))!==-1),(N.tag!==null&&N.tag!=="?"||H||N.indent!==2&&L>0)&&(F=!1),H&&N.usedDuplicates[W])N.dump="*ref_"+W;else{if(X&&H&&!N.usedDuplicates[W]&&(N.usedDuplicates[W]=!0),G==="[object Object]")P&&Object.keys(N.dump).length!==0?(function(q,Q,ae,ne){var ee,V,M,I,U,z,j="",$=q.tag,J=Object.keys(ae);if(q.sortKeys===!0)J.sort();else if(typeof q.sortKeys=="function")J.sort(q.sortKeys);else if(q.sortKeys)throw new o("sortKeys must be a boolean or a function");for(ee=0,V=J.length;ee1024)&&(q.dump&&q.dump.charCodeAt(0)===10?z+="?":z+="? "),z+=q.dump,U&&(z+=x(q,Q)),O(q,Q+1,I,!0,U)&&(q.dump&&q.dump.charCodeAt(0)===10?z+=":":z+=": ",j+=z+=q.dump));q.tag=$,q.dump=j||"{}"}(N,L,N.dump,F),H&&(N.dump="&ref_"+W+N.dump)):(function(q,Q,ae){var ne,ee,V,M,I,U="",z=q.tag,j=Object.keys(ae);for(ne=0,ee=j.length;ne1024&&(I+="? "),I+=q.dump+(q.condenseFlow?'"':"")+":"+(q.condenseFlow?"":" "),O(q,Q,M,!1,!1)&&(U+=I+=q.dump));q.tag=z,q.dump="{"+U+"}"}(N,L,N.dump),H&&(N.dump="&ref_"+W+" "+N.dump));else if(G==="[object Array]"){var Y=N.noArrayIndent&&L>0?L-1:L;P&&N.dump.length!==0?(function(q,Q,ae,ne){var ee,V,M="",I=q.tag;for(ee=0,V=ae.length;ee "+N.dump)}return!0}function b(N,L){var B,P,F=[],k=[];for(function G(W,H,X){var Y,q,Q;if(W!==null&&typeof W=="object")if((q=H.indexOf(W))!==-1)X.indexOf(q)===-1&&X.push(q);else if(H.push(W),Array.isArray(W))for(q=0,Q=W.length;q=S.length&&(S=void 0),{value:S&&S[_++],done:!S}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__read||function(S,T){var w=typeof Symbol=="function"&&S[Symbol.iterator];if(!w)return S;var _,E,D=w.call(S),O=[];try{for(;(T===void 0||T-- >0)&&!(_=D.next()).done;)O.push(_.value)}catch(b){E={error:b}}finally{try{_&&!_.done&&(w=D.return)&&w.call(D)}finally{if(E)throw E.error}}return O};Object.defineProperty(n,"__esModule",{value:!0});var c=r(91),p=r(2),l=r(183),f=r(0),h=r(7),v=r(95),m=r(69),x=r(3),y=r(306),d=r(307),g=r(308),C=function(S){function T(w,_){_===void 0&&(_=!1);var E=S.call(this)||this;return E._hasDeclaration=!1,E._docTypeName="",E._hasDocumentElement=!1,E._currentElementSerialized=!1,E._openTags=[],E._ended=!1,E._fragment=_,E._options=p.applyDefaults(w||{},c.DefaultXMLBuilderCBOptions),E._builderOptions={defaultNamespace:E._options.defaultNamespace,namespaceAlias:E._options.namespaceAlias},E._options.format==="json"?E._writer=new d.JSONCBWriter(E._options):E._options.format==="yaml"?E._writer=new g.YAMLCBWriter(E._options):E._writer=new y.XMLCBWriter(E._options),E._options.data!==void 0&&E.on("data",E._options.data),E._options.end!==void 0&&E.on("end",E._options.end),E._options.error!==void 0&&E.on("error",E._options.error),E._prefixMap=new v.NamespacePrefixMap,E._prefixMap.set("xml",h.namespace.XML),E._prefixIndex={value:1},E._push(E._writer.frontMatter()),E}return o(T,S),T.prototype.ele=function(w,_,E){var D,O;if(p.isObject(w)||p.isString(w)&&(/^\s*/g,">");return this._push(this._writer.text(E)),this},T.prototype.ins=function(w,_){var E;_===void 0&&(_=""),this._serializeOpenTag(!0);try{E=l.fragment(this._builderOptions).ins(w,_).first().node}catch(D){return this.emit("error",D),this}return this._options.wellFormed&&(E.target.indexOf(":")!==-1||/^xml$/i.test(E.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!f.xml_isLegalChar(E.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(E.target,E.data)),this)},T.prototype.dat=function(w){var _;this._serializeOpenTag(!0);try{_=l.fragment(this._builderOptions).dat(w).first().node}catch(E){return this.emit("error",E),this}return this._push(this._writer.cdata(_.data)),this},T.prototype.dec=function(w){return w===void 0&&(w={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(w.version||"1.0",w.encoding,w.standalone)),this._hasDeclaration=!0,this)},T.prototype.dtd=function(w){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(this._docTypeName!=="")return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var _;try{_=l.create().dtd(w).first().node}catch(E){return this.emit("error",E),this}return this._options.wellFormed&&!f.xml_isPubidChar(_.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!f.xml_isLegalChar(_.systemId)||_.systemId.indexOf('"')!==-1&&_.systemId.indexOf("'")!==-1)?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=w.name,this._push(this._writer.docType(w.name,_.publicId,_.systemId)),this)},T.prototype.import=function(w){var _,E,D=l.fragment().set(this._options);try{D.import(w)}catch(N){return this.emit("error",N),this}try{for(var O=s(D.node.childNodes),b=O.next();!b.done;b=O.next()){var R=b.value;this._fromNode(R)}}catch(N){_={error:N}}finally{try{b&&!b.done&&(E=O.return)&&E.call(O)}finally{if(_)throw _.error}}return this},T.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},T.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},T.prototype._serializeOpenTag=function(w){if(!this._currentElementSerialized&&this._currentElement!==void 0){var _=this._currentElement.node;if(!this._options.wellFormed||_.localName.indexOf(":")===-1&&f.xml_isName(_.localName)){var E="",D=!1,O=this._prefixMap.copy(),b={},R=this._recordNamespaceInformation(_,O,b),N=this._openTags.length===0?null:this._openTags[this._openTags.length-1][1],L=_.namespaceURI;if(L===null&&(L=N),N===L)R!==null&&(D=!0),E=L===h.namespace.XML?"xml:"+_.localName:_.localName,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E));else{var B=_.prefix,P=null;if(B===null&&L===R||(P=O.get(B,L)),B==="xmlns"){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));P=B}P!==null?(E=P+":"+_.localName,R!==null&&R!==h.namespace.XML&&(N=R||null),this._writer.beginElement(E),this._push(this._writer.openTagBegin(E))):B!==null?(B in b&&(B=this._generatePrefix(L,O,this._prefixIndex)),O.set(B,L),E+=B+":"+_.localName,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E)),this._push(this._writer.attribute("xmlns:"+B,this._serializeAttributeValue(L,this._options.wellFormed))),R!==null&&(N=R||null)):R===null||R!==null&&R!==L?(D=!0,E+=_.localName,N=L,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(L,this._options.wellFormed)))):(E+=_.localName,N=L,this._writer.beginElement(E),this._push(this._writer.openTagBegin(E)))}this._serializeAttributes(_,O,this._prefixIndex,b,D,this._options.wellFormed);var F=L===h.namespace.HTML;F&&!w&&T._VoidElementNames.has(_.localName)?(this._push(this._writer.openTagEnd(E,!0,!0)),this._writer.endElement(E)):F||w?this._push(this._writer.openTagEnd(E,!1,!1)):(this._push(this._writer.openTagEnd(E,!0,!1)),this._writer.endElement(E)),this._currentElementSerialized=!0,this._openTags.push([E,N,this._prefixMap,w]),this._isPrefixMapModified(this._prefixMap,O)&&(this._prefixMap=O),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},T.prototype._serializeCloseTag=function(){this._writer.level--;var w=this._openTags.pop();if(w!==void 0){var _=u(w,4),E=_[0],D=(_[1],_[2]),O=_[3];this._prefixMap=D,O&&(this._push(this._writer.closeTag(E)),this._writer.endElement(E))}else this.emit("error",new Error("Last element is undefined."))},T.prototype._push=function(w){w===null?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):w.length!==0&&(this._writer.hasData=!0,this.emit("data",w,this._writer.level))},T.prototype._fromNode=function(w){var _,E,D,O;if(x.Guard.isElementNode(w)){var b=w.prefix?w.prefix+":"+w.localName:w.localName;w.namespaceURI!==null?this.ele(w.namespaceURI,b):this.ele(b);try{for(var R=s(w.attributes),N=R.next();!N.done;N=R.next()){var L=N.value,B=L.prefix?L.prefix+":"+L.localName:L.localName;L.namespaceURI!==null?this.att(L.namespaceURI,B,L.value):this.att(B,L.value)}}catch(G){_={error:G}}finally{try{N&&!N.done&&(E=R.return)&&E.call(R)}finally{if(_)throw _.error}}try{for(var P=s(w.childNodes),F=P.next();!F.done;F=P.next()){var k=F.value;this._fromNode(k)}}catch(G){D={error:G}}finally{try{F&&!F.done&&(O=P.return)&&O.call(P)}finally{if(D)throw D.error}}this.up()}else x.Guard.isExclusiveTextNode(w)&&w.data?this.txt(w.data):x.Guard.isCommentNode(w)?this.com(w.data):x.Guard.isCDATASectionNode(w)?this.dat(w.data):x.Guard.isProcessingInstructionNode(w)&&this.ins(w.target,w.data)},T.prototype._serializeAttributes=function(w,_,E,D,O,b){var R,N,L=b?new m.LocalNameSet:void 0;try{for(var B=s(w.attributes),P=B.next();!P.done;P=B.next()){var F=P.value;if(b||O||F.namespaceURI!==null){if(b&&L&&L.has(F.namespaceURI,F.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));b&&L&&L.set(F.namespaceURI,F.localName);var k=F.namespaceURI,G=null;if(k!==null)if(G=_.get(F.prefix,k),k===h.namespace.XMLNS){if(F.value===h.namespace.XML||F.prefix===null&&O||F.prefix!==null&&(!(F.localName in D)||D[F.localName]!==F.value)&&_.has(F.localName,F.value))continue;if(b&&F.value===h.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(b&&F.value==="")return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));F.prefix==="xmlns"&&(G="xmlns")}else G===null&&(G=F.prefix===null||_.hasPrefix(F.prefix)&&!_.has(F.prefix,k)?this._generatePrefix(k,_,E):F.prefix,this._push(this._writer.attribute("xmlns:"+G,this._serializeAttributeValue(k,this._options.wellFormed))));if(b&&(F.localName.indexOf(":")!==-1||!f.xml_isName(F.localName)||F.localName==="xmlns"&&k===null))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((G!==null?G+":":"")+F.localName,this._serializeAttributeValue(F.value,this._options.wellFormed)))}else this._push(this._writer.attribute(F.localName,this._serializeAttributeValue(F.value,this._options.wellFormed)))}}catch(W){R={error:W}}finally{try{P&&!P.done&&(N=B.return)&&N.call(B)}finally{if(R)throw R.error}}},T.prototype._serializeAttributeValue=function(w,_){return _&&w!==null&&!f.xml_isLegalChar(w)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):w===null?"":w.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&").replace(//g,">").replace(/"/g,""")},T.prototype._recordNamespaceInformation=function(w,_,E){var D,O,b=null;try{for(var R=s(w.attributes),N=R.next();!N.done;N=R.next()){var L=N.value,B=L.namespaceURI,P=L.prefix;if(B===h.namespace.XMLNS){if(P===null){b=L.value;continue}var F=L.localName,k=L.value;if(k===h.namespace.XML||(k===""&&(k=null),_.has(F,k)))continue;_.set(F,k),E[F]=k||""}}}catch(G){D={error:G}}finally{try{N&&!N.done&&(O=R.return)&&O.call(R)}finally{if(D)throw D.error}}return b},T.prototype._generatePrefix=function(w,_,E){var D="ns"+E.value;return E.value++,_.set(D,w),D},T.prototype._isPrefixMapModified=function(w,_){var E=w._items,D=_._items,O=w._nullItems,b=_._nullItems;for(var R in D){var N=E[R];if(N===void 0)return!0;var L=D[R];if(N.length!==L.length)return!0;for(var B=0;B':l?"':f?"':""},c.prototype.comment=function(p){return this._beginLine()+""},c.prototype.text=function(p){return this._beginLine()+p},c.prototype.instruction=function(p,l){return l?this._beginLine()+"":this._beginLine()+""},c.prototype.cdata=function(p){return this._beginLine()+""},c.prototype.openTagBegin=function(p){return this._lineLength+=1+p.length,this._beginLine()+"<"+p},c.prototype.openTagEnd=function(p,l,f){return f?" />":l?this._writerOptions.allowEmptyTags?">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},c.prototype.closeTag=function(p){return this._beginLine()+""},c.prototype.attribute=function(p,l){var f=p+'="'+l+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+f.length>this._writerOptions.width?(f=this._beginLine()+this._indent(1)+f,this._lineLength=f.length,f):(this._lineLength+=1+f.length," "+f)},c.prototype.beginElement=function(p){},c.prototype.endElement=function(p){},c.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var p=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=p.length,p}return""},c.prototype._indent=function(p){return p<=0?"":this._writerOptions.indent.repeat(p)},c}(r(114).BaseCBWriter);n.XMLCBWriter=s},function(a,n,r){r(74);var i,o=this&&this.__extends||(i=function(u,c){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,l){p.__proto__=l}||function(p,l){for(var f in l)l.hasOwnProperty(f)&&(p[f]=l[f])})(u,c)},function(u,c){function p(){this.constructor=u}i(u,c),u.prototype=c===null?Object.create(c):(p.prototype=c.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(u){function c(p){var l=u.call(this,p)||this;return l._hasChildren=[],l._additionalLevel=0,l}return o(c,u),c.prototype.frontMatter=function(){return""},c.prototype.declaration=function(p,l,f){return""},c.prototype.docType=function(p,l,f){return""},c.prototype.comment=function(p){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(p)+this._sep()+"}"},c.prototype.text=function(p){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(p)+this._sep()+"}"},c.prototype.instruction=function(p,l){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(l?p+" "+l:p)+this._sep()+"}"},c.prototype.cdata=function(p){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(p)+this._sep()+"}"},c.prototype.attribute=function(p,l){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+p)+this._sep()+this._val(l)+this._sep()+"}"},c.prototype.openTagBegin=function(p){var l=this._comma()+this._beginLine()+"{"+this._sep()+this._key(p)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,l+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),l},c.prototype.openTagEnd=function(p,l,f){if(l){var h=this._sep()+"]";return this._additionalLevel--,h+=this._beginLine()+"}"+this._sep()+"}"}return""},c.prototype.closeTag=function(p){var l=this._beginLine()+"]";return this._additionalLevel--,l+=this._beginLine()+"}"+this._sep()+"}"},c.prototype.beginElement=function(p){},c.prototype.endElement=function(p){this._hasChildren.pop()},c.prototype._beginLine=function(p){return p===void 0&&(p=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+p):""},c.prototype._indent=function(p){return p+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(p+this._additionalLevel)},c.prototype._comma=function(){var p=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),p},c.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},c.prototype._key=function(p){return'"'+p+'":'},c.prototype._val=function(p){return JSON.stringify(p)},c}(r(114).BaseCBWriter);n.JSONCBWriter=s},function(a,n,r){r(74);var i,o=this&&this.__extends||(i=function(u,c){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,l){p.__proto__=l}||function(p,l){for(var f in l)l.hasOwnProperty(f)&&(p[f]=l[f])})(u,c)},function(u,c){function p(){this.constructor=u}i(u,c),u.prototype=c===null?Object.create(c):(p.prototype=c.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=function(u){function c(p){var l=u.call(this,p)||this;if(l._rootWritten=!1,l._additionalLevel=0,p.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(p.offset<0)throw new Error("YAML offset should be zero or a positive number.");return l}return o(c,u),c.prototype.frontMatter=function(){return this._beginLine()+"---"},c.prototype.declaration=function(p,l,f){return""},c.prototype.docType=function(p,l,f){return""},c.prototype.comment=function(p){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(p)},c.prototype.text=function(p){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(p)},c.prototype.instruction=function(p,l){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(l?p+" "+l:p)},c.prototype.cdata=function(p){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(p)},c.prototype.attribute=function(p,l){this._additionalLevel++;var f=this._beginLine()+this._key(this._builderOptions.convert.att+p)+" "+this._val(l);return this._additionalLevel--,f},c.prototype.openTagBegin=function(p){var l=this._beginLine()+this._key(p);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,l+=this._beginLine(!0)+this._key(this._builderOptions.convert.text)},c.prototype.openTagEnd=function(p,l,f){return l?" "+this._val(""):""},c.prototype.closeTag=function(p){return this._additionalLevel--,""},c.prototype.beginElement=function(p){},c.prototype.endElement=function(p){},c.prototype._beginLine=function(p){return p===void 0&&(p=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,p)},c.prototype._indent=function(p,l){if(p+this._additionalLevel<=0)return"";var f=this._writerOptions.indent.repeat(p+this._additionalLevel);return!l&&this._rootWritten?f.substr(0,f.length-2)+"-"+f.substr(-1,1):f},c.prototype._key=function(p){return'"'+p+'":'},c.prototype._val=function(p){return JSON.stringify(p)},c}(r(114).BaseCBWriter);n.YAMLCBWriter=s},function(a,n,r){var i,o=typeof Reflect=="object"?Reflect:null,s=o&&typeof o.apply=="function"?o.apply:function(g,C,S){return Function.prototype.apply.call(g,C,S)};i=o&&typeof o.ownKeys=="function"?o.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var u=Number.isNaN||function(g){return g!=g};function c(){c.init.call(this)}a.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var p=10;function l(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function f(g){return g._maxListeners===void 0?c.defaultMaxListeners:g._maxListeners}function h(g,C,S,T){var w,_,E,D;if(l(S),(_=g._events)===void 0?(_=g._events=Object.create(null),g._eventsCount=0):(_.newListener!==void 0&&(g.emit("newListener",C,S.listener?S.listener:S),_=g._events),E=_[C]),E===void 0)E=_[C]=S,++g._eventsCount;else if(typeof E=="function"?E=_[C]=T?[S,E]:[E,S]:T?E.unshift(S):E.push(S),(w=f(g))>0&&E.length>w&&!E.warned){E.warned=!0;var O=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");O.name="MaxListenersExceededWarning",O.emitter=g,O.type=C,O.count=E.length,D=O,console&&console.warn&&console.warn(D)}return g}function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(g,C,S){var T={fired:!1,wrapFn:void 0,target:g,type:C,listener:S},w=v.bind(T);return w.listener=S,T.wrapFn=w,w}function x(g,C,S){var T=g._events;if(T===void 0)return[];var w=T[C];return w===void 0?[]:typeof w=="function"?S?[w.listener||w]:[w]:S?function(_){for(var E=new Array(_.length),D=0;D0&&(_=C[0]),_ instanceof Error)throw _;var E=new Error("Unhandled error."+(_?" ("+_.message+")":""));throw E.context=_,E}var D=w[g];if(D===void 0)return!1;if(typeof D=="function")s(D,this,C);else{var O=D.length,b=d(D,O);for(S=0;S=0;_--)if(S[_]===C||S[_].listener===C){E=S[_].listener,w=_;break}if(w<0)return this;w===0?S.shift():function(D,O){for(;O+1=0;T--)this.removeListener(g,C[T]);return this},c.prototype.listeners=function(g){return x(this,g,!0)},c.prototype.rawListeners=function(g){return x(this,g,!1)},c.listenerCount=function(g,C){return typeof g.listenerCount=="function"?g.listenerCount(C):y.call(g,C)},c.prototype.listenerCount=y,c.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(a,n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=r(77);n.createCB=function(o){return new i.XMLBuilderCBImpl(o)},n.fragmentCB=function(o){return new i.XMLBuilderCBImpl(o,!0)}}])})})(QT);function ew(t,e){return[...t.getElementsByTagName(e)]}function kh(t,e){return ew(t,e)[0]}function tw(t){return Cc.create(t)}function nw(t){return oi.extractBinary(t,/^\s*\s*_/m,/\n\s*<\/AppendedData>/m)}var qn={Int8:Int8Array,UInt8:Uint8Array,Int16:Int16Array,UInt16:Uint16Array,Int32:Int32Array,UInt32:Uint32Array,Int64:Int32Array,UInt64:Uint32Array,Float32:Float32Array,Float64:Float64Array},si={Int8:1,UInt8:1,Int16:2,UInt16:2,Int32:4,UInt32:4,Int64:8,UInt64:8,Float32:4,Float64:8};function Sc(t){const e=t.length-1;return t.filter((a,n)=>n0&&(i===0?o=n*r:o=(n-1)*r+i);const s=new ArrayBuffer(o),u={offset:0,uint8:new Uint8Array(s)};let c=aw(a);for(;c{f.trim().length&&(p[l++]=Number(f))})}else if(u==="binary"){const l=new Uint8Array(Fr.toArrayBuffer(e.firstChild.nodeValue.trim()));if(a==="vtkZLibDataCompressor"){const f=wc(l,r);p=new qn[o](f.buffer),/^U?Int64$/.test(o)&&(p=Sc(p))}else p=new qn[o](l.buffer,si[r]),o.indexOf("Int64")!==-1&&(p=Sc(p))}else if(u==="appended"){const l=Number(e.getAttribute("offset"));p=Tc(new Uint8Array(i,l),o,r)}else console.error("Format not supported",u);return{name:s,values:p,numberOfComponents:c}}function _c(t){return new TextDecoder().decode(t).split("\0").slice(0,-1)}function ow(t,e,a,n,r){const i=t.getAttribute("Name"),o=t.getAttribute("format"),s=Number(t.getAttribute("NumberOfComponents")||"1"),u=Number(t.getAttribute("NumberOfTuples")||"1")*s,c=[];if(o==="ascii"){const p=t.firstChild.nodeValue.trim().split(/\s+/);let l=0;const f=[];for(;c.length{const m=v-h;l[f++]=m;for(let x=0;x{const f=e.getAttribute(l);f&&(u[f]=a[`set${l}`])});const c=e.getElementsByTagName("DataArray"),p=c.length;for(let l=0;lpe.newInstance(ci(Number(s.getAttribute("NumberOfTuples")),s,e,a,n,r))),o=[...t.getElementsByTagName("Array")].filter(s=>s.getAttribute("type")==="String").map(s=>ZT.newInstance(ow(s,e,a,n,r)));return[...i,...o]}function lw(t,e){e.classHierarchy.push("vtkXMLReader"),e.dataAccessHelper||(e.dataAccessHelper=oa.get("http"));function a(n,r={}){return e.dataAccessHelper.fetchBinary(n,r)}t.setUrl=(n,r={})=>{e.url=n;const i=n.split("/");return i.pop(),e.baseURL=i.join("/"),t.loadData(r)},t.loadData=(n={})=>a(e.url,n).then(t.parseAsArrayBuffer),t.parseAsArrayBuffer=n=>{if(!n)return!1;if(n!==e.rawDataBuffer)t.modified();else return!0;const{text:r,binaryBuffer:i}=nw(n);e.rawDataBuffer=n,e.binaryBuffer=i;const o=tw(r).root(),s=o.node,u=s.getAttribute("type"),c=s.getAttribute("compressor"),p=s.getAttribute("byte_order"),l=s.getAttribute("header_type")||"UInt32";if(c&&c!=="vtkZLibDataCompressor")return console.error("Invalid compressor",c),!1;if(p&&p!=="LittleEndian")return console.error("Only LittleEndian encoding is supported"),!1;if(u!==e.dataType)return console.error("Invalid data type",u,"expecting",e.dataType),!1;if(kh(s,"AppendedData")){const h=kh(s,"AppendedData"),v=h.getAttribute("encoding"),m=o.filter(S=>{const{node:T}=S;return T.nodeType===Node.ELEMENT_NODE&&T.getAttribute("format")==="appended"&&T.hasAttribute("offset")},!1,!0).map(S=>({node:S.node,offset:Number(S.node.getAttribute("offset"))}));m.sort((S,T)=>S.offset-T.offset);let x=e.binaryBuffer;v==="base64"&&(x=h.textContent.trim().substr(1));const y=[];for(let S=0;SS+T.length,0),g=new ArrayBuffer(d),C=new Uint8Array(g);for(let S=0,T=0;S{t.parseAsArrayBuffer(e.rawDataBuffer)}}var fw={};function pw(t,e,a={}){Object.assign(e,fw,a),A.obj(t,e),A.get(t,e,["url","baseURL"]),A.setGet(t,e,["dataAccessHelper"]),A.algo(t,e,0,1),lw(t,e)}var Yn={extend:pw,processDataArray:ci,processFieldData:cw,processCells:sw};function hw(t,e){e.classHierarchy.push("vtkXMLImageDataReader"),t.parseXML=(a,n,r,i,o)=>{var h;const s=a.getElementsByTagName(e.dataType)[0],u=s.getAttribute("Origin").split(" ").map(v=>Number(v)),c=s.getAttribute("Spacing").split(" ").map(v=>Number(v)),p=(h=s.getAttribute("Direction"))==null?void 0:h.split(" ").map(v=>Number(v)),l=s.getElementsByTagName("Piece"),f=l.length;for(let v=0;vNumber(d)),y=_0.newInstance({origin:u,spacing:c,direction:p,extent:x});Yn.processFieldData(y.getNumberOfPoints(),m.getElementsByTagName("PointData")[0],y.getPointData(),r,i,o,e.binaryBuffer),Yn.processFieldData(y.getNumberOfCells(),m.getElementsByTagName("CellData")[0],y.getCellData(),r,i,o,e.binaryBuffer),e.output[v]=y}}}var gw={dataType:"ImageData"};function dw(t,e,a={}){Object.assign(e,gw,a),Yn.extend(t,e,a),hw(t,e)}A.newInstance(dw,"vtkXMLImageDataReader");function vw(t,e,a,n,r,i,o){const s=Number(a.getAttribute(`NumberOf${e}`));if(s>0){const u=a.getElementsByTagName(e)[0].getElementsByTagName("DataArray")[0],{values:c,numberOfComponents:p}=Yn.processDataArray(s,u,n,r,i,o);t[`get${e}`]().setData(c,p)}return s}function yw(t,e,a,n,r,i,o){const s=Number(a.getAttribute(`NumberOf${e}`));if(s>0){const u=Yn.processCells(s,a.getElementsByTagName(e)[0],n,r,i,o);t[`get${e}`]().setData(u)}return s}function mw(t,e){e.classHierarchy.push("vtkXMLPolyDataReader"),t.parseXML=(a,n,r,i,o)=>{const s=a.getElementsByTagName(e.dataType)[0].getElementsByTagName("Piece"),u=s.length;for(let c=0;c{h+=yw(p,v,l,r,i,o,e.binaryBuffer)}),Yn.processFieldData(f,l.getElementsByTagName("PointData")[0],p.getPointData(),r,i,o,e.binaryBuffer),Yn.processFieldData(h,l.getElementsByTagName("CellData")[0],p.getCellData(),r,i,o,e.binaryBuffer),e.output[c]=p}}}var xw={dataType:"PolyData"};function Cw(t,e,a={}){Object.assign(e,xw,a),Yn.extend(t,e,a),mw(t,e)}A.newInstance(Cw,"vtkXMLPolyDataReader");const Sw={props:{port:{type:Number,default:0},vtkClass:{type:String,default:"vtkConeSource"},state:{type:Object,default:()=>({})}},setup(t){const e=se.ref(null),a=se.inject("downstream"),n=se.inject("representation");se.provide("downstream",e),se.onMounted(()=>{e.value=_t({vtkClass:t.vtkClass,...t.state}),a.value.setInputConnection(e.value.getOutputPort(),t.port)}),se.onBeforeUnmount(()=>{e.value&&(e.value.delete(),e.value=null)}),se.watch(()=>t.vtkClass,r=>{e.value=_t({vtkClass:r,...t.state}),a.setInputConnection(e.value.getOutputPort(),t.port)}),se.watch(()=>t.state,r=>{e.value.set(r),n&&n.dataChanged()})},template:'
'};var{vtkWarningMacro:Ko}=A;function Tw(t,e){e.classHierarchy.push("vtkCalculator"),t.setFormula=a=>a===e.formula?!1:(e.formula=a,t.modified(),!0),t.getFormula=()=>e.formula,t.augmentInputArrays=(a,n)=>{const r=n.slice(0);return(a===ft.POINT||a===ft.VERTEX)&&r.push({location:ft.COORDINATE}),r},t.createSimpleFormulaObject=(a,n,r,i,o={})=>({getArrays:s=>{var u;return{input:(u=s[0])!=null&&u.isA("vtkImageData")?n.map(c=>({location:a,name:c})):t.augmentInputArrays(a,n.map(c=>({location:a,name:c}))),output:[{location:a,name:r,attribute:"outputAttributeType"in o?o.outputAttributeType:Ff.SCALARS,numberOfComponents:"numberOfOutputComponents"in o?o.numberOfOutputComponents:1}]}},evaluate:(s,u)=>{const c=new Array(s.length),p=s.map((m,x)=>{const y=m.getNumberOfComponents(),d=m.getData();return y===1?g=>d[g]:g=>m.getTuple(g,c[x])}),l=u[0],f=l.getData(),h=l.getNumberOfComponents();let v=new Array(h);if(h===1)f.forEach((m,x)=>{f[x]=i(...p.map(y=>y(x)),x,v)});else{const m=l.getNumberOfTuples();for(let x=0;xy(x)),x,v),l.setTuple(x,v)}}}),t.setFormulaSimple=(a,n,r,i,o={})=>t.setFormula(t.createSimpleFormulaObject(a,n,r,i,o)),t.prepareArrays=(a,n,r)=>{const i=[],o=[];return a.input.forEach(s=>{if(s.location===ft.COORDINATE)i.push(n.getPoints());else{const u=[[ft.UNIFORM,p=>p.getFieldData()],[ft.POINT,p=>p.getPointData()],[ft.CELL,p=>p.getCellData()],[ft.VERTEX,p=>p.getVertexData()],[ft.EDGE,p=>p.getEdgeData()],[ft.ROW,p=>p.getRowData()]].reduce((p,l)=>(p[l[0]]=l[1],p),{}),c="location"in s&&s.location in u?u[s.location](n):null;c?s.name?i.push(c.getArrayByName(s.name)):"index"in s?i.push(c.getArrayByIndex(s.index)):"attribute"in s&&s.location!==ft.UNIFORM?i.push(c.getActiveAttribute(s.attribute)):(Ko(`No matching array for specifier "${JSON.stringify(s)}".`),i.push(null)):(Ko(`Specifier "${JSON.stringify(s)}" did not provide a usable location.`),i.push(null))}}),a.output.forEach(s=>{const u={...s},c="numberOfComponents"in u?u.numberOfComponents:1;if(s.location===ft.UNIFORM&&"tuples"in u&&(u.size=c*u.tuples),s.location===ft.COORDINATE){const p=n.getPoints(),l=kt.newInstance({dataType:p.getDataType()});l.setNumberOfPoints(p.getNumberOfPoints(),p.getNumberOfComponents()),r.setPoints(l),o.push(l)}else{const p=[[ft.UNIFORM,h=>h.getFieldData(),(h,v)=>"tuples"in v?v.tuples:0],[ft.POINT,h=>h.getPointData(),h=>h.getNumberOfPoints()],[ft.CELL,h=>h.getCellData(),h=>h.getNumberOfCells()],[ft.VERTEX,h=>h.getVertexData(),h=>h.getNumberOfVertices()],[ft.EDGE,h=>h.getEdgeData(),h=>h.getNumberOfEdges()],[ft.ROW,h=>h.getRowData(),h=>h.getNumberOfRows()]].reduce((h,v)=>(h[v[0]]={getData:v[1],getSize:v[2]},h),{});let l=null,f=0;if("location"in s&&s.location in p&&(l=p[s.location].getData(r),f=p[s.location].getSize(n,u)),f<=0)Ko(`Output array size could not be determined for ${JSON.stringify(s)}.`),o.push(null);else if(l){u.size=c*f;const h=pe.newInstance(u),v=l.addArray(h);"attribute"in u&&s.location!==ft.UNIFORM&&l.setActiveAttributeByIndex(v,u.attribute),o.push(h)}else Ko(`Specifier "${JSON.stringify(s)}" did not provide a usable location.`),o.push(null)}}),{arraysIn:i,arraysOut:o}},t.requestData=(a,n)=>{var s;if(!e.formula)return 0;const r=e.formula.getArrays(a),i=((s=n[0])==null?void 0:s.initialize())||_t({vtkClass:a[0].getClassName()});i.shallowCopy(a[0]),n[0]=i;const o=t.prepareArrays(r,a[0],n[0]);return e.formula.evaluate(o.arraysIn,o.arraysOut),1}}var ww={formula:{getArrays:()=>({input:[],output:[]}),evaluate:()=>null}};function Ah(t,e,a={}){Object.assign(e,ww,a),A.obj(t,e),A.algo(t,e,1,1),Tw(t,e)}var _w=A.newInstance(Ah,"vtkCalculator"),Ew={newInstance:_w,extend:Ah};const{FieldDataTypes:Vh}=dr,Dw={props:{port:{type:Number,default:0},name:{type:String,default:"scalars"},location:{type:String,default:"POINT"},arrays:{type:Array,default:()=>[]},formula:{type:Function,default:t=>t[0]}},setup(t){const e=se.ref(Ew.newInstance()),a=se.inject("downstream");se.provide("downstream",e),se.onMounted(()=>{e.value.setFormulaSimple(Vh[t.location],t.arrays,t.name,t.formula),a.value.setInputConnection(e.value.getOutputPort(),t.port)}),se.onBeforeUnmount(()=>{e.value&&(e.value.delete(),e.value=null)}),se.onUpdated(()=>{e.value.setFormulaSimple(Vh[t.location],t.arrays,t.name,t.formula)})},template:'
'},Bh={setup(){const t=se.inject("dataset");se.provide("fields",t==null?void 0:t.getCellData())},template:'
'},Ow={int32:Int32Array,int16:Int16Array,int8:Int8Array,uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array,float32:Float32Array,float64:Float64Array};function Uh(t,e){if(!t)return null;if(Array.isArray(t))return e.from(t);if(t.dtype){const{bvals:a,dtype:n}=t,r=Fr.toArrayBuffer(a);return new Ow[n](r)}return t}const Gh={props:{name:{type:String,default:"scalars"},registration:{type:String,default:"addArray"},type:{type:String,default:"Float32Array"},values:{type:[Array,Object,Uint8Array,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]},numberOfComponents:{type:Number,default:1}},setup(t){const e=se.inject("dataset"),a=se.inject("fields"),n=se.inject("representation"),r=pe.newInstance({empty:!0}),i=En(()=>{const p=mt[t.type];r.setData(Uh(t.values,p),t.numberOfComponents),e&&e.modified(),n&&n.dataChanged()},1),{name:o,type:s,values:u,numberOfComponents:c}=se.toRefs(t);se.watch(o,r.setName),se.watch(s,i),se.watch(u,i),se.watch(c,i),se.onMounted(()=>{a&&a[t.registration](r),t.name&&r.setName(t.name),t.values&&(t.values.bvals||t.values.length)&&i()}),se.onBeforeUnmount(()=>{a&&a.removeArray(r),r.delete()}),se.provide("array",r)},template:'
'},bw={setup(){const t=se.inject("dataset");se.provide("fields",t==null?void 0:t.getFieldData())},template:'
'};var Mw=JSON.parse('[{"Name":"KAAMS","IndexedColors":[1.00,1.00,1.00,1.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,1.00,1.00,1.00,0.00,1.00,0.00,1.00,0.00,1.00,1.00,0.63,0.63,1.00,0.67,0.50,0.33,1.00,0.50,0.75,0.53,0.35,0.70,1.00,0.75,0.50],"Annotations":[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{"ColorSpace":"Diverging","Name":"Cool to Warm","NanColor":[1,1,0],"RGBPoints":[0,0.23137254902,0.298039215686,0.752941176471,0.5,0.865,0.865,0.865,1,0.705882352941,0.0156862745098,0.149019607843]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Cool to Warm (Extended)","NanColor":[0.25,0,0],"RGBPoints":[0,0,0,0.34902,0.03125,0.039216,0.062745,0.380392,0.0625,0.062745,0.117647,0.411765,0.09375,0.090196,0.184314,0.45098,0.125,0.12549,0.262745,0.501961,0.15625,0.160784,0.337255,0.541176,0.1875,0.2,0.396078,0.568627,0.21875,0.239216,0.454902,0.6,0.25,0.286275,0.5215689999999999,0.65098,0.28125,0.337255,0.592157,0.7019609999999999,0.3125,0.388235,0.654902,0.74902,0.34375,0.466667,0.737255,0.819608,0.375,0.572549,0.819608,0.878431,0.40625,0.654902,0.866667,0.9098039999999999,0.4375,0.752941,0.917647,0.941176,0.46875,0.823529,0.956863,0.968627,0.5,0.988235,0.960784,0.901961,0.5,0.941176,0.984314,0.988235,0.52,0.988235,0.945098,0.85098,0.54,0.980392,0.898039,0.784314,0.5625,0.968627,0.835294,0.698039,0.59375,0.94902,0.733333,0.588235,0.625,0.929412,0.65098,0.509804,0.65625,0.9098039999999999,0.564706,0.435294,0.6875,0.878431,0.458824,0.352941,0.71875,0.839216,0.388235,0.286275,0.75,0.760784,0.294118,0.211765,0.78125,0.7019609999999999,0.211765,0.168627,0.8125,0.65098,0.156863,0.129412,0.84375,0.6,0.09411799999999999,0.09411799999999999,0.875,0.54902,0.066667,0.098039,0.90625,0.501961,0.05098,0.12549,0.9375,0.45098,0.054902,0.172549,0.96875,0.4,0.054902,0.192157,1,0.34902,0.070588,0.211765]},{"ColorSpace":"Diverging","Name":"Warm to Cool","NanColor":[1,1,0],"RGBPoints":[0,0.705882352941,0.0156862745098,0.149019607843,0.5,0.865,0.865,0.865,1,0.23137254902,0.298039215686,0.752941176471]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Warm to Cool (Extended)","NanColor":[0.250004,0,0],"RGBPoints":[0,0.34902,0,0.129412,0.025,0.4,0.00392157,0.101961,0.05,0.470588,0.0156863,0.0901961,0.075,0.54902,0.027451,0.0705882,0.1,0.619608,0.0627451,0.0431373,0.125,0.690196,0.12549,0.0627451,0.15,0.7411759999999999,0.184314,0.0745098,0.175,0.788235,0.266667,0.0941176,0.2,0.811765,0.345098,0.113725,0.225,0.831373,0.411765,0.133333,0.25,0.85098,0.47451,0.145098,0.275,0.870588,0.54902,0.156863,0.3,0.878431,0.619608,0.168627,0.325,0.890196,0.658824,0.196078,0.35,0.9098039999999999,0.717647,0.235294,0.375,0.929412,0.776471,0.278431,0.395522,0.94902,0.823529,0.321569,0.418905,0.968627,0.87451,0.407843,0.444278,0.980392,0.917647,0.509804,0.470149,0.988235,0.956863,0.643137,0.483582,0.992157,0.964706,0.7137250000000001,0.499,0.988235,0.980392,0.870588,0.5,1,1,1,0.501,0.913725,0.988235,0.9372549999999999,0.516418,0.827451,0.980392,0.886275,0.531343,0.764706,0.980392,0.866667,0.546766,0.658824,0.980392,0.843137,0.564179,0.572549,0.964706,0.835294,0.587562,0.423529,0.941176,0.87451,0.60597,0.262745,0.901961,0.862745,0.629851,0.0705882,0.8549020000000001,0.870588,0.651741,0.0509804,0.8,0.85098,0.681592,0.0235294,0.709804,0.831373,0.712935,0.0313725,0.615686,0.811765,0.75,0.0313725,0.537255,0.788235,0.775,0.0392157,0.466667,0.7686269999999999,0.8,0.0509804,0.396078,0.7411759999999999,0.825,0.054902,0.317647,0.709804,0.85,0.054902,0.243137,0.678431,0.875,0.0431373,0.164706,0.639216,0.9,0.0313725,0.09803920000000001,0.6,0.925,0.0392157,0.0392157,0.5607839999999999,0.95,0.105882,0.0509804,0.509804,0.975,0.113725,0.0235294,0.45098,1,0.12549,0,0.380392]},{"ColorSpace":"RGB","Name":"Rainbow Desaturated","NanColor":[1,1,0],"RGBPoints":[0,0.278431372549,0.278431372549,0.858823529412,0.143,0,0,0.360784313725,0.285,0,1,1,0.429,0,0.501960784314,0,0.571,1,1,0,0.714,1,0.380392156863,0,0.857,0.419607843137,0,0,1,0.8784313725489999,0.301960784314,0.301960784314]},{"ColorSpace":"RGB","Name":"Cold and Hot","NanColor":[1,1,0],"RGBPoints":[0,0,1,1,0.45,0,0,1,0.5,0,0,0.501960784314,0.55,1,0,0,1,1,1,0]},{"ColorSpace":"RGB","Name":"Black-Body Radiation","NanColor":[0,0.498039215686,1],"RGBPoints":[0,0,0,0,0.4,0.901960784314,0,0,0.8,0.901960784314,0.901960784314,0,1,1,1,1]},{"ColorSpace":"RGB","Name":"X Ray","NanColor":[1,0,0],"RGBPoints":[0,1,1,1,1,0,0,0]},{"ColorSpace":"RGB","Name":"Grayscale","NanColor":[1,0,0],"RGBPoints":[0,0,0,0,1,1,1,1]},{"ColorSpace":"RGB","Name":"Grayscale-DICOM-sigmoid","Notes":"This is a 16 point sample of a sigmoid grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2","NanColor":[1,0,0],"BelowRangeColor":[0,0,0],"AboveRangeColor":[1,1,1],"RGBPoints":[-1,0.01798620996209156,0.01798620996209156,0.01798620996209156,-0.8666666666666667,0.030275691986950463,0.030275691986950463,0.030275691986950463,-0.7333333333333334,0.05053016223541345,0.05053016223541345,0.05053016223541345,-0.6,0.08317269649392238,0.08317269649392238,0.08317269649392238,-0.4666666666666667,0.13392788832407365,0.13392788832407365,0.13392788832407365,-0.33333333333333337,0.2086085273260449,0.2086085273260449,0.2086085273260449,-0.19999999999999996,0.31002551887238755,0.31002551887238755,0.31002551887238755,-0.06666666666666665,0.4337256058045608,0.4337256058045608,0.4337256058045608,0.06666666666666665,0.5662743941954392,0.5662743941954392,0.5662743941954392,0.19999999999999996,0.6899744811276125,0.6899744811276125,0.6899744811276125,0.33333333333333326,0.791391472673955,0.791391472673955,0.791391472673955,0.46666666666666656,0.8660721116759263,0.8660721116759263,0.8660721116759263,0.6000000000000001,0.9168273035060777,0.9168273035060777,0.9168273035060777,0.7333333333333334,0.9494698377645865,0.9494698377645865,0.9494698377645865,0.8666666666666667,0.9697243080130495,0.9697243080130495,0.9697243080130495,1,0.9820137900379085,0.9820137900379085,0.9820137900379085]},{"ColorSpace":"RGB","Name":"Inverted-Grayscale","NanColor":[1,0,0],"RGBPoints":[0,1,1,1,1,0,0,0]},{"ColorSpace":"RGB","Name":"Inverted-Grayscale-DICOM-sigmoid","Notes":"This is a 16 point sample of a sigmoid inverted-grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2","BelowRangeColor":[1,1,1],"AboveRangeColor":[0,0,0],"NanColor":[1,0,0],"RGBPoints":[-1,0.9820137900379085,0.9820137900379085,0.9820137900379085,-0.8666666666666667,0.9697243080130495,0.9697243080130495,0.9697243080130495,-0.7333333333333334,0.9494698377645866,0.9494698377645866,0.9494698377645866,-0.6,0.9168273035060777,0.9168273035060777,0.9168273035060777,-0.4666666666666667,0.8660721116759263,0.8660721116759263,0.8660721116759263,-0.33333333333333337,0.791391472673955,0.791391472673955,0.791391472673955,-0.19999999999999996,0.6899744811276125,0.6899744811276125,0.6899744811276125,-0.06666666666666665,0.5662743941954391,0.5662743941954391,0.5662743941954391,0.06666666666666665,0.43372560580456077,0.43372560580456077,0.43372560580456077,0.19999999999999996,0.3100255188723875,0.3100255188723875,0.3100255188723875,0.33333333333333326,0.20860852732604496,0.20860852732604496,0.20860852732604496,0.46666666666666656,0.13392788832407365,0.13392788832407365,0.13392788832407365,0.6000000000000001,0.08317269649392234,0.08317269649392234,0.08317269649392234,0.7333333333333334,0.05053016223541351,0.05053016223541351,0.05053016223541351,0.8666666666666667,0.03027569198695046,0.03027569198695046,0.03027569198695046,1,0.01798620996209155,0.01798620996209155,0.01798620996209155]},{"ColorSpace":"RGB","Name":"BkRd","NanColor":[0,1,1],"RGBPoints":[0,0,0,0,1,1,0,0]},{"ColorSpace":"RGB","Name":"BkGn","NanColor":[1,0,1],"RGBPoints":[0,0,0,0,1,0,1,0]},{"ColorSpace":"RGB","Name":"BkBu","NanColor":[1,1,0],"RGBPoints":[0,0,0,0,1,0,0,1]},{"ColorSpace":"RGB","Name":"BkMa","NanColor":[0,1,0],"RGBPoints":[0,0,0,0,1,1,0,1]},{"ColorSpace":"RGB","Name":"BkCy","NanColor":[0,1,1],"RGBPoints":[0,0,0,0,1,0,1,1]},{"ColorSpace":"RGB","Name":"Black, Blue and White","NanColor":[1,1,0],"RGBPoints":[0,0,0,0,0.333,0,0,0.501960784314,0.666,0,0.501960784314,1,1,1,1,1]},{"ColorSpace":"RGB","Name":"Black, Orange and White","NanColor":[1,1,0],"RGBPoints":[0,0,0,0,0.333,0.501960784314,0,0,0.666,1,0.501960784314,0,1,1,1,1]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Linear YGB 1211g","NanColor":[0.25,0,0],"RGBPoints":[0,1,0.988235,0.968627,0.02,1,0.952941,0.878431,0.05,0.968627,0.905882,0.776471,0.1,0.94902,0.898039,0.6470590000000001,0.15,0.901961,0.878431,0.556863,0.2,0.847059,0.858824,0.482353,0.25,0.690196,0.819608,0.435294,0.3,0.513725,0.7686269999999999,0.384314,0.35,0.337255,0.721569,0.337255,0.4,0.278431,0.658824,0.392157,0.45,0.231373,0.639216,0.435294,0.5,0.203922,0.6,0.486275,0.55,0.172549,0.568627,0.537255,0.6,0.141176,0.517647,0.54902,0.65,0.133333,0.458824,0.541176,0.7,0.12549,0.396078,0.529412,0.75,0.117647,0.321569,0.5215689999999999,0.8,0.121569,0.258824,0.509804,0.85,0.133333,0.227451,0.501961,0.9,0.145098,0.192157,0.490196,0.95,0.188235,0.164706,0.470588,1,0.258824,0.196078,0.439216]},{"ColorSpace":"CIELAB","Creator":"Francesca Samsel","Name":"Linear Green (Gr4L)","NanColor":[0.25,0,0],"RGBPoints":[0,0.054901999999999999,0.109804,0.121569,0.050000000000000003,0.074510000000000007,0.17254900000000001,0.180392,0.10000000000000001,0.086275000000000004,0.231373,0.219608,0.14999999999999999,0.094117999999999993,0.27843099999999998,0.25097999999999998,0.20000000000000001,0.109804,0.34902,0.27843099999999998,0.25,0.11372500000000001,0.40000000000000002,0.27843099999999998,0.29999999999999999,0.117647,0.45097999999999999,0.270588,0.34999999999999998,0.117647,0.49019600000000002,0.24313699999999999,0.40000000000000002,0.11372500000000001,0.52156899999999995,0.20392199999999999,0.45000000000000001,0.109804,0.54901999999999995,0.15294099999999999,0.5,0.082352999999999996,0.58823499999999995,0.082352999999999996,0.55000000000000004,0.109804,0.63137299999999996,0.050979999999999998,0.59999999999999998,0.21176500000000001,0.67843100000000001,0.082352999999999996,0.65000000000000002,0.31764700000000001,0.72156900000000002,0.11372500000000001,0.69999999999999996,0.43137300000000001,0.76078400000000002,0.16078400000000001,0.75,0.556863,0.80000000000000004,0.23921600000000001,0.80000000000000004,0.66666700000000001,0.83921599999999996,0.29411799999999999,0.84999999999999998,0.78431399999999996,0.87843099999999996,0.39607799999999999,0.90000000000000002,0.88627500000000003,0.92156899999999997,0.53333299999999995,0.94999999999999996,0.96078399999999997,0.94901999999999997,0.67058799999999996,1,1,0.98431400000000002,0.90196100000000001]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Linear Blue (8_31f)","NanColor":[0.25,0,0],"RGBPoints":[0,0.960784,1,0.980392,0.05,0.815686,0.960784,0.913725,0.1,0.670588,0.929412,0.870588,0.15,0.556863,0.901961,0.843137,0.2,0.478431,0.870588,0.823529,0.25,0.439216,0.831373,0.803922,0.3,0.4,0.8,0.788235,0.35,0.376471,0.7686269999999999,0.7686269999999999,0.4,0.34902,0.709804,0.7294119999999999,0.45,0.32549,0.654902,0.690196,0.5,0.301961,0.607843,0.658824,0.55,0.247059,0.545098,0.619608,0.6,0.239216,0.494118,0.580392,0.65,0.227451,0.439216,0.541176,0.7,0.227451,0.403922,0.5215689999999999,0.75,0.231373,0.368627,0.501961,0.8,0.227451,0.321569,0.470588,0.85,0.219608,0.282353,0.439216,0.9,0.192157,0.235294,0.4,0.95,0.160784,0.184314,0.34902,1,0.133333,0.12549,0.301961]},{"ColorSpace":"HSV","Name":"Blue to Red Rainbow","NanColor":[0.498039215686,0.498039215686,0.498039215686],"RGBPoints":[0,0,0,1,1,1,0,0]},{"ColorSpace":"HSV","Name":"Red to Blue Rainbow","NanColor":[0.498039215686,0.498039215686,0.498039215686],"RGBPoints":[0,1,0,0,1,0,0,1]},{"ColorSpace":"RGB","Name":"Rainbow Blended White","NanColor":[1,1,0],"RGBPoints":[0,1,1,1,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.8784313725489999,0,1]},{"ColorSpace":"RGB","Name":"Rainbow Blended Grey","NanColor":[1,1,0],"RGBPoints":[0,0.317647058824,0.341176470588,0.43137254902,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.8784313725489999,0,1]},{"ColorSpace":"RGB","Name":"Rainbow Blended Black","NanColor":[1,1,0],"RGBPoints":[0,0,0,0,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.8784313725489999,0,1]},{"ColorSpace":"RGB","Name":"Blue to Yellow","NanColor":[1,0,0],"RGBPoints":[0,0.0392156862745,0.0392156862745,0.949019607843,1,0.949019607843,0.949019607843,0.0392156862745]},{"ColorSpace":"HSV","Name":"blot","RGBPoints":[0,0,0,1,0.166,0,0,1,0.167,1,0,1,0.332,1,0,1,0.333,0,1,1,0.5,0,1,1,0.501,0,1,0,0.666,0,1,0,0.667,1,1,0,0.832,1,1,0,0.833,1,0,0,1,1,0,0]},{"ColorSpace":"Lab","Name":"CIELab Blue to Red","NanColor":[1,1,0],"RGBPoints":[0,0,0.6,0.749019607843,1,0.76862745098,0.466666666667,0.341176470588]},{"ColorSpace":"RGB","Name":"jet","RGBPoints":[-1,0,0,0.5625,-0.777778,0,0,1,-0.269841,0,1,1,-0.015873,0.5,1,0.5,0.238095,1,1,0,0.746032,1,0,0,1,0.5,0,0]},{"ColorSpace":"RGB","Name":"rainbow","RGBPoints":[-1,0,0,1,-0.5,0,1,1,0,0,1,0,0.5,1,1,0,1,1,0,0]},{"ColorSpace":"Lab","Name":"erdc_rainbow_bright","RGBPoints":[-1,0.32549,0.14902,0.960784,-0.866221,0.297047,0.375586,0.963836,-0.732441,0.180302,0.536818,0.964627,-0.598662,0.1302,0.649207,0.929647,-0.464883,0.0445143,0.749654,0.855998,-0.331104,0.0271325,0.830713,0.721527,-0.197324,0.259504,0.8661450000000001,0.543555,-0.0635452,0.428364,0.890725,0.329819,0.07023409999999999,0.568503,0.898508,0.187623,0.204013,0.738259,0.890317,0.0825461,0.337793,0.84546,0.86136,0.0147555,0.471572,0.912191,0.808018,0,0.605351,0.962848,0.710445,0,0.73913,0.9994690000000001,0.600258,0.0176284,0.87291,0.994156,0.445975,0.193912,1,0.980407,0.247105,0.262699]},{"ColorSpace":"Lab","Name":"erdc_rainbow_dark","RGBPoints":[-1,0,0,0.423499,-0.866221,0,0.119346,0.529237,-0.732441,0,0.238691,0.634976,-0.598662,0,0.346852,0.68788,-0.464883,0,0.45022,0.718141,-0.331104,0,0.553554,0.664839,-0.197324,0,0.651082,0.519303,-0.0635452,0.115841,0.72479,0.352857,0.07023409999999999,0.326771,0.781195,0.140187,0.204013,0.522765,0.798524,0.0284624,0.337793,0.703162,0.788685,0.00885756,0.471572,0.845118,0.7511330000000001,0,0.605351,0.955734,0.690825,0,0.73913,0.995402,0.567916,0.0618524,0.87291,0.987712,0.403398,0.164851,1,0.980407,0.247105,0.262699]},{"ColorSpace":"Lab","Name":"nic_CubicL","RGBPoints":[-1,0.479965,0.0118108,0.5306999999999999,-0.87451,0.522213,0.0551282,0.706919,-0.74902,0.50839,0.237278,0.867764,-0.623529,0.451617,0.373834,0.987255,-0.498039,0.39365,0.497255,0.97506,-0.372549,0.328631,0.599639,0.8918430000000001,-0.247059,0.250043,0.690286,0.7785530000000001,-0.121569,0.249656,0.7649049999999999,0.645857,0.00392157,0.297954,0.821466,0.50449,0.129412,0.337509,0.872595,0.358447,0.254902,0.430011,0.913789,0.297079,0.380392,0.587191,0.931381,0.333353,0.5058820000000001,0.7279369999999999,0.93591,0.353742,0.631373,0.826403,0.921081,0.365066,0.756863,0.893201,0.846317,0.372662,0.8823530000000001,0.965347,0.7388400000000001,0.378506,1,0.983235,0.597451,0.366856]},{"ColorSpace":"Lab","Name":"nic_CubicYF","RGBPoints":[-1,0.5151,0.0482,0.6697,-0.87451,0.520711,0.168955,0.800574,-0.74902,0.493694,0.278596,0.911824,-0.623529,0.440026,0.369475,0.984978,-0.498039,0.398932,0.457593,0.987053,-0.372549,0.350651,0.540644,0.929608,-0.247059,0.298827,0.615625,0.857729,-0.121569,0.239928,0.685061,0.769531,0.00392157,0.228832,0.739349,0.673287,0.129412,0.263297,0.78608,0.5699880000000001,0.254902,0.298107,0.828337,0.460214,0.380392,0.33092,0.864071,0.352674,0.5058820000000001,0.38306,0.898169,0.287309,0.631373,0.49023,0.917481,0.307961,0.756863,0.6237200000000001,0.926026,0.332309,0.8823530000000001,0.717458,0.92527,0.342476,1,0.8,0.9255,0.3529]},{"ColorSpace":"Lab","Name":"gist_earth","RGBPoints":[-1,0,0,0,-0.87451,0.239216,0.027451,0.415686,-0.74902,0.0901961,0.254902,0.556863,-0.623529,0.0941176,0.352941,0.54902,-0.498039,0.105882,0.435294,0.5333329999999999,-0.372549,0.12549,0.52549,0.501961,-0.247059,0.156863,0.596078,0.443137,-0.121569,0.196078,0.65098,0.380392,0.00392157,0.282353,0.717647,0.301961,0.129412,0.466667,0.772549,0.27451,0.254902,0.678431,0.784314,0.309804,0.380392,0.901961,0.756863,0.376471,0.5058820000000001,0.992157,0.705882,0.5215689999999999,0.631373,1,0.721569,0.7019609999999999,0.756863,1,0.784314,0.784314,0.8823530000000001,1,0.866667,0.866667,1,1,1,1]},{"ColorSpace":"Lab","Name":"2hot","RGBPoints":[-1,0.0416667,0,0,-0.873016,0.208333,0,0,-0.746032,0.375,0,0,-0.619048,0.541667,0,0,-0.492063,0.708333,0,0,-0.365079,0.854137,0,0,-0.238095,0.937488,0.039062,0,-0.111111,1,0.208333,0,0.015873,1,0.375,0,0.142857,1,0.541667,0,0.269841,1,0.708333,0,0.396825,1,0.858805,0.03125,0.52381,1,0.947392,0.15625,0.650794,1,1,0.3125,0.777778,1,1,0.5625,0.904762,1,1,0.8125,1,1,1,1]},{"ColorSpace":"Lab","Name":"erdc_red2yellow_BW","RGBPoints":[-1,7.54296e-07,0,1.09827e-05,-0.87451,0.18285,0.0264094,0,-0.74902,0.3066,0,0,-0.623529,0.422841,0,0,-0.498039,0.522945,0,0,-0.372549,0.605721,0,0,-0.247059,0.672502,0.14168,0,-0.121569,0.728167,0.244025,0,0.00392157,0.781215,0.333454,0,0.129412,0.825,0.423586,0,0.254902,0.855893,0.5167929999999999,0,0.380392,0.880491,0.608846,0,0.5058820000000001,0.910305,0.695505,0,0.631373,0.94109,0.779067,0.223528,0.756863,0.967873,0.858572,0.473521,0.8823530000000001,0.986815,0.933211,0.751583,1,1,1,0.999997]},{"ColorSpace":"Lab","Name":"erdc_marine2gold_BW","RGBPoints":[-1,1.11641e-07,0,1.62551e-06,-0.87451,0.0413146,0.0619808,0.209857,-0.74902,0.0185557,0.101341,0.350684,-0.623529,0.00486405,0.149847,0.461054,-0.498039,0.0836345,0.210845,0.517906,-0.372549,0.173222,0.276134,0.541793,-0.247059,0.259857,0.343877,0.535869,-0.121569,0.362299,0.408124,0.504293,0.00392157,0.468266,0.468276,0.468257,0.129412,0.582781,0.527545,0.374914,0.254902,0.691591,0.585251,0.274266,0.380392,0.784454,0.645091,0.247332,0.5058820000000001,0.862299,0.710383,0.27518,0.631373,0.920863,0.782923,0.351563,0.756863,0.955792,0.859699,0.533541,0.8823530000000001,0.976162,0.93433,0.780671,1,1,1,0.999983]},{"ColorSpace":"Lab","Name":"erdc_blue2gold_BW","RGBPoints":[-1,0,0,0,-0.87451,0.07427350000000001,0.0440331,0.230013,-0.74902,0.125276,0.0258685,0.415826,-0.623529,0.143879,0.0163031,0.591346,-0.498039,0.212261,0.06278549999999999,0.7052389999999999,-0.372549,0.306048,0.141178,0.763636,-0.247059,0.391537,0.232286,0.773263,-0.121569,0.461734,0.336633,0.708321,0.00392157,0.54209,0.427581,0.5900069999999999,0.129412,0.61704,0.508623,0.460978,0.254902,0.702703,0.579586,0.309117,0.380392,0.790336,0.644811,0.170397,0.5058820000000001,0.870173,0.7107329999999999,0.117134,0.631373,0.9365599999999999,0.781991,0.157144,0.756863,0.965672,0.8620679999999999,0.409836,0.8823530000000001,0.985751,0.936296,0.714162,1,1,1,0.999999]},{"ColorSpace":"Lab","Name":"erdc_sapphire2gold_BW","RGBPoints":[-1,0.107704,0.107708,0.107694,-0.87451,0.1851,0.112354,0.308554,-0.74902,0.236782,0.114233,0.48788,-0.623529,0.28296,0.126187,0.639464,-0.498039,0.344787,0.171643,0.739713,-0.372549,0.413325,0.242371,0.76913,-0.247059,0.481863,0.3131,0.719841,-0.121569,0.5504019999999999,0.383829,0.612222,0.00392157,0.61894,0.454558,0.51126,0.129412,0.687478,0.5252869999999999,0.39993,0.254902,0.7560170000000001,0.596016,0.289923,0.380392,0.824555,0.666745,0.255498,0.5058820000000001,0.892979,0.736822,0.27696,0.631373,0.938851,0.804966,0.351734,0.756863,0.966491,0.874853,0.53572,0.8823530000000001,0.982105,0.94153,0.782579,1,1,1,0.999986]},{"ColorSpace":"Lab","Name":"erdc_red2purple_BW","RGBPoints":[-1,0,0,0,-0.87451,0.167793,0.0166271,0.0431278,-0.74902,0.262608,0.0107595,0.0791181,-0.623529,0.351902,0.0101858,0.100926,-0.498039,0.441257,0.0160835,0.131919,-0.372549,0.5221,0.0555972,0.195625,-0.247059,0.593852,0.104294,0.310234,-0.121569,0.654628,0.158115,0.448486,0.00392157,0.707443,0.220914,0.570253,0.129412,0.7495039999999999,0.293268,0.67897,0.254902,0.781587,0.370517,0.779269,0.380392,0.809951,0.451099,0.855831,0.5058820000000001,0.84424,0.531462,0.900451,0.631373,0.865174,0.620901,0.91606,0.756863,0.875041,0.714054,0.910284,0.8823530000000001,0.880764,0.80554,0.896276,1,0.887572,0.887591,0.887556]},{"ColorSpace":"Lab","Name":"erdc_purple2pink_BW","RGBPoints":[-1,0,0,0,-0.87451,0.117562,0.0291202,0.175876,-0.74902,0.178368,0.0458476,0.285454,-0.623529,0.237731,0.0680173,0.387717,-0.498039,0.300877,0.09562909999999999,0.484802,-0.372549,0.370929,0.136858,0.554985,-0.247059,0.449033,0.189273,0.58863,-0.121569,0.529971,0.245796,0.598587,0.00392157,0.609914,0.300643,0.610244,0.129412,0.697079,0.351286,0.616371,0.254902,0.7858579999999999,0.401991,0.617376,0.380392,0.862517,0.45745,0.64463,0.5058820000000001,0.91359,0.525462,0.705336,0.631373,0.9325830000000001,0.61064,0.767412,0.756863,0.922478,0.706966,0.817522,0.8823530000000001,0.901302,0.803071,0.856311,1,0.887571,0.887591,0.887549]},{"ColorSpace":"Lab","Name":"erdc_pbj_lin","RGBPoints":[-1,0,0,0,-0.87451,0.091821,0.0611476,0.10617,-0.74902,0.160311,0.0900022,0.192713,-0.623529,0.22484,0.12126,0.272128,-0.498039,0.291263,0.157469,0.340828,-0.372549,0.360015,0.200388,0.388903,-0.247059,0.437497,0.250058,0.387201,-0.121569,0.512636,0.304969,0.355955,0.00392157,0.582603,0.360874,0.33488,0.129412,0.655126,0.416374,0.306351,0.254902,0.725889,0.473329,0.279051,0.380392,0.778125,0.537928,0.302697,0.5058820000000001,0.815894,0.606931,0.382431,0.631373,0.839159,0.679308,0.497608,0.756863,0.854748,0.7516659999999999,0.631792,0.8823530000000001,0.869483,0.822508,0.7685920000000001,1,0.887572,0.887589,0.887565]},{"ColorSpace":"Lab","Name":"erdc_blue2green_muted","RGBPoints":[-1,0.107704,0.107708,0.107695,-0.87451,0.141522,0.13066,0.270741,-0.74902,0.180123,0.146119,0.42308,-0.623529,0.210161,0.169674,0.551795,-0.498039,0.239701,0.212939,0.634969,-0.372549,0.253916,0.282947,0.653641,-0.247059,0.242791,0.366933,0.608521,-0.121569,0.226302,0.446776,0.52693,0.00392157,0.236237,0.514689,0.458798,0.129412,0.274641,0.577589,0.376069,0.254902,0.349625,0.633993,0.288131,0.380392,0.4437,0.683677,0.260497,0.5058820000000001,0.536247,0.731214,0.285424,0.631373,0.628472,0.777128,0.349151,0.756863,0.718259,0.819287,0.496825,0.8823530000000001,0.804768,0.856164,0.703299,1,0.887571,0.887591,0.887548]},{"ColorSpace":"Lab","Name":"erdc_blue2green_BW","RGBPoints":[-1,3.63578e-07,0,5.29374e-06,-0.87451,0.0539915,0.0577948,0.212806,-0.74902,0.0620393,0.07589419999999999,0.388959,-0.623529,0.0697499,0.102032,0.54177,-0.498039,0.113295,0.156156,0.64334,-0.372549,0.152047,0.243196,0.670283,-0.247059,0.158096,0.344084,0.622864,-0.121569,0.151142,0.43922,0.532767,0.00392157,0.17155,0.5215880000000001,0.457719,0.129412,0.225861,0.599141,0.363997,0.254902,0.32328,0.6700700000000001,0.259083,0.380392,0.442344,0.733697,0.223754,0.5058820000000001,0.558409,0.794941,0.257411,0.631373,0.673875,0.854344,0.340822,0.756863,0.7872440000000001,0.909326,0.524717,0.8823530000000001,0.896483,0.958063,0.775914,1,1,1,0.999982]},{"ColorSpace":"Lab","Name":"GREEN-WHITE_LINEAR","RGBPoints":[-1,0,0,0,-0.87451,0,0.062745,0,-0.74902,0,0.12549,0,-0.623529,0,0.188235,0,-0.498039,0,0.25098,0,-0.372549,0,0.313725,0,-0.247059,0,0.376471,0,-0.121569,0.09411799999999999,0.439216,0,0.00392157,0.196078,0.501961,0,0.129412,0.294118,0.564706,0,0.254902,0.396078,0.627451,0,0.380392,0.498039,0.690196,0,0.5058820000000001,0.6,0.752941,0.145098,0.631373,0.7019609999999999,0.815686,0.364706,0.756863,0.8,0.878431,0.580392,0.8823530000000001,0.901961,0.941176,0.796078,1,1,1,1]},{"ColorSpace":"Lab","Name":"erdc_green2yellow_BW","RGBPoints":[-1,0,0,0,-0.87451,0,0.105542,0.0603919,-0.74902,0,0.159454,0.104148,-0.623529,0,0.219502,0.15542,-0.498039,0,0.282276,0.203811,-0.372549,0,0.346331,0.235652,-0.247059,0,0.411765,0.235428,-0.121569,0,0.477177,0.217977,0.00392157,0.0593644,0.541635,0.21361,0.129412,0.233081,0.604722,0.210591,0.254902,0.369803,0.664942,0.226536,0.380392,0.498446,0.722367,0.288237,0.5058820000000001,0.601929,0.7822440000000001,0.380815,0.631373,0.703207,0.840497,0.512134,0.756863,0.803186,0.896433,0.674462,0.8823530000000001,0.903834,0.9502660000000001,0.846715,1,1,1,0.999981]},{"ColorSpace":"Lab","Name":"blue2cyan","RGBPoints":[-1,0,0,0,-0.87451,0,0.152941,0.364706,-0.74902,0,0.254902,0.470588,-0.623529,0,0.34902,0.572549,-0.498039,0,0.443137,0.670588,-0.372549,0,0.537255,0.772549,-0.247059,0,0.627451,0.870588,-0.121569,0,0.717647,0.964706,0.00392157,0.0784314,0.772549,1,0.129412,0.207843,0.858824,1,0.254902,0.32549,0.941176,1,0.380392,0.45098,1,1,0.5058820000000001,0.5607839999999999,1,1,0.631373,0.662745,1,1,0.756863,0.760784,1,1,0.8823530000000001,0.870588,1,1,1,1,1,1]},{"ColorSpace":"Lab","Name":"erdc_blue2cyan_BW","RGBPoints":[-1,4.05298e-07,0,5.9012e-06,-0.87451,0.0207526,0.0740933,0.18093,-0.74902,0,0.121033,0.30343,-0.623529,0,0.166892,0.416095,-0.498039,0,0.216768,0.524796,-0.372549,0.0164769,0.275471,0.608585,-0.247059,0.0544527,0.344824,0.659267,-0.121569,0.0880643,0.419118,0.688675,0.00392157,0.127938,0.492556,0.720256,0.129412,0.149476,0.5669459999999999,0.756918,0.254902,0.188961,0.641333,0.792122,0.380392,0.245482,0.715336,0.827609,0.5058820000000001,0.329216,0.786235,0.874761,0.631373,0.453558,0.852803,0.918466,0.756863,0.626281,0.910493,0.954,0.8823530000000001,0.82257,0.958709,0.980146,1,1,1,0.999989]},{"ColorSpace":"Lab","Name":"erdc_blue_BW","RGBPoints":[-1,0,0,0,-0.87451,0.0425591,0.0763529,0.150682,-0.74902,0.0569472,0.119154,0.275403,-0.623529,0.0635978,0.164772,0.395427,-0.498039,0.07743419999999999,0.213851,0.510014,-0.372549,0.106815,0.267034,0.615102,-0.247059,0.122093,0.324649,0.720068,-0.121569,0.160851,0.387068,0.806956,0.00392157,0.213754,0.453516,0.878012,0.129412,0.26722,0.524656,0.932436,0.254902,0.326844,0.599279,0.968038,0.380392,0.403403,0.674712,0.984784,0.5058820000000001,0.499703,0.745519,1,0.631373,0.615055,0.813983,1,0.756863,0.74405,0.879228,1,0.8823530000000001,0.8779090000000001,0.941913,1,1,1,1,0.999996]},{"ColorSpace":"Lab","Name":"BLUE-WHITE","RGBPoints":[-1,0,0,0,-0.87451,0,0,0.082353,-0.74902,0,0,0.168627,-0.623529,0,0,0.254902,-0.498039,0,0,0.337255,-0.372549,0,0,0.423529,-0.247059,0,0,0.509804,-0.121569,0,0.101961,0.592157,0.00392157,0,0.203922,0.678431,0.129412,0,0.301961,0.764706,0.254902,0,0.403922,0.85098,0.380392,0,0.5058820000000001,0.933333,0.5058820000000001,0,0.603922,1,0.631373,0.254902,0.705882,1,0.756863,0.509804,0.807843,1,0.8823530000000001,0.764706,0.905882,1,1,1,1,1]},{"ColorSpace":"Lab","Name":"erdc_purple_BW","RGBPoints":[-1,4.264e-08,0,6.20844e-07,-0.87451,0.100579,0.0593111,0.145666,-0.74902,0.167794,0.0889224,0.254953,-0.623529,0.231446,0.123339,0.360511,-0.498039,0.296699,0.163027,0.461278,-0.372549,0.363211,0.209286,0.55306,-0.247059,0.431136,0.260776,0.637195,-0.121569,0.498202,0.320012,0.705799,0.00392157,0.567456,0.380459,0.778091,0.129412,0.629381,0.445284,0.8448,0.254902,0.688373,0.517374,0.895694,0.380392,0.74891,0.590906,0.93976,0.5058820000000001,0.805017,0.667956,0.977626,0.631373,0.8509139999999999,0.752618,0.9923959999999999,0.756863,0.89724,0.838454,0.994093,0.8823530000000001,0.948461,0.922603,0.994449,1,1,1,0.9999670000000001]},{"ColorSpace":"Lab","Name":"erdc_magenta_BW","RGBPoints":[-1,0,0,2.54023e-05,-0.87451,0.128696,0.0456782,0.11635,-0.74902,0.228133,0.0476299,0.201452,-0.623529,0.327273,0.0374065,0.282107,-0.498039,0.420953,0.0408166,0.35709,-0.372549,0.511562,0.06422029999999999,0.430511,-0.247059,0.599552,0.102686,0.504257,-0.121569,0.684646,0.150536,0.579429,0.00392157,0.765817,0.205978,0.656062,0.129412,0.839176,0.27229,0.731807,0.254902,0.89536,0.357594,0.797309,0.380392,0.930238,0.457825,0.846984,0.5058820000000001,0.945921,0.564536,0.880571,0.631373,0.948995,0.670753,0.9022790000000001,0.756863,0.947124,0.772819,0.918171,0.8823530000000001,0.947265,0.869424,0.934352,1,0.954719,0.95475,0.954726]},{"ColorSpace":"Lab","Name":"magenta","RGBPoints":[-1,0,0,0,-0.87451,0.364706,0,0.152941,-0.74902,0.470588,0,0.254902,-0.623529,0.572549,0,0.34902,-0.498039,0.670588,0,0.443137,-0.372549,0.772549,0,0.537255,-0.247059,0.870588,0,0.627451,-0.121569,0.964706,0,0.717647,0.00392157,1,0.0784314,0.772549,0.129412,1,0.207843,0.858824,0.254902,1,0.32549,0.941176,0.380392,1,0.45098,1,0.5058820000000001,1,0.5607839999999999,1,0.631373,1,0.662745,1,0.756863,1,0.760784,1,0.8823530000000001,1,0.870588,1,1,1,1,1]},{"ColorSpace":"Lab","Name":"RED-PURPLE","RGBPoints":[-1,0,0,0,-0.87451,0.188235,0,0.007842999999999999,-0.74902,0.345098,0,0.035294,-0.623529,0.439216,0,0.098039,-0.498039,0.5333329999999999,0,0.152941,-0.372549,0.627451,0.015686,0.211765,-0.247059,0.721569,0.031373,0.266667,-0.121569,0.8,0.047059,0.329412,0.00392157,0.862745,0.047059,0.403922,0.129412,0.941176,0.062745,0.466667,0.254902,0.988235,0.078431,0.54902,0.380392,0.988235,0.141176,0.643137,0.5058820000000001,0.988235,0.25098,0.7294119999999999,0.631373,0.988235,0.376471,0.811765,0.756863,0.988235,0.54902,0.886275,0.8823530000000001,0.988235,0.752941,0.952941,1,0.996078,0.996078,0.996078]},{"ColorSpace":"Lab","Name":"erdc_red_BW","RGBPoints":[-1,0,0,0,-0.87451,0.147204,0.0480135,0.0401815,-0.74902,0.253411,0.0617478,0.0301333,-0.623529,0.356059,0.07463309999999999,0.0446897,-0.498039,0.457731,0.09349349999999999,0.0636931,-0.372549,0.557199,0.122714,0.0860013,-0.247059,0.665179,0.144238,0.105585,-0.121569,0.763833,0.187056,0.138326,0.00392157,0.847035,0.254558,0.189407,0.129412,0.905663,0.345937,0.258215,0.254902,0.941431,0.447111,0.346277,0.380392,0.962608,0.5469270000000001,0.457571,0.5058820000000001,0.987833,0.637276,0.569944,0.631373,0.994202,0.732176,0.687958,0.756863,0.993304,0.826268,0.800567,0.8823530000000001,0.994413,0.917205,0.906393,1,1,1,0.999979]},{"ColorSpace":"Lab","Name":"RED_TEMPERATURE","RGBPoints":[-1,0,0,0,-0.87451,0.090196,0,0,-0.74902,0.180392,0,0,-0.623529,0.270588,0,0,-0.498039,0.360784,0,0,-0.372549,0.45098,0,0,-0.247059,0.545098,0,0,-0.121569,0.635294,0,0,0.00392157,0.72549,0.058824,0,0.129412,0.815686,0.176471,0,0.254902,0.905882,0.294118,0,0.380392,1,0.411765,0,0.5058820000000001,1,0.5333329999999999,0.027451,0.631373,1,0.65098,0.27451,0.756863,1,0.7686269999999999,0.5215689999999999,0.8823530000000001,1,0.886275,0.7686269999999999,1,1,1,1]},{"ColorSpace":"Lab","Name":"erdc_orange_BW","RGBPoints":[-1,0,0,2.53806e-05,-0.87451,0.135871,0.0593824,0,-0.74902,0.224328,0.0907216,0,-0.623529,0.318083,0.119647,0,-0.498039,0.414443,0.150246,0,-0.372549,0.511077,0.184884,0,-0.247059,0.605501,0.226033,0,-0.121569,0.6952739999999999,0.275491,0,0.00392157,0.777826,0.334445,0,0.129412,0.851498,0.402441,0,0.254902,0.915899,0.47759,0.000602975,0.380392,0.971984,0.557882,0.0361443,0.5058820000000001,1,0.6412870000000001,0.135967,0.631373,1,0.725198,0.27997,0.756863,1,0.808205,0.438135,0.8823530000000001,1,0.89306,0.587036,1,1,0.977928,0.721599]},{"ColorSpace":"Lab","Name":"heated_object","RGBPoints":[-1,0,0,0,-0.87451,0.34902,0.0862745,0,-0.74902,0.45098,0.172549,0,-0.623529,0.52549,0.231373,0,-0.498039,0.580392,0.278431,0,-0.372549,0.623529,0.313725,0,-0.247059,0.670588,0.352941,0,-0.121569,0.717647,0.392157,0,0.00392157,0.772549,0.439216,0,0.129412,0.839216,0.494118,0,0.254902,0.901961,0.541176,0,0.380392,0.968627,0.6,0,0.5058820000000001,1,0.658824,0,0.631373,1,0.721569,0,0.756863,1,0.827451,0.298039,0.8823530000000001,1,0.976471,0.72549,1,1,1,1]},{"ColorSpace":"Lab","Name":"erdc_gold_BW","RGBPoints":[-1,0,0,1.90933e-05,-0.87451,0.128363,0.0636265,0,-0.74902,0.193795,0.111057,0,-0.623529,0.25976,0.15987,0,-0.498039,0.328546,0.210589,0,-0.372549,0.399726,0.26332,0,-0.247059,0.472969,0.318261,0,-0.121569,0.546245,0.375827,0,0.00392157,0.6174500000000001,0.436719,0,0.129412,0.685545,0.501113,0,0.254902,0.749578,0.5687990000000001,0,0.380392,0.80962,0.6394,0,0.5058820000000001,0.865572,0.712699,0.10257,0.631373,0.917709,0.787569,0.233665,0.756863,0.9669140000000001,0.863138,0.369608,0.8823530000000001,1,0.939405,0.496104,1,0.999225,1,0.612275]},{"ColorSpace":"Lab","Name":"erdc_brown_BW","RGBPoints":[-1,3.3216e-07,0,4.83629e-06,-0.87451,0.14693,0.0518172,0,-0.74902,0.225806,0.08149960000000001,0,-0.623529,0.301681,0.111452,0,-0.498039,0.370487,0.150664,0,-0.372549,0.43108,0.199477,0,-0.247059,0.4849,0.255107,0,-0.121569,0.536798,0.313486,0,0.00392157,0.5928600000000001,0.371167,0,0.129412,0.653119,0.428135,0,0.254902,0.714589,0.485917,0.0379541,0.380392,0.774667,0.54565,0.116634,0.5058820000000001,0.831222,0.608047,0.183895,0.631373,0.880305,0.674199,0.260298,0.756863,0.922314,0.742472,0.367086,0.8823530000000001,0.959408,0.811222,0.497258,1,0.993548,0.875183,0.622093]},{"ColorSpace":"Lab","Name":"copper_Matlab","RGBPoints":[-1,0,0,0,-0.87451,0.0784314,0.0501961,0.0313725,-0.74902,0.156863,0.100392,0.0627451,-0.623529,0.235294,0.150588,0.0941176,-0.498039,0.313725,0.200784,0.12549,-0.372549,0.392157,0.25098,0.156863,-0.247059,0.470588,0.301176,0.188235,-0.121569,0.54902,0.351373,0.219608,0.00392157,0.627451,0.401569,0.25098,0.129412,0.705882,0.451765,0.282353,0.254902,0.784314,0.501961,0.313725,0.380392,0.862745,0.552157,0.345098,0.5058820000000001,0.941176,0.602353,0.376471,0.631373,1,0.652549,0.407843,0.756863,1,0.702745,0.439216,0.8823530000000001,1,0.752941,0.470588,1,1,0.8,0.5]},{"ColorSpace":"Lab","Name":"pink_Matlab","RGBPoints":[-1,0,0,0,-0.87451,0.312416,0.204524,0.204524,-0.74902,0.441822,0.289241,0.289241,-0.623529,0.54112,0.354246,0.354246,-0.498039,0.624831,0.409048,0.409048,-0.372549,0.698582,0.45733,0.45733,-0.247059,0.764404,0.502282,0.500979,-0.121569,0.791292,0.591516,0.54112,0.00392157,0.8172970000000001,0.66895,0.578481,0.129412,0.842499,0.738308,0.613572,0.254902,0.866968,0.801687,0.6467619999999999,0.380392,0.8907659999999999,0.86041,0.678329,0.5058820000000001,0.913944,0.913944,0.7112540000000001,0.631373,0.936549,0.936549,0.79459,0.756863,0.9586209999999999,0.9586209999999999,0.8699789999999999,0.8823530000000001,0.980196,0.980196,0.9393359999999999,1,1,1,1]},{"ColorSpace":"Lab","Name":"bone_Matlab","RGBPoints":[-1,0,0,0,-0.87451,0.054902,0.054902,0.075817,-0.74902,0.109804,0.109804,0.151634,-0.623529,0.164706,0.164706,0.227451,-0.498039,0.219608,0.219608,0.303268,-0.372549,0.27451,0.27451,0.379085,-0.247059,0.329412,0.329902,0.454412,-0.121569,0.384314,0.405719,0.509314,0.00392157,0.439216,0.481536,0.5642160000000001,0.129412,0.494118,0.557353,0.6191179999999999,0.254902,0.54902,0.63317,0.67402,0.380392,0.603922,0.708987,0.728922,0.5058820000000001,0.660294,0.783824,0.783824,0.631373,0.746569,0.8387250000000001,0.8387250000000001,0.756863,0.832843,0.8936269999999999,0.8936269999999999,0.8823530000000001,0.919118,0.948529,0.948529,1,1,1,1]},{"ColorSpace":"Lab","Name":"gray_Matlab","RGBPoints":[-1,0,0,0,-0.87451,0.0627451,0.0627451,0.0627451,-0.74902,0.12549,0.12549,0.12549,-0.623529,0.188235,0.188235,0.188235,-0.498039,0.25098,0.25098,0.25098,-0.372549,0.313725,0.313725,0.313725,-0.247059,0.376471,0.376471,0.376471,-0.121569,0.439216,0.439216,0.439216,0.00392157,0.501961,0.501961,0.501961,0.129412,0.564706,0.564706,0.564706,0.254902,0.627451,0.627451,0.627451,0.380392,0.690196,0.690196,0.690196,0.5058820000000001,0.752941,0.752941,0.752941,0.631373,0.815686,0.815686,0.815686,0.756863,0.878431,0.878431,0.878431,0.8823530000000001,0.941176,0.941176,0.941176,1,1,1,1]},{"ColorSpace":"Lab","Name":"Purples","RGBPoints":[-1,0.247059,0,0.490196,-0.87451,0.288397,0.07677,0.525629,-0.74902,0.32975,0.153587,0.561092,-0.623529,0.373057,0.236263,0.600461,-0.498039,0.416363,0.319,0.639923,-0.372549,0.459669,0.405613,0.685198,-0.247059,0.503345,0.491534,0.730058,-0.121569,0.562399,0.54862,0.757616,0.00392157,0.621453,0.606075,0.785544,0.129412,0.680508,0.674971,0.824914,0.254902,0.7395620000000001,0.743406,0.863899,0.380392,0.798616,0.800492,0.8934260000000001,0.5058820000000001,0.85684,0.8566550000000001,0.9224909999999999,0.631373,0.898178,0.894056,0.942176,0.756863,0.938654,0.9309190000000001,0.961646,0.8823530000000001,0.964245,0.9584780000000001,0.977393,1,0.988235,0.984314,0.992157]},{"ColorSpace":"Lab","Name":"Blues","RGBPoints":[-1,0.031373,0.188235,0.419608,-0.87451,0.031373,0.253195,0.516063,-0.74902,0.031757,0.318139,0.6121490000000001,-0.623529,0.080969,0.38113,0.661361,-0.498039,0.130427,0.444152,0.710327,-0.372549,0.195386,0.509112,0.743791,-0.247059,0.260715,0.573841,0.777209,-0.121569,0.341423,0.628958,0.808704,0.00392157,0.422745,0.684075,0.839892,0.129412,0.523137,0.739193,0.861546,0.254902,0.622684,0.7934639999999999,0.883429,0.380392,0.701423,0.826928,0.910988,0.5058820000000001,0.778685,0.8603,0.937993,0.631373,0.825928,0.891795,0.9537409999999999,0.756863,0.8732799999999999,0.923291,0.969489,0.8823530000000001,0.9224909999999999,0.9547870000000001,0.985236,1,0.968627,0.984314,1]},{"ColorSpace":"Lab","Name":"Greens","RGBPoints":[-1,0,0.266667,0.105882,-0.87451,0,0.347374,0.139346,-0.74902,0.000538,0.427912,0.172933,-0.623529,0.069435,0.486967,0.222145,-0.498039,0.138178,0.546082,0.271326,-0.372549,0.197232,0.609073,0.31857,-0.247059,0.257255,0.671742,0.365859,-0.121569,0.357647,0.720953,0.415071,0.00392157,0.45767,0.769919,0.465021,0.129412,0.546251,0.811257,0.537855,0.254902,0.6342950000000001,0.8522110000000001,0.610688,0.380392,0.709097,0.883706,0.683522,0.5058820000000001,0.78316,0.914833,0.755894,0.631373,0.842215,0.938454,0.818885,0.756863,0.899977,0.961538,0.880692,0.8823530000000001,0.935409,0.975317,0.92203,1,0.968627,0.988235,0.960784]},{"ColorSpace":"Lab","Name":"PuBu","RGBPoints":[-1,0.301961,0,0.294118,-0.87451,0.404321,0.029527,0.390573,-0.74902,0.5059900000000001,0.059592,0.486782,-0.623529,0.519769,0.158016,0.551742,-0.498039,0.533456,0.256194,0.616301,-0.372549,0.54133,0.33887,0.655671,-0.247059,0.54902,0.421592,0.695087,-0.121569,0.54902,0.506236,0.736424,0.00392157,0.550127,0.590573,0.777701,0.129412,0.5855590000000001,0.665375,0.81707,0.254902,0.6221449999999999,0.739023,0.8558249999999999,0.380392,0.687105,0.7842980000000001,0.8794459999999999,0.5058820000000001,0.752065,0.829758,0.903253,0.631373,0.817024,0.87897,0.9308110000000001,0.756863,0.880907,0.927213,0.957832,0.8823530000000001,0.9261819999999999,0.958708,0.975548,1,0.968627,0.988235,0.992157]},{"ColorSpace":"Lab","Name":"BuPu","RGBPoints":[-1,0.007842999999999999,0.219608,0.345098,-0.87451,0.01178,0.286536,0.449427,-0.74902,0.015702,0.35328,0.5534790000000001,-0.623529,0.01767,0.396586,0.622376,-0.498039,0.021115,0.4402,0.690688,-0.372549,0.11757,0.5031910000000001,0.722184,-0.247059,0.214625,0.565859,0.753633,-0.121569,0.336671,0.615071,0.78316,0.00392157,0.457978,0.663975,0.812503,0.129412,0.556401,0.703345,0.836125,0.254902,0.65421,0.742714,0.859669,0.380392,0.736886,0.782084,0.881323,0.5058820000000001,0.8182700000000001,0.821638,0.903068,0.631373,0.873387,0.864944,0.92669,0.756863,0.927536,0.907605,0.9499880000000001,0.8823530000000001,0.964937,0.9391,0.967705,1,1,0.968627,0.984314]},{"ColorSpace":"Lab","Name":"BuGn","RGBPoints":[-1,0.031373,0.25098,0.5058820000000001,-0.87451,0.031373,0.329719,0.590527,-0.74902,0.031911,0.408397,0.674787,-0.623529,0.100807,0.479262,0.710219,-0.498039,0.169704,0.550219,0.745744,-0.372549,0.238601,0.62699,0.7870819999999999,-0.247059,0.307958,0.703114,0.826759,-0.121569,0.39654,0.7523260000000001,0.7972320000000001,0.00392157,0.485121,0.801046,0.767705,0.129412,0.573702,0.83451,0.738178,0.254902,0.661592,0.867743,0.7110340000000001,0.380392,0.732457,0.895302,0.74253,0.5058820000000001,0.801845,0.922307,0.774579,0.631373,0.841215,0.938055,0.817885,0.756863,0.880907,0.95391,0.861084,0.8823530000000001,0.9261819999999999,0.971626,0.9024219999999999,1,0.968627,0.988235,0.941176]},{"ColorSpace":"Lab","Name":"GnBu","RGBPoints":[-1,0,0.266667,0.105882,-0.87451,0,0.347374,0.139346,-0.74902,0.000538,0.427912,0.172933,-0.623529,0.069435,0.486967,0.222145,-0.498039,0.138178,0.546175,0.272095,-0.372549,0.197232,0.615071,0.368551,-0.247059,0.256609,0.683276,0.464867,-0.121569,0.329443,0.722645,0.555417,0.00392157,0.403137,0.762138,0.645413,0.129412,0.503529,0.805444,0.718247,0.254902,0.603922,0.848597,0.790465,0.380392,0.704314,0.887966,0.8475510000000001,0.5058820000000001,0.802307,0.9263209999999999,0.903714,0.631373,0.851519,0.944037,0.941115,0.756863,0.899977,0.961538,0.976901,0.8823530000000001,0.935409,0.975317,0.984775,1,0.968627,0.988235,0.992157]},{"ColorSpace":"Lab","Name":"GnBuPu","RGBPoints":[-1,0.003922,0.27451,0.211765,-0.87451,0.003922,0.349312,0.280661,-0.74902,0.003937,0.423852,0.349773,-0.623529,0.005905,0.46519,0.446228,-0.498039,0.009443,0.506344,0.542837,-0.372549,0.111803,0.535871,0.649135,-0.247059,0.214025,0.565859,0.753633,-0.121569,0.310481,0.615071,0.78316,0.00392157,0.407797,0.663975,0.812503,0.129412,0.531811,0.703345,0.836125,0.254902,0.65421,0.742714,0.859669,0.380392,0.736886,0.782084,0.881323,0.5058820000000001,0.8182700000000001,0.821176,0.902884,0.631373,0.873387,0.854641,0.9225680000000001,0.756863,0.927536,0.888535,0.942361,0.8823530000000001,0.964937,0.9298729999999999,0.964014,1,1,0.968627,0.984314]},{"ColorSpace":"Lab","Name":"BuGnYl","RGBPoints":[-1,0.031373,0.113725,0.345098,-0.87451,0.08845799999999999,0.159,0.463206,-0.74902,0.145052,0.204567,0.5807,-0.623529,0.139146,0.287243,0.620069,-0.498039,0.13318,0.370196,0.659562,-0.372549,0.123337,0.470588,0.706805,-0.247059,0.115386,0.570335,0.753126,-0.121569,0.186251,0.643168,0.761,0.00392157,0.258716,0.71514,0.768074,0.129412,0.380761,0.760415,0.750358,0.254902,0.503576,0.806075,0.732795,0.380392,0.645306,0.861192,0.719016,0.5058820000000001,0.783899,0.91511,0.705606,0.631373,0.858701,0.9446369999999999,0.6997,0.756863,0.931349,0.973303,0.698424,0.8823530000000001,0.966782,0.987082,0.777163,1,1,1,0.85098]},{"ColorSpace":"Lab","Name":"PuRd","RGBPoints":[-1,0.286275,0,0.415686,-0.87451,0.38273,0.001968,0.441276,-0.74902,0.479231,0.003922,0.466774,-0.623529,0.581592,0.003922,0.480554,-0.498039,0.683799,0.00549,0.494887,-0.372549,0.776317,0.105882,0.544098,-0.247059,0.867866,0.206321,0.592618,-0.121569,0.9190469999999999,0.308681,0.612303,0.00392157,0.968812,0.411226,0.632603,0.129412,0.9747169999999999,0.519493,0.671972,0.254902,0.980546,0.626451,0.71065,0.380392,0.984483,0.701253,0.732303,0.5058820000000001,0.988328,0.77504,0.755617,0.631373,0.990296,0.828189,0.812703,0.756863,0.992372,0.880907,0.869035,0.8823530000000001,0.996309,0.9261819999999999,0.912341,1,1,0.968627,0.952941]},{"ColorSpace":"Lab","Name":"RdPu","RGBPoints":[-1,0.403922,0,0.121569,-0.87451,0.500377,0,0.192434,-0.74902,0.596909,0.000277,0.263037,-0.623529,0.703206,0.035709,0.300438,-0.498039,0.808612,0.071296,0.338854,-0.372549,0.857824,0.116571,0.441215,-0.247059,0.905513,0.163552,0.54293,-0.121569,0.889765,0.281661,0.6177319999999999,0.00392157,0.873156,0.39897,0.691611,0.129412,0.82985,0.491488,0.736886,0.254902,0.789081,0.583237,0.781853,0.380392,0.810734,0.656071,0.819254,0.5058820000000001,0.833126,0.729181,0.85684,0.631373,0.8705270000000001,0.80792,0.898178,0.756863,0.907605,0.884398,0.938331,0.8823530000000001,0.9391,0.921799,0.958016,1,0.968627,0.956863,0.976471]},{"ColorSpace":"Lab","Name":"Oranges","RGBPoints":[-1,0.498039,0.152941,0.015686,-0.87451,0.57481,0.182468,0.013718,-0.74902,0.651765,0.212042,0.011734,-0.623529,0.752157,0.247474,0.007797,-0.498039,0.851719,0.283368,0.004475,-0.372549,0.898962,0.348328,0.039908,-0.247059,0.945652,0.413426,0.076401,-0.121569,0.9692730000000001,0.484291,0.157109,0.00392157,0.992157,0.554971,0.238185,0.129412,0.992157,0.619931,0.330704,0.254902,0.992157,0.684967,0.423837,0.380392,0.992157,0.751895,0.532103,0.5058820000000001,0.992249,0.817716,0.639354,0.631373,0.994218,0.861023,0.725967,0.756863,0.996186,0.903576,0.810965,0.8823530000000001,0.998155,0.933103,0.868051,1,1,0.960784,0.921569]},{"ColorSpace":"Lab","Name":"Reds","RGBPoints":[-1,0.403922,0,0.05098,-0.87451,0.525967,0.029527,0.066728,-0.74902,0.647643,0.058962,0.08247599999999999,-0.623529,0.722445,0.076678,0.09822400000000001,-0.498039,0.797186,0.095194,0.114187,-0.372549,0.868051,0.164091,0.143714,-0.247059,0.937809,0.233541,0.173933,-0.121569,0.96143,0.326059,0.232987,0.00392157,0.984375,0.418147,0.292657,0.129412,0.986344,0.496886,0.371396,0.254902,0.988235,0.575702,0.450673,0.380392,0.988235,0.656409,0.543191,0.5058820000000001,0.98842,0.736747,0.635894,0.631373,0.992357,0.809581,0.732349,0.756863,0.996186,0.880692,0.826759,0.8823530000000001,0.998155,0.92203,0.885813,1,1,0.960784,0.941176]},{"ColorSpace":"Lab","Name":"RdOr","RGBPoints":[-1,0.498039,0,0,-0.87451,0.6004,0,0,-0.74902,0.702514,0.000738,0.000477,-0.623529,0.773379,0.095225,0.061499,-0.498039,0.843875,0.189865,0.12283,-0.372549,0.891119,0.294195,0.203537,-0.247059,0.937855,0.397924,0.283137,-0.121569,0.963445,0.476663,0.316601,0.00392157,0.988297,0.555771,0.351665,0.129412,0.990265,0.646321,0.436309,0.254902,0.992157,0.735256,0.5196460000000001,0.380392,0.992157,0.7844680000000001,0.570827,0.5058820000000001,0.992249,0.833218,0.623483,0.631373,0.994218,0.872587,0.706159,0.756863,0.996186,0.911419,0.788189,0.8823530000000001,0.998155,0.9409459999999999,0.859054,1,1,0.968627,0.92549]},{"ColorSpace":"Lab","Name":"BrOrYl","RGBPoints":[-1,0.4,0.145098,0.023529,-0.87451,0.5003919999999999,0.174625,0.019592,-0.74902,0.600784,0.204291,0.015656,-0.623529,0.701176,0.251534,0.011719,-0.498039,0.800984,0.299146,0.008397,-0.372549,0.863975,0.370012,0.043829,-0.247059,0.9263209999999999,0.441107,0.0794,-0.121569,0.961753,0.521815,0.120738,0.00392157,0.996078,0.602645,0.163122,0.129412,0.996078,0.68729,0.237924,0.254902,0.996078,0.771011,0.314879,0.380392,0.996078,0.8320340000000001,0.444798,0.5058820000000001,0.996171,0.892042,0.572595,0.631373,0.998139,0.931411,0.65724,0.756863,1,0.969489,0.741669,0.8823530000000001,1,0.985236,0.822376,1,1,1,0.898039]},{"ColorSpace":"Lab","Name":"RdOrYl","RGBPoints":[-1,0.501961,0,0.14902,-0.87451,0.622038,0,0.14902,-0.74902,0.741761,0.0004,0.148866,-0.623529,0.816563,0.05158,0.129181,-0.498039,0.890965,0.10356,0.110235,-0.372549,0.940177,0.205921,0.137793,-0.247059,0.988281,0.308789,0.165536,-0.121569,0.99025,0.432803,0.200969,0.00392157,0.992218,0.555217,0.236278,0.129412,0.994187,0.628051,0.267774,0.254902,0.996078,0.701038,0.301269,0.380392,0.996078,0.777809,0.383945,0.5058820000000001,0.996171,0.852826,0.466621,0.631373,0.998139,0.892195,0.549296,0.756863,1,0.931349,0.632188,0.8823530000000001,1,0.966782,0.7188,1,1,1,0.8]},{"ColorSpace":"Lab","Name":"CIELab_blue2red","RGBPoints":[-1,0,0.6,0.74902,1,0.76863,0.46667,0.34118]},{"ColorSpace":"Lab","Name":"blue2yellow","RGBPoints":[-1,0,0,1,0,0.5,0.5,0.5,1,1,1,0]},{"ColorSpace":"Lab","Name":"erdc_blue2gold","RGBPoints":[-1,0.175119,0.0438468,1,-0.874016,0.22383,0.159771,0.94557,-0.748031,0.27254,0.233611,0.891216,-0.622047,0.321251,0.296526,0.836857,-0.496063,0.369962,0.354296,0.782359,-0.370079,0.418672,0.409139,0.72754,-0.244094,0.467383,0.462152,0.672148,-0.11811,0.51609,0.51396,0.615825,0.007874020000000001,0.572863,0.55452,0.559172,0.133858,0.630269,0.593822,0.517729,0.259843,0.689588,0.624668,0.47446,0.385827,0.745394,0.6561129999999999,0.428638,0.511811,0.798624,0.688104,0.379105,0.637795,0.849926,0.720593,0.323834,0.76378,0.899765,0.753543,0.258657,0.889764,0.948487,0.78692,0.171778,1,0.990413,0.816451,0.00729848]},{"ColorSpace":"Lab","Name":"erdc_blue2yellow","RGBPoints":[-1,0.08301219999999999,0,0.495617,-0.87451,0.141973,0.0551288,0.57363,-0.74902,0.193048,0.110258,0.604561,-0.623529,0.234231,0.165386,0.57643,-0.498039,0.275413,0.220515,0.548299,-0.372549,0.316596,0.275644,0.520169,-0.247059,0.357778,0.330773,0.492038,-0.121569,0.398961,0.385901,0.463908,0.00392157,0.449929,0.438487,0.426815,0.129412,0.511572,0.488299,0.379944,0.254902,0.581222,0.53603,0.325741,0.380392,0.650871,0.583761,0.271538,0.5058820000000001,0.720521,0.631493,0.217335,0.631373,0.79017,0.679224,0.163132,0.756863,0.85982,0.726955,0.108929,0.8823530000000001,0.910254,0.774159,0.14112,1,0.927513,0.81759,0.306289]},{"ColorSpace":"Lab","Name":"erdc_cyan2orange","RGBPoints":[-1,0.0471513,0.213874,0.414329,-0.87451,0.06747019999999999,0.256648,0.439027,-0.74902,0.0959957,0.299331,0.462089,-0.623529,0.132428,0.341872,0.483212,-0.498039,0.188743,0.38277,0.500597,-0.372549,0.268511,0.420229,0.5121790000000001,-0.247059,0.352945,0.455602,0.519101,-0.121569,0.43893,0.489368,0.5215379999999999,0.00392157,0.522445,0.522495,0.522436,0.129412,0.600089,0.555682,0.53205,0.254902,0.67988,0.587981,0.5391629999999999,0.380392,0.761011,0.619586,0.544439,0.5058820000000001,0.84278,0.650741,0.548567,0.631373,0.910713,0.687347,0.557822,0.756863,0.952232,0.734972,0.577775,0.8823530000000001,0.975642,0.7898579999999999,0.604868,1,0.990752,0.843643,0.632857]},{"ColorSpace":"Lab","Name":"erdc_purple2green","RGBPoints":[-1,0.235006,0.0483128,0.530899,-0.87451,0.302968,0.108419,0.552391,-0.74902,0.360241,0.166059,0.569502,-0.623529,0.406746,0.226782,0.579373,-0.498039,0.444073,0.28964,0.582094,-0.372549,0.473648,0.353774,0.577947,-0.247059,0.497636,0.418154,0.5679110000000001,-0.121569,0.519086,0.481741,0.553968,0.00392157,0.542884,0.542914,0.542875,0.129412,0.566303,0.603989,0.5274990000000001,0.254902,0.595218,0.662965,0.516857,0.380392,0.628641,0.720701,0.510673,0.5058820000000001,0.665373,0.777849,0.508165,0.631373,0.704182,0.834921,0.5083029999999999,0.756863,0.743846,0.892328,0.5099900000000001,0.8823530000000001,0.783158,0.950422,0.512181,1,0.818617,1,0.513888]},{"ColorSpace":"Lab","Name":"erdc_purple2green_dark","RGBPoints":[-1,0.107656,0,0.428682,-0.87451,0.1924,0,0.449799,-0.74902,0.255118,0.0648939,0.466726,-0.623529,0.304256,0.133066,0.476703,-0.498039,0.343202,0.19716,0.479793,-0.372549,0.373876,0.260353,0.476241,-0.247059,0.398497,0.322872,0.466953,-0.121569,0.420016,0.384252,0.453785,0.00392157,0.44319,0.443216,0.443186,0.129412,0.465553,0.502139,0.428233,0.254902,0.492959,0.559151,0.417591,0.380392,0.524654,0.615092,0.411016,0.5058820000000001,0.55959,0.670583,0.40779,0.631373,0.596614,0.726102,0.406948,0.756863,0.634544,0.7820319999999999,0.407439,0.8823530000000001,0.672183,0.838703,0.408237,1,0.706131,0.892759,0.408452]},{"ColorSpace":"Lab","Name":"coolwarm","RGBPoints":[-1,0.229806,0.298718,0.753683,-0.875,0.303869,0.406535,0.844959,-0.75,0.383013,0.509419,0.917388,-0.625,0.466667,0.604563,0.968155,-0.5,0.552953,0.688929,0.995376,-0.375,0.639176,0.7596000000000001,0.998151,-0.25,0.722193,0.813953,0.976575,-0.125,0.798692,0.849786,0.931689,0,0.865395,0.86541,0.8653960000000001,0.125,0.9241279999999999,0.827385,0.774508,0.25,0.958853,0.769768,0.6780080000000001,0.375,0.969954,0.694267,0.579375,0.5,0.958003,0.602842,0.481776,0.625,0.923945,0.497309,0.38797,0.75,0.869187,0.378313,0.300267,0.875,0.795632,0.241284,0.220526,1,0.705673,0.0155562,0.150233]},{"ColorSpace":"Lab","Name":"BuRd","RGBPoints":[-1,0.019608,0.188235,0.380392,-0.87451,0.088504,0.321107,0.564937,-0.74902,0.163399,0.444983,0.697501,-0.623529,0.247059,0.555709,0.754095,-0.498039,0.420684,0.676432,0.818685,-0.372549,0.606459,0.7897729999999999,0.880277,-0.247059,0.761476,0.868512,0.924567,-0.121569,0.878047,0.925721,0.951942,0.00392157,0.969089,0.9664740000000001,0.964937,0.129412,0.9838519999999999,0.897578,0.846828,0.254902,0.982468,0.800692,0.706113,0.380392,0.960323,0.66782,0.536332,0.5058820000000001,0.894579,0.503806,0.399769,0.631373,0.81707,0.33218,0.281046,0.756863,0.7284890000000001,0.155017,0.197386,0.8823530000000001,0.576932,0.055363,0.14925,1,0.403922,0,0.121569]},{"ColorSpace":"Lab","Name":"Spectral_lowBlue","RGBPoints":[-1,0.368627,0.309804,0.635294,-0.87451,0.260361,0.450058,0.70173,-0.74902,0.248058,0.591311,0.717186,-0.623529,0.376009,0.734025,0.6581320000000001,-0.498039,0.537947,0.814764,0.64506,-0.372549,0.702345,0.879585,0.636678,-0.247059,0.8475200000000001,0.938639,0.607151,-0.121569,0.940408,0.976163,0.6560550000000001,0.00392157,0.999923,0.9976159999999999,0.745021,0.129412,0.997463,0.921338,0.61707,0.254902,0.9950020000000001,0.824606,0.499885,0.380392,0.992541,0.701576,0.39654,0.5058820000000001,0.973472,0.547405,0.318108,0.631373,0.937793,0.398539,0.270127,0.756863,0.861515,0.282891,0.299654,0.8823530000000001,0.746482,0.144637,0.288812,1,0.619608,0.003922,0.258824]},{"ColorSpace":"Lab","Name":"GnRP","RGBPoints":[-1,0,0.266667,0.105882,-0.87451,0.066436,0.394617,0.174779,-0.74902,0.168858,0.524567,0.25767,-0.623529,0.323875,0.657439,0.361015,-0.498039,0.504883,0.7723179999999999,0.506344,-0.372549,0.678431,0.870127,0.654902,-0.247059,0.803922,0.921799,0.780392,-0.121569,0.897116,0.951942,0.882814,0.00392157,0.967397,0.965936,0.9674739999999999,0.129412,0.928028,0.879815,0.930565,0.254902,0.866052,0.7807770000000001,0.882891,0.380392,0.77501,0.665129,0.821376,0.5058820000000001,0.675663,0.5370239999999999,0.737024,0.631373,0.57847,0.396155,0.6459819999999999,0.756863,0.492349,0.223914,0.547559,0.8823530000000001,0.375548,0.096886,0.423299,1,0.25098,0,0.294118]},{"ColorSpace":"Lab","Name":"GYPi","RGBPoints":[-1,0.152941,0.392157,0.098039,-0.87451,0.246444,0.505344,0.117724,-0.74902,0.351942,0.614533,0.161399,-0.623529,0.474971,0.717878,0.240138,-0.498039,0.611995,0.811226,0.392849,-0.372549,0.746328,0.893118,0.565321,-0.247059,0.8595159999999999,0.94233,0.747405,-0.121569,0.928105,0.9638600000000001,0.875663,0.00392157,0.969089,0.966859,0.968012,0.129412,0.9838519999999999,0.910265,0.9483279999999999,0.254902,0.979239,0.833218,0.914648,0.380392,0.949712,0.729873,0.862976,0.5058820000000001,0.905652,0.5829299999999999,0.763552,0.631373,0.85521,0.410073,0.652211,0.756863,0.793695,0.183699,0.5316419999999999,0.8823530000000001,0.683737,0.063899,0.420761,1,0.556863,0.003922,0.321569]},{"ColorSpace":"Lab","Name":"GnYlRd","RGBPoints":[-1,0,0.407843,0.215686,-0.87451,0.063975,0.525952,0.277201,-0.74902,0.177932,0.633064,0.332718,-0.623529,0.364937,0.724106,0.379469,-0.498039,0.5279509999999999,0.7971549999999999,0.40223,-0.372549,0.678431,0.862822,0.433449,-0.247059,0.803922,0.916955,0.514648,-0.121569,0.909419,0.961861,0.625067,0.00392157,0.999923,0.9976159999999999,0.745021,0.129412,0.997463,0.921338,0.61707,0.254902,0.9950020000000001,0.824606,0.499885,0.380392,0.992541,0.701576,0.39654,0.5058820000000001,0.973472,0.547405,0.318108,0.631373,0.9390230000000001,0.389927,0.245521,0.756863,0.867666,0.239831,0.176624,0.8823530000000001,0.762399,0.110727,0.151326,1,0.6470590000000001,0,0.14902]},{"ColorSpace":"Lab","Name":"GBBr","RGBPoints":[-1,0,0.235294,0.188235,-0.87451,0.002461,0.338639,0.301423,-0.74902,0.055902,0.448981,0.417609,-0.623529,0.183852,0.56955,0.538178,-0.498039,0.357785,0.700115,0.6607460000000001,-0.372549,0.540177,0.819531,0.77624,-0.247059,0.714879,0.890888,0.864821,-0.121569,0.8511339999999999,0.934564,0.922645,0.00392157,0.960861,0.959785,0.95694,0.129412,0.963322,0.927797,0.83391,0.254902,0.9399459999999999,0.868897,0.68935,0.380392,0.8833530000000001,0.775394,0.517109,0.5058820000000001,0.808074,0.6258359999999999,0.324106,0.631373,0.717647,0.476355,0.15494,0.756863,0.592157,0.358247,0.06882000000000001,0.8823530000000001,0.458593,0.26436,0.031142,1,0.329412,0.188235,0.019608]},{"ColorSpace":"Lab","Name":"PuOr","RGBPoints":[-1,0.498039,0.231373,0.031373,-0.87451,0.62599,0.30273,0.026451,-0.74902,0.746943,0.387082,0.037524,-0.623529,0.85767,0.490427,0.07197199999999999,-0.498039,0.936409,0.617762,0.236371,-0.372549,0.992695,0.743099,0.43291,-0.247059,0.995156,0.841523,0.63714,-0.121569,0.985313,0.913802,0.813687,0.00392157,0.966244,0.966398,0.967705,0.129412,0.889965,0.8950399999999999,0.938178,0.254902,0.806151,0.804306,0.894656,0.380392,0.712649,0.688658,0.833141,0.5058820000000001,0.594233,0.554325,0.744637,0.631373,0.474894,0.404229,0.6523640000000001,0.756863,0.366628,0.217224,0.563783,0.8823530000000001,0.266436,0.089965,0.434833,1,0.176471,0,0.294118]},{"ColorSpace":"Lab","Name":"PRGn","RGBPoints":[-1,0.25098,0,0.294118,-0.87451,0.383852,0.103345,0.431911,-0.74902,0.497732,0.234679,0.55371,-0.623529,0.583852,0.40692,0.652134,-0.498039,0.681968,0.545175,0.742561,-0.372549,0.7806999999999999,0.672357,0.825221,-0.247059,0.871742,0.788005,0.886736,-0.121569,0.930488,0.885198,0.932872,0.00392157,0.966321,0.968089,0.965859,0.129412,0.892503,0.950865,0.877278,0.254902,0.796078,0.91857,0.772549,0.380392,0.670588,0.866897,0.6470590000000001,0.5058820000000001,0.493195,0.765398,0.496655,0.631373,0.314187,0.649135,0.354556,0.756863,0.15917,0.516263,0.251211,0.8823530000000001,0.062284,0.386621,0.170473,1,0,0.266667,0.105882]},{"ColorSpace":"Lab","Name":"PiYG","RGBPoints":[-1,0.556863,0.003922,0.321569,-0.87451,0.692195,0.067897,0.427374,-0.74902,0.797539,0.197847,0.539177,-0.623529,0.859054,0.424221,0.6597460000000001,-0.498039,0.908574,0.592618,0.770319,-0.372549,0.951557,0.736332,0.866205,-0.247059,0.981084,0.839677,0.917878,-0.121569,0.98293,0.913802,0.949558,0.00392157,0.96732,0.9684739999999999,0.965629,0.129412,0.92549,0.963552,0.8696660000000001,0.254902,0.852441,0.939254,0.736025,0.380392,0.739254,0.890042,0.553941,0.5058820000000001,0.60323,0.805536,0.382238,0.631373,0.467282,0.711419,0.235217,0.756863,0.344252,0.608074,0.156478,0.8823530000000001,0.2406,0.49827,0.116494,1,0.152941,0.392157,0.098039]},{"ColorSpace":"Lab","Name":"OrPu","RGBPoints":[-1,0.176471,0,0.294118,-0.87451,0.272434,0.09596300000000001,0.444214,-0.74902,0.373395,0.228912,0.56932,-0.623529,0.481661,0.415917,0.657901,-0.498039,0.601922,0.562937,0.750481,-0.372549,0.718493,0.695886,0.836986,-0.247059,0.811995,0.811534,0.898501,-0.121569,0.894733,0.8995,0.9400230000000001,0.00392157,0.969166,0.966859,0.963629,0.129412,0.98639,0.910265,0.803691,0.254902,0.9950020000000001,0.835371,0.624375,0.380392,0.992541,0.736947,0.420146,0.5058820000000001,0.931949,0.6094580000000001,0.224221,0.631373,0.85075,0.483968,0.06981900000000001,0.756863,0.740023,0.380623,0.035371,0.8823530000000001,0.617993,0.29827,0.026759,1,0.498039,0.231373,0.031373]},{"ColorSpace":"Lab","Name":"BrBG","RGBPoints":[-1,0.329412,0.188235,0.019608,-0.87451,0.467205,0.269435,0.031911,-0.74902,0.6,0.365629,0.074202,-0.623529,0.72549,0.483737,0.160323,-0.498039,0.812995,0.635832,0.336409,-0.372549,0.88689,0.781238,0.527874,-0.247059,0.943483,0.87474,0.700115,-0.121569,0.963168,0.929796,0.841599,0.00392157,0.957247,0.959938,0.959554,0.129412,0.84406,0.932872,0.920185,0.254902,0.70396,0.886428,0.859285,0.380392,0.529258,0.815071,0.7707039999999999,0.5058820000000001,0.346251,0.691811,0.653057,0.631373,0.175855,0.562015,0.5306419999999999,0.756863,0.047905,0.441446,0.410073,0.8823530000000001,0.002307,0.33218,0.294348,1,0,0.235294,0.188235]},{"ColorSpace":"Lab","Name":"GyRd","RGBPoints":[-1,0.101961,0.101961,0.101961,-0.87451,0.227451,0.227451,0.227451,-0.74902,0.359939,0.359939,0.359939,-0.623529,0.502653,0.502653,0.502653,-0.498039,0.631373,0.631373,0.631373,-0.372549,0.749865,0.749865,0.749865,-0.247059,0.843368,0.843368,0.843368,-0.121569,0.926105,0.926105,0.926105,0.00392157,0.999846,0.997232,0.995694,0.129412,0.9949249999999999,0.908651,0.857901,0.254902,0.982468,0.800692,0.706113,0.380392,0.960323,0.66782,0.536332,0.5058820000000001,0.894579,0.503806,0.399769,0.631373,0.81707,0.33218,0.281046,0.756863,0.7284890000000001,0.155017,0.197386,0.8823530000000001,0.576932,0.055363,0.14925,1,0.403922,0,0.121569]},{"ColorSpace":"Lab","Name":"erdc_divHi_purpleGreen","RGBPoints":[-1,0.297553,0,0.489074,-0.87451,0.40259,0.151146,0.567754,-0.74902,0.516038,0.284843,0.658231,-0.623529,0.629783,0.423646,0.750938,-0.498039,0.735198,0.563697,0.835956,-0.372549,0.82408,0.695541,0.903582,-0.247059,0.889091,0.807454,0.944862,-0.121569,0.92334,0.886917,0.951839,0.00392157,0.921045,0.921084,0.921003,0.129412,0.877324,0.907455,0.845381,0.254902,0.7976490000000001,0.8497130000000001,0.734695,0.380392,0.691646,0.75964,0.600532,0.5058820000000001,0.568981,0.649159,0.453807,0.631373,0.438945,0.529756,0.304259,0.756863,0.30973,0.412001,0.158303,0.8823530000000001,0.187078,0.305111,0.00251458,1,0.101655,0.220836,0]},{"ColorSpace":"Lab","Name":"erdc_divHi_purpleGreen_dim","RGBPoints":[-1,0.404088,0.131038,0.592767,-0.87451,0.486469,0.230957,0.651243,-0.74902,0.575165,0.339335,0.717723,-0.623529,0.662741,0.454332,0.784263,-0.498039,0.742071,0.570213,0.8429179999999999,-0.372549,0.806935,0.678992,0.886227,-0.247059,0.8522189999999999,0.771315,0.90763,-0.121569,0.873345,0.837327,0.901572,0.00392157,0.866783,0.86682,0.866745,0.129412,0.82839,0.858225,0.796812,0.254902,0.762578,0.814287,0.700202,0.380392,0.6764289999999999,0.744229,0.585735,0.5058820000000001,0.577033,0.65732,0.461526,0.631373,0.47128,0.562476,0.33476,0.756863,0.365461,0.467957,0.21076,0.8823530000000001,0.264758,0.381138,0.0878313,1,0.182591,0.312249,0]},{"ColorSpace":"Lab","Name":"erdc_divLow_icePeach","RGBPoints":[-1,0.480048,0.817441,0.9980560000000001,-0.87451,0.425898,0.726921,0.8831870000000001,-0.74902,0.366682,0.629445,0.7619359999999999,-0.623529,0.308756,0.531002,0.640217,-0.498039,0.258021,0.43705,0.523433,-0.372549,0.219244,0.352381,0.416348,-0.247059,0.195127,0.281032,0.322979,-0.121569,0.186286,0.22627,0.246525,0.00392157,0.192352,0.19236,0.192364,0.129412,0.255927,0.214469,0.191756,0.254902,0.340459,0.254426,0.206666,0.380392,0.444655,0.309315,0.234029,0.5058820000000001,0.565353,0.376004,0.270969,0.631373,0.697917,0.450748,0.314293,0.756863,0.836657,0.529064,0.360227,0.8823530000000001,0.972695,0.614884,0.413123,1,1,0.705904,0.472699]},{"ColorSpace":"Lab","Name":"erdc_divLow_purpleGreen","RGBPoints":[-1,0.9560340000000001,0.6664870000000001,0.952663,-0.87451,0.874457,0.572698,0.936352,-0.74902,0.7534650000000001,0.488253,0.909063,-0.623529,0.63309,0.413507,0.763833,-0.498039,0.514491,0.345878,0.620015,-0.372549,0.405008,0.288141,0.484376,-0.247059,0.311388,0.241986,0.363556,-0.121569,0.238722,0.209044,0.263449,0.00392157,0.192352,0.192366,0.192362,0.129412,0.200379,0.233201,0.168618,0.254902,0.230151,0.291737,0.165227,0.380392,0.279481,0.366076,0.178607,0.5058820000000001,0.344927,0.453267,0.205703,0.631373,0.421554,0.549449,0.242643,0.756863,0.5033339999999999,0.649999,0.284377,0.8823530000000001,0.583497,0.749672,0.324969,1,0.650705,0.837228,0.356264]},{"ColorSpace":"Lab","Name":"Haze_green","RGBPoints":[-1,1,0.835294,0.886275,-0.87451,0.9372549999999999,0.756863,0.870443,-0.74902,0.875817,0.666376,0.857807,-0.623529,0.778359,0.5830070000000001,0.808134,-0.498039,0.676253,0.494118,0.745098,-0.372549,0.561365,0.390123,0.682353,-0.247059,0.438344,0.262745,0.621496,-0.121569,0.321133,0.141031,0.558751,0.00392157,0.203922,0.0217865,0.495861,0.129412,0.265505,0.129412,0.433261,0.254902,0.311692,0.255338,0.37008,0.380392,0.356282,0.377342,0.310821,0.5058820000000001,0.39971,0.488889,0.258243,0.631373,0.442556,0.604357,0.205519,0.756863,0.48671,0.71968,0.152941,0.8823530000000001,0.529847,0.830356,0.100944,1,0.572549,0.933333,0.054902]},{"ColorSpace":"Lab","Name":"Haze_lime","RGBPoints":[-1,0.704034,0.784196,1,-0.87451,0.633111,0.691418,0.956078,-0.74902,0.564021,0.600606,0.912157,-0.623529,0.496827,0.51189,0.868235,-0.498039,0.43157,0.425416,0.824314,-0.372549,0.368248,0.341347,0.780392,-0.247059,0.306767,0.259855,0.736471,-0.121569,0.246862,0.181069,0.692549,0.00392157,0.191619,0.109542,0.648627,0.129412,0.257404,0.194031,0.604706,0.254902,0.321794,0.278775,0.5607839999999999,0.380392,0.387909,0.364617,0.516863,0.5058820000000001,0.456569,0.451881,0.472941,0.631373,0.527424,0.5407729999999999,0.42902,0.756863,0.599759,0.631427,0.385098,0.8823530000000001,0.673065,0.723898,0.341176,1,0.7427510000000001,0.812252,0.3]},{"ColorSpace":"RGB","Name":"Haze","RGBPoints":[-1,1,0.835294,0.996078,-0.00392157,0.023529,0.141176,0.498039,0.00392157,0.015686,0.137255,0.494118,1,0.984314,0.764706,0]},{"ColorSpace":"Lab","Name":"Haze_cyan","RGBPoints":[-1,0.956863,1,0.835294,-0.87451,0.933188,0.921714,0.760784,-0.74902,0.870588,0.803486,0.671605,-0.623529,0.807843,0.684096,0.583297,-0.498039,0.745098,0.569208,0.494118,-0.372549,0.682353,0.437763,0.390123,-0.247059,0.621496,0.288163,0.262745,-0.121569,0.558751,0.144517,0.141031,0.00392157,0.495861,0.0217865,0.0413943,0.129412,0.433261,0.137255,0.129412,0.254902,0.37008,0.263181,0.255338,0.380392,0.306318,0.381845,0.372694,0.5058820000000001,0.243137,0.5039940000000001,0.494263,0.631373,0.180392,0.629484,0.619753,0.756863,0.117647,0.754975,0.747131,0.8823530000000001,0.054902,0.876398,0.866812,1,0,0.988235,0.976471]},{"ColorSpace":"Lab","Name":"nic_Edge","RGBPoints":[-1,0.191208,0.191208,0.191208,-0.87451,0.239484,0.00545035,0.614821,-0.74902,0.220593,0.0617459,0.863547,-0.623529,0.17509,0.278988,0.97794,-0.498039,0.143526,0.5760690000000001,0.998553,-0.372549,0.166456,0.871883,0.96594,-0.247059,0.376202,0.993555,0.981833,-0.121569,0.681996,0.991297,0.999239,0.00392157,0.954172,0.952734,0.94374,0.129412,0.999735,0.9930099999999999,0.662896,0.254902,0.979399,0.991466,0.357973,0.380392,0.968771,0.854967,0.162659,0.5058820000000001,0.999245,0.556697,0.144323,0.631373,0.973959,0.26223,0.177946,0.756863,0.8523579999999999,0.0526707,0.222974,0.8823530000000001,0.593889,0.00912724,0.238855,1,0.191208,0.191208,0.191208]},{"ColorSpace":"Lab","Name":"erdc_iceFire_H","RGBPoints":[-1,4.05432e-07,0,5.90122e-06,-0.87451,0,0.120401,0.302675,-0.74902,0,0.216583,0.524574,-0.623529,0.0552475,0.345025,0.6595,-0.498039,0.128047,0.492588,0.720288,-0.372549,0.188955,0.641309,0.792092,-0.247059,0.327673,0.784935,0.873434,-0.121569,0.60824,0.892164,0.935547,0.00392157,0.881371,0.912178,0.818099,0.129412,0.951407,0.8356209999999999,0.449279,0.254902,0.904481,0.690489,0,0.380392,0.85407,0.510864,0,0.5058820000000001,0.777093,0.33018,0.00088199,0.631373,0.672862,0.139087,0.00269398,0.756863,0.508815,0,0,0.8823530000000001,0.299417,0.000366289,0.000547829,1,0.0157519,0.00332021,4.55569e-08]},{"ColorSpace":"Lab","Name":"erdc_iceFire_L","RGBPoints":[-1,0.870485,0.913768,0.832905,-0.87451,0.586919,0.887865,0.934003,-0.74902,0.31583,0.776442,0.867858,-0.623529,0.18302,0.632034,0.787722,-0.498039,0.117909,0.484134,0.713825,-0.372549,0.0507239,0.335979,0.654741,-0.247059,0,0.209874,0.511832,-0.121569,0,0.114689,0.28935,0.00392157,0.0157519,0.00332021,4.55569e-08,0.129412,0.312914,0,0,0.254902,0.520865,0,0,0.380392,0.680105,0.15255,0.0025996,0.5058820000000001,0.7851089999999999,0.339479,0.000797922,0.631373,0.8573539999999999,0.522494,0,0.756863,0.910974,0.699774,0,0.8823530000000001,0.951921,0.842817,0.478545,1,0.881371,0.912178,0.818099]},{"ColorSpace":"RGB","Name":"hsv","RGBPoints":[-1,1,0,0,-0.666666,1,0,1,-0.333333,0,0,1,0,0,1,1,0.33333,0,1,0,0.66666,1,1,0,1,1,0,0]},{"ColorSpace":"Lab","Name":"hue_L60","RGBPoints":[-1,0.964784,0.400592,0.349549,-0.87451,0.964915,0.372498,0.5378500000000001,-0.74902,0.892353,0.401039,0.759569,-0.623529,0.7926299999999999,0.446956,0.903017,-0.498039,0.682208,0.49954,0.966673,-0.372549,0.56392,0.553082,0.968836,-0.247059,0.442031,0.606396,0.901601,-0.121569,0.305499,0.65701,0.765784,0.00392157,0.197251,0.687914,0.620914,0.129412,0.193882,0.701887,0.472654,0.254902,0.249866,0.7061229999999999,0.320005,0.380392,0.35132,0.697417,0.202919,0.5058820000000001,0.498097,0.669467,0.125232,0.631373,0.637477,0.626239,0.107431,0.756863,0.762115,0.56872,0.155812,0.8823530000000001,0.8894339999999999,0.481116,0.240445,1,0.964784,0.400592,0.349549]},{"IndexedColors":[0,0,0,0.8941176470588236,0.1019607843137255,0.1098039215686274,0.2156862745098039,0.4941176470588236,0.7215686274509804,0.3019607843137255,0.6862745098039216,0.2901960784313726,0.596078431372549,0.3058823529411765,0.6392156862745098,1,0.4980392156862745,0,0.6509803921568628,0.3372549019607843,0.1568627450980392],"Name":"Spectrum","NanColor":[0.6509803921568628,0.3372549019607843,0.1568627450980392]},{"IndexedColors":[0.4745098039215686,0.09019607843137255,0.09019607843137255,0.7098039215686275,0.00392156862745098,0.00392156862745098,0.9372549019607843,0.2784313725490196,0.09803921568627451,0.9764705882352941,0.5137254901960784,0.1411764705882353,1,0.7058823529411765,0,1,0.8980392156862745,0.02352941176470588],"Name":"Warm","NanColor":[1,0.8980392156862745,0.02352941176470588]},{"IndexedColors":[0.4588235294117647,0.6941176470588235,0.00392156862745098,0.3450980392156863,0.5019607843137255,0.1607843137254902,0.3137254901960784,0.8431372549019608,0.7490196078431373,0.1098039215686274,0.5843137254901961,0.803921568627451,0.2313725490196079,0.407843137254902,0.6705882352941176,0.6039215686274509,0.407843137254902,1,0.3725490196078431,0.2,0.5019607843137255],"Name":"Cool","NanColor":[0.3725490196078431,0.2,0.5019607843137255]},{"IndexedColors":[0.2313725490196079,0.407843137254902,0.6705882352941176,0.1098039215686274,0.5843137254901961,0.803921568627451,0.3058823529411765,0.8509803921568627,0.9176470588235294,0.4509803921568628,0.6039215686274509,0.8352941176470589,0.2588235294117647,0.2392156862745098,0.6627450980392157,0.3137254901960784,0.3294117647058823,0.5294117647058824,0.06274509803921569,0.1647058823529412,0.3215686274509804],"Name":"Blues","NanColor":[0.06274509803921569,0.1647058823529412,0.3215686274509804]},{"IndexedColors":[0.1098039215686274,0.5843137254901961,0.803921568627451,0.2313725490196079,0.407843137254902,0.6705882352941176,0.4,0.2431372549019608,0.7176470588235294,0.6352941176470588,0.3294117647058823,0.8117647058823529,0.8705882352941177,0.3803921568627451,0.807843137254902,0.8627450980392157,0.3803921568627451,0.5843137254901961,0.2392156862745098,0.06274509803921569,0.3215686274509804],"Name":"Wild Flower","NanColor":[0.2392156862745098,0.06274509803921569,0.3215686274509804]},{"IndexedColors":[0.396078431372549,0.4862745098039216,0.2156862745098039,0.4588235294117647,0.6941176470588235,0.00392156862745098,0.6980392156862745,0.7294117647058823,0.1882352941176471,1,0.8980392156862745,0.02352941176470588,1,0.7058823529411765,0,0.9764705882352941,0.5137254901960784,0.1411764705882353],"Name":"Citrus","NanColor":[0.9764705882352941,0.5137254901960784,0.1411764705882353]},{"IndexedColors":[0.4980392156862745,0.2313725490196079,0.03137254901960784,0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.07843137254901961,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333,0.1764705882352941,0,0.2941176470588235],"Name":"Brewer Diverging Purple-Orange (11)","NanColor":[0.1764705882352941,0,0.2941176470588235]},{"IndexedColors":[0.4980392156862745,0.2313725490196079,0.03137254901960784,0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.07843137254901961,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333,0.1764705882352941,0,0.2941176470588235],"Name":"Brewer Diverging Purple-Orange (10)","NanColor":[0.1764705882352941,0,0.2941176470588235]},{"IndexedColors":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.07843137254901961,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333],"Name":"Brewer Diverging Purple-Orange (9)","NanColor":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{"IndexedColors":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.07843137254901961,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333],"Name":"Brewer Diverging Purple-Orange (8)","NanColor":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{"IndexedColors":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.9450980392156862,0.6392156862745098,0.2509803921568627,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6,0.5568627450980392,0.7647058823529411,0.3294117647058823,0.1529411764705882,0.5333333333333333],"Name":"Brewer Diverging Purple-Orange (7)","NanColor":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{"IndexedColors":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.9450980392156862,0.6392156862745098,0.2509803921568627,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6,0.5568627450980392,0.7647058823529411,0.3294117647058823,0.1529411764705882,0.5333333333333333],"Name":"Brewer Diverging Purple-Orange (6)","NanColor":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{"IndexedColors":[0.9019607843137255,0.3803921568627451,0.00392156862745098,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.3686274509803922,0.2352941176470588,0.6],"Name":"Brewer Diverging Purple-Orange (5)","NanColor":[0.3686274509803922,0.2352941176470588,0.6]},{"IndexedColors":[0.9019607843137255,0.3803921568627451,0.00392156862745098,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.3686274509803922,0.2352941176470588,0.6],"Name":"Brewer Diverging Purple-Orange (4)","NanColor":[0.3686274509803922,0.2352941176470588,0.6]},{"IndexedColors":[0.9450980392156862,0.6392156862745098,0.2509803921568627,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.6,0.5568627450980392,0.7647058823529411],"Name":"Brewer Diverging Purple-Orange (3)","NanColor":[0.6,0.5568627450980392,0.7647058823529411]},{"IndexedColors":[0.6196078431372549,0.00392156862745098,0.2588235294117647,0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353,0.3686274509803922,0.3098039215686275,0.6352941176470588],"Name":"Brewer Diverging Spectral (11)","NanColor":[0.3686274509803922,0.3098039215686275,0.6352941176470588]},{"IndexedColors":[0.6196078431372549,0.00392156862745098,0.2588235294117647,0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353,0.3686274509803922,0.3098039215686275,0.6352941176470588],"Name":"Brewer Diverging Spectral (10)","NanColor":[0.3686274509803922,0.3098039215686275,0.6352941176470588]},{"IndexedColors":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353],"Name":"Brewer Diverging Spectral (9)","NanColor":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{"IndexedColors":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353],"Name":"Brewer Diverging Spectral (8)","NanColor":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{"IndexedColors":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9882352941176471,0.5529411764705883,0.3490196078431372,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6,0.8352941176470589,0.5803921568627451,0.196078431372549,0.5333333333333333,0.7411764705882353],"Name":"Brewer Diverging Spectral (7)","NanColor":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{"IndexedColors":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9882352941176471,0.5529411764705883,0.3490196078431372,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6,0.8352941176470589,0.5803921568627451,0.196078431372549,0.5333333333333333,0.7411764705882353],"Name":"Brewer Diverging Spectral (6)","NanColor":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{"IndexedColors":[0.8431372549019608,0.09803921568627451,0.1098039215686274,0.9921568627450981,0.6823529411764706,0.3803921568627451,1,1,0.7490196078431373,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.1686274509803922,0.5137254901960784,0.7294117647058823],"Name":"Brewer Diverging Spectral (5)","NanColor":[0.1686274509803922,0.5137254901960784,0.7294117647058823]},{"IndexedColors":[0.8431372549019608,0.09803921568627451,0.1098039215686274,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.1686274509803922,0.5137254901960784,0.7294117647058823],"Name":"Brewer Diverging Spectral (4)","NanColor":[0.1686274509803922,0.5137254901960784,0.7294117647058823]},{"IndexedColors":[0.9882352941176471,0.5529411764705883,0.3490196078431372,1,1,0.7490196078431373,0.6,0.8352941176470589,0.5803921568627451],"Name":"Brewer Diverging Spectral (3)","NanColor":[0.6,0.8352941176470589,0.5803921568627451]},{"IndexedColors":[0.3294117647058823,0.1882352941176471,0.0196078431372549,0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922,0,0.2352941176470588,0.1882352941176471],"Name":"Brewer Diverging Brown-Blue-Green (11)","NanColor":[0,0.2352941176470588,0.1882352941176471]},{"IndexedColors":[0.3294117647058823,0.1882352941176471,0.0196078431372549,0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922,0,0.2352941176470588,0.1882352941176471],"Name":"Brewer Diverging Brown-Blue-Green (10)","NanColor":[0,0.2352941176470588,0.1882352941176471]},{"IndexedColors":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922],"Name":"Brewer Diverging Brown-Blue-Green (9)","NanColor":[0.00392156862745098,0.4,0.3686274509803922]},{"IndexedColors":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922],"Name":"Brewer Diverging Brown-Blue-Green (8)","NanColor":[0.00392156862745098,0.4,0.3686274509803922]},{"IndexedColors":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.8470588235294118,0.7019607843137254,0.396078431372549,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.3529411764705883,0.7058823529411765,0.6745098039215687,0.00392156862745098,0.4,0.3686274509803922],"Name":"Brewer Diverging Brown-Blue-Green (7)","NanColor":[0.00392156862745098,0.4,0.3686274509803922]},{"IndexedColors":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.8470588235294118,0.7019607843137254,0.396078431372549,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.3529411764705883,0.7058823529411765,0.6745098039215687,0.00392156862745098,0.4,0.3686274509803922],"Name":"Brewer Diverging Brown-Blue-Green (6)","NanColor":[0.00392156862745098,0.4,0.3686274509803922]},{"IndexedColors":[0.6509803921568628,0.3803921568627451,0.1019607843137255,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.5019607843137255,0.803921568627451,0.7568627450980392,0.00392156862745098,0.5215686274509804,0.4431372549019608],"Name":"Brewer Diverging Brown-Blue-Green (5)","NanColor":[0.00392156862745098,0.5215686274509804,0.4431372549019608]},{"IndexedColors":[0.6509803921568628,0.3803921568627451,0.1019607843137255,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.5019607843137255,0.803921568627451,0.7568627450980392,0.00392156862745098,0.5215686274509804,0.4431372549019608],"Name":"Brewer Diverging Brown-Blue-Green (4)","NanColor":[0.00392156862745098,0.5215686274509804,0.4431372549019608]},{"IndexedColors":[0.8470588235294118,0.7019607843137254,0.396078431372549,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.3529411764705883,0.7058823529411765,0.6745098039215687],"Name":"Brewer Diverging Brown-Blue-Green (3)","NanColor":[0.3529411764705883,0.7058823529411765,0.6745098039215687]},{"IndexedColors":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8980392156862745,0.9607843137254902,0.9764705882352941,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.4274509803921568,0.1725490196078431,0,0.2666666666666667,0.1058823529411765],"Name":"Brewer Sequential Blue-Green (9)","NanColor":[0,0.2666666666666667,0.1058823529411765]},{"IndexedColors":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8980392156862745,0.9607843137254902,0.9764705882352941,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.3450980392156863,0.1411764705882353],"Name":"Brewer Sequential Blue-Green (8)","NanColor":[0,0.3450980392156863,0.1411764705882353]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.8,0.9254901960784314,0.9019607843137255,0.8,0.9254901960784314,0.9019607843137255,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.3450980392156863,0.1411764705882353],"Name":"Brewer Sequential Blue-Green (7)","NanColor":[0,0.3450980392156863,0.1411764705882353]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.1725490196078431,0.6352941176470588,0.3725490196078431,0,0.4274509803921568,0.1725490196078431],"Name":"Brewer Sequential Blue-Green (6)","NanColor":[0,0.4274509803921568,0.1725490196078431]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.6980392156862745,0.8862745098039215,0.8862745098039215,0.4,0.7607843137254902,0.6431372549019608,0.1725490196078431,0.6352941176470588,0.3725490196078431,0,0.4274509803921568,0.1725490196078431],"Name":"Brewer Sequential Blue-Green (5)","NanColor":[0,0.4274509803921568,0.1725490196078431]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.6980392156862745,0.8862745098039215,0.8862745098039215,0.4,0.7607843137254902,0.6431372549019608,0.1372549019607843,0.5450980392156862,0.2705882352941176],"Name":"Brewer Sequential Blue-Green (4)","NanColor":[0.1372549019607843,0.5450980392156862,0.2705882352941176]},{"IndexedColors":[0.8980392156862745,0.9607843137254902,0.9764705882352941,0.6,0.8470588235294118,0.788235294117647,0.1725490196078431,0.6352941176470588,0.3725490196078431],"Name":"Brewer Sequential Blue-Green (3)","NanColor":[0.1725490196078431,0.6352941176470588,0.3725490196078431]},{"IndexedColors":[1,1,0.8980392156862745,1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.07843137254901961,0.8,0.2980392156862745,0.007843137254901961,0.6,0.203921568627451,0.01568627450980392,0.4,0.1450980392156863,0.02352941176470588],"Name":"Brewer Sequential Yellow-Orange-Brown (9)","NanColor":[0.4,0.1450980392156863,0.02352941176470588]},{"IndexedColors":[1,1,0.8980392156862745,1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.07843137254901961,0.8,0.2980392156862745,0.007843137254901961,0.5490196078431373,0.1764705882352941,0.01568627450980392],"Name":"Brewer Sequential Yellow-Orange-Brown (8)","NanColor":[0.5490196078431373,0.1764705882352941,0.01568627450980392]},{"IndexedColors":[1,1,0.8313725490196079,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.07843137254901961,0.8,0.2980392156862745,0.007843137254901961,0.5490196078431373,0.1764705882352941,0.01568627450980392],"Name":"Brewer Sequential Yellow-Orange-Brown (7)","NanColor":[0.5490196078431373,0.1764705882352941,0.01568627450980392]},{"IndexedColors":[1,1,0.8313725490196079,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.8509803921568627,0.3725490196078431,0.05490196078431372,0.6,0.203921568627451,0.01568627450980392],"Name":"Brewer Sequential Yellow-Orange-Brown (6)","NanColor":[0.6,0.203921568627451,0.01568627450980392]},{"IndexedColors":[1,1,0.8313725490196079,0.996078431372549,0.8509803921568627,0.5568627450980392,0.996078431372549,0.6,0.1607843137254902,0.8509803921568627,0.3725490196078431,0.05490196078431372,0.6,0.203921568627451,0.01568627450980392],"Name":"Brewer Sequential Yellow-Orange-Brown (5)","NanColor":[0.6,0.203921568627451,0.01568627450980392]},{"IndexedColors":[1,1,0.8313725490196079,0.996078431372549,0.8509803921568627,0.5568627450980392,0.996078431372549,0.6,0.1607843137254902,0.8,0.2980392156862745,0.007843137254901961],"Name":"Brewer Sequential Yellow-Orange-Brown (4)","NanColor":[0.8,0.2980392156862745,0.007843137254901961]},{"IndexedColors":[1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.7686274509803922,0.3098039215686275,0.8509803921568627,0.3725490196078431,0.05490196078431372],"Name":"Brewer Sequential Yellow-Orange-Brown (3)","NanColor":[0.8509803921568627,0.3725490196078431,0.05490196078431372]},{"IndexedColors":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8784313725490196,0.9254901960784314,0.9568627450980393,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.5058823529411764,0.05882352941176471,0.4862745098039216,0.3019607843137255,0,0.2941176470588235],"Name":"Brewer Sequential Blue-Purple (9)","NanColor":[0.3019607843137255,0,0.2941176470588235]},{"IndexedColors":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8784313725490196,0.9254901960784314,0.9568627450980393,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.4313725490196079,0.00392156862745098,0.4196078431372549],"Name":"Brewer Sequential Blue-Purple (8)","NanColor":[0.4313725490196079,0.00392156862745098,0.4196078431372549]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.4313725490196079,0.00392156862745098,0.4196078431372549],"Name":"Brewer Sequential Blue-Purple (7)","NanColor":[0.4313725490196079,0.00392156862745098,0.4196078431372549]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.3372549019607843,0.6549019607843137,0.5058823529411764,0.05882352941176471,0.4862745098039216],"Name":"Brewer Sequential Blue-Purple (6)","NanColor":[0.5058823529411764,0.05882352941176471,0.4862745098039216]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7019607843137254,0.803921568627451,0.8901960784313725,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.3372549019607843,0.6549019607843137,0.5058823529411764,0.05882352941176471,0.4862745098039216],"Name":"Brewer Sequential Blue-Purple (5)","NanColor":[0.5058823529411764,0.05882352941176471,0.4862745098039216]},{"IndexedColors":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7019607843137254,0.803921568627451,0.8901960784313725,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.2549019607843137,0.615686274509804],"Name":"Brewer Sequential Blue-Purple (4)","NanColor":[0.5333333333333333,0.2549019607843137,0.615686274509804]},{"IndexedColors":[0.8784313725490196,0.9254901960784314,0.9568627450980393,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5333333333333333,0.3372549019607843,0.6549019607843137],"Name":"Brewer Sequential Blue-Purple (3)","NanColor":[0.5333333333333333,0.3372549019607843,0.6549019607843137]},{"IndexedColors":[0.4980392156862745,0.788235294117647,0.4980392156862745,0.7450980392156863,0.6823529411764706,0.8313725490196079,0.9921568627450981,0.7529411764705882,0.5254901960784314,1,1,0.6,0.2196078431372549,0.4235294117647059,0.6901960784313725,0.9411764705882353,0.007843137254901961,0.4980392156862745,0.7490196078431373,0.3568627450980392,0.09019607843137255,0.4,0.4,0.4],"Name":"Brewer Qualitative Accent","NanColor":[0.4,0.4,0.4]},{"IndexedColors":[0.1058823529411765,0.6196078431372549,0.4666666666666667,0.8509803921568627,0.3725490196078431,0.007843137254901961,0.4588235294117647,0.4392156862745098,0.7019607843137254,0.9058823529411765,0.1607843137254902,0.5411764705882353,0.4,0.6509803921568628,0.1176470588235294,0.9019607843137255,0.6705882352941176,0.007843137254901961,0.6509803921568628,0.4627450980392157,0.1137254901960784,0.4,0.4,0.4],"Name":"Brewer Qualitative Dark2","NanColor":[0.4,0.4,0.4]},{"IndexedColors":[0.4,0.7607843137254902,0.6470588235294118,0.9882352941176471,0.5529411764705883,0.3843137254901961,0.5529411764705883,0.6274509803921569,0.796078431372549,0.9058823529411765,0.5411764705882353,0.7647058823529411,0.6509803921568628,0.8470588235294118,0.3294117647058823,1,0.8509803921568627,0.1843137254901961,0.8980392156862745,0.7686274509803922,0.5803921568627451,0.7019607843137254,0.7019607843137254,0.7019607843137254],"Name":"Brewer Qualitative Set2","NanColor":[0.7019607843137254,0.7019607843137254,0.7019607843137254]},{"IndexedColors":[0.7019607843137254,0.8862745098039215,0.803921568627451,0.9921568627450981,0.803921568627451,0.6745098039215687,0.796078431372549,0.8352941176470589,0.9098039215686274,0.9568627450980393,0.792156862745098,0.8941176470588236,0.9019607843137255,0.9607843137254902,0.788235294117647,1,0.9490196078431372,0.6823529411764706,0.9450980392156862,0.8862745098039215,0.8,0.8,0.8,0.8],"Name":"Brewer Qualitative Pastel2","NanColor":[0.8,0.8,0.8]},{"IndexedColors":[0.984313725490196,0.7058823529411765,0.6823529411764706,0.7019607843137254,0.803921568627451,0.8901960784313725,0.8,0.9215686274509803,0.7725490196078432,0.8705882352941177,0.796078431372549,0.8941176470588236,0.996078431372549,0.8509803921568627,0.6509803921568628,1,1,0.8,0.8980392156862745,0.8470588235294118,0.7411764705882353,0.9921568627450981,0.8549019607843137,0.9254901960784314,0.9490196078431372,0.9490196078431372,0.9490196078431372],"Name":"Brewer Qualitative Pastel1","NanColor":[0.9490196078431372,0.9490196078431372,0.9490196078431372]},{"IndexedColors":[0.8941176470588236,0.1019607843137255,0.1098039215686274,0.2156862745098039,0.4941176470588236,0.7215686274509804,0.3019607843137255,0.6862745098039216,0.2901960784313726,0.596078431372549,0.3058823529411765,0.6392156862745098,1,0.4980392156862745,0,1,1,0.2,0.6509803921568628,0.3372549019607843,0.1568627450980392,0.9686274509803922,0.5058823529411764,0.7490196078431373,0.6,0.6,0.6],"Name":"Brewer Qualitative Set1","NanColor":[0.6,0.6,0.6]},{"IndexedColors":[0.6509803921568628,0.807843137254902,0.8901960784313725,0.1215686274509804,0.4705882352941176,0.7058823529411765,0.6980392156862745,0.8745098039215686,0.5411764705882353,0.2,0.6274509803921569,0.1725490196078431,0.984313725490196,0.6039215686274509,0.6,0.8901960784313725,0.1019607843137255,0.1098039215686274,0.9921568627450981,0.7490196078431373,0.4352941176470588,1,0.4980392156862745,0,0.792156862745098,0.6980392156862745,0.8392156862745098,0.4156862745098039,0.2392156862745098,0.6039215686274509,1,1,0.6],"Name":"Brewer Qualitative Paired","NanColor":[1,1,0.6]},{"IndexedColors":[0.5529411764705883,0.8274509803921568,0.7803921568627451,1,1,0.7019607843137254,0.7450980392156863,0.7294117647058823,0.8549019607843137,0.984313725490196,0.5019607843137255,0.4470588235294118,0.5019607843137255,0.6941176470588235,0.8274509803921568,0.9921568627450981,0.7058823529411765,0.3843137254901961,0.7019607843137254,0.8705882352941177,0.4117647058823529,0.9882352941176471,0.803921568627451,0.8980392156862745,0.8509803921568627,0.8509803921568627,0.8509803921568627,0.7372549019607844,0.5019607843137255,0.7411764705882353,0.8,0.9215686274509803,0.7725490196078432,1,0.9294117647058824,0.4352941176470588],"Name":"Brewer Qualitative Set3","NanColor":[1,0.9294117647058824,0.4352941176470588]},{"IndexedColors":[1,0,0,1,0.862745,0,0,0.695201,0],"Name":"Traffic Lights","NanColor":[0.803922,0,0.803922]},{"IndexedColors":[0.908659,0.604013,0.581857,1,0.862745,0,0,0.695201,0],"Name":"Traffic Lights For Deuteranopes","NanColor":[0.803922,0,0.803922]},{"IndexedColors":[0.4196078431372549,0,0.07058823529411765,0.9019607843137255,0.9411764705882353,0.0196078431372549,0.01568627450980392,0.6196078431372549,0.007843137254901961],"Name":"Traffic Lights For Deuteranopes 2","NanColor":[0.803922,0,0.803922]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Muted Blue-Green","NanColor":[0.25,0,0],"RGBPoints":[0,0.109804,0.27451,0.301961,0.02,0.129412,0.309804,0.341176,0.05,0.14902,0.341176,0.380392,0.1,0.188235,0.403922,0.458824,0.15,0.227451,0.447059,0.5215689999999999,0.2,0.290196,0.494118,0.588235,0.25,0.368627,0.552941,0.670588,0.3,0.458824,0.619608,0.74902,0.35,0.588235,0.7137250000000001,0.85098,0.4,0.72549,0.815686,0.941176,0.45,0.831373,0.8823530000000001,0.980392,0.475,0.9098039999999999,0.933333,1,0.5,0.980392,0.984314,1,0.5,0.996078,1,0.94902,0.5,1,1,0.980392,0.5,0.980392,0.984314,1,0.525,0.972549,0.988235,0.890196,0.55,0.917647,0.960784,0.835294,0.6,0.835294,0.921569,0.772549,0.65,0.7686269999999999,0.901961,0.737255,0.7,0.670588,0.831373,0.654902,0.75,0.576471,0.760784,0.584314,0.8,0.498039,0.678431,0.5215689999999999,0.85,0.392157,0.5607839999999999,0.427451,0.9,0.294118,0.45098,0.333333,0.95,0.211765,0.34902,0.254902,1,0.152941,0.278431,0.196078]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Green-Blue Asymmetric Divergent (62Blbc)","NanColor":[0.25,0,0],"RGBPoints":[0,0.121569,0.2,0.145098,0.05,0.196078,0.301961,0.223529,0.1,0.258824,0.4,0.278431,0.2,0.341176,0.54902,0.341176,0.25,0.419608,0.619608,0.376471,0.3,0.545098,0.7019609999999999,0.392157,0.35,0.643137,0.780392,0.403922,0.4,0.7294119999999999,0.819608,0.45098,0.45,0.811765,0.870588,0.5215689999999999,0.5,0.898039,0.9098039999999999,0.564706,0.55,0.941176,0.92549,0.686275,0.6,0.960784,0.94902,0.776471,0.64,1,1,1,0.65,0.890196,0.988235,0.972549,0.7,0.721569,0.894118,0.901961,0.75,0.631373,0.823529,0.839216,0.8,0.517647,0.662745,0.7019609999999999,0.85,0.384314,0.494118,0.54902,0.9,0.298039,0.360784,0.45098,0.95,0.223529,0.25098,0.34902,0.99,0.156863,0.172549,0.25098,1,0.137255,0.137255,0.188235]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Asymmtrical Earth Tones (6_21b)","NanColor":[0.25,0,0],"RGBPoints":[0,0.141176,0.14902,0.2,0.05,0.215686,0.258824,0.321569,0.1,0.243137,0.368627,0.380392,0.15,0.27451,0.439216,0.4,0.2,0.32549,0.501961,0.384314,0.25,0.403922,0.6,0.419608,0.3,0.486275,0.7019609999999999,0.454902,0.35,0.556863,0.74902,0.494118,0.4,0.670588,0.8,0.545098,0.5,0.8549020000000001,0.901961,0.631373,0.55,0.92549,0.941176,0.694118,0.6,0.960784,0.94902,0.776471,0.65,0.988235,0.968627,0.9098039999999999,0.7,0.839216,0.815686,0.772549,0.75,0.7019609999999999,0.662745,0.615686,0.8,0.6,0.529412,0.478431,0.85,0.501961,0.403922,0.360784,0.9,0.439216,0.313725,0.290196,1,0.301961,0.164706,0.176471]},{"ColorSpace":"Lab","Creator":"Francesca Samsel","Name":"Yellow 15","NanColor":[0.25,0,0],"RGBPoints":[0,1,1,0.988235,0.002,1,1,0.988235,0.05,0.984314,0.988235,0.843137,0.1,0.988235,0.988235,0.7411759999999999,0.15,0.980392,0.968627,0.654902,0.2,0.980392,0.945098,0.576471,0.25,0.968627,0.905882,0.486275,0.3,0.968627,0.862745,0.388235,0.35,0.960784,0.803922,0.286275,0.4,0.94902,0.7411759999999999,0.219608,0.45,0.941176,0.678431,0.14902,0.5,0.929412,0.607843,0.09411799999999999,0.55,0.921569,0.545098,0.054902,0.6,0.9098039999999999,0.486275,0.035294,0.65,0.890196,0.411765,0.019608,0.7,0.8,0.305882,0,0.75,0.760784,0.239216,0,0.8,0.678431,0.180392,0.011765,0.85,0.6,0.121569,0.023529,0.9,0.501961,0.054902,0.031373,0.95,0.4,0.039216,0.058824,1,0.301961,0.047059,0.090196]},{"ColorSpace":"Diverging","Name":"Magma (matplotlib)","NanColor":[0,1,0],"Source":"https://github.com/BIDS/colormap/blob/master/colormaps.py","License":"CC0","Creator":"Nathaniel J. Smith & Stefan van der Walt","RGBPoints":[0.000000,0.001462,0.000466,0.013866,0.003922,0.002258,0.001295,0.018331,0.007843,0.003279,0.002305,0.023708,0.011765,0.004512,0.003490,0.029965,0.015686,0.005950,0.004843,0.037130,0.019608,0.007588,0.006356,0.044973,0.023529,0.009426,0.008022,0.052844,0.027451,0.011465,0.009828,0.060750,0.031373,0.013708,0.011771,0.068667,0.035294,0.016156,0.013840,0.076603,0.039216,0.018815,0.016026,0.084584,0.043137,0.021692,0.018320,0.092610,0.047059,0.024792,0.020715,0.100676,0.050980,0.028123,0.023201,0.108787,0.054902,0.031696,0.025765,0.116965,0.058824,0.035520,0.028397,0.125209,0.062745,0.039608,0.031090,0.133515,0.066667,0.043830,0.033830,0.141886,0.070588,0.048062,0.036607,0.150327,0.074510,0.052320,0.039407,0.158841,0.078431,0.056615,0.042160,0.167446,0.082353,0.060949,0.044794,0.176129,0.086275,0.065330,0.047318,0.184892,0.090196,0.069764,0.049726,0.193735,0.094118,0.074257,0.052017,0.202660,0.098039,0.078815,0.054184,0.211667,0.101961,0.083446,0.056225,0.220755,0.105882,0.088155,0.058133,0.229922,0.109804,0.092949,0.059904,0.239164,0.113725,0.097833,0.061531,0.248477,0.117647,0.102815,0.063010,0.257854,0.121569,0.107899,0.064335,0.267289,0.125490,0.113094,0.065492,0.276784,0.129412,0.118405,0.066479,0.286321,0.133333,0.123833,0.067295,0.295879,0.137255,0.129380,0.067935,0.305443,0.141176,0.135053,0.068391,0.315000,0.145098,0.140858,0.068654,0.324538,0.149020,0.146785,0.068738,0.334011,0.152941,0.152839,0.068637,0.343404,0.156863,0.159018,0.068354,0.352688,0.160784,0.165308,0.067911,0.361816,0.164706,0.171713,0.067305,0.370771,0.168627,0.178212,0.066576,0.379497,0.172549,0.184801,0.065732,0.387973,0.176471,0.191460,0.064818,0.396152,0.180392,0.198177,0.063862,0.404009,0.184314,0.204935,0.062907,0.411514,0.188235,0.211718,0.061992,0.418647,0.192157,0.218512,0.061158,0.425392,0.196078,0.225302,0.060445,0.431742,0.200000,0.232077,0.059889,0.437695,0.203922,0.238826,0.059517,0.443256,0.207843,0.245543,0.059352,0.448436,0.211765,0.252220,0.059415,0.453248,0.215686,0.258857,0.059706,0.457710,0.219608,0.265447,0.060237,0.461840,0.223529,0.271994,0.060994,0.465660,0.227451,0.278493,0.061978,0.469190,0.231373,0.284951,0.063168,0.472451,0.235294,0.291366,0.064553,0.475462,0.239216,0.297740,0.066117,0.478243,0.243137,0.304081,0.067835,0.480812,0.247059,0.310382,0.069702,0.483186,0.250980,0.316654,0.071690,0.485380,0.254902,0.322899,0.073782,0.487408,0.258824,0.329114,0.075972,0.489287,0.262745,0.335308,0.078236,0.491024,0.266667,0.341482,0.080564,0.492631,0.270588,0.347636,0.082946,0.494121,0.274510,0.353773,0.085373,0.495501,0.278431,0.359898,0.087831,0.496778,0.282353,0.366012,0.090314,0.497960,0.286275,0.372116,0.092816,0.499053,0.290196,0.378211,0.095332,0.500067,0.294118,0.384299,0.097855,0.501002,0.298039,0.390384,0.100379,0.501864,0.301961,0.396467,0.102902,0.502658,0.305882,0.402548,0.105420,0.503386,0.309804,0.408629,0.107930,0.504052,0.313725,0.414709,0.110431,0.504662,0.317647,0.420791,0.112920,0.505215,0.321569,0.426877,0.115395,0.505714,0.325490,0.432967,0.117855,0.506160,0.329412,0.439062,0.120298,0.506555,0.333333,0.445163,0.122724,0.506901,0.337255,0.451271,0.125132,0.507198,0.341176,0.457386,0.127522,0.507448,0.345098,0.463508,0.129893,0.507652,0.349020,0.469640,0.132245,0.507809,0.352941,0.475780,0.134577,0.507921,0.356863,0.481929,0.136891,0.507989,0.360784,0.488088,0.139186,0.508011,0.364706,0.494258,0.141462,0.507988,0.368627,0.500438,0.143719,0.507920,0.372549,0.506629,0.145958,0.507806,0.376471,0.512831,0.148179,0.507648,0.380392,0.519045,0.150383,0.507443,0.384314,0.525270,0.152569,0.507192,0.388235,0.531507,0.154739,0.506895,0.392157,0.537755,0.156894,0.506551,0.396078,0.544015,0.159033,0.506159,0.400000,0.550287,0.161158,0.505719,0.403922,0.556571,0.163269,0.505230,0.407843,0.562866,0.165368,0.504692,0.411765,0.569172,0.167454,0.504105,0.415686,0.575490,0.169530,0.503466,0.419608,0.581819,0.171596,0.502777,0.423529,0.588158,0.173652,0.502035,0.427451,0.594508,0.175701,0.501241,0.431373,0.600868,0.177743,0.500394,0.435294,0.607238,0.179779,0.499492,0.439216,0.613617,0.181811,0.498536,0.443137,0.620005,0.183840,0.497524,0.447059,0.626401,0.185867,0.496456,0.450980,0.632805,0.187893,0.495332,0.454902,0.639216,0.189921,0.494150,0.458824,0.645633,0.191952,0.492910,0.462745,0.652056,0.193986,0.491611,0.466667,0.658483,0.196027,0.490253,0.470588,0.664915,0.198075,0.488836,0.474510,0.671349,0.200133,0.487358,0.478431,0.677786,0.202203,0.485819,0.482353,0.684224,0.204286,0.484219,0.486275,0.690661,0.206384,0.482558,0.490196,0.697098,0.208501,0.480835,0.494118,0.703532,0.210638,0.479049,0.498039,0.709962,0.212797,0.477201,0.501961,0.716387,0.214982,0.475290,0.505882,0.722805,0.217194,0.473316,0.509804,0.729216,0.219437,0.471279,0.513725,0.735616,0.221713,0.469180,0.517647,0.742004,0.224025,0.467018,0.521569,0.748378,0.226377,0.464794,0.525490,0.754737,0.228772,0.462509,0.529412,0.761077,0.231214,0.460162,0.533333,0.767398,0.233705,0.457755,0.537255,0.773695,0.236249,0.455289,0.541176,0.779968,0.238851,0.452765,0.545098,0.786212,0.241514,0.450184,0.549020,0.792427,0.244242,0.447543,0.552941,0.798608,0.247040,0.444848,0.556863,0.804752,0.249911,0.442102,0.560784,0.810855,0.252861,0.439305,0.564706,0.816914,0.255895,0.436461,0.568627,0.822926,0.259016,0.433573,0.572549,0.828886,0.262229,0.430644,0.576471,0.834791,0.265540,0.427671,0.580392,0.840636,0.268953,0.424666,0.584314,0.846416,0.272473,0.421631,0.588235,0.852126,0.276106,0.418573,0.592157,0.857763,0.279857,0.415496,0.596078,0.863320,0.283729,0.412403,0.600000,0.868793,0.287728,0.409303,0.603922,0.874176,0.291859,0.406205,0.607843,0.879464,0.296125,0.403118,0.611765,0.884651,0.300530,0.400047,0.615686,0.889731,0.305079,0.397002,0.619608,0.894700,0.309773,0.393995,0.623529,0.899552,0.314616,0.391037,0.627451,0.904281,0.319610,0.388137,0.631373,0.908884,0.324755,0.385308,0.635294,0.913354,0.330052,0.382563,0.639216,0.917689,0.335500,0.379915,0.643137,0.921884,0.341098,0.377376,0.647059,0.925937,0.346844,0.374959,0.650980,0.929845,0.352734,0.372677,0.654902,0.933606,0.358764,0.370541,0.658824,0.937221,0.364929,0.368567,0.662745,0.940687,0.371224,0.366762,0.666667,0.944006,0.377643,0.365136,0.670588,0.947180,0.384178,0.363701,0.674510,0.950210,0.390820,0.362468,0.678431,0.953099,0.397563,0.361438,0.682353,0.955849,0.404400,0.360619,0.686275,0.958464,0.411324,0.360014,0.690196,0.960949,0.418323,0.359630,0.694118,0.963310,0.425390,0.359469,0.698039,0.965549,0.432519,0.359529,0.701961,0.967671,0.439703,0.359810,0.705882,0.969680,0.446936,0.360311,0.709804,0.971582,0.454210,0.361030,0.713725,0.973381,0.461520,0.361965,0.717647,0.975082,0.468861,0.363111,0.721569,0.976690,0.476226,0.364466,0.725490,0.978210,0.483612,0.366025,0.729412,0.979645,0.491014,0.367783,0.733333,0.981000,0.498428,0.369734,0.737255,0.982279,0.505851,0.371874,0.741176,0.983485,0.513280,0.374198,0.745098,0.984622,0.520713,0.376698,0.749020,0.985693,0.528148,0.379371,0.752941,0.986700,0.535582,0.382210,0.756863,0.987646,0.543015,0.385210,0.760784,0.988533,0.550446,0.388365,0.764706,0.989363,0.557873,0.391671,0.768627,0.990138,0.565296,0.395122,0.772549,0.990871,0.572706,0.398714,0.776471,0.991558,0.580107,0.402441,0.780392,0.992196,0.587502,0.406299,0.784314,0.992785,0.594891,0.410283,0.788235,0.993326,0.602275,0.414390,0.792157,0.993834,0.609644,0.418613,0.796078,0.994309,0.616999,0.422950,0.800000,0.994738,0.624350,0.427397,0.803922,0.995122,0.631696,0.431951,0.807843,0.995480,0.639027,0.436607,0.811765,0.995810,0.646344,0.441361,0.815686,0.996096,0.653659,0.446213,0.819608,0.996341,0.660969,0.451160,0.823529,0.996580,0.668256,0.456192,0.827451,0.996775,0.675541,0.461314,0.831373,0.996925,0.682828,0.466526,0.835294,0.997077,0.690088,0.471811,0.839216,0.997186,0.697349,0.477182,0.843137,0.997254,0.704611,0.482635,0.847059,0.997325,0.711848,0.488154,0.850980,0.997351,0.719089,0.493755,0.854902,0.997351,0.726324,0.499428,0.858824,0.997341,0.733545,0.505167,0.862745,0.997285,0.740772,0.510983,0.866667,0.997228,0.747981,0.516859,0.870588,0.997138,0.755190,0.522806,0.874510,0.997019,0.762398,0.528821,0.878431,0.996898,0.769591,0.534892,0.882353,0.996727,0.776795,0.541039,0.886275,0.996571,0.783977,0.547233,0.890196,0.996369,0.791167,0.553499,0.894118,0.996162,0.798348,0.559820,0.898039,0.995932,0.805527,0.566202,0.901961,0.995680,0.812706,0.572645,0.905882,0.995424,0.819875,0.579140,0.909804,0.995131,0.827052,0.585701,0.913725,0.994851,0.834213,0.592307,0.917647,0.994524,0.841387,0.598983,0.921569,0.994222,0.848540,0.605696,0.925490,0.993866,0.855711,0.612482,0.929412,0.993545,0.862859,0.619299,0.933333,0.993170,0.870024,0.626189,0.937255,0.992831,0.877168,0.633109,0.941176,0.992440,0.884330,0.640099,0.945098,0.992089,0.891470,0.647116,0.949020,0.991688,0.898627,0.654202,0.952941,0.991332,0.905763,0.661309,0.956863,0.990930,0.912915,0.668481,0.960784,0.990570,0.920049,0.675675,0.964706,0.990175,0.927196,0.682926,0.968627,0.989815,0.934329,0.690198,0.972549,0.989434,0.941470,0.697519,0.976471,0.989077,0.948604,0.704863,0.980392,0.988717,0.955742,0.712242,0.984314,0.988367,0.962878,0.719649,0.988235,0.988033,0.970012,0.727077,0.992157,0.987691,0.977154,0.734536,0.996078,0.987387,0.984288,0.742002,1.000000,0.987053,0.991438,0.749504]},{"ColorSpace":"Diverging","Name":"Inferno (matplotlib)","NanColor":[0,1,0],"Source":"https://github.com/BIDS/colormap/blob/master/colormaps.py","License":"CC0","Creator":"Nathaniel J. Smith & Stefan van der Walt","RGBPoints":[0.000000,0.001462,0.000466,0.013866,0.003922,0.002267,0.001270,0.018570,0.007843,0.003299,0.002249,0.024239,0.011765,0.004547,0.003392,0.030909,0.015686,0.006006,0.004692,0.038558,0.019608,0.007676,0.006136,0.046836,0.023529,0.009561,0.007713,0.055143,0.027451,0.011663,0.009417,0.063460,0.031373,0.013995,0.011225,0.071862,0.035294,0.016561,0.013136,0.080282,0.039216,0.019373,0.015133,0.088767,0.043137,0.022447,0.017199,0.097327,0.047059,0.025793,0.019331,0.105930,0.050980,0.029432,0.021503,0.114621,0.054902,0.033385,0.023702,0.123397,0.058824,0.037668,0.025921,0.132232,0.062745,0.042253,0.028139,0.141141,0.066667,0.046915,0.030324,0.150164,0.070588,0.051644,0.032474,0.159254,0.074510,0.056449,0.034569,0.168414,0.078431,0.061340,0.036590,0.177642,0.082353,0.066331,0.038504,0.186962,0.086275,0.071429,0.040294,0.196354,0.090196,0.076637,0.041905,0.205799,0.094118,0.081962,0.043328,0.215289,0.098039,0.087411,0.044556,0.224813,0.101961,0.092990,0.045583,0.234358,0.105882,0.098702,0.046402,0.243904,0.109804,0.104551,0.047008,0.253430,0.113725,0.110536,0.047399,0.262912,0.117647,0.116656,0.047574,0.272321,0.121569,0.122908,0.047536,0.281624,0.125490,0.129285,0.047293,0.290788,0.129412,0.135778,0.046856,0.299776,0.133333,0.142378,0.046242,0.308553,0.137255,0.149073,0.045468,0.317085,0.141176,0.155850,0.044559,0.325338,0.145098,0.162689,0.043554,0.333277,0.149020,0.169575,0.042489,0.340874,0.152941,0.176493,0.041402,0.348111,0.156863,0.183429,0.040329,0.354971,0.160784,0.190367,0.039309,0.361447,0.164706,0.197297,0.038400,0.367535,0.168627,0.204209,0.037632,0.373238,0.172549,0.211095,0.037030,0.378563,0.176471,0.217949,0.036615,0.383522,0.180392,0.224763,0.036405,0.388129,0.184314,0.231538,0.036405,0.392400,0.188235,0.238273,0.036621,0.396353,0.192157,0.244967,0.037055,0.400007,0.196078,0.251620,0.037705,0.403378,0.200000,0.258234,0.038571,0.406485,0.203922,0.264810,0.039647,0.409345,0.207843,0.271347,0.040922,0.411976,0.211765,0.277850,0.042353,0.414392,0.215686,0.284321,0.043933,0.416608,0.219608,0.290763,0.045644,0.418637,0.223529,0.297178,0.047470,0.420491,0.227451,0.303568,0.049396,0.422182,0.231373,0.309935,0.051407,0.423721,0.235294,0.316282,0.053490,0.425116,0.239216,0.322610,0.055634,0.426377,0.243137,0.328921,0.057827,0.427511,0.247059,0.335217,0.060060,0.428524,0.250980,0.341500,0.062325,0.429425,0.254902,0.347771,0.064616,0.430217,0.258824,0.354032,0.066925,0.430906,0.262745,0.360284,0.069247,0.431497,0.266667,0.366529,0.071579,0.431994,0.270588,0.372768,0.073915,0.432400,0.274510,0.379001,0.076253,0.432719,0.278431,0.385228,0.078591,0.432955,0.282353,0.391453,0.080927,0.433109,0.286275,0.397674,0.083257,0.433183,0.290196,0.403894,0.085580,0.433179,0.294118,0.410113,0.087896,0.433098,0.298039,0.416331,0.090203,0.432943,0.301961,0.422549,0.092501,0.432714,0.305882,0.428768,0.094790,0.432412,0.309804,0.434987,0.097069,0.432039,0.313725,0.441207,0.099338,0.431594,0.317647,0.447428,0.101597,0.431080,0.321569,0.453651,0.103848,0.430498,0.325490,0.459875,0.106089,0.429846,0.329412,0.466100,0.108322,0.429125,0.333333,0.472328,0.110547,0.428334,0.337255,0.478558,0.112764,0.427475,0.341176,0.484789,0.114974,0.426548,0.345098,0.491022,0.117179,0.425552,0.349020,0.497257,0.119379,0.424488,0.352941,0.503493,0.121575,0.423356,0.356863,0.509730,0.123769,0.422156,0.360784,0.515967,0.125960,0.420887,0.364706,0.522206,0.128150,0.419549,0.368627,0.528444,0.130341,0.418142,0.372549,0.534683,0.132534,0.416667,0.376471,0.540920,0.134729,0.415123,0.380392,0.547157,0.136929,0.413511,0.384314,0.553392,0.139134,0.411829,0.388235,0.559624,0.141346,0.410078,0.392157,0.565854,0.143567,0.408258,0.396078,0.572081,0.145797,0.406369,0.400000,0.578304,0.148039,0.404411,0.403922,0.584521,0.150294,0.402385,0.407843,0.590734,0.152563,0.400290,0.411765,0.596940,0.154848,0.398125,0.415686,0.603139,0.157151,0.395891,0.419608,0.609330,0.159474,0.393589,0.423529,0.615513,0.161817,0.391219,0.427451,0.621685,0.164184,0.388781,0.431373,0.627847,0.166575,0.386276,0.435294,0.633998,0.168992,0.383704,0.439216,0.640135,0.171438,0.381065,0.443137,0.646260,0.173914,0.378359,0.447059,0.652369,0.176421,0.375586,0.450980,0.658463,0.178962,0.372748,0.454902,0.664540,0.181539,0.369846,0.458824,0.670599,0.184153,0.366879,0.462745,0.676638,0.186807,0.363849,0.466667,0.682656,0.189501,0.360757,0.470588,0.688653,0.192239,0.357603,0.474510,0.694627,0.195021,0.354388,0.478431,0.700576,0.197851,0.351113,0.482353,0.706500,0.200728,0.347777,0.486275,0.712396,0.203656,0.344383,0.490196,0.718264,0.206636,0.340931,0.494118,0.724103,0.209670,0.337424,0.498039,0.729909,0.212759,0.333861,0.501961,0.735683,0.215906,0.330245,0.505882,0.741423,0.219112,0.326576,0.509804,0.747127,0.222378,0.322856,0.513725,0.752794,0.225706,0.319085,0.517647,0.758422,0.229097,0.315266,0.521569,0.764010,0.232554,0.311399,0.525490,0.769556,0.236077,0.307485,0.529412,0.775059,0.239667,0.303526,0.533333,0.780517,0.243327,0.299523,0.537255,0.785929,0.247056,0.295477,0.541176,0.791293,0.250856,0.291390,0.545098,0.796607,0.254728,0.287264,0.549020,0.801871,0.258674,0.283099,0.552941,0.807082,0.262692,0.278898,0.556863,0.812239,0.266786,0.274661,0.560784,0.817341,0.270954,0.270390,0.564706,0.822386,0.275197,0.266085,0.568627,0.827372,0.279517,0.261750,0.572549,0.832299,0.283913,0.257383,0.576471,0.837165,0.288385,0.252988,0.580392,0.841969,0.292933,0.248564,0.584314,0.846709,0.297559,0.244113,0.588235,0.851384,0.302260,0.239636,0.592157,0.855992,0.307038,0.235133,0.596078,0.860533,0.311892,0.230606,0.600000,0.865006,0.316822,0.226055,0.603922,0.869409,0.321827,0.221482,0.607843,0.873741,0.326906,0.216886,0.611765,0.878001,0.332060,0.212268,0.615686,0.882188,0.337287,0.207628,0.619608,0.886302,0.342586,0.202968,0.623529,0.890341,0.347957,0.198286,0.627451,0.894305,0.353399,0.193584,0.631373,0.898192,0.358911,0.188860,0.635294,0.902003,0.364492,0.184116,0.639216,0.905735,0.370140,0.179350,0.643137,0.909390,0.375856,0.174563,0.647059,0.912966,0.381636,0.169755,0.650980,0.916462,0.387481,0.164924,0.654902,0.919879,0.393389,0.160070,0.658824,0.923215,0.399359,0.155193,0.662745,0.926470,0.405389,0.150292,0.666667,0.929644,0.411479,0.145367,0.670588,0.932737,0.417627,0.140417,0.674510,0.935747,0.423831,0.135440,0.678431,0.938675,0.430091,0.130438,0.682353,0.941521,0.436405,0.125409,0.686275,0.944285,0.442772,0.120354,0.690196,0.946965,0.449191,0.115272,0.694118,0.949562,0.455660,0.110164,0.698039,0.952075,0.462178,0.105031,0.701961,0.954506,0.468744,0.099874,0.705882,0.956852,0.475356,0.094695,0.709804,0.959114,0.482014,0.089499,0.713725,0.961293,0.488716,0.084289,0.717647,0.963387,0.495462,0.079073,0.721569,0.965397,0.502249,0.073859,0.725490,0.967322,0.509078,0.068659,0.729412,0.969163,0.515946,0.063488,0.733333,0.970919,0.522853,0.058367,0.737255,0.972590,0.529798,0.053324,0.741176,0.974176,0.536780,0.048392,0.745098,0.975677,0.543798,0.043618,0.749020,0.977092,0.550850,0.039050,0.752941,0.978422,0.557937,0.034931,0.756863,0.979666,0.565057,0.031409,0.760784,0.980824,0.572209,0.028508,0.764706,0.981895,0.579392,0.026250,0.768627,0.982881,0.586606,0.024661,0.772549,0.983779,0.593849,0.023770,0.776471,0.984591,0.601122,0.023606,0.780392,0.985315,0.608422,0.024202,0.784314,0.985952,0.615750,0.025592,0.788235,0.986502,0.623105,0.027814,0.792157,0.986964,0.630485,0.030908,0.796078,0.987337,0.637890,0.034916,0.800000,0.987622,0.645320,0.039886,0.803922,0.987819,0.652773,0.045581,0.807843,0.987926,0.660250,0.051750,0.811765,0.987945,0.667748,0.058329,0.815686,0.987874,0.675267,0.065257,0.819608,0.987714,0.682807,0.072489,0.823529,0.987464,0.690366,0.079990,0.827451,0.987124,0.697944,0.087731,0.831373,0.986694,0.705540,0.095694,0.835294,0.986175,0.713153,0.103863,0.839216,0.985566,0.720782,0.112229,0.843137,0.984865,0.728427,0.120785,0.847059,0.984075,0.736087,0.129527,0.850980,0.983196,0.743758,0.138453,0.854902,0.982228,0.751442,0.147565,0.858824,0.981173,0.759135,0.156863,0.862745,0.980032,0.766837,0.166353,0.866667,0.978806,0.774545,0.176037,0.870588,0.977497,0.782258,0.185923,0.874510,0.976108,0.789974,0.196018,0.878431,0.974638,0.797692,0.206332,0.882353,0.973088,0.805409,0.216877,0.886275,0.971468,0.813122,0.227658,0.890196,0.969783,0.820825,0.238686,0.894118,0.968041,0.828515,0.249972,0.898039,0.966243,0.836191,0.261534,0.901961,0.964394,0.843848,0.273391,0.905882,0.962517,0.851476,0.285546,0.909804,0.960626,0.859069,0.298010,0.913725,0.958720,0.866624,0.310820,0.917647,0.956834,0.874129,0.323974,0.921569,0.954997,0.881569,0.337475,0.925490,0.953215,0.888942,0.351369,0.929412,0.951546,0.896226,0.365627,0.933333,0.950018,0.903409,0.380271,0.937255,0.948683,0.910473,0.395289,0.941176,0.947594,0.917399,0.410665,0.945098,0.946809,0.924168,0.426373,0.949020,0.946392,0.930761,0.442367,0.952941,0.946403,0.937159,0.458592,0.956863,0.946903,0.943348,0.474970,0.960784,0.947937,0.949318,0.491426,0.964706,0.949545,0.955063,0.507860,0.968627,0.951740,0.960587,0.524203,0.972549,0.954529,0.965896,0.540361,0.976471,0.957896,0.971003,0.556275,0.980392,0.961812,0.975924,0.571925,0.984314,0.966249,0.980678,0.587206,0.988235,0.971162,0.985282,0.602154,0.992157,0.976511,0.989753,0.616760,0.996078,0.982257,0.994109,0.631017,1.000000,0.988362,0.998364,0.644924]},{"ColorSpace":"Diverging","Name":"Plasma (matplotlib)","NanColor":[0,1,0],"Source":"https://github.com/BIDS/colormap/blob/master/colormaps.py","License":"CC0","Creator":"Nathaniel J. Smith & Stefan van der Walt","RGBPoints":[0.000000,0.050383,0.029803,0.527975,0.003922,0.063536,0.028426,0.533124,0.007843,0.075353,0.027206,0.538007,0.011765,0.086222,0.026125,0.542658,0.015686,0.096379,0.025165,0.547103,0.019608,0.105980,0.024309,0.551368,0.023529,0.115124,0.023556,0.555468,0.027451,0.123903,0.022878,0.559423,0.031373,0.132381,0.022258,0.563250,0.035294,0.140603,0.021687,0.566959,0.039216,0.148607,0.021154,0.570562,0.043137,0.156421,0.020651,0.574065,0.047059,0.164070,0.020171,0.577478,0.050980,0.171574,0.019706,0.580806,0.054902,0.178950,0.019252,0.584054,0.058824,0.186213,0.018803,0.587228,0.062745,0.193374,0.018354,0.590330,0.066667,0.200445,0.017902,0.593364,0.070588,0.207435,0.017442,0.596333,0.074510,0.214350,0.016973,0.599239,0.078431,0.221197,0.016497,0.602083,0.082353,0.227983,0.016007,0.604867,0.086275,0.234715,0.015502,0.607592,0.090196,0.241396,0.014979,0.610259,0.094118,0.248032,0.014439,0.612868,0.098039,0.254627,0.013882,0.615419,0.101961,0.261183,0.013308,0.617911,0.105882,0.267703,0.012716,0.620346,0.109804,0.274191,0.012109,0.622722,0.113725,0.280648,0.011488,0.625038,0.117647,0.287076,0.010855,0.627295,0.121569,0.293478,0.010213,0.629490,0.125490,0.299855,0.009561,0.631624,0.129412,0.306210,0.008902,0.633694,0.133333,0.312543,0.008239,0.635700,0.137255,0.318856,0.007576,0.637640,0.141176,0.325150,0.006915,0.639512,0.145098,0.331426,0.006261,0.641316,0.149020,0.337683,0.005618,0.643049,0.152941,0.343925,0.004991,0.644710,0.156863,0.350150,0.004382,0.646298,0.160784,0.356359,0.003798,0.647810,0.164706,0.362553,0.003243,0.649245,0.168627,0.368733,0.002724,0.650601,0.172549,0.374897,0.002245,0.651876,0.176471,0.381047,0.001814,0.653068,0.180392,0.387183,0.001434,0.654177,0.184314,0.393304,0.001114,0.655199,0.188235,0.399411,0.000859,0.656133,0.192157,0.405503,0.000678,0.656977,0.196078,0.411580,0.000577,0.657730,0.200000,0.417642,0.000564,0.658390,0.203922,0.423689,0.000646,0.658956,0.207843,0.429719,0.000831,0.659425,0.211765,0.435734,0.001127,0.659797,0.215686,0.441732,0.001540,0.660069,0.219608,0.447714,0.002080,0.660240,0.223529,0.453677,0.002755,0.660310,0.227451,0.459623,0.003574,0.660277,0.231373,0.465550,0.004545,0.660139,0.235294,0.471457,0.005678,0.659897,0.239216,0.477344,0.006980,0.659549,0.243137,0.483210,0.008460,0.659095,0.247059,0.489055,0.010127,0.658534,0.250980,0.494877,0.011990,0.657865,0.254902,0.500678,0.014055,0.657088,0.258824,0.506454,0.016333,0.656202,0.262745,0.512206,0.018833,0.655209,0.266667,0.517933,0.021563,0.654109,0.270588,0.523633,0.024532,0.652901,0.274510,0.529306,0.027747,0.651586,0.278431,0.534952,0.031217,0.650165,0.282353,0.540570,0.034950,0.648640,0.286275,0.546157,0.038954,0.647010,0.290196,0.551715,0.043136,0.645277,0.294118,0.557243,0.047331,0.643443,0.298039,0.562738,0.051545,0.641509,0.301961,0.568201,0.055778,0.639477,0.305882,0.573632,0.060028,0.637349,0.309804,0.579029,0.064296,0.635126,0.313725,0.584391,0.068579,0.632812,0.317647,0.589719,0.072878,0.630408,0.321569,0.595011,0.077190,0.627917,0.325490,0.600266,0.081516,0.625342,0.329412,0.605485,0.085854,0.622686,0.333333,0.610667,0.090204,0.619951,0.337255,0.615812,0.094564,0.617140,0.341176,0.620919,0.098934,0.614257,0.345098,0.625987,0.103312,0.611305,0.349020,0.631017,0.107699,0.608287,0.352941,0.636008,0.112092,0.605205,0.356863,0.640959,0.116492,0.602065,0.360784,0.645872,0.120898,0.598867,0.364706,0.650746,0.125309,0.595617,0.368627,0.655580,0.129725,0.592317,0.372549,0.660374,0.134144,0.588971,0.376471,0.665129,0.138566,0.585582,0.380392,0.669845,0.142992,0.582154,0.384314,0.674522,0.147419,0.578688,0.388235,0.679160,0.151848,0.575189,0.392157,0.683758,0.156278,0.571660,0.396078,0.688318,0.160709,0.568103,0.400000,0.692840,0.165141,0.564522,0.403922,0.697324,0.169573,0.560919,0.407843,0.701769,0.174005,0.557296,0.411765,0.706178,0.178437,0.553657,0.415686,0.710549,0.182868,0.550004,0.419608,0.714883,0.187299,0.546338,0.423529,0.719181,0.191729,0.542663,0.427451,0.723444,0.196158,0.538981,0.431373,0.727670,0.200586,0.535293,0.435294,0.731862,0.205013,0.531601,0.439216,0.736019,0.209439,0.527908,0.443137,0.740143,0.213864,0.524216,0.447059,0.744232,0.218288,0.520524,0.450980,0.748289,0.222711,0.516834,0.454902,0.752312,0.227133,0.513149,0.458824,0.756304,0.231555,0.509468,0.462745,0.760264,0.235976,0.505794,0.466667,0.764193,0.240396,0.502126,0.470588,0.768090,0.244817,0.498465,0.474510,0.771958,0.249237,0.494813,0.478431,0.775796,0.253658,0.491171,0.482353,0.779604,0.258078,0.487539,0.486275,0.783383,0.262500,0.483918,0.490196,0.787133,0.266922,0.480307,0.494118,0.790855,0.271345,0.476706,0.498039,0.794549,0.275770,0.473117,0.501961,0.798216,0.280197,0.469538,0.505882,0.801855,0.284626,0.465971,0.509804,0.805467,0.289057,0.462415,0.513725,0.809052,0.293491,0.458870,0.517647,0.812612,0.297928,0.455338,0.521569,0.816144,0.302368,0.451816,0.525490,0.819651,0.306812,0.448306,0.529412,0.823132,0.311261,0.444806,0.533333,0.826588,0.315714,0.441316,0.537255,0.830018,0.320172,0.437836,0.541176,0.833422,0.324635,0.434366,0.545098,0.836801,0.329105,0.430905,0.549020,0.840155,0.333580,0.427455,0.552941,0.843484,0.338062,0.424013,0.556863,0.846788,0.342551,0.420579,0.560784,0.850066,0.347048,0.417153,0.564706,0.853319,0.351553,0.413734,0.568627,0.856547,0.356066,0.410322,0.572549,0.859750,0.360588,0.406917,0.576471,0.862927,0.365119,0.403519,0.580392,0.866078,0.369660,0.400126,0.584314,0.869203,0.374212,0.396738,0.588235,0.872303,0.378774,0.393355,0.592157,0.875376,0.383347,0.389976,0.596078,0.878423,0.387932,0.386600,0.600000,0.881443,0.392529,0.383229,0.603922,0.884436,0.397139,0.379860,0.607843,0.887402,0.401762,0.376494,0.611765,0.890340,0.406398,0.373130,0.615686,0.893250,0.411048,0.369768,0.619608,0.896131,0.415712,0.366407,0.623529,0.898984,0.420392,0.363047,0.627451,0.901807,0.425087,0.359688,0.631373,0.904601,0.429797,0.356329,0.635294,0.907365,0.434524,0.352970,0.639216,0.910098,0.439268,0.349610,0.643137,0.912800,0.444029,0.346251,0.647059,0.915471,0.448807,0.342890,0.650980,0.918109,0.453603,0.339529,0.654902,0.920714,0.458417,0.336166,0.658824,0.923287,0.463251,0.332801,0.662745,0.925825,0.468103,0.329435,0.666667,0.928329,0.472975,0.326067,0.670588,0.930798,0.477867,0.322697,0.674510,0.933232,0.482780,0.319325,0.678431,0.935630,0.487712,0.315952,0.682353,0.937990,0.492667,0.312575,0.686275,0.940313,0.497642,0.309197,0.690196,0.942598,0.502639,0.305816,0.694118,0.944844,0.507658,0.302433,0.698039,0.947051,0.512699,0.299049,0.701961,0.949217,0.517763,0.295662,0.705882,0.951344,0.522850,0.292275,0.709804,0.953428,0.527960,0.288883,0.713725,0.955470,0.533093,0.285490,0.717647,0.957469,0.538250,0.282096,0.721569,0.959424,0.543431,0.278701,0.725490,0.961336,0.548636,0.275305,0.729412,0.963203,0.553865,0.271909,0.733333,0.965024,0.559118,0.268513,0.737255,0.966798,0.564396,0.265118,0.741176,0.968526,0.569700,0.261721,0.745098,0.970205,0.575028,0.258325,0.749020,0.971835,0.580382,0.254931,0.752941,0.973416,0.585761,0.251540,0.756863,0.974947,0.591165,0.248151,0.760784,0.976428,0.596595,0.244767,0.764706,0.977856,0.602051,0.241387,0.768627,0.979233,0.607532,0.238013,0.772549,0.980556,0.613039,0.234646,0.776471,0.981826,0.618572,0.231287,0.780392,0.983041,0.624131,0.227937,0.784314,0.984199,0.629718,0.224595,0.788235,0.985301,0.635330,0.221265,0.792157,0.986345,0.640969,0.217948,0.796078,0.987332,0.646633,0.214648,0.800000,0.988260,0.652325,0.211364,0.803922,0.989128,0.658043,0.208100,0.807843,0.989935,0.663787,0.204859,0.811765,0.990681,0.669558,0.201642,0.815686,0.991365,0.675355,0.198453,0.819608,0.991985,0.681179,0.195295,0.823529,0.992541,0.687030,0.192170,0.827451,0.993032,0.692907,0.189084,0.831373,0.993456,0.698810,0.186041,0.835294,0.993814,0.704741,0.183043,0.839216,0.994103,0.710698,0.180097,0.843137,0.994324,0.716681,0.177208,0.847059,0.994474,0.722691,0.174381,0.850980,0.994553,0.728728,0.171622,0.854902,0.994561,0.734791,0.168938,0.858824,0.994495,0.740880,0.166335,0.862745,0.994355,0.746995,0.163821,0.866667,0.994141,0.753137,0.161404,0.870588,0.993851,0.759304,0.159092,0.874510,0.993482,0.765499,0.156891,0.878431,0.993033,0.771720,0.154808,0.882353,0.992505,0.777967,0.152855,0.886275,0.991897,0.784239,0.151042,0.890196,0.991209,0.790537,0.149377,0.894118,0.990439,0.796859,0.147870,0.898039,0.989587,0.803205,0.146529,0.901961,0.988648,0.809579,0.145357,0.905882,0.987621,0.815978,0.144363,0.909804,0.986509,0.822401,0.143557,0.913725,0.985314,0.828846,0.142945,0.917647,0.984031,0.835315,0.142528,0.921569,0.982653,0.841812,0.142303,0.925490,0.981190,0.848329,0.142279,0.929412,0.979644,0.854866,0.142453,0.933333,0.977995,0.861432,0.142808,0.937255,0.976265,0.868016,0.143351,0.941176,0.974443,0.874622,0.144061,0.945098,0.972530,0.881250,0.144923,0.949020,0.970533,0.887896,0.145919,0.952941,0.968443,0.894564,0.147014,0.956863,0.966271,0.901249,0.148180,0.960784,0.964021,0.907950,0.149370,0.964706,0.961681,0.914672,0.150520,0.968627,0.959276,0.921407,0.151566,0.972549,0.956808,0.928152,0.152409,0.976471,0.954287,0.934908,0.152921,0.980392,0.951726,0.941671,0.152925,0.984314,0.949151,0.948435,0.152178,0.988235,0.946602,0.955190,0.150328,0.992157,0.944152,0.961916,0.146861,0.996078,0.941896,0.968590,0.140956,1.000000,0.940015,0.975158,0.131326]},{"ColorSpace":"Diverging","Name":"Viridis (matplotlib)","NanColor":[1,0,0],"Source":"https://github.com/BIDS/colormap/blob/master/colormaps.py","License":"CC0","Creator":"Eric Firing","RGBPoints":[0.000000,0.267004,0.004874,0.329415,0.003922,0.268510,0.009605,0.335427,0.007843,0.269944,0.014625,0.341379,0.011765,0.271305,0.019942,0.347269,0.015686,0.272594,0.025563,0.353093,0.019608,0.273809,0.031497,0.358853,0.023529,0.274952,0.037752,0.364543,0.027451,0.276022,0.044167,0.370164,0.031373,0.277018,0.050344,0.375715,0.035294,0.277941,0.056324,0.381191,0.039216,0.278791,0.062145,0.386592,0.043137,0.279566,0.067836,0.391917,0.047059,0.280267,0.073417,0.397163,0.050980,0.280894,0.078907,0.402329,0.054902,0.281446,0.084320,0.407414,0.058824,0.281924,0.089666,0.412415,0.062745,0.282327,0.094955,0.417331,0.066667,0.282656,0.100196,0.422160,0.070588,0.282910,0.105393,0.426902,0.074510,0.283091,0.110553,0.431554,0.078431,0.283197,0.115680,0.436115,0.082353,0.283229,0.120777,0.440584,0.086275,0.283187,0.125848,0.444960,0.090196,0.283072,0.130895,0.449241,0.094118,0.282884,0.135920,0.453427,0.098039,0.282623,0.140926,0.457517,0.101961,0.282290,0.145912,0.461510,0.105882,0.281887,0.150881,0.465405,0.109804,0.281412,0.155834,0.469201,0.113725,0.280868,0.160771,0.472899,0.117647,0.280255,0.165693,0.476498,0.121569,0.279574,0.170599,0.479997,0.125490,0.278826,0.175490,0.483397,0.129412,0.278012,0.180367,0.486697,0.133333,0.277134,0.185228,0.489898,0.137255,0.276194,0.190074,0.493001,0.141176,0.275191,0.194905,0.496005,0.145098,0.274128,0.199721,0.498911,0.149020,0.273006,0.204520,0.501721,0.152941,0.271828,0.209303,0.504434,0.156863,0.270595,0.214069,0.507052,0.160784,0.269308,0.218818,0.509577,0.164706,0.267968,0.223549,0.512008,0.168627,0.266580,0.228262,0.514349,0.172549,0.265145,0.232956,0.516599,0.176471,0.263663,0.237631,0.518762,0.180392,0.262138,0.242286,0.520837,0.184314,0.260571,0.246922,0.522828,0.188235,0.258965,0.251537,0.524736,0.192157,0.257322,0.256130,0.526563,0.196078,0.255645,0.260703,0.528312,0.200000,0.253935,0.265254,0.529983,0.203922,0.252194,0.269783,0.531579,0.207843,0.250425,0.274290,0.533103,0.211765,0.248629,0.278775,0.534556,0.215686,0.246811,0.283237,0.535941,0.219608,0.244972,0.287675,0.537260,0.223529,0.243113,0.292092,0.538516,0.227451,0.241237,0.296485,0.539709,0.231373,0.239346,0.300855,0.540844,0.235294,0.237441,0.305202,0.541921,0.239216,0.235526,0.309527,0.542944,0.243137,0.233603,0.313828,0.543914,0.247059,0.231674,0.318106,0.544834,0.250980,0.229739,0.322361,0.545706,0.254902,0.227802,0.326594,0.546532,0.258824,0.225863,0.330805,0.547314,0.262745,0.223925,0.334994,0.548053,0.266667,0.221989,0.339161,0.548752,0.270588,0.220057,0.343307,0.549413,0.274510,0.218130,0.347432,0.550038,0.278431,0.216210,0.351535,0.550627,0.282353,0.214298,0.355619,0.551184,0.286275,0.212395,0.359683,0.551710,0.290196,0.210503,0.363727,0.552206,0.294118,0.208623,0.367752,0.552675,0.298039,0.206756,0.371758,0.553117,0.301961,0.204903,0.375746,0.553533,0.305882,0.203063,0.379716,0.553925,0.309804,0.201239,0.383670,0.554294,0.313725,0.199430,0.387607,0.554642,0.317647,0.197636,0.391528,0.554969,0.321569,0.195860,0.395433,0.555276,0.325490,0.194100,0.399323,0.555565,0.329412,0.192357,0.403199,0.555836,0.333333,0.190631,0.407061,0.556089,0.337255,0.188923,0.410910,0.556326,0.341176,0.187231,0.414746,0.556547,0.345098,0.185556,0.418570,0.556753,0.349020,0.183898,0.422383,0.556944,0.352941,0.182256,0.426184,0.557120,0.356863,0.180629,0.429975,0.557282,0.360784,0.179019,0.433756,0.557430,0.364706,0.177423,0.437527,0.557565,0.368627,0.175841,0.441290,0.557685,0.372549,0.174274,0.445044,0.557792,0.376471,0.172719,0.448791,0.557885,0.380392,0.171176,0.452530,0.557965,0.384314,0.169646,0.456262,0.558030,0.388235,0.168126,0.459988,0.558082,0.392157,0.166617,0.463708,0.558119,0.396078,0.165117,0.467423,0.558141,0.400000,0.163625,0.471133,0.558148,0.403922,0.162142,0.474838,0.558140,0.407843,0.160665,0.478540,0.558115,0.411765,0.159194,0.482237,0.558073,0.415686,0.157729,0.485932,0.558013,0.419608,0.156270,0.489624,0.557936,0.423529,0.154815,0.493313,0.557840,0.427451,0.153364,0.497000,0.557724,0.431373,0.151918,0.500685,0.557587,0.435294,0.150476,0.504369,0.557430,0.439216,0.149039,0.508051,0.557250,0.443137,0.147607,0.511733,0.557049,0.447059,0.146180,0.515413,0.556823,0.450980,0.144759,0.519093,0.556572,0.454902,0.143343,0.522773,0.556295,0.458824,0.141935,0.526453,0.555991,0.462745,0.140536,0.530132,0.555659,0.466667,0.139147,0.533812,0.555298,0.470588,0.137770,0.537492,0.554906,0.474510,0.136408,0.541173,0.554483,0.478431,0.135066,0.544853,0.554029,0.482353,0.133743,0.548535,0.553541,0.486275,0.132444,0.552216,0.553018,0.490196,0.131172,0.555899,0.552459,0.494118,0.129933,0.559582,0.551864,0.498039,0.128729,0.563265,0.551229,0.501961,0.127568,0.566949,0.550556,0.505882,0.126453,0.570633,0.549841,0.509804,0.125394,0.574318,0.549086,0.513725,0.124395,0.578002,0.548287,0.517647,0.123463,0.581687,0.547445,0.521569,0.122606,0.585371,0.546557,0.525490,0.121831,0.589055,0.545623,0.529412,0.121148,0.592739,0.544641,0.533333,0.120565,0.596422,0.543611,0.537255,0.120092,0.600104,0.542530,0.541176,0.119738,0.603785,0.541400,0.545098,0.119512,0.607464,0.540218,0.549020,0.119423,0.611141,0.538982,0.552941,0.119483,0.614817,0.537692,0.556863,0.119699,0.618490,0.536347,0.560784,0.120081,0.622161,0.534946,0.564706,0.120638,0.625828,0.533488,0.568627,0.121380,0.629492,0.531973,0.572549,0.122312,0.633153,0.530398,0.576471,0.123444,0.636809,0.528763,0.580392,0.124780,0.640461,0.527068,0.584314,0.126326,0.644107,0.525311,0.588235,0.128087,0.647749,0.523491,0.592157,0.130067,0.651384,0.521608,0.596078,0.132268,0.655014,0.519661,0.600000,0.134692,0.658636,0.517649,0.603922,0.137339,0.662252,0.515571,0.607843,0.140210,0.665859,0.513427,0.611765,0.143303,0.669459,0.511215,0.615686,0.146616,0.673050,0.508936,0.619608,0.150148,0.676631,0.506589,0.623529,0.153894,0.680203,0.504172,0.627451,0.157851,0.683765,0.501686,0.631373,0.162016,0.687316,0.499129,0.635294,0.166383,0.690856,0.496502,0.639216,0.170948,0.694384,0.493803,0.643137,0.175707,0.697900,0.491033,0.647059,0.180653,0.701402,0.488189,0.650980,0.185783,0.704891,0.485273,0.654902,0.191090,0.708366,0.482284,0.658824,0.196571,0.711827,0.479221,0.662745,0.202219,0.715272,0.476084,0.666667,0.208030,0.718701,0.472873,0.670588,0.214000,0.722114,0.469588,0.674510,0.220124,0.725509,0.466226,0.678431,0.226397,0.728888,0.462789,0.682353,0.232815,0.732247,0.459277,0.686275,0.239374,0.735588,0.455688,0.690196,0.246070,0.738910,0.452024,0.694118,0.252899,0.742211,0.448284,0.698039,0.259857,0.745492,0.444467,0.701961,0.266941,0.748751,0.440573,0.705882,0.274149,0.751988,0.436601,0.709804,0.281477,0.755203,0.432552,0.713725,0.288921,0.758394,0.428426,0.717647,0.296479,0.761561,0.424223,0.721569,0.304148,0.764704,0.419943,0.725490,0.311925,0.767822,0.415586,0.729412,0.319809,0.770914,0.411152,0.733333,0.327796,0.773980,0.406640,0.737255,0.335885,0.777018,0.402049,0.741176,0.344074,0.780029,0.397381,0.745098,0.352360,0.783011,0.392636,0.749020,0.360741,0.785964,0.387814,0.752941,0.369214,0.788888,0.382914,0.756863,0.377779,0.791781,0.377939,0.760784,0.386433,0.794644,0.372886,0.764706,0.395174,0.797475,0.367757,0.768627,0.404001,0.800275,0.362552,0.772549,0.412913,0.803041,0.357269,0.776471,0.421908,0.805774,0.351910,0.780392,0.430983,0.808473,0.346476,0.784314,0.440137,0.811138,0.340967,0.788235,0.449368,0.813768,0.335384,0.792157,0.458674,0.816363,0.329727,0.796078,0.468053,0.818921,0.323998,0.800000,0.477504,0.821444,0.318195,0.803922,0.487026,0.823929,0.312321,0.807843,0.496615,0.826376,0.306377,0.811765,0.506271,0.828786,0.300362,0.815686,0.515992,0.831158,0.294279,0.819608,0.525776,0.833491,0.288127,0.823529,0.535621,0.835785,0.281908,0.827451,0.545524,0.838039,0.275626,0.831373,0.555484,0.840254,0.269281,0.835294,0.565498,0.842430,0.262877,0.839216,0.575563,0.844566,0.256415,0.843137,0.585678,0.846661,0.249897,0.847059,0.595839,0.848717,0.243329,0.850980,0.606045,0.850733,0.236712,0.854902,0.616293,0.852709,0.230052,0.858824,0.626579,0.854645,0.223353,0.862745,0.636902,0.856542,0.216620,0.866667,0.647257,0.858400,0.209861,0.870588,0.657642,0.860219,0.203082,0.874510,0.668054,0.861999,0.196293,0.878431,0.678489,0.863742,0.189503,0.882353,0.688944,0.865448,0.182725,0.886275,0.699415,0.867117,0.175971,0.890196,0.709898,0.868751,0.169257,0.894118,0.720391,0.870350,0.162603,0.898039,0.730889,0.871916,0.156029,0.901961,0.741388,0.873449,0.149561,0.905882,0.751884,0.874951,0.143228,0.909804,0.762373,0.876424,0.137064,0.913725,0.772852,0.877868,0.131109,0.917647,0.783315,0.879285,0.125405,0.921569,0.793760,0.880678,0.120005,0.925490,0.804182,0.882046,0.114965,0.929412,0.814576,0.883393,0.110347,0.933333,0.824940,0.884720,0.106217,0.937255,0.835270,0.886029,0.102646,0.941176,0.845561,0.887322,0.099702,0.945098,0.855810,0.888601,0.097452,0.949020,0.866013,0.889868,0.095953,0.952941,0.876168,0.891125,0.095250,0.956863,0.886271,0.892374,0.095374,0.960784,0.896320,0.893616,0.096335,0.964706,0.906311,0.894855,0.098125,0.968627,0.916242,0.896091,0.100717,0.972549,0.926106,0.897330,0.104071,0.976471,0.935904,0.898570,0.108131,0.980392,0.945636,0.899815,0.112838,0.984314,0.955300,0.901065,0.118128,0.988235,0.964894,0.902323,0.123941,0.992157,0.974417,0.903590,0.130215,0.996078,0.983868,0.904867,0.136897,1.000000,0.993248,0.906157,0.143936]},{"ShowIndexedColorActiveValues":1,"IndexedColors":[0.07,0.50,0.70,1.00,1.00,1.00,0.85,1.00,1.00,0.80,0.50,1.00,0.76,1.00,0.00,1.00,0.71,0.71,0.50,0.50,0.50,0.05,0.05,1.00,1.00,0.05,0.05,0.70,1.00,1.00,0.70,0.89,0.96,0.67,0.36,0.95,0.54,1.00,0.00,0.75,0.65,0.65,0.50,0.60,0.60,1.00,0.50,0.00,1.00,1.00,0.19,0.12,0.94,0.12,0.50,0.82,0.89,0.56,0.25,0.83,0.24,1.00,0.00,0.90,0.90,0.90,0.75,0.76,0.78,0.65,0.65,0.67,0.54,0.60,0.78,0.61,0.48,0.78,0.50,0.48,0.78,0.44,0.48,0.78,0.36,0.48,0.76,1.00,0.48,0.38,0.49,0.50,0.69,0.76,0.56,0.56,0.40,0.56,0.56,0.74,0.50,0.89,1.00,0.63,0.00,0.65,0.16,0.16,0.36,0.72,0.82,0.44,0.18,0.69,0.00,1.00,0.00,0.58,1.00,1.00,0.58,0.88,0.88,0.45,0.76,0.79,0.33,0.71,0.71,0.23,0.62,0.62,0.14,0.56,0.56,0.04,0.49,0.55,0.00,0.41,0.52,0.88,0.88,1.00,1.00,0.85,0.56,0.65,0.46,0.45,0.40,0.50,0.50,0.62,0.39,0.71,0.83,0.48,0.00,0.58,0.00,0.58,0.26,0.62,0.69,0.34,0.09,0.56,0.00,0.79,0.00,0.44,0.83,1.00,1.00,1.00,0.78,0.85,1.00,0.78,0.78,1.00,0.78,0.64,1.00,0.78,0.56,1.00,0.78,0.38,1.00,0.78,0.27,1.00,0.78,0.19,1.00,0.78,0.12,1.00,0.78,0.00,1.00,0.61,0.00,0.90,0.46,0.00,0.83,0.32,0.00,0.75,0.22,0.00,0.67,0.14,0.30,0.76,1.00,0.30,0.65,1.00,0.13,0.58,0.84,0.15,0.49,0.67,0.15,0.40,0.59,0.09,0.33,0.53,0.96,0.93,0.82,0.80,0.82,0.12,0.71,0.71,0.76,0.65,0.33,0.30,0.34,0.35,0.38,0.62,0.31,0.71,0.67,0.36,0.00,0.46,0.31,0.27,0.26,0.51,0.59,0.26,0.00,0.40,0.00,0.49,0.00,0.44,0.67,0.98,0.00,0.73,1.00,0.00,0.63,1.00,0.00,0.56,1.00,0.00,0.50,1.00,0.00,0.42,1.00,0.33,0.36,0.95,0.47,0.36,0.89,0.54,0.31,0.89,0.63,0.21,0.83,0.70,0.12,0.83,0.70,0.12,0.73,0.70,0.05,0.65,0.74,0.05,0.53,0.78,0.00,0.40,0.80,0.00,0.35,0.82,0.00,0.31,0.85,0.00,0.27,0.88,0.00,0.22,0.90,0.00,0.18,0.91,0.00,0.15,0.92,0.00,0.14,0.93,0.00,0.13,0.94,0.00,0.12,0.95,0.00,0.11,0.96,0.00,0.10,0.97,0.00,0.09,0.98,0.00,0.08,0.99,0.00,0.07,1.00,0.00,0.06],"Annotations":[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],"Name":"BlueObeliskElements"}]'),la=Object.create(null);Mw.filter(t=>t.RGBPoints).filter(t=>t.ColorSpace!=="CIELAB").forEach(t=>{la[t.Name]=t});var fa=Object.keys(la);fa.sort();function Nw(t){return la[t]}function Rw(t){!t.RGBPoints||t.ColorSpace==="CIELAB"||(la[t.Name]||(fa.push(t.Name),fa.sort()),la[t.Name]=t)}function Lw(t){const e=fa.indexOf(t);e>-1&&fa.splice(e,1),delete la[t]}var Ec={addPreset:Rw,removePresetByName:Lw,getPresetByName:Nw,rgbPresetNames:fa},Fw={RGB:0,HSV:1,LAB:2,DIVERGING:3},kw={LINEAR:0,LOG10:1},Ih={ColorSpace:Fw,Scale:kw},{ColorSpace:$t,Scale:Dc}=Ih,{ScalarMappingTarget:Xo}=uo,{vtkDebugMacro:Aw,vtkErrorMacro:An,vtkWarningMacro:Vw}=A;function Ph(t,e){const a=t[0],n=t[1],r=t[2],i=Math.sqrt(a*a+n*n+r*r),o=i>.001?Math.acos(a/i):0,s=o>.001?Math.atan2(r,n):0;e[0]=i,e[1]=o,e[2]=s}function Bw(t,e){const a=t[0],n=t[1],r=t[2];e[0]=a*Math.cos(n),e[1]=a*Math.sin(n)*Math.cos(r),e[2]=a*Math.sin(n)*Math.sin(r)}function zh(t,e){if(t[0]>=e-.1)return t[2];const a=t[1]*Math.sqrt(e*e-t[0]*t[0])/(t[0]*Math.sin(t[1]));return t[2]>-.3*Math.PI?t[2]+a:t[2]-a}function Uw(t,e){let a=t-e;for(a<0&&(a=-a);a>=2*Math.PI;)a-=2*Math.PI;return a>Math.PI&&(a=2*Math.PI-a),a}function Wh(t,e,a,n){const r=[],i=[];ur(e,r),ur(a,i);const o=[],s=[];Ph(r,o),Ph(i,s);let u=t;if(o[1]>.05&&s[1]>.05&&Uw(o[2],s[2])>.33*Math.PI){let l=Math.max(o[0],s[0]);l=Math.max(88,l),t<.5?(s[0]=l,s[1]=0,s[2]=0,u*=2):(o[0]=l,o[1]=0,o[2]=0,u=2*u-1)}o[1]<.05&&s[1]>.05?o[2]=zh(s,o[0]):s[1]<.05&&o[1]>.05&&(s[2]=zh(o,s[0]));const c=[];c[0]=(1-u)*o[0]+u*s[0],c[1]=(1-u)*o[1]+u*s[1],c[2]=(1-u)*o[2]+u*s[2];const p=[];Bw(c,p),Li(p,n)}function Gw(t,e){e.classHierarchy.push("vtkColorTransferFunction"),t.getSize=()=>e.nodes.length,t.addRGBPoint=(a,n,r,i)=>t.addRGBPointLong(a,n,r,i,.5,0),t.addRGBPointLong=(a,n,r,i,o=.5,s=0)=>{if(o<0||o>1)return An("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return An("Sharpness outside range [0.0, 1.0]"),-1;e.allowDuplicateScalars||t.removePoint(a);const u={x:a,r:n,g:r,b:i,midpoint:o,sharpness:s};e.nodes.push(u),t.sortAndUpdateRange();let c=0;for(;ct.addHSVPointLong(a,n,r,i,.5,0),t.addHSVPointLong=(a,n,r,i,o=.5,s=0)=>{const u=[];return cr([n,r,i],u),t.addRGBPoint(a,u[0],u[1],u[2],o,s)},t.setNodes=a=>{if(e.nodes!==a){const n=JSON.stringify(e.nodes);e.nodes=a;const r=JSON.stringify(e.nodes);if(t.sortAndUpdateRange()||n!==r)return t.modified(),!0}return!1},t.sortAndUpdateRange=()=>{const a=JSON.stringify(e.nodes);e.nodes.sort((i,o)=>i.x-o.x);const n=JSON.stringify(e.nodes),r=t.updateRange();return!r&&a!==n?(t.modified(),!0):r},t.updateRange=()=>{const a=[2];a[0]=e.mappingRange[0],a[1]=e.mappingRange[1];const n=e.nodes.length;return n?(e.mappingRange[0]=e.nodes[0].x,e.mappingRange[1]=e.nodes[n-1].x):(e.mappingRange[0]=0,e.mappingRange[1]=0),a[0]===e.mappingRange[0]&&a[1]===e.mappingRange[1]?!1:(t.modified(),!0)},t.removePoint=a=>{let n=0;for(;n=e.nodes.length)return-1;let i=!1;return e.nodes.splice(n,1),(n===0||n===e.nodes.length)&&(i=t.updateRange()),i||t.modified(),r},t.movePoint=(a,n)=>{if(a!==n){t.removePoint(n);for(let r=0;r{e.nodes=[],t.sortAndUpdateRange()},t.addRGBSegment=(a,n,r,i,o,s,u,c)=>{t.sortAndUpdateRange();for(let p=0;p=a&&e.nodes[p].x<=o?e.nodes.splice(p,1):p++;t.addRGBPointLong(a,n,r,i,.5,0),t.addRGBPointLong(o,s,u,c,.5,0),t.modified()},t.addHSVSegment=(a,n,r,i,o,s,u,c)=>{const p=[n,r,i],l=[s,u,c],f=[],h=[];cr(p,f),cr(l,h),t.addRGBSegment(a,f[0],f[1],f[2],o,h[0],h[1],h[2])},t.mapValue=a=>{const n=[];return t.getColor(a,n),[Math.floor(255*n[0]+.5),Math.floor(255*n[1]+.5),Math.floor(255*n[2]+.5),255]},t.getColor=(a,n)=>{if(e.indexedLookup){const r=t.getSize(),i=t.getAnnotatedValueIndexInternal(a);if(i<0||r===0){const o=t.getNanColorByReference();n[0]=o[0],n[1]=o[1],n[2]=o[2]}else{const o=[];t.getNodeValue(i%r,o),n[0]=o[1],n[1]=o[2],n[2]=o[3]}return}t.getTable(a,a,1,n)},t.getRedValue=a=>{const n=[];return t.getColor(a,n),n[0]},t.getGreenValue=a=>{const n=[];return t.getColor(a,n),n[1]},t.getBlueValue=a=>{const n=[];return t.getColor(a,n),n[2]},t.logScaleEnabled=()=>e.scale===Dc.LOG10,t.usingLogScale=()=>t.logScaleEnabled()&&e.mappingRange[0]>0,t.getTable=(a,n,r,i)=>{const o=t.usingLogScale(),s=o?Math.log10(Number(a)):Number(a),u=o?Math.log10(Number(n)):Number(n);if(ki(s)||ki(u)){for(let w=0;w1?v=s+w/(r-1)*(u-s):v=.5*(s+u),e.discretize){const E=T;if(v>=E[0]&&v<=E[1]){const D=e.numberOfValues,O=E[1]-E[0];if(D<=1)v=E[0]+O/2;else{const b=Ws(D*((v-E[0])/O));v=E[0]+b/(D-1)*O}}}for(;ce.nodes[c].x;)c++,c.99999&&(g=.99999));if(v>T[1])i[_]=0,i[_+1]=0,i[_+2]=0,e.clamping&&(t.getUseAboveRangeColor()?(i[_]=e.aboveRangeColor[0],i[_+1]=e.aboveRangeColor[1],i[_+2]=e.aboveRangeColor[2]):(i[_]=l,i[_+1]=f,i[_+2]=h));else if(v0&&(i[_]=e.nodes[0].r,i[_+1]=e.nodes[0].g,i[_+2]=e.nodes[0].b));else if(c===0&&(Math.abs(v-s)<1e-6||e.discretize))p>0?(i[_]=e.nodes[0].r,i[_+1]=e.nodes[0].g,i[_+2]=e.nodes[0].b):(i[_]=0,i[_+1]=0,i[_+2]=0);else{let E=0;if(E=(v-m)/(x-m),E.99)if(E<.5){i[_]=y[0],i[_+1]=y[1],i[_+2]=y[2];continue}else{i[_]=d[0],i[_+1]=d[1],i[_+2]=d[2];continue}if(C<.01){if(e.colorSpace===$t.RGB)i[_]=(1-E)*y[0]+E*d[0],i[_+1]=(1-E)*y[1]+E*d[1],i[_+2]=(1-E)*y[2]+E*d[2];else if(e.colorSpace===$t.HSV){const F=[],k=[];ba(y,F),ba(d,k),e.hSVWrap&&(F[0]-k[0]>.5||k[0]-F[0]>.5)&&(F[0]>k[0]?F[0]-=1:k[0]-=1);const G=[];G[0]=(1-E)*F[0]+E*k[0],G[0]<0&&(G[0]+=1),G[1]=(1-E)*F[1]+E*k[1],G[2]=(1-E)*F[2]+E*k[2],cr(G,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else if(e.colorSpace===$t.LAB){const F=[],k=[];ur(y,F),ur(d,k);const G=[];G[0]=(1-E)*F[0]+E*k[0],G[1]=(1-E)*F[1]+E*k[1],G[2]=(1-E)*F[2]+E*k[2],Li(G,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else e.colorSpace===$t.DIVERGING?(Wh(E,y,d,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]):An("ColorSpace set to invalid value.",e.colorSpace);continue}E<.5?E=.5*(E*2)**(1+10*C):E>.5&&(E=1-.5*((1-E)*2)**(1+10*C));const D=E*E,O=D*E,b=2*O-3*D+1,R=-2*O+3*D,N=O-2*D+E,L=O-D;let B,P;if(e.colorSpace===$t.RGB)for(let F=0;F<3;F++)B=d[F]-y[F],P=(1-C)*B,i[_+F]=b*y[F]+R*d[F]+N*P+L*P;else if(e.colorSpace===$t.HSV){const F=[],k=[];ba(y,F),ba(d,k),e.hSVWrap&&(F[0]-k[0]>.5||k[0]-F[0]>.5)&&(F[0]>k[0]?F[0]-=1:k[0]-=1);const G=[];for(let W=0;W<3;W++)B=k[W]-F[W],P=(1-C)*B,G[W]=b*F[W]+R*k[W]+N*P+L*P,W===0&&G[W]<0&&(G[W]+=1);cr(G,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else if(e.colorSpace===$t.LAB){const F=[],k=[];ur(y,F),ur(d,k);const G=[];for(let W=0;W<3;W++)B=k[W]-F[W],P=(1-C)*B,G[W]=b*F[W]+R*k[W]+N*P+L*P;Li(G,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]}else e.colorSpace===$t.DIVERGING?(Wh(E,y,d,S),i[_]=S[0],i[_+1]=S[1],i[_+2]=S[2]):An("ColorSpace set to invalid value.");for(let F=0;F<3;F++)i[_+F]=i[_+F]<0?0:i[_+F],i[_+F]=i[_+F]>1?1:i[_+F]}}},t.getUint8Table=(a,n,r,i=!1)=>{if(t.getMTime()<=e.buildTime&&e.tableSize===r&&e.tableWithAlpha!==i)return e.table;if(e.nodes.length===0)return An("Attempting to lookup a value with no points in the function"),e.table;const o=i?4:3;(e.tableSize!==r||e.tableWithAlpha!==i)&&(e.table=new Uint8Array(r*o),e.tableSize=r,e.tableWithAlpha=i);const s=[];t.getTable(a,n,r,s);for(let u=0;u{t.removeAllPoints();const n=a.getNumberOfComponents();for(let r=0;r{let o=0;t.removeAllPoints(),r>1&&(o=(n-a)/(r-1));for(let s=0;sa<0||a>=e.nodes.length?(An("Index out of range!"),-1):(n[0]=e.nodes[a].x,n[1]=e.nodes[a].r,n[2]=e.nodes[a].g,n[3]=e.nodes[a].b,n[4]=e.nodes[a].midpoint,n[5]=e.nodes[a].sharpness,1),t.setNodeValue=(a,n)=>{if(a<0||a>=e.nodes.length)return An("Index out of range!"),-1;const r=e.nodes[a].x;return e.nodes[a].x=n[0],e.nodes[a].r=n[1],e.nodes[a].g=n[2],e.nodes[a].b=n[3],e.nodes[a].midpoint=n[4],e.nodes[a].sharpness=n[5],r!==n[0]?t.sortAndUpdateRange():t.modified(),1},t.getNumberOfAvailableColors=()=>{var n;if(e.indexedLookup&&t.getSize())return t.getSize();if(e.tableSize)return e.tableSize;const a=((n=e.nodes)==null?void 0:n.length)??0;return Math.max(4094,a)},t.getIndexedColor=(a,n)=>{const r=t.getSize();if(r>0&&a>=0){const o=[];t.getNodeValue(a%r,o);for(let s=0;s<3;++s)n[s]=o[s+1];n[3]=1;return}const i=t.getNanColorByReference();n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=1},t.fillFromDataPointer=(a,n)=>{if(!(a<=0||!n)){t.removeAllPoints();for(let r=0;r{const r=[a,n],i=[a,n],o=t.getRange(),s=t.logScaleEnabled();if(o[1]===r[1]&&o[0]===r[0])return;if(r[1]===r[0]){An("attempt to set zero width color range");return}s&&(r[0]<=0?console.warn("attempt to set log scale color range with non-positive minimum"):(i[0]=Math.log10(r[0]),i[1]=Math.log10(r[1])));const u=(i[1]-i[0])/(o[1]-o[0]),c=i[0]-o[0]*u;for(let p=0;p{const n=t.getRange(),r=[];n[0]a[1]?(t.getColor(a[1],r),t.addRGBPoint(a[1],r[0],r[1],r[2])):(t.getColor(n[1],r),t.addRGBPoint(a[1],r[0],r[1],r[2])),t.sortAndUpdateRange();for(let i=0;i=a[0]&&e.nodes[i].x<=a[1]?e.nodes.splice(i,1):++i;return 1},t.estimateMinNumberOfSamples=(a,n)=>{const r=t.findMinimumXDistance();return Math.ceil((n-a)/r)},t.findMinimumXDistance=()=>{if(e.nodes.length<2)return-1;let a=Number.MAX_VALUE;for(let n=0;n{if(t.getSize()===0){Aw("Transfer Function Has No Points!");return}e.indexedLookup?t.mapDataIndexed(a,n,r,i):t.mapData(a,n,r,i)},t.mapData=(a,n,r,i)=>{if(t.getSize()===0){Vw("Transfer Function Has No Points!");return}const o=Math.floor(t.getAlpha()*255+.5),s=a.getNumberOfTuples(),u=a.getNumberOfComponents(),c=n.getData(),p=a.getData(),l=[];if(r===Xo.RGBA)for(let f=0;f{const n=JSON.stringify(e.colorSpace);a.ColorSpace&&(e.colorSpace=$t[a.ColorSpace.toUpperCase()],e.colorSpace===void 0&&(An(`ColorSpace ${a.ColorSpace} not supported, using RGB instead`),e.colorSpace=$t.RGB));let r=n!==JSON.stringify(e.colorSpace);const i=r||JSON.stringify(e.nanColor);if(a.NanColor)for(e.nanColor=[].concat(a.NanColor);e.nanColor.length<4;)e.nanColor.push(1);r=r||i!==JSON.stringify(e.nanColor);const o=r||JSON.stringify(e.nodes);if(a.RGBPoints){const c=a.RGBPoints.length;e.nodes=[];const p=.5,l=0;for(let f=0;f[0,1]},actor:{type:Object},mapper:{type:Object},property:{type:Object}};let zw=class{constructor(e,a,n,r){this.refs={presetName:a,colorRange:n},this.view=r,this.actor=hn.newInstance(),this.lookupTable=Oc.newInstance(),this.mapper=e({lookupTable:this.lookupTable,useLookupTableScalarRange:!0}),this.actor.setMapper(this.mapper),this.property=this.actor.getProperty()}updateColorMapPreset(){const e=Ec.getPresetByName(this.refs.presetName.value);this.lookupTable.applyColorMap(e),this.updateColorDataRange()}updateColorDataRange(){this.lookupTable.setMappingRange(...this.refs.colorRange.value),this.lookupTable.updateRange(),this.dataChanged()}dataChanged(){this.view&&se.nextTick(this.view.render)}};function Hh(t,e){const a=se.inject("view"),{colorMapPreset:n,colorDataRange:r}=se.toRefs(t),i=new zw(e,n,r,a),o=se.ref(i.mapper);se.provide("representation",i),se.provide("downstream",o),se.onMounted(()=>{["actor","mapper","property"].forEach(s=>{i[s].set(t[s])}),i.actor.set({representationId:t.id},!0),i.updateColorMapPreset(),a.renderer.addActor(i.actor)}),se.onBeforeUnmount(()=>{var s;(s=a==null?void 0:a.renderer)==null||s.removeActor(i.actor),i.actor.delete(),i.actor=null,i.mapper.delete(),i.mapper=null,i.lookupTable.delete(),i.lookupTable=null}),["actor","mapper","property"].forEach(s=>{se.watch(()=>t[s],u=>{i[s].set(u)&&i.dataChanged()})}),["colorMapPreset","colorDataRange"].forEach(s=>{se.watch(()=>t[s],()=>i[`update${Wr(s)}`]())}),se.watch(()=>t.id,s=>i.actor.set({representationId:s},!0))}const Ww={props:$h,setup(t){Hh(t,dn.newInstance)},template:'
'};var jw={DIRECTION:0,ROTATION:1,MATRIX:2},$w={SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2},Kh={OrientationModes:jw,ScaleModes:$w},{OrientationModes:Jn,ScaleModes:Vn}=Kh,{vtkErrorMacro:Hw}=A;function Kw(t,e){e.classHierarchy.push("vtkGlyph3DMapper"),t.getOrientationModeAsString=()=>A.enumToString(Jn,e.orientationMode),t.setOrientationModeToDirection=()=>t.setOrientationMode(Jn.DIRECTION),t.setOrientationModeToRotation=()=>t.setOrientationMode(Jn.ROTATION),t.setOrientationModeToMatrix=()=>t.setOrientationMode(Jn.MATRIX),t.getOrientationArrayData=()=>{const a=t.getInputData(0);return!a||!a.getPointData()?null:e.orientationArray?a.getPointData().getArray(e.orientationArray):a.getPointData().getVectors()},t.getScaleModeAsString=()=>A.enumToString(Vn,e.scaleMode),t.setScaleModeToScaleByMagnitude=()=>t.setScaleMode(Vn.SCALE_BY_MAGNITUDE),t.setScaleModeToScaleByComponents=()=>t.setScaleMode(Vn.SCALE_BY_COMPONENTS),t.setScaleModeToScaleByConstant=()=>t.setScaleMode(Vn.SCALE_BY_CONSTANT),t.getScaleArrayData=()=>{const a=t.getInputData(0);return!a||!a.getPointData()?null:e.scaleArray?a.getPointData().getArray(e.scaleArray):a.getPointData().getScalars()},t.computeBounds=()=>t.buildArrays(),t.buildArrays=()=>{const a=t.getInputData(0),n=t.getInputData(1);if(!a||!n){de.reset(e.bounds);return}if(e.buildTime.getMTime(){const a=t.getInputData(1),n=t.getInputData().getPoints().getNumberOfValues()/3;return{points:n*a.getPoints().getNumberOfValues()/3,verts:n*(a.getVerts().getNumberOfValues()-a.getVerts().getNumberOfCells()),lines:n*(a.getLines().getNumberOfValues()-2*a.getLines().getNumberOfCells()),triangles:n*(a.getPolys().getNumberOfValues()-3*a.getLines().getNumberOfCells())}},t.setSourceConnection=a=>t.setInputConnection(a,1)}var Xw={orient:!0,orientationMode:Jn.DIRECTION,orientationArray:null,scaling:!0,scaleFactor:1,scaleMode:Vn.SCALE_BY_MAGNITUDE,scaleArray:null,matrixArray:null,normalArray:null,colorArray:null};function Xh(t,e,a={}){Object.assign(e,Xw,a),dn.extend(t,e,a),A.algo(t,e,2,0),e.buildTime={},A.obj(e.buildTime,{mtime:0}),A.setGet(t,e,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),A.get(t,e,["colorArray","matrixArray","normalArray","buildTime"]),Kw(t,e)}var qw=A.newInstance(Xh,"vtkGlyph3DMapper"),qh={newInstance:qw,extend:Xh,...Kh};const Yw={props:$h,setup(t){Hh(t,qh.newInstance)},template:'
'},Jw=[Array,Float32Array,Float64Array,Object],qo=[Array,Uint8Array,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Object],Yh={props:{port:{type:Number,default:0},points:{type:Jw},verts:{type:qo},lines:{type:qo},polys:{type:qo},strips:{type:qo},connectivity:{type:String,default:"manual"}},setup(t){const e=se.computed(()=>t.points&&t.points.length>196608?Uint32Array:Uint16Array),a=se.inject("downstream"),n=se.inject("representation"),r=Je.newInstance(),i=En(()=>{if(t.connectivity!=="manual"){const f=t.points.length/3;switch(t.connectivity){case"points":{const h=new Uint32Array(f+1);h[0]=f;for(let v=0;vo(f,"getPoints",Float64Array,3)),se.watch(u,f=>o(f,"getVerts",e.value)),se.watch(c,f=>o(f,"getLines",e.value)),se.watch(p,f=>o(f,"getPolys",e.value)),se.watch(l,f=>o(f,"getStrips",e.value)),se.watch(a,()=>{a.value&&a.value.setInputData(r,t.port)}),se.onMounted(()=>{o(t.points,"getPoints",Float64Array,3),o(t.verts,"getVerts",e.value),o(t.lines,"getLines",e.value),o(t.polys,"getPolys",e.value),o(t.strips,"getStrips",e.value),a.value&&a.value.setInputData(r,t.port)}),se.onBeforeUnmount(()=>{r.delete()}),se.provide("dataset",r)},template:'
'},Jh={setup(){const t=se.inject("dataset");se.provide("fields",t==null?void 0:t.getPointData())},template:'
'},Zw={props:{port:{type:Number,default:0},state:{type:Object}},components:{VtkPolydata:Yh,VtkCellData:Bh,VtkPointData:Jh,VtkDataArray:Gh},template:` - `},Hw={props:{port:{type:Number,default:0},vtkClass:{type:String,default:""},url:{type:String},parseAsText:{type:String},parseAsArrayBuffer:{type:String},renderOnUpdate:{type:Boolean,default:!1},resetCameraOnUpdate:{type:Boolean,default:!1}},setup(t){const e=se.ref(null),a=se.inject("downstream"),n=se.inject("representation"),r=se.inject("view");function i(){e.value&&(n&&n.dataChanged(),t.resetCameraOnUpdate&&r.resetCamera(),t.renderOnUpdate&&r.render())}const{vtkClass:o,url:s,parseAsText:c,parseAsArrayBuffer:l}=se.toRefs(t);se.watch(o,p=>{let u=e.value;e.value=wt({vtkClass:p}),a.setInputConnection(e.value.getOutputPort(),t.port),u&&u.delete()}),se.watch(s,async p=>{await e.value.setUrl(p),i()}),se.watch(c,p=>{e.value.parseAsText(p),i()}),se.watch(l,p=>{e.value.parseAsArrayBuffer(Rr.toArrayBuffer(p)),i()}),se.onMounted(async()=>{let p=!1;e.value=wt({vtkClass:t.vtkClass}),a.value.setInputConnection(e.value.getOutputPort(),t.port),t.url&&(await e.value.setUrl(t.url),p=!0),t.parseAsText&&(e.value.parseAsText(t.parseAsText),p=!0),t.parseAsArrayBuffer&&(e.value.parseAsArrayBuffer(Rr.toArrayBuffer(t.parseAsArrayBuffer)),p=!0),p&&i()}),se.onBeforeUnmount(()=>{e.value&&(e.value.delete(),e.value=null)})}},{vtkErrorMacro:Kw}=V;function Xw(t,e){e.classHierarchy.push("vtkCanvasView");function a(){e._renderable&&(e.canvas.setAttribute("width",e.size[0]),e.canvas.setAttribute("height",e.size[1])),e.viewStream&&e.viewStream.setSize(e.size[0],e.size[1]),e.canvas.style.display=e.useOffScreen?"none":"block",e.el&&(e.el.style.cursor=e.cursorVisibility?e.cursor:"none")}t.onModified(a),t.setContainer=n=>{e.el&&e.el!==n&&(e.canvas.parentNode!==e.el&&Kw("Error: canvas parent node does not match container"),e.el.removeChild(e.canvas),e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)),e.el!==n&&(e.el=n,e.el&&e.el.appendChild(e.canvas),e.useBackgroundImage&&e.el.appendChild(e.bgImage),t.modified())},t.setBackgroundImage=n=>{e.bgImage.src=n.src},t.setUseBackgroundImage=n=>{e.useBackgroundImage=n,e.useBackgroundImage&&e.el&&!e.el.contains(e.bgImage)?e.el.appendChild(e.bgImage):!e.useBackgroundImage&&e.el&&e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)},t.setViewStream=n=>e.viewStream===n?!1:(e.subscription&&(e.subscription.unsubscribe(),e.subscription=null),e.viewStream=n,e.viewStream&&(t.setUseBackgroundImage(!0),e.subscription=e.viewStream.onImageReady(r=>t.setBackgroundImage(r.image)),e.viewStream.setSize(e.size[0],e.size[1]),e.viewStream.invalidateCache(),e.viewStream.render(),t.modified()),!0),t.delete=V.chain(t.setViewStream,t.delete),e._renderable=t,e._renderers=[t],t.traverseAllPasses=()=>{},t.isInViewport=()=>!0,t.getInteractive=()=>!0}const qw={canvas:null,size:[300,300],cursorVisibility:!0,cursor:"pointer",useOffScreen:!1,useBackgroundImage:!1};function U1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,qw,a),e.canvas||(e.canvas=document.createElement("canvas"),e.canvas.style.width="100%"),e.bgImage=new Image,e.bgImage.style.position="absolute",e.bgImage.style.left="0",e.bgImage.style.top="0",e.bgImage.style.width="100%",e.bgImage.style.height="100%",e.bgImage.style.zIndex="-1",V.obj(t,e,a),V.get(t,e,["useBackgroundImage","_renderable"]),V.setGet(t,e,["canvas","cursor","useOffScreen","interactor"]),V.setGetArray(t,e,["size"],2),V.getArray(t,e,["_renderers"]),V.moveToProtected(t,e,["renderable","renderers"]),Xw(t,e)}var Yw={newInstance:V.newInstance(U1,"vtkCanvasView"),extend:U1};function Jw(t){return{subscribeToImageStream:e=>t.subscribe("viewport.image.push.subscription",e),unsubscribeToImageStream:e=>t.unsubscribe(e),registerView:e=>t.call("viewport.image.push.observer.add",[e]),unregisterView:e=>t.call("viewport.image.push.observer.remove",[e]),enableView:(e,a)=>t.call("viewport.image.push.enabled",[e,a]),render:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{size:[400,400],view:-1};return t.call("viewport.image.push",[e])},resetCamera:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;return t.call("viewport.camera.reset",[e])},invalidateCache:e=>t.call("viewport.image.push.invalidate.cache",[e]),setQuality:function(e,a){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return t.call("viewport.image.push.quality",[e,a,n])},setSize:function(e){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:400,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:400;return t.call("viewport.image.push.original.size",[e,a,n])},setServerAnimationFPS:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:30;return t.call("viewport.image.animation.fps.max",[e])},getServerAnimationFPS:()=>t.call("viewport.image.animation.fps.get",[]),startAnimation:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;return t.call("viewport.image.animation.start",[e])},stopAnimation:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;return t.call("viewport.image.animation.stop",[e])},updateCamera:function(e,a,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return t.call("viewport.camera.update",[e??-1,a,n,r,i])},updateCameraParameters:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return t.call("viewport.camera.update.params",[e,a,n])}}}function Zw(t,e){e.classHierarchy.push("vtkViewStream"),e.imageDecodingPool=[new Image,new Image],e.eventPool=[],e.nextPoolImageIndex=0,e.urlToRevoke=[],e.activeURL=null,e.fps=[],e.lastTime=Date.now(),e.lastImageEvent=null;function a(i){if(e.deleted)return;const o=Number(this.dataset.id);t.invokeImageReady(e.eventPool[o])}function n(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;for(;e.imageDecodingPool.length{const i=e.camera.getReferenceByName("focalPoint"),o=e.camera.getReferenceByName("viewUp"),s=e.camera.getReferenceByName("position"),c=e.camera.getParallelProjection(),l=e.camera.getViewAngle(),p=e.camera.getParallelScale();let u=null;return e.useCameraParameters?u=e.protocol.updateCameraParameters(e.viewId,{focalPoint:i,viewUp:o,position:s,parallelProjection:c,viewAngle:l,parallelScale:p},!1):u=e.protocol.updateCamera(e.viewId,i,o,s,!1),e.isAnimating&&setTimeout(t.pushCamera,1e3/e.cameraUpdateRate),u},t.invalidateCache=()=>e.protocol.invalidateCache(e.viewId),t.render=()=>e.protocol.render({view:e.viewId,size:e.size}),t.resetCamera=()=>e.protocol.resetCamera(e.viewId),t.startAnimation=()=>e.protocol.startAnimation(e.viewId),t.stopAnimation=()=>e.protocol.stopAnimation(e.viewId),t.setSize=(i,o)=>{let s=!1;return(e.size[0]!==i||e.size[1]!==o)&&(e.size=[i,o],s=!0),s&&(t.modified(),e.protocol)?e.protocol.setSize(e.viewId,i,o):Promise.resolve(!1)},t.startInteraction=()=>{const i=[e.protocol.setQuality(e.viewId,e.interactiveQuality,e.interactiveRatio)];return e.camera&&(i.push(t.startAnimation()),e.isAnimating=!0,i.push(t.pushCamera())),Promise.all(i)},t.endInteraction=()=>{const i=[];return i.push(e.protocol.setQuality(e.viewId,e.stillQuality,e.stillRatio)),e.camera?(i.push(t.stopAnimation()),e.isAnimating=!1,i.push(t.pushCamera())):i.push(t.render()),Promise.all(i)},t.setViewId=i=>e.viewId===i||!e.protocol?!1:(e.viewId&&e.protocol.unregisterView(e.viewId),e.viewId=i,e.viewId&&e.protocol.registerView(e.viewId).then(o=>{let{viewId:s}=o;e.viewId=s}),!0),t.processMessage=i=>{if(i.id!=e.viewId)return;const o=new Blob([i.image],{type:e.mimeType});if(e.activeURL)for(e.urlToRevoke.push(e.activeURL),e.activeURL=null;e.urlToRevoke.length>60;){const l=e.urlToRevoke.shift();window.URL.revokeObjectURL(l)}e.activeURL=URL.createObjectURL(o);const s=Date.now(),c=Math.floor(1e4/(s-e.lastTime))/10;for(e.fps.push(c),e.lastTime=s,e.lastImageEvent={url:e.activeURL,fps:c,metadata:{size:i.size,id:i.id,memory:i.memsize,workTime:i.workTime}},e.decodeImage?r(e.lastImageEvent):t.invokeImageReady(e.lastImageEvent);e.fps.length>e.fpsWindowSize;)e.fps.shift()},t.delete=V.chain(()=>{for(e.unregisterViewStream(t),t.setViewId(null);e.urlToRevoke.length;)window.URL.revokeObjectURL(e.urlToRevoke.pop())},t.delete),n()}const Qw={cameraUpdateRate:30,decodeImage:!0,fpsWindowSize:250,interactiveQuality:80,interactiveRatio:1,isAnimating:!1,mimeType:"image/jpeg",size:[-1,-1],stillQuality:100,stillRatio:1,useCameraParameters:!1,viewId:null};function G1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Qw,a),V.obj(t,e),V.event(t,e,"ImageReady"),V.get(t,e,["viewId","size","fps","lastImageEvent"]),V.setGet(t,e,["camera","cameraUpdateRate","decodeImage","fpsWindowSize","interactiveQuality","interactiveRatio","stillQuality","stillRatio","useCameraParameters"]),Zw(t,e),Object.assign(t,e.sharedAPI)}var e_={newInstance:V.newInstance(G1,"vtkViewStream"),extend:G1};function t_(t,e){e.classHierarchy.push("vtkImageStream");function a(n){const r=n[0];if(!(!r||!r.image))for(let i=0;i0&&arguments[0]!==void 0?arguments[0]:30,r=!1;return e.serverAnimationFPS!==n&&(e.serverAnimationFPS=n,r=!0),e.protocol?(r&&t.modified(),e.protocol.setServerAnimationFPS(n)):Promise.resolve(!0)},t.connect=function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jw;e.connected||!n||!r||(e.protocol=r(n),e.protocol.subscribeToImageStream(a).promise.then(i=>{e.renderTopicSubscription=i,e.connected=!0}).catch(i=>{e.connected=!1,console.error(i)}))},t.disconnect=()=>{e.protocol&&e.connected&&e.renderTopicSubscription&&(e.protocol.unsubscribeToImageStream(e.renderTopicSubscription),e.renderTopicSubscription=null),e.connected=!1},t.registerViewStream=n=>{e.viewStreams.push(n)},t.unregisterViewStream=n=>{e.viewStreams=e.viewStreams.filter(r=>r!==n)},t.createViewStream=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"-1",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[400,400];const{setServerAnimationFPS:i,getServerAnimationFPS:o,unregisterViewStream:s}=t,c=e_.newInstance({protocol:e.protocol,unregisterViewStream:s,sharedAPI:{setServerAnimationFPS:i,getServerAnimationFPS:o}});return c.setViewId(n),c.setSize(r[0],r[1]),t.registerViewStream(c),c},t.delete=V.chain(()=>{for(;e.viewStreams.length;)e.viewStreams.pop().delete();t.disconnect()},t.delete)}const n_={viewStreams:[],serverAnimationFPS:-1};function I1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,n_,a),V.obj(t,e),V.get(t,e,["serverAnimationFPS","protocol"]),t_(t,e)}var r_={newInstance:V.newInstance(I1,"vtkImageStream"),extend:I1};const jo={Unknown:0,LeftController:1,RightController:2},Wo={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7},a_={Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4},Fr={LeftButton:1,MiddleButton:2,RightButton:3};var P1={Device:jo,Input:Wo,Axis:a_,MouseButton:Fr};const{Device:$o,Input:kr}=P1,{vtkWarningMacro:Ho,vtkErrorMacro:Ko,normalizeWheel:i_,vtkOnceErrorMacro:o_}=V,fa={ctrlKey:!1,altKey:!1,shiftKey:!1},xc={"xr-standard":[kr.Trigger,kr.Grip,kr.TrackPad,kr.Thumbstick,kr.A,kr.B]},Cc=["StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"];function ii(t){t.cancelable&&t.preventDefault()}function Xo(t){const e=Object.create(null);return t.forEach(a=>{let{pointerId:n,position:r}=a;e[n]=r}),e}function s_(t,e){e.classHierarchy.push("vtkRenderWindowInteractor");const a={...t},n=new Set,r=new Map;let i=1;t.start=()=>{!e.initialized&&(t.initialize(),!e.initialized)||t.startEventLoop()},t.setRenderWindow=v=>{Ko("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},t.setInteractorStyle=v=>{e.interactorStyle!==v&&(e.interactorStyle!=null&&e.interactorStyle.setInteractor(null),e.interactorStyle=v,e.interactorStyle!=null&&e.interactorStyle.getInteractor()!==t&&e.interactorStyle.setInteractor(t))},t.initialize=()=>{e.initialized=!0,t.enable(),t.render()},t.enable=()=>t.setEnabled(!0),t.disable=()=>t.setEnabled(!1),t.startEventLoop=()=>Ho("empty event loop");function o(v,m){e._forcedRenderer||(e.currentRenderer=t.findPokedRenderer(v,m))}t.getCurrentRenderer=()=>(e.currentRenderer||o(0,0),e.currentRenderer);function s(v){const m=e._view.getCanvas(),x=m.getBoundingClientRect(),y=m.width/x.width,g=m.height/x.height,C={x:y*(v.clientX-x.left),y:g*(x.height-v.clientY+x.top),z:0,movementX:y*v.movementX,movementY:g*v.movementY};return(r.size<=1||!e.currentRenderer)&&o(C.x,C.y),C}const c=e._getScreenEventPositionFor||s;function l(v){return{controlKey:v.ctrlKey,altKey:v.altKey,shiftKey:v.shiftKey}}function p(v){const m=l(v);return{key:v.key,keyCode:v.charCode,...m}}function u(v){return v.pointerType||""}const f=()=>{if(e.container===null)return;const{container:v}=e;v.addEventListener("contextmenu",ii),v.addEventListener("wheel",t.handleWheel),v.addEventListener("DOMMouseScroll",t.handleWheel),v.addEventListener("pointerenter",t.handlePointerEnter),v.addEventListener("pointerleave",t.handlePointerLeave),v.addEventListener("pointermove",t.handlePointerMove,{passive:!1}),v.addEventListener("pointerdown",t.handlePointerDown,{passive:!1}),v.addEventListener("pointerup",t.handlePointerUp),v.addEventListener("pointercancel",t.handlePointerCancel),v.addEventListener("keypress",t.handleKeyPress),v.addEventListener("keydown",t.handleKeyDown),document.addEventListener("keyup",t.handleKeyUp),document.addEventListener("pointerlockchange",t.handlePointerLockChange),v.tabIndex=0,v.style.touchAction="none",v.style.userSelect="none",v.style.webkitTapHighlightColor="rgba(0,0,0,0)"};t.bindEvents=v=>{if(v===null)return;a.setContainer(v)&&f()};const h=()=>{clearTimeout(e.moveTimeoutID),clearTimeout(e.wheelTimeoutID),e.moveTimeoutID=0,e.wheelTimeoutID=0,i=1;const{container:v}=e;v&&(v.removeEventListener("contextmenu",ii),v.removeEventListener("wheel",t.handleWheel),v.removeEventListener("DOMMouseScroll",t.handleWheel),v.removeEventListener("pointerenter",t.handlePointerEnter),v.removeEventListener("pointerleave",t.handlePointerLeave),v.removeEventListener("pointermove",t.handlePointerMove,{passive:!1}),v.removeEventListener("pointerdown",t.handlePointerDown,{passive:!1}),v.removeEventListener("pointerup",t.handlePointerUp),v.removeEventListener("pointercancel",t.handlePointerCancel),v.removeEventListener("keypress",t.handleKeyPress),v.removeEventListener("keydown",t.handleKeyDown)),document.removeEventListener("keyup",t.handleKeyUp),document.removeEventListener("pointerlockchange",t.handlePointerLockChange),r.clear()};t.unbindEvents=()=>{h(),a.setContainer(null)},t.handleKeyPress=v=>{const m=p(v);t.keyPressEvent(m)},t.handleKeyDown=v=>{const m=p(v);t.keyDownEvent(m)},t.handleKeyUp=v=>{const m=p(v);t.keyUpEvent(m)},t.handlePointerEnter=v=>{const m={...l(v),position:c(v),deviceType:u(v)};t.pointerEnterEvent(m),m.deviceType==="mouse"&&t.mouseEnterEvent(m)},t.handlePointerLeave=v=>{const m={...l(v),position:c(v),deviceType:u(v)};t.pointerLeaveEvent(m),m.deviceType==="mouse"&&t.mouseLeaveEvent(m)},t.handlePointerDown=v=>{if(!(v.button>2||t.isPointerLocked()))switch(e.preventDefaultOnPointerDown&&ii(v),v.target.hasPointerCapture(v.pointerId)&&v.target.releasePointerCapture(v.pointerId),e.container.setPointerCapture(v.pointerId),r.has(v.pointerId)&&Ho("[RenderWindowInteractor] duplicate pointerId detected"),r.set(v.pointerId,{pointerId:v.pointerId,position:c(v)}),v.pointerType){case"pen":case"touch":t.handleTouchStart(v);break;case"mouse":default:t.handleMouseDown(v);break}},t.handlePointerUp=v=>{if(r.has(v.pointerId))switch(e.preventDefaultOnPointerUp&&ii(v),r.delete(v.pointerId),e.container.releasePointerCapture(v.pointerId),v.pointerType){case"pen":case"touch":t.handleTouchEnd(v);break;case"mouse":default:t.handleMouseUp(v);break}},t.handlePointerCancel=v=>{if(r.has(v.pointerId))switch(r.delete(v.pointerId),v.pointerType){case"pen":case"touch":t.handleTouchEnd(v);break;case"mouse":default:t.handleMouseUp(v);break}},t.handlePointerMove=v=>{if(r.has(v.pointerId)){const m=r.get(v.pointerId);m.position=c(v)}switch(v.pointerType){case"pen":case"touch":t.handleTouchMove(v);break;case"mouse":default:t.handleMouseMove(v);break}},t.handleMouseDown=v=>{const m={...l(v),position:c(v),deviceType:u(v)};switch(v.button){case 0:t.leftButtonPressEvent(m);break;case 1:t.middleButtonPressEvent(m);break;case 2:t.rightButtonPressEvent(m);break;default:Ko(`Unknown mouse button pressed: ${v.button}`);break}},t.requestPointerLock=()=>{e.container&&e.container.requestPointerLock()},t.exitPointerLock=()=>{var v;return(v=document.exitPointerLock)==null?void 0:v.call(document)},t.isPointerLocked=()=>!!e.container&&document.pointerLockElement===e.container,t.handlePointerLockChange=()=>{t.isPointerLocked()?t.startPointerLockEvent():t.endPointerLockEvent()};function d(){e._view&&e.enabled&&e.enableRender&&(e.inRender=!0,e._view.traverseAllPasses(),e.inRender=!1),t.invokeRenderEvent()}t.requestAnimation=v=>{if(v===void 0){Ko("undefined requester, can not start animating");return}if(n.has(v)){Ho("requester is already registered for animating");return}n.add(v),!e.animationRequest&&n.size===1&&!e.xrAnimation&&(e._animationStartTime=Date.now(),e._animationFrameCount=0,e.animationRequest=requestAnimationFrame(t.handleAnimation),t.startAnimationEvent())},t.extendAnimation=v=>{const m=Date.now()+v;e._animationExtendedEnd=Math.max(e._animationExtendedEnd,m),!e.animationRequest&&n.size===0&&!e.xrAnimation&&(e._animationStartTime=Date.now(),e._animationFrameCount=0,e.animationRequest=requestAnimationFrame(t.handleAnimation),t.startAnimationEvent())},t.isAnimating=()=>e.xrAnimation||e.animationRequest!==null,t.cancelAnimation=function(v){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!n.has(v)){if(!m){const x=v&&v.getClassName?v.getClassName():v;Ho(`${x} did not request an animation`)}return}n.delete(v),e.animationRequest&&n.size===0&&Date.now()>e._animationExtendedEnd&&(cancelAnimationFrame(e.animationRequest),e.animationRequest=null,t.endAnimationEvent(),t.render())},t.switchToXRAnimation=()=>{e.animationRequest&&(cancelAnimationFrame(e.animationRequest),e.animationRequest=null),e.xrAnimation=!0},t.returnFromXRAnimation=()=>{e.xrAnimation=!1,n.size!==0&&(e.recentAnimationFrameRate=10,e.animationRequest=requestAnimationFrame(t.handleAnimation))},t.updateXRGamepads=(v,m,x)=>{v.inputSources.forEach(y=>{const g=y.gripSpace==null?null:m.getPose(y.gripSpace,x),C=y.gripSpace==null?null:m.getPose(y.targetRaySpace,x),S=y.gamepad,T=y.handedness;if(S){S.index in e.lastGamepadValues||(e.lastGamepadValues[S.index]={left:{buttons:{}},right:{buttons:{}},none:{buttons:{}}});for(let w=0;w{const m={...l(v),position:c(v),deviceType:u(v)};e.moveTimeoutID===0?t.startMouseMoveEvent(m):(t.mouseMoveEvent(m),clearTimeout(e.moveTimeoutID)),e.moveTimeoutID=setTimeout(()=>{t.endMouseMoveEvent(),e.moveTimeoutID=0},200)},t.handleAnimation=()=>{const v=Date.now();e._animationFrameCount++,v-e._animationStartTime>1e3&&e._animationFrameCount>1&&(e.recentAnimationFrameRate=1e3*(e._animationFrameCount-1)/(v-e._animationStartTime),e.lastFrameTime=1/e.recentAnimationFrameRate,t.animationFrameRateUpdateEvent(),e._animationStartTime=v,e._animationFrameCount=1),t.animationEvent(),d(),n.size>0||Date.now(){ii(v);const m={...i_(v),...l(v),position:c(v),deviceType:u(v)};e.wheelTimeoutID===0&&(Math.abs(m.spinY)>=.3?i=Math.abs(m.spinY):i=1),m.spinY/=i,e.wheelTimeoutID===0?(t.startMouseWheelEvent(m),t.mouseWheelEvent(m)):(t.mouseWheelEvent(m),clearTimeout(e.wheelTimeoutID)),e.mouseScrollDebounceByPass?(t.extendAnimation(600),t.endMouseWheelEvent(),e.wheelTimeoutID=0):e.wheelTimeoutID=setTimeout(()=>{t.extendAnimation(600),t.endMouseWheelEvent(),e.wheelTimeoutID=0},200)},t.handleMouseUp=v=>{const m={...l(v),position:c(v),deviceType:u(v)};switch(v.button){case 0:t.leftButtonReleaseEvent(m);break;case 1:t.middleButtonReleaseEvent(m);break;case 2:t.rightButtonReleaseEvent(m);break;default:Ko(`Unknown mouse button released: ${v.button}`);break}},t.handleTouchStart=v=>{const m=[...r.values()];if(e.recognizeGestures&&m.length>1){const x=Xo(r);if(m.length===2){const y={...l(fa),position:m[0].position,deviceType:u(v)};t.leftButtonReleaseEvent(y)}t.recognizeGesture("TouchStart",x)}else if(m.length===1){const x={...l(fa),position:c(v),deviceType:u(v)};t.leftButtonPressEvent(x)}},t.handleTouchMove=v=>{const m=[...r.values()];if(e.recognizeGestures&&m.length>1){const x=Xo(r);t.recognizeGesture("TouchMove",x)}else if(m.length===1){const x={...l(fa),position:m[0].position,deviceType:u(v)};t.mouseMoveEvent(x)}},t.handleTouchEnd=v=>{const m=[...r.values()];if(e.recognizeGestures)if(m.length===0){const x={...l(fa),position:c(v),deviceType:u(v)};t.leftButtonReleaseEvent(x)}else if(m.length===1){const x=Xo(r);t.recognizeGesture("TouchEnd",x);const y={...l(fa),position:m[0].position,deviceType:u(v)};t.leftButtonPressEvent(y)}else{const x=Xo(r);t.recognizeGesture("TouchMove",x)}else if(m.length===1){const x={...l(fa),position:m[0].position,deviceType:u(v)};t.leftButtonReleaseEvent(x)}},t.setView=v=>{e._view!==v&&(e._view=v,e._view.getRenderable().setInteractor(t),t.modified())},t.getFirstRenderer=()=>{var v,m,x;return(x=(m=(v=e._view)==null?void 0:v.getRenderable())==null?void 0:m.getRenderersByReference())==null?void 0:x[0]},t.findPokedRenderer=function(){var T,w;let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!e._view)return null;const x=(w=(T=e._view)==null?void 0:T.getRenderable())==null?void 0:w.getRenderers();if(!x||x.length===0)return null;x.sort((_,E)=>_.getLayer()-E.getLayer());let y=null,g=null,C=null,S=x.length;for(;S--;){const _=x[S];if(e._view.isInViewport(v,m,_)&&_.getInteractive()){C=_;break}y===null&&_.getInteractive()&&(y=_),g===null&&e._view.isInViewport(v,m,_)&&(g=_)}return C===null&&(C=y),C===null&&(C=g),C==null&&(C=x[0]),C},t.render=()=>{!t.isAnimating()&&!e.inRender&&d()},Cc.forEach(v=>{const m=v.charAt(0).toLowerCase()+v.slice(1);t[`${m}Event`]=x=>{if(!e.enabled)return;if(!t.getCurrentRenderer()){o_(` + `},Qw={props:{port:{type:Number,default:0},vtkClass:{type:String,default:""},url:{type:String},parseAsText:{type:String},parseAsArrayBuffer:{type:String},renderOnUpdate:{type:Boolean,default:!1},resetCameraOnUpdate:{type:Boolean,default:!1}},setup(t){const e=se.ref(null),a=se.inject("downstream"),n=se.inject("representation"),r=se.inject("view");function i(){e.value&&(n&&n.dataChanged(),t.resetCameraOnUpdate&&r.resetCamera(),t.renderOnUpdate&&r.render())}const{vtkClass:o,url:s,parseAsText:u,parseAsArrayBuffer:c}=se.toRefs(t);se.watch(o,p=>{let l=e.value;e.value=_t({vtkClass:p}),a.setInputConnection(e.value.getOutputPort(),t.port),l&&l.delete()}),se.watch(s,async p=>{await e.value.setUrl(p),i()}),se.watch(u,p=>{e.value.parseAsText(p),i()}),se.watch(c,p=>{e.value.parseAsArrayBuffer(Fr.toArrayBuffer(p)),i()}),se.onMounted(async()=>{let p=!1;e.value=_t({vtkClass:t.vtkClass}),a.value.setInputConnection(e.value.getOutputPort(),t.port),t.url&&(await e.value.setUrl(t.url),p=!0),t.parseAsText&&(e.value.parseAsText(t.parseAsText),p=!0),t.parseAsArrayBuffer&&(e.value.parseAsArrayBuffer(Fr.toArrayBuffer(t.parseAsArrayBuffer)),p=!0),p&&i()}),se.onBeforeUnmount(()=>{e.value&&(e.value.delete(),e.value=null)})}};var Yo={Unknown:0,LeftController:1,RightController:2},Jo={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7},e_={Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4},Ar={LeftButton:1,MiddleButton:2,RightButton:3},Zh={Device:Yo,Input:Jo,Axis:e_,MouseButton:Ar},{Device:Zo,Input:Vr}=Zh,{vtkWarningMacro:Qo,vtkErrorMacro:es,normalizeWheel:t_,vtkOnceErrorMacro:n_}=A,pa={ctrlKey:!1,altKey:!1,shiftKey:!1},bc={"xr-standard":[Vr.Trigger,Vr.Grip,Vr.TrackPad,Vr.Thumbstick,Vr.A,Vr.B]},Mc=["StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"];function ui(t){t.cancelable&&t.preventDefault()}function ts(t){const e=Object.create(null);return t.forEach(({pointerId:a,position:n})=>{e[a]=n}),e}function r_(t,e){e.classHierarchy.push("vtkRenderWindowInteractor");const a={...t},n=new Set,r=new Map;let i=1,o=0;t.start=()=>{!e.initialized&&(t.initialize(),!e.initialized)||t.startEventLoop()},t.setRenderWindow=y=>{es("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},t.setInteractorStyle=y=>{e.interactorStyle!==y&&(e.interactorStyle!=null&&e.interactorStyle.setInteractor(null),e.interactorStyle=y,e.interactorStyle!=null&&e.interactorStyle.getInteractor()!==t&&e.interactorStyle.setInteractor(t))},t.initialize=()=>{e.initialized=!0,t.enable(),t.render()},t.enable=()=>t.setEnabled(!0),t.disable=()=>t.setEnabled(!1),t.startEventLoop=()=>Qo("empty event loop");function s(y,d){e._forcedRenderer||(e.currentRenderer=t.findPokedRenderer(y,d))}t.getCurrentRenderer=()=>(e.currentRenderer||s(0,0),e.currentRenderer);function u(y){const d=e._view.getCanvas(),g=d.getBoundingClientRect(),C=d.width/g.width,S=d.height/g.height,T={x:C*(y.clientX-g.left),y:S*(g.height-y.clientY+g.top),z:0,movementX:C*y.movementX,movementY:S*y.movementY};return(r.size<=1||!e.currentRenderer)&&s(T.x,T.y),T}const c=e._getScreenEventPositionFor||u;function p(y){return{controlKey:y.ctrlKey,altKey:y.altKey,shiftKey:y.shiftKey}}function l(y){const d=p(y);return{key:y.key,keyCode:y.charCode,...d}}function f(y){return y.pointerType||""}const h=()=>{if(e.container===null)return;const{container:y}=e;y.addEventListener("contextmenu",ui),y.addEventListener("wheel",t.handleWheel),y.addEventListener("DOMMouseScroll",t.handleWheel),y.addEventListener("pointerenter",t.handlePointerEnter),y.addEventListener("pointerleave",t.handlePointerLeave),y.addEventListener("pointermove",t.handlePointerMove,{passive:!1}),y.addEventListener("pointerdown",t.handlePointerDown,{passive:!1}),y.addEventListener("pointerup",t.handlePointerUp),y.addEventListener("pointercancel",t.handlePointerCancel),y.addEventListener("keypress",t.handleKeyPress),y.addEventListener("keydown",t.handleKeyDown),document.addEventListener("keyup",t.handleKeyUp),document.addEventListener("pointerlockchange",t.handlePointerLockChange),y.tabIndex=0,y.style.touchAction="none",y.style.userSelect="none",y.style.webkitTapHighlightColor="rgba(0,0,0,0)"};t.bindEvents=y=>{y!==null&&a.setContainer(y)&&h()};const v=()=>{clearTimeout(e.moveTimeoutID),clearTimeout(e.wheelTimeoutID),e.moveTimeoutID=0,e.wheelTimeoutID=0,i=1;const{container:y}=e;y&&(y.removeEventListener("contextmenu",ui),y.removeEventListener("wheel",t.handleWheel),y.removeEventListener("DOMMouseScroll",t.handleWheel),y.removeEventListener("pointerenter",t.handlePointerEnter),y.removeEventListener("pointerleave",t.handlePointerLeave),y.removeEventListener("pointermove",t.handlePointerMove,{passive:!1}),y.removeEventListener("pointerdown",t.handlePointerDown,{passive:!1}),y.removeEventListener("pointerup",t.handlePointerUp),y.removeEventListener("pointercancel",t.handlePointerCancel),y.removeEventListener("keypress",t.handleKeyPress),y.removeEventListener("keydown",t.handleKeyDown)),document.removeEventListener("keyup",t.handleKeyUp),document.removeEventListener("pointerlockchange",t.handlePointerLockChange),r.clear(),o=0};t.unbindEvents=()=>{v(),a.setContainer(null)},t.handleKeyPress=y=>{const d=l(y);t.keyPressEvent(d)},t.handleKeyDown=y=>{const d=l(y);t.keyDownEvent(d)},t.handleKeyUp=y=>{const d=l(y);t.keyUpEvent(d)},t.handlePointerEnter=y=>{const d={...p(y),position:c(y),deviceType:f(y)};t.pointerEnterEvent(d),d.deviceType==="mouse"&&t.mouseEnterEvent(d)},t.handlePointerLeave=y=>{const d={...p(y),position:c(y),deviceType:f(y)};t.pointerLeaveEvent(d),d.deviceType==="mouse"&&t.mouseLeaveEvent(d)},t.handlePointerDown=y=>{if(!(y.button>2||t.isPointerLocked()))switch(e.preventDefaultOnPointerDown&&ui(y),y.target.hasPointerCapture(y.pointerId)&&y.target.releasePointerCapture(y.pointerId),e.container.setPointerCapture(y.pointerId),r.has(y.pointerId)&&Qo("[RenderWindowInteractor] duplicate pointerId detected"),r.set(y.pointerId,{pointerId:y.pointerId,position:c(y)}),y.pointerType){case"pen":case"touch":t.handleTouchStart(y);break;default:t.handleMouseDown(y),o=y.buttons;break}};function m(y,d,g){d&~g&1&&t.leftButtonReleaseEvent(y),d&~g&4&&t.middleButtonReleaseEvent(y),d&~g&2&&t.rightButtonReleaseEvent(y),~d&g&1&&t.leftButtonPressEvent(y),~d&g&4&&t.middleButtonPressEvent(y),~d&g&2&&t.rightButtonPressEvent(y)}t.handlePointerUp=y=>{if(r.has(y.pointerId))switch(e.preventDefaultOnPointerUp&&ui(y),r.delete(y.pointerId),e.container.releasePointerCapture(y.pointerId),y.pointerType){case"pen":case"touch":t.handleTouchEnd(y);break;default:{const d=[1,4,2][y.button]??0;m({...p(y),position:c(y),deviceType:f(y)},o&~d,y.buttons&~d),t.handleMouseUp(y),o=y.buttons;break}}},t.handlePointerCancel=y=>{if(r.has(y.pointerId))switch(r.delete(y.pointerId),y.pointerType){case"pen":case"touch":t.handleTouchEnd(y);break;default:m({...p(y),position:c(y),deviceType:f(y)},o,0),o=0;break}},t.handlePointerMove=y=>{if(r.has(y.pointerId)){const d=r.get(y.pointerId);d.position=c(y)}switch(y.pointerType){case"pen":case"touch":t.handleTouchMove(y);break;default:{const d=y.buttons;d!==o&&(m({...p(y),position:c(y),deviceType:f(y)},o,d),o=d),t.handleMouseMove(y);break}}},t.handleMouseDown=y=>{const d={...p(y),position:c(y),deviceType:f(y)};switch(y.button){case 0:t.leftButtonPressEvent(d);break;case 1:t.middleButtonPressEvent(d);break;case 2:t.rightButtonPressEvent(d);break;default:es(`Unknown mouse button pressed: ${y.button}`);break}},t.requestPointerLock=()=>{if(e.container)return e.container.requestPointerLock()},t.exitPointerLock=()=>{var y;return(y=document.exitPointerLock)==null?void 0:y.call(document)},t.isPointerLocked=()=>!!e.container&&document.pointerLockElement===e.container,t.handlePointerLockChange=()=>{t.isPointerLocked()?t.startPointerLockEvent():t.endPointerLockEvent()};function x(){e._view&&e.enabled&&e.enableRender&&(e.inRender=!0,e._view.traverseAllPasses(),e.inRender=!1),t.invokeRenderEvent()}t.requestAnimation=y=>{if(y===void 0){es("undefined requester, can not start animating");return}if(n.has(y)){Qo("requester is already registered for animating");return}n.add(y),!e.animationRequest&&n.size===1&&!e.xrAnimation&&(e._animationStartTime=Date.now(),e._animationFrameCount=0,e.animationRequest=requestAnimationFrame(t.handleAnimation),t.startAnimationEvent())},t.extendAnimation=y=>{const d=Date.now()+y;e._animationExtendedEnd=Math.max(e._animationExtendedEnd,d),!e.animationRequest&&n.size===0&&!e.xrAnimation&&(e._animationStartTime=Date.now(),e._animationFrameCount=0,e.animationRequest=requestAnimationFrame(t.handleAnimation),t.startAnimationEvent())},t.isAnimating=()=>e.xrAnimation||e.animationRequest!==null,t.cancelAnimation=(y,d=!1)=>{if(!n.has(y)){d||Qo(`${y&&y.getClassName?y.getClassName():y} did not request an animation`);return}n.delete(y),e.animationRequest&&n.size===0&&Date.now()>e._animationExtendedEnd&&(cancelAnimationFrame(e.animationRequest),e.animationRequest=null,t.endAnimationEvent(),t.render())},t.switchToXRAnimation=()=>{e.animationRequest&&(cancelAnimationFrame(e.animationRequest),e.animationRequest=null),e.xrAnimation=!0},t.returnFromXRAnimation=()=>{e.xrAnimation=!1,n.size!==0&&(e.recentAnimationFrameRate=10,e.animationRequest=requestAnimationFrame(t.handleAnimation))},t.updateXRGamepads=(y,d,g)=>{y.inputSources.forEach(C=>{const S=C.gripSpace==null?null:d.getPose(C.gripSpace,g),T=C.gripSpace==null?null:d.getPose(C.targetRaySpace,g),w=C.gamepad,_=C.handedness;if(w){w.index in e.lastGamepadValues||(e.lastGamepadValues[w.index]={left:{buttons:{}},right:{buttons:{}},none:{buttons:{}}});for(let E=0;E{const d={...p(y),position:c(y),deviceType:f(y)};e.moveTimeoutID===0?t.startMouseMoveEvent(d):(t.mouseMoveEvent(d),clearTimeout(e.moveTimeoutID)),e.moveTimeoutID=setTimeout(()=>{t.endMouseMoveEvent(),e.moveTimeoutID=0},200)},t.handleAnimation=()=>{const y=Date.now();e._animationFrameCount++,y-e._animationStartTime>1e3&&e._animationFrameCount>1&&(e.recentAnimationFrameRate=1e3*(e._animationFrameCount-1)/(y-e._animationStartTime),e.lastFrameTime=1/e.recentAnimationFrameRate,t.animationFrameRateUpdateEvent(),e._animationStartTime=y,e._animationFrameCount=1),t.animationEvent(),x(),n.size>0||Date.now(){ui(y);const d={...t_(y),...p(y),position:c(y),deviceType:f(y)};e.wheelTimeoutID===0&&(Math.abs(d.spinY)>=.3?i=Math.abs(d.spinY):i=1),d.spinY/=i,e.wheelTimeoutID===0?(t.startMouseWheelEvent(d),t.mouseWheelEvent(d)):(t.mouseWheelEvent(d),clearTimeout(e.wheelTimeoutID)),e.mouseScrollDebounceByPass?(t.extendAnimation(600),t.endMouseWheelEvent(),e.wheelTimeoutID=0):e.wheelTimeoutID=setTimeout(()=>{t.extendAnimation(600),t.endMouseWheelEvent(),e.wheelTimeoutID=0},200)},t.handleMouseUp=y=>{const d={...p(y),position:c(y),deviceType:f(y)};switch(y.button){case 0:t.leftButtonReleaseEvent(d);break;case 1:t.middleButtonReleaseEvent(d);break;case 2:t.rightButtonReleaseEvent(d);break;default:es(`Unknown mouse button released: ${y.button}`);break}},t.handleTouchStart=y=>{const d=[...r.values()];if(e.recognizeGestures&&d.length>1){const g=ts(r);if(d.length===2){const C={...p(pa),position:d[0].position,deviceType:f(y)};t.leftButtonReleaseEvent(C)}t.recognizeGesture("TouchStart",g)}else if(d.length===1){const g={...p(pa),position:c(y),deviceType:f(y)};t.leftButtonPressEvent(g)}},t.handleTouchMove=y=>{const d=[...r.values()];if(e.recognizeGestures&&d.length>1){const g=ts(r);t.recognizeGesture("TouchMove",g)}else if(d.length===1){const g={...p(pa),position:d[0].position,deviceType:f(y)};t.mouseMoveEvent(g)}},t.handleTouchEnd=y=>{const d=[...r.values()];if(e.recognizeGestures)if(d.length===0){const g={...p(pa),position:c(y),deviceType:f(y)};t.leftButtonReleaseEvent(g)}else if(d.length===1){const g=ts(r);t.recognizeGesture("TouchEnd",g);const C={...p(pa),position:d[0].position,deviceType:f(y)};t.leftButtonPressEvent(C)}else{const g=ts(r);t.recognizeGesture("TouchMove",g)}else if(d.length===1){const g={...p(pa),position:d[0].position,deviceType:f(y)};t.leftButtonReleaseEvent(g)}},t.setView=y=>{e._view!==y&&(e._view=y,e._view.getRenderable().setInteractor(t),t.modified())},t.getFirstRenderer=()=>{var y,d,g;return(g=(d=(y=e._view)==null?void 0:y.getRenderable())==null?void 0:d.getRenderersByReference())==null?void 0:g[0]},t.findPokedRenderer=(y=0,d=0)=>{var _,E;if(!e._view)return null;const g=(E=(_=e._view)==null?void 0:_.getRenderable())==null?void 0:E.getRenderers();if(!g||g.length===0)return null;g.sort((D,O)=>D.getLayer()-O.getLayer());let C=null,S=null,T=null,w=g.length;for(;w--;){const D=g[w];if(e._view.isInViewport(y,d,D)&&D.getInteractive()){T=D;break}C===null&&D.getInteractive()&&(C=D),S===null&&e._view.isInViewport(y,d,D)&&(S=D)}return T===null&&(T=C),T===null&&(T=S),T==null&&(T=g[0]),T},t.render=()=>{!t.isAnimating()&&!e.inRender&&x()},Mc.forEach(y=>{const d=y.charAt(0).toLowerCase()+y.slice(1);t[`${d}Event`]=g=>{if(!e.enabled)return;if(!t.getCurrentRenderer()){n_(` Can not forward events without a current renderer on the interactor. - `);return}const g={type:v,pokedRenderer:e.currentRenderer,firstRenderer:t.getFirstRenderer(),...x};t[`invoke${v}`](g)}}),t.recognizeGesture=(v,m)=>{if(Object.keys(m).length>2)return;if(e.startingEventPositions||(e.startingEventPositions={}),v==="TouchStart"){Object.keys(m).forEach(D=>{e.startingEventPositions[D]=m[D]}),e.currentGesture="Start";return}if(v==="TouchEnd"){e.currentGesture==="Pinch"&&(t.render(),t.endPinchEvent()),e.currentGesture==="Rotate"&&(t.render(),t.endRotateEvent()),e.currentGesture==="Pan"&&(t.render(),t.endPanEvent()),e.currentGesture="Start",e.startingEventPositions={};return}let x=0;const y=[],g=[];Object.keys(m).forEach(D=>{y[x]=m[D],g[x]=e.startingEventPositions[D],x++});const C=Math.sqrt((g[0].x-g[1].x)*(g[0].x-g[1].x)+(g[0].y-g[1].y)*(g[0].y-g[1].y)),S=Math.sqrt((y[0].x-y[1].x)*(y[0].x-y[1].x)+(y[0].y-y[1].y)*(y[0].y-y[1].y));let T=Ra(Math.atan2(g[1].y-g[0].y,g[1].x-g[0].x)),w=Ra(Math.atan2(y[1].y-y[0].y,y[1].x-y[0].x)),_=w-T;w=w+180>=360?w-180:w+180,T=T+180>=360?T-180:T+180,Math.abs(w-T)D&&O>M&&O>N){e.currentGesture="Pinch";const R={scale:1,touches:m};t.startPinchEvent(R)}else if(M>D&&M>N){e.currentGesture="Rotate";const R={rotation:0,touches:m};t.startRotateEvent(R)}else if(N>D){e.currentGesture="Pan";const R={translation:[0,0],touches:m};t.startPanEvent(R)}}else{if(e.currentGesture==="Rotate"){const D={rotation:_,touches:m};t.rotateEvent(D)}if(e.currentGesture==="Pinch"){const D={scale:S/C,touches:m};t.pinchEvent(D)}if(e.currentGesture==="Pan"){const D={translation:E,touches:m};t.panEvent(D)}}},t.handleVisibilityChange=()=>{e._animationStartTime=Date.now(),e._animationFrameCount=0},t.setCurrentRenderer=v=>{e._forcedRenderer=!!v,e.currentRenderer=v},t.setContainer=v=>{h();const m=a.setContainer(v??null);return m&&f(),m},t.delete=()=>{for(;n.size;)t.cancelAnimation(n.values().next().value);typeof document.hidden<"u"&&document.removeEventListener("visibilitychange",t.handleVisibilityChange),e.container&&t.setContainer(null),a.delete()},typeof document.hidden<"u"&&document.addEventListener("visibilitychange",t.handleVisibilityChange,!1)}const c_={renderWindow:null,interactorStyle:null,picker:null,pickingManager:null,initialized:!1,enabled:!1,enableRender:!0,currentRenderer:null,lightFollowCamera:!0,desiredUpdateRate:30,stillUpdateRate:2,container:null,recognizeGestures:!0,currentGesture:"Start",animationRequest:null,lastFrameTime:.1,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{},preventDefaultOnPointerDown:!1,preventDefaultOnPointerUp:!1,mouseScrollDebounceByPass:!1};function z1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,c_,a),V.obj(t,e),e._animationExtendedEnd=0,V.event(t,e,"RenderEvent"),Cc.forEach(n=>V.event(t,e,n)),V.get(t,e,["initialized","interactorStyle","lastFrameTime","recentAnimationFrameRate","_view"]),V.setGet(t,e,["container","lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker","preventDefaultOnPointerDown","preventDefaultOnPointerUp","mouseScrollDebounceByPass"]),V.moveToProtected(t,e,["view"]),s_(t,e)}var qo={newInstance:V.newInstance(z1,"vtkRenderWindowInteractor"),extend:z1,handledEvents:Cc,...P1};const{vtkErrorMacro:u_,VOID:l_}=V;function f_(t,e,a,n){return t.getRenderWindow().getViews()[0].worldToDisplay(e,a,n,t)}function p_(t,e,a,n){return t.getRenderWindow().getViews()[0].displayToWorld(e,a,n,t)}const h_={computeWorldToDisplay:f_,computeDisplayToWorld:p_};function g_(t,e){e.classHierarchy.push("vtkInteractorObserver");const a={...t};function n(){for(;e.subscribedEvents.length;)e.subscribedEvents.pop().unsubscribe()}function r(){qo.handledEvents.forEach(i=>{t[`handle${i}`]&&e.subscribedEvents.push(e._interactor[`on${i}`](o=>e.processEvents?t[`handle${i}`](o):l_,e.priority))})}t.setInteractor=i=>{i!==e._interactor&&(n(),e._interactor=i,i&&e.enabled&&r(),t.modified())},t.setEnabled=i=>{i!==e.enabled&&(n(),i&&(e._interactor?r():u_(` + `);return}const C={type:y,pokedRenderer:e.currentRenderer,firstRenderer:t.getFirstRenderer(),...g};t[`invoke${y}`](C)}}),t.recognizeGesture=(y,d)=>{if(Object.keys(d).length>2)return;if(e.startingEventPositions||(e.startingEventPositions={}),y==="TouchStart"){Object.keys(d).forEach(b=>{e.startingEventPositions[b]=d[b]}),e.currentGesture="Start";return}if(y==="TouchEnd"){e.currentGesture==="Pinch"&&(t.render(),t.endPinchEvent()),e.currentGesture==="Rotate"&&(t.render(),t.endRotateEvent()),e.currentGesture==="Pan"&&(t.render(),t.endPanEvent()),e.currentGesture="Start",e.startingEventPositions={};return}let g=0;const C=[],S=[];Object.keys(d).forEach(b=>{C[g]=d[b],S[g]=e.startingEventPositions[b],g++});const T=Math.sqrt((S[0].x-S[1].x)*(S[0].x-S[1].x)+(S[0].y-S[1].y)*(S[0].y-S[1].y)),w=Math.sqrt((C[0].x-C[1].x)*(C[0].x-C[1].x)+(C[0].y-C[1].y)*(C[0].y-C[1].y));let _=_a(Math.atan2(S[1].y-S[0].y,S[1].x-S[0].x)),E=_a(Math.atan2(C[1].y-C[0].y,C[1].x-C[0].x)),D=E-_;E=E+180>=360?E-180:E+180,_=_+180>=360?_-180:_+180,Math.abs(E-_)b&&R>N&&R>L){e.currentGesture="Pinch";const B={scale:1,touches:d};t.startPinchEvent(B)}else if(N>b&&N>L){e.currentGesture="Rotate";const B={rotation:0,touches:d};t.startRotateEvent(B)}else if(L>b){e.currentGesture="Pan";const B={translation:[0,0],touches:d};t.startPanEvent(B)}}else{if(e.currentGesture==="Rotate"){const b={rotation:D,touches:d};t.rotateEvent(b)}if(e.currentGesture==="Pinch"){const b={scale:w/T,touches:d};t.pinchEvent(b)}if(e.currentGesture==="Pan"){const b={translation:O,touches:d};t.panEvent(b)}}},t.handleVisibilityChange=()=>{e._animationStartTime=Date.now(),e._animationFrameCount=0},t.setCurrentRenderer=y=>{e._forcedRenderer=!!y,e.currentRenderer=y},t.setContainer=y=>{v();const d=a.setContainer(y??null);return d&&h(),d},t.delete=()=>{for(;n.size;)t.cancelAnimation(n.values().next().value);typeof document.hidden<"u"&&document.removeEventListener("visibilitychange",t.handleVisibilityChange),e.container&&t.setContainer(null),a.delete()},typeof document.hidden<"u"&&document.addEventListener("visibilitychange",t.handleVisibilityChange,!1)}var a_={renderWindow:null,interactorStyle:null,picker:null,pickingManager:null,initialized:!1,enabled:!1,enableRender:!0,currentRenderer:null,lightFollowCamera:!0,desiredUpdateRate:30,stillUpdateRate:2,container:null,recognizeGestures:!0,currentGesture:"Start",animationRequest:null,lastFrameTime:.1,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{},preventDefaultOnPointerDown:!1,preventDefaultOnPointerUp:!1,mouseScrollDebounceByPass:!1};function Qh(t,e,a={}){Object.assign(e,a_,a),A.obj(t,e),e._animationExtendedEnd=0,A.event(t,e,"RenderEvent"),Mc.forEach(n=>A.event(t,e,n)),A.get(t,e,["initialized","interactorStyle","lastFrameTime","recentAnimationFrameRate","_view"]),A.setGet(t,e,["container","lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker","preventDefaultOnPointerDown","preventDefaultOnPointerUp","mouseScrollDebounceByPass"]),A.moveToProtected(t,e,["view"]),r_(t,e)}var i_=A.newInstance(Qh,"vtkRenderWindowInteractor"),ns={newInstance:i_,extend:Qh,handledEvents:Mc,...Zh},{vtkErrorMacro:o_,VOID:s_}=A;function c_(t,e,a,n){return t.getRenderWindow().getViews()[0].worldToDisplay(e,a,n,t)}function u_(t,e,a,n){return t.getRenderWindow().getViews()[0].displayToWorld(e,a,n,t)}var l_={computeWorldToDisplay:c_,computeDisplayToWorld:u_};function f_(t,e){e.classHierarchy.push("vtkInteractorObserver");const a={...t};function n(){for(;e.subscribedEvents.length;)e.subscribedEvents.pop().unsubscribe()}function r(){ns.handledEvents.forEach(i=>{t[`handle${i}`]&&e.subscribedEvents.push(e._interactor[`on${i}`](o=>e.processEvents?t[`handle${i}`](o):s_,e.priority))})}t.setInteractor=i=>{i!==e._interactor&&(n(),e._interactor=i,i&&e.enabled&&r(),t.modified())},t.setEnabled=i=>{i!==e.enabled&&(n(),i&&(e._interactor?r():o_(` The interactor must be set before subscribing to events - `)),e.enabled=i,t.modified())},t.computeDisplayToWorld=(i,o,s,c)=>i?e._interactor.getView().displayToWorld(o,s,c,i):null,t.computeWorldToDisplay=(i,o,s,c)=>i?e._interactor.getView().worldToDisplay(o,s,c,i):null,t.setPriority=i=>{a.setPriority(i)&&e._interactor&&(n(),r())}}const d_={enabled:!0,priority:0,processEvents:!0,subscribedEvents:[]};function j1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,d_,a),V.obj(t,e),V.event(t,e,"InteractionEvent"),V.event(t,e,"StartInteractionEvent"),V.event(t,e,"EndInteractionEvent"),V.get(t,e,["_interactor","enabled"]),V.setGet(t,e,["priority","processEvents"]),V.moveToProtected(t,e,["interactor"]),g_(t,e)}var v_={newInstance:V.newInstance(j1,"vtkInteractorObserver"),extend:j1,...h_};const W1={IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025};var $1={States:W1};const{States:Sn}=$1,Sc={Rotate:Sn.IS_ROTATE,Pan:Sn.IS_PAN,Spin:Sn.IS_SPIN,Dolly:Sn.IS_DOLLY,CameraPose:Sn.IS_CAMERA_POSE,WindowLevel:Sn.IS_WINDOW_LEVEL,Slice:Sn.IS_SLICE};function y_(t,e){e.classHierarchy.push("vtkInteractorStyle"),Object.keys(Sc).forEach(a=>{V.event(t,e,`Start${a}Event`),t[`start${a}`]=()=>{e.state===Sn.IS_NONE&&(e.state=Sc[a],e._interactor.requestAnimation(t),t.invokeStartInteractionEvent({type:"StartInteractionEvent"}),t[`invokeStart${a}Event`]({type:`Start${a}Event`}))},V.event(t,e,`End${a}Event`),t[`end${a}`]=()=>{e.state===Sc[a]&&(e.state=Sn.IS_NONE,e._interactor.cancelAnimation(t),t.invokeEndInteractionEvent({type:"EndInteractionEvent"}),t[`invokeEnd${a}Event`]({type:`End${a}Event`}),e._interactor.render())}}),e.getRenderer=a=>e.focusedRenderer||a.pokedRenderer,t.handleKeyPress=a=>{const n=e._interactor;let r=null;switch(a.key){case"r":case"R":e.getRenderer(a).resetCamera(),n.render();break;case"w":case"W":r=e.getRenderer(a).getActors(),r.forEach(i=>{const o=i.getProperty();o.setRepresentationToWireframe&&o.setRepresentationToWireframe()}),n.render();break;case"s":case"S":r=e.getRenderer(a).getActors(),r.forEach(i=>{const o=i.getProperty();o.setRepresentationToSurface&&o.setRepresentationToSurface()}),n.render();break;case"v":case"V":r=e.getRenderer(a).getActors(),r.forEach(i=>{const o=i.getProperty();o.setRepresentationToPoints&&o.setRepresentationToPoints()}),n.render();break}}}const m_={state:Sn.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function H1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,m_,a),v_.extend(t,e,a),V.setGet(t,e,["focusedRenderer"]),y_(t,e)}var Tc={newInstance:V.newInstance(H1,"vtkInteractorStyle"),extend:H1,...$1};const oi={type:"StartInteractionEvent"},K1={type:"InteractionEvent"},si={type:"EndInteractionEvent"};function x_(t,e){e.classHierarchy.push("vtkInteractorStyleRemoteMouse");function a(n){const{buttonLeft:r,buttonMiddle:i,buttonRight:o}=e,s=n.shiftKey?1:0,c=n.controlKey?1:0,l=n.altKey?1:0,p=n.metaKey?1:0,u=r||i||o?"down":"up",[f,h]=e._interactor.getView().getSizeByReference();let{x:d,y:v}=n.position;return d/=f,v/=h,{action:u,x:d,y:v,buttonLeft:r,buttonMiddle:i,buttonRight:o,shiftKey:s,altKey:l,ctrlKey:c,metaKey:p,...e.remoteEventAddOn}}t.handleLeftButtonPress=n=>{e.previousPosition=n.position,e.buttonLeft=1,t.onButtonDown(1,n)},t.handleMiddleButtonPress=n=>{e.previousPosition=n.position,e.buttonMiddle=1,t.onButtonDown(2,n)},t.handleRightButtonPress=n=>{e.previousPosition=n.position,e.buttonRight=1,t.onButtonDown(3,n)},t.handleLeftButtonRelease=n=>{e.buttonLeft=0,t.onButtonUp(1,n)},t.handleMiddleButtonRelease=n=>{e.buttonMiddle=0,t.onButtonUp(2,n)},t.handleRightButtonRelease=n=>{e.buttonRight=0,t.onButtonUp(3,n)},t.onButtonDown=(n,r)=>{e._interactor.requestAnimation(t.onButtonDown),t.invokeStartInteractionEvent(oi),t.invokeRemoteMouseEvent(a(r))},t.onButtonUp=(n,r)=>{t.invokeRemoteMouseEvent(a(r)),t.invokeEndInteractionEvent(si),e._interactor.cancelAnimation(t.onButtonDown)},t.handleStartMouseWheel=n=>{e._interactor.requestAnimation(t.handleStartMouseWheel),t.invokeStartInteractionEvent(oi),t.invokeRemoteWheelEvent({type:"StartMouseWheel",...a(n),spinY:n.spinY})},t.handleMouseWheel=n=>{let r=!0;if(e.wheelThrottleDelay){const i=Date.now();r=e.wheelThrottleDelay{t.invokeRemoteWheelEvent({type:"EndMouseWheel",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartMouseWheel),t.invokeEndInteractionEvent(si)},t.handleMouseMove=n=>{const r=Date.now();e.throttleDelay{},t.handleStartPinch=n=>{t.startDolly();const{scale:r}=n;e._interactor.requestAnimation(t.handleStartPinch),t.invokeStartInteractionEvent(oi),t.invokeRemoteGestureEvent({type:"StartPinch",scale:r,...e.remoteEventAddOn})},t.handlePinch=n=>{const{scale:r}=n;t.invokeRemoteGestureEvent({type:"Pinch",scale:r,...e.remoteEventAddOn})},t.handleEndPinch=()=>{t.endDolly(),t.invokeRemoteGestureEvent({type:"EndPinch",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartPinch),t.invokeEndInteractionEvent(si)},t.handleStartRotate=n=>{t.startRotate();const{rotation:r}=n;e._interactor.requestAnimation(t.handleStartRotate),t.invokeStartInteractionEvent(oi),t.invokeRemoteGestureEvent({type:"StartRotate",rotation:r,...e.remoteEventAddOn})},t.handleRotate=n=>{const{rotation:r}=n;t.invokeRemoteGestureEvent({type:"Rotate",rotation:r,...e.remoteEventAddOn})},t.handleEndRotate=()=>{t.endRotate(),t.invokeRemoteGestureEvent({type:"EndRotate",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartRotate),t.invokeEndInteractionEvent(si)},t.handleStartPan=n=>{t.startPan();const{translation:r}=n;e._interactor.requestAnimation(t.handleStartPan),t.invokeStartInteractionEvent(oi),t.invokeRemoteGestureEvent({type:"StartPan",translation:r,...e.remoteEventAddOn})},t.handlePan=n=>{const{translation:r}=n;t.invokeRemoteGestureEvent({type:"Pan",translation:r,...e.remoteEventAddOn})},t.handleEndPan=()=>{t.endPan(),t.invokeRemoteGestureEvent({type:"EndPan",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartPan),t.invokeEndInteractionEvent(si)}}const C_={buttonLeft:0,buttonMiddle:0,buttonRight:0,sendMouseMove:!1,throttleDelay:33.3,lastThrottleTime:0,wheelThrottleDelay:0,wheelLastThrottleTime:0};function X1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,C_,a),Tc.extend(t,e,a),V.setGet(t,e,["sendMouseMove","remoteEventAddOn","throttleDelay","wheelThrottleDelay"]),V.event(t,e,"RemoteMouseEvent"),V.event(t,e,"RemoteWheelEvent"),V.event(t,e,"RemoteGestureEvent"),x_(t,e)}var S_={newInstance:V.newInstance(X1,"vtkInteractorStyleRemoteMouse"),extend:X1};const Yo=r_.newInstance(),T_=Yo.connect,w_=Yo.disconnect;function __(t,e){e.classHierarchy.push("vtkRemoteView"),e.canvasView=Yw.newInstance({canvas:e.canvasElement}),e.interactorStyle=S_.newInstance(),e.interactor=qo.newInstance(),e.interactor.setView(e.canvasView),e.interactor.initialize(),e.interactor.setInteractorStyle(e.interactorStyle),e.interactorStyle.onRemoteMouseEvent(n=>{e.session&&e.rpcMouseEvent&&e.session.call(e.rpcMouseEvent,[n])}),e.interactorStyle.onRemoteWheelEvent(n=>{e.session&&e.rpcWheelEvent&&e.session.call(e.rpcWheelEvent,[n])}),e.interactorStyle.onRemoteGestureEvent(n=>{e.session&&e.rpcGestureEvent&&e.session.call(e.rpcGestureEvent,[n])}),t.delete=V.chain(()=>{e.session=null,e.canvasView&&(e.canvasView.setViewStream(null),e.canvasView.delete()),e.interactor&&e.interactor.delete(),e.viewStream&&e.viewStream.delete()},t.delete),t.getCanvasElement=()=>e.canvasView.getCanvas(),t.setViewStream=n=>{e.viewStream=n,e.canvasView.setViewStream(e.viewStream),e.viewStream.setStillQuality(e.stillQuality),e.viewStream.setStillRatio(e.stillRatio),e.viewStream.setInteractiveQuality(e.interactiveQuality),e.viewStream.setInteractiveRatio(e.interactiveRatio),e.interactor.onStartAnimation(e.viewStream.startInteraction),e.interactor.onEndAnimation(e.viewStream.endInteraction),t.setViewId(n.getViewId())},t.setViewId=n=>{e.viewStream||t.setViewStream(Yo.createViewStream(n)),e.viewStream.setViewId(n),e.interactorStyle.setRemoteEventAddOn({view:n}),t.modified()},t.setContainer=n=>{e.container&&e.interactor.unbindEvents(n),e.container=n,e.canvasView.setContainer(e.container),n&&(e.interactor.bindEvents(n),t.resize())},t.resize=()=>{if(e.container&&e.canvasView){const{width:n,height:r}=e.container.getBoundingClientRect();e.canvasView.setSize(n,r),t.render()}},t.render=()=>{e.viewStream&&e.viewStream.render()},t.resetCamera=()=>{e.viewStream&&e.viewStream.resetCamera()};const a={modified:t.modified};V.set(a,e,["interactiveQuality","interactiveRatio","stillQuality","stillRatio"]),t.setInteractiveQuality=n=>{const r=a.setInteractiveQuality(n);return e.viewStream&&r&&e.viewStream.setInteractiveQuality(e.interactiveQuality),r},t.setInteractiveRatio=n=>{const r=a.setInteractiveRatio(n);return e.viewStream&&r&&e.viewStream.setInteractiveRatio(e.interactiveRatio),r},t.setStillQuality=n=>{const r=a.setStillQuality(n);return e.viewStream&&r&&e.viewStream.setStillQuality(e.stillQuality),r},t.setStillRatio=n=>{const r=a.setStillRatio(n);return e.viewStream&&r&&e.viewStream.setStillRatio(e.stillRatio),r},e.viewStream&&t.setViewStream(e.viewStream)}const E_={viewId:"-1",interactiveQuality:60,interactiveRatio:1/window.devicePixelRatio,stillQuality:100,stillRatio:1,rpcMouseEvent:"viewport.mouse.interaction",rpcGestureEvent:null,rpcWheelEvent:null,canvasElement:null};function q1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,E_,a),V.obj(t,e,a),V.get(t,e,["container","viewStream","canvasView","interactor","interactorStyle","interactiveQuality","interactiveRatio","stillQuality","stillRatio","canvasElement"]),V.setGet(t,e,["session","rpcMouseEvent","rpcGestureEvent","rpcWheelEvent"]),__(t,e)}var D_={newInstance:V.newInstance(q1,"vtkRemoteView"),extend:q1,SHARED_IMAGE_STREAM:Yo,connectImageStream:T_,disconnectImageStream:w_};function O_(t,e){e.classHierarchy.push("vtkCompositeMouseManipulator"),t.startInteraction=()=>{},t.endInteraction=()=>{},t.onButtonDown=(a,n,r)=>{},t.onButtonUp=a=>{},t.onMouseMove=(a,n,r)=>{},t.onStartScroll=(a,n,r)=>{},t.onScroll=(a,n,r)=>{},t.onEndScroll=a=>{},t.isDragEnabled=()=>e.dragEnabled,t.isScrollEnabled=()=>e.scrollEnabled}const b_={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1};function M_(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,b_,a),V.setGet(t,e,["button","shift","control","alt"]),V.set(t,e,["dragEnabled","scrollEnabled"]),O_(t,e)}var pa={extend:M_};const N_=[-2,-1,-2,-1],R_={position:"absolute",zIndex:1,border:"2px solid #F44336",backgroundColor:"rgba(0, 0, 0, 0.1)",borderRadius:"4px",boxSizing:"border-box"};function L_(t,e){Object.keys(e).forEach(a=>{t.style[a]=e[a]})}function F_(t,e){e.classHierarchy.push("vtkMouseBoxSelectionManipulator");let a=null,n=null,r=null,i=null,o=null,s=!1;function c(){return!r||!i?N_:[Math.min(r.x,i.x),Math.max(r.x,i.x),Math.min(r.y,i.y),Math.max(r.y,i.y)]}function l(){if(!a||!n)return;const[p,u]=a.getSize(),{width:f,height:h}=n.getBoundingClientRect(),[d,v,m,x]=c();o.style.left=`${f*d/p}px`,o.style.top=`${h-h*x/u}px`,o.style.width=`${f*(v-d)/p}px`,o.style.height=`${h*(x-m)/u}px`}t.onButtonDown=(p,u,f)=>{r=f,e.renderSelection&&(a||(a=p.getView()),!n&&(a!=null&&a.getContainer)&&(n=a.getContainer()),n||(n=e.container),o||(o=document.createElement("div"),L_(o,e.selectionStyle)),l(),n&&!s&&(s=!0,n.appendChild(o)))},t.onMouseMove=(p,u,f)=>{r&&f&&(i=f,t.invokeBoxSelectInput({view:a,container:n,selection:c()}),e.renderSelection&&l())},t.onButtonUp=(p,u)=>{!r||!i&&!e.boxChangeOnClick||(i||(i=r),t.invokeBoxSelectChange({view:a,container:n,selection:c()}),s&&(o.parentElement.removeChild(o),s=!1),a=null,n=null,r=null,i=null)}}function k_(t){return{boxChangeOnClick:!1,renderSelection:!0,...t,selectionStyle:{...R_,...t.selectionStyle}}}function Y1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,k_(a)),ut(t,e),pa.extend(t,e,a),Hr(t,e,"BoxSelectChange"),Hr(t,e,"BoxSelectInput"),pt(t,e,["renderSelection","boxChangeOnClick","selectionStyle","container"]),F_(t,e)}var J1={newInstance:Je(Y1,"vtkMouseBoxSelectionManipulator"),extend:Y1};const{vtkDebugMacro:wc}=V,{States:V_}=Tc,ci={type:"StartInteractionEvent"},Yn={type:"InteractionEvent"},ui={type:"EndInteractionEvent"};function _c(t,e,a,n,r,i){const o=t.getActiveCamera();let s=o.getFocalPoint();s=e.getInteractorStyle().computeWorldToDisplay(t,s[0],s[1],s[2]);const c=s[2],l=e.getInteractorStyle().computeDisplayToWorld(t,a,n,c),p=e.getInteractorStyle().computeDisplayToWorld(t,r,i,c),u=[p[0]-l[0],p[1]-l[1],p[2]-l[2]];s=o.getFocalPoint();const f=o.getPosition();o.setFocalPoint(u[0]+s[0],u[1]+s[1],u[2]+s[2]),o.setPosition(u[0]+f[0],u[1]+f[1],u[2]+f[2])}function A_(t,e,a,n){const r=a.getActiveCamera();if(r.getParallelProjection()){const i=n.getView(),o=i.getViewportSize(a),s=a.getViewport(),c=i.getSize(),l=o[0],p=o[1],u=l/2,f=p/2,h=e.x-s[0]*c[0],d=e.y-s[1]*c[1];_c(a,n,u,f,h,d),r.setParallelScale(r.getParallelScale()/t),_c(a,n,h,d,u,f)}else{let i=r.getFocalPoint();const o=r.getViewPlaneNormal();i=n.getInteractorStyle().computeWorldToDisplay(a,i[0],i[1],i[2]);const s=n.getInteractorStyle().computeDisplayToWorld(a,e.x,e.y,i[2]);r.setFocalPoint(s[0],s[1],s[2]),r.dolly(t),a.resetCameraClippingRange();const c=r.getPosition();i=r.getFocalPoint();const l=[0,0,0];let p=o[0]*(i[0]-c[0])+o[1]*(i[1]-c[1])+o[2]*(i[2]-c[2]);p/=o[0]**2+o[1]**2+o[2]**2,l[0]=c[0]+o[0]*p,l[1]=c[1]+o[1]*p,l[2]=c[2]+o[2]*p,r.setFocalPoint(l[0],l[1],l[2]),a.resetCameraClippingRange()}}function B_(t,e,a){if(Number.isNaN(a))return;const n=e.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/a):(n.dolly(a),e.resetCameraClippingRange()),t.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()}const U_={dollyToPosition:A_,translateCamera:_c,dollyByFactor:B_};function G_(t,e){e.classHierarchy.push("vtkInteractorStyleManipulator"),e.currentVRManipulators=new Map,e.mouseManipulators=[],e.keyboardManipulators=[],e.vrManipulators=[],e.gestureManipulators=[],e.currentManipulator=null,e.currentWheelManipulator=null,e.centerOfRotation=[0,0,0],e.rotationFactor=1,t.removeAllManipulators=()=>{t.removeAllMouseManipulators(),t.removeAllKeyboardManipulators(),t.removeAllVRManipulators(),t.removeAllGestureManipulators()},t.removeAllMouseManipulators=()=>{e.mouseManipulators=[]},t.removeAllKeyboardManipulators=()=>{e.keyboardManipulators=[]},t.removeAllVRManipulators=()=>{e.vrManipulators=[]},t.removeAllGestureManipulators=()=>{e.gestureManipulators=[]};const a=(r,i)=>{const o=i.indexOf(r);return o===-1?!1:(i.splice(o,1),t.modified(),!0)};t.removeMouseManipulator=r=>a(r,e.mouseManipulators),t.removeKeyboardManipulator=r=>a(r,e.keyboardManipulators),t.removeVRManipulator=r=>a(r,e.vrManipulators),t.removeGestureManipulator=r=>a(r,e.gestureManipulators);const n=(r,i)=>i.indexOf(r)!==-1?!1:(i.push(r),t.modified(),!0);t.addMouseManipulator=r=>n(r,e.mouseManipulators),t.addKeyboardManipulator=r=>n(r,e.keyboardManipulators),t.addVRManipulator=r=>n(r,e.vrManipulators),t.addGestureManipulator=r=>n(r,e.gestureManipulators),t.getNumberOfMouseManipulators=()=>e.mouseManipulators.length,t.getNumberOfKeyboardManipulators=()=>e.keyboardManipulators.length,t.getNumberOfVRManipulators=()=>e.vrManipulators.length,t.getNumberOfGestureManipulators=()=>e.gestureManipulators.length,t.resetCurrentManipulator=()=>{e.currentManipulator=null,e.currentWheelManipulator=null},t.handleLeftButtonPress=r=>{e.previousPosition=r.position,t.onButtonDown(Fr.LeftButton,r)},t.handleMiddleButtonPress=r=>{e.previousPosition=r.position,t.onButtonDown(Fr.MiddleButton,r)},t.handleRightButtonPress=r=>{e.previousPosition=r.position,t.onButtonDown(Fr.RightButton,r)},t.handleButton3D=r=>{if(!r)return;const i=t.findVRManipulator(r.device,r.input,r.pressed);i?(e.currentVRManipulators.set(r.device,i),i.onButton3D(t,e.getRenderer(r),e.state,r),r.pressed?t.startCameraPose():(e.currentVRManipulators.delete(r.device),e.currentVRManipulators.size===0&&t.endCameraPose())):wc("No manipulator found")},t.handleMove3D=r=>{const i=e.currentVRManipulators.get(r.device);i&&e.state===V_.IS_CAMERA_POSE&&i.onMove3D(t,e.getRenderer(r),e.state,r)},t.onButtonDown=(r,i)=>{e.currentManipulator||(e.currentManipulator=t.findMouseManipulator(r,i.shiftKey,i.controlKey,i.altKey),e.currentManipulator?(e.currentManipulator.setCenter&&e.currentManipulator.setCenter(e.centerOfRotation),e.currentManipulator.setRotationFactor&&e.currentManipulator.setRotationFactor(e.rotationFactor),e.currentManipulator.startInteraction(),e.currentManipulator.onButtonDown(e._interactor,e.getRenderer(i),i.position),e._interactor.requestAnimation(t.onButtonDown),t.invokeStartInteractionEvent(ci)):wc("No manipulator found"))},t.findMouseManipulator=(r,i,o,s)=>{let c=null,l=e.mouseManipulators.length;for(;l--;){const p=e.mouseManipulators[l];p&&p.getButton()===r&&p.getShift()===i&&p.getControl()===o&&p.getAlt()===s&&p.isDragEnabled()&&(c=p)}return c},t.findVRManipulator=(r,i)=>{let o=null,s=e.vrManipulators.length;for(;s--;){const c=e.vrManipulators[s];c&&c.getDevice()===r&&c.getInput()===i&&(o=c)}return o},t.handleLeftButtonRelease=()=>{t.onButtonUp(Fr.LeftButton)},t.handleMiddleButtonRelease=()=>{t.onButtonUp(Fr.MiddleButton)},t.handleRightButtonRelease=()=>{t.onButtonUp(Fr.RightButton)},t.onButtonUp=r=>{e.currentManipulator&&e.currentManipulator.getButton&&e.currentManipulator.getButton()===r&&(e.currentManipulator.onButtonUp(e._interactor),e.currentManipulator.endInteraction(),e._interactor.isPointerLocked()||(e.currentManipulator=null),e._interactor.cancelAnimation(t.onButtonDown),t.invokeEndInteractionEvent(ui))},t.handleEndPointerLock=()=>{e.currentManipulator=null},t.handleStartMouseWheel=r=>{if(e.currentWheelManipulator)return;let i=null,o=e.mouseManipulators.length;for(;o--;){const s=e.mouseManipulators[o];s&&s.isScrollEnabled()&&s.getShift()===r.shiftKey&&s.getControl()===r.controlKey&&s.getAlt()===r.altKey&&(i=s)}i?(e.currentWheelManipulator=i,e.currentWheelManipulator.onStartScroll(e._interactor,e.getRenderer(r),r.spinY),e.currentWheelManipulator.startInteraction(),e._interactor.requestAnimation(t.handleStartMouseWheel),t.invokeStartInteractionEvent(ci)):wc("No manipulator found")},t.handleEndMouseWheel=()=>{e.currentWheelManipulator&&e.currentWheelManipulator.onEndScroll&&(e.currentWheelManipulator.onEndScroll(e._interactor),e.currentWheelManipulator.endInteraction(),e.currentWheelManipulator=null,e._interactor.cancelAnimation(t.handleStartMouseWheel),t.invokeEndInteractionEvent(ui))},t.handleMouseWheel=r=>{e.currentWheelManipulator&&e.currentWheelManipulator.onScroll&&(e.currentWheelManipulator.onScroll(e._interactor,e.getRenderer(r),r.spinY,e.cachedMousePosition),t.invokeInteractionEvent(Yn))},t.handleMouseMove=r=>{e.cachedMousePosition=r.position,e.currentManipulator&&e.currentManipulator.onMouseMove&&(e.currentManipulator.onMouseMove(e._interactor,e.getRenderer(r),r.position),t.invokeInteractionEvent(Yn))},t.handleKeyPress=r=>{e.keyboardManipulators.filter(i=>i.onKeyPress).forEach(i=>{i.onKeyPress(e._interactor,e.getRenderer(r),r.key),t.invokeInteractionEvent(Yn)})},t.handleKeyDown=r=>{e.keyboardManipulators.filter(i=>i.onKeyDown).forEach(i=>{i.onKeyDown(e._interactor,e.getRenderer(r),r.key),t.invokeInteractionEvent(Yn)})},t.handleKeyUp=r=>{e.keyboardManipulators.filter(i=>i.onKeyUp).forEach(i=>{i.onKeyUp(e._interactor,e.getRenderer(r),r.key),t.invokeInteractionEvent(Yn)})},t.handleStartPinch=r=>{t.startDolly();let i=e.gestureManipulators.length;for(;i--;){const o=e.gestureManipulators[i];o&&o.isPinchEnabled()&&(o.onStartPinch(e._interactor,r.scale),o.startInteraction())}e._interactor.requestAnimation(t.handleStartPinch),t.invokeStartInteractionEvent(ci)},t.handleEndPinch=()=>{t.endDolly();let r=e.gestureManipulators.length;for(;r--;){const i=e.gestureManipulators[r];i&&i.isPinchEnabled()&&(i.onEndPinch(e._interactor),i.endInteraction())}e._interactor.cancelAnimation(t.handleStartPinch),t.invokeEndInteractionEvent(ui)},t.handleStartRotate=r=>{t.startRotate();let i=e.gestureManipulators.length;for(;i--;){const o=e.gestureManipulators[i];o&&o.isRotateEnabled()&&(o.onStartRotate(e._interactor,r.rotation),o.startInteraction())}e._interactor.requestAnimation(t.handleStartRotate),t.invokeStartInteractionEvent(ci)},t.handleEndRotate=()=>{t.endRotate();let r=e.gestureManipulators.length;for(;r--;){const i=e.gestureManipulators[r];i&&i.isRotateEnabled()&&(i.onEndRotate(e._interactor),i.endInteraction())}e._interactor.cancelAnimation(t.handleStartRotate),t.invokeEndInteractionEvent(ui)},t.handleStartPan=r=>{t.startPan();let i=e.gestureManipulators.length;for(;i--;){const o=e.gestureManipulators[i];o&&o.isPanEnabled()&&(o.onStartPan(e._interactor,r.translation),o.startInteraction())}e._interactor.requestAnimation(t.handleStartPan),t.invokeStartInteractionEvent(ci)},t.handleEndPan=()=>{t.endPan();let r=e.gestureManipulators.length;for(;r--;){const i=e.gestureManipulators[r];i&&i.isPanEnabled()&&(i.onEndPan(e._interactor),i.endInteraction())}e._interactor.cancelAnimation(t.handleStartPan),t.invokeEndInteractionEvent(ui)},t.handlePinch=r=>{let i=e.gestureManipulators.length,o=0;for(;i--;){const s=e.gestureManipulators[i];s&&s.isPinchEnabled()&&(s.onPinch(e._interactor,e.getRenderer(r),r.scale),o++)}o&&t.invokeInteractionEvent(Yn)},t.handlePan=r=>{const i=e.getRenderer(r);let o=e.gestureManipulators.length,s=0;for(;o--;){const c=e.gestureManipulators[o];c&&c.isPanEnabled()&&(c.onPan(e._interactor,i,r.translation),s++)}s&&t.invokeInteractionEvent(Yn)},t.handleRotate=r=>{let i=e.gestureManipulators.length,o=0;for(;i--;){const s=e.gestureManipulators[i];s&&s.isRotateEnabled()&&(s.onRotate(e._interactor,e.getRenderer(r),r.rotation),o++)}o&&t.invokeInteractionEvent(Yn)}}const I_=t=>({cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1,...t});function Z1(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,I_(a)),Tc.extend(t,e,a),V.setGet(t,e,["rotationFactor"]),V.get(t,e,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),V.setGetArray(t,e,["centerOfRotation"],3),G_(t,e)}var Vr={newInstance:V.newInstance(Z1,"vtkInteractorStyleManipulator"),extend:Z1,...U_};const Q1={props:{viewId:{type:String,default:"-1"},wsClient:{type:Object},interactiveRatio:{type:[Number,String]},interactiveQuality:{type:[Number,String]},stillRatio:{type:[Number,String]},stillQuality:{type:[Number,String]},enablePicking:{type:Boolean,default:!1},interactorEvents:{type:Array,default:()=>["EndAnimation"]},boxSelection:{type:Boolean,default:!1},visible:{type:Boolean,default:!1},pickingModes:{type:Array,default:()=>[]}},emits:["onImageCapture","BoxSelection","select","hover","click","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],setup(t,{emit:e}){const a=se.ref(!1),n=se.ref(null),r=se.inject("trame"),i=t.wsClient||(r==null?void 0:r.client);let o=null;if(!i)throw new Error("VtkRemoteView can not be created without a wsClient");const s=i.getImageStream().createViewStream(t.viewId);s.get("protocol").protocol.setQuality(t.viewId,5,.1);const c=D_.newInstance({rpcWheelEvent:"viewport.mouse.zoom.wheel",viewStream:s});t.interactiveRatio&&c.setInteractiveRatio(Number(t.interactiveRatio)),t.interactiveQuality&&c.setInteractiveQuality(Number(t.interactiveQuality)),t.stillRatio&&c.setStillRatio(Number(t.stillRatio)),t.stillQuality&&c.setStillQuality(Number(t.stillQuality));const l=c.render,p=c.resetCamera,u=c.setInteractiveQuality,f=c.setInteractiveRatio,h=c.setStillQuality,d=c.setStillRatio,v=c.getInteractiveQuality,m=c.getInteractiveRatio,x=c.getStillQuality,y=c.getStillRatio,g=c.getInteractor(),C=[];t.interactorEvents.forEach(M=>{const N=`on${M}`;C.push(g[N](R=>e(M,R)))});const S=Vr.newInstance({enabled:t.boxSelection}),T=J1.newInstance({button:1});S.addMouseManipulator(T),C.push(T.onBoxSelectChange(({container:M,selection:N})=>{if(M){const{width:R,height:B}=M.getBoundingClientRect(),I={selection:N,size:[R,B],mode:"remote"};e("BoxSelection",I),t.pickingModes.includes("select")&&e("select",{...I,action:"select"})}})),S.setInteractor(g);function w(){const M=c.getCanvasView(),[N,R]=M.getSize();M.setSize(N+2,R+2),se.nextTick(c.resize)}const _=async()=>{const M=c.getCanvasView().get("bgImage").bgImage.src,R=await(await fetch(M)).blob();return e("onImageCapture",R),R};se.onMounted(async()=>{const M=se.unref(n);c.getCanvasView().setUseBackgroundImage(0),c.setContainer(M),T.setContainer(M),T.setBoxChangeOnClick(t.enablePicking);const N=i.getConnection().getSession();c.setSession(N),c.setViewId(t.viewId),await se.nextTick();const{width:R,height:B}=M.getBoundingClientRect(),I=R<10||B<10?10:0;c.getCanvasView().setSize(Math.round(R+I),Math.round(B+I)),await new Promise(P=>{const L=s.onImageReady(({image:k,metadata:A})=>{const[j,H]=A.size;if(j!==k.width||H!==k.height){s.render();return}const K=s.getStillRatio()*Math.round(I+R),Y=s.getStillRatio()*Math.round(I+B);j===K&&H===Y?(L.unsubscribe(),c.getCanvasView().setBackgroundImage(k),P()):s.render()});s.endInteraction()}),c.getCanvasView().setUseBackgroundImage(1),a.value=!0,window.ResizeObserver?(o=new ResizeObserver(c.resize),o.observe(M)):window.addEventListener("resize",c.resize)}),se.onBeforeUnmount(()=>{for(o?(o.disconnect(),o=null):window.removeEventListener("resize",c.resize);C.length;)C.pop().unsubscribe();S.setEnabled(!1),S.delete(),T.delete(),c.delete()}),se.watch(()=>t.viewId,M=>{a.value&&(c.setViewId(se.unref(M)),c.resize())}),se.watch(()=>t.visible,M=>{se.unref(M)&&w()}),se.watch(()=>t.enablePicking,M=>{c.getInteractorStyle().setSendMouseMove(M),T.setBoxChangeOnClick(M)}),se.watch(()=>t.interactiveRatio,M=>{c.setInteractiveRatio(M)}),se.watch(()=>t.interactiveQuality,M=>{c.setInteractiveQuality(M)}),se.watch(()=>t.stillRatio,M=>{c.setStillRatio(M)}),se.watch(()=>t.stillQuality,M=>{c.setStillQuality(M)}),se.watch(()=>[t.pickingModes.includes("select"),t.boxSelection],([M,N])=>{S.setEnabled(M||N),c.getInteractorStyle().setEnabled(!M||t.enablePicking)});function E(M){const N=n.value;if(!N)return;const R=N.getBoundingClientRect(),[B,I]=c.getCanvasView().getSize(),P=B/R.width,L=I/R.height;return{position:{x:P*(M.clientX-R.left),y:L*(R.height-M.clientY+R.top),z:0},size:[B,I],scale:[P,L]}}function D(M){t.pickingModes.includes("click")&&e("click",{mode:"remote",action:"click",...E(M)})}function O(M){t.pickingModes.includes("hover")&&e("hover",{mode:"remote",action:"hover",...E(M)})}return{connected:a,vtkContainer:n,onClick:D,onMouseMove:O,render:l,resetCamera:p,resize:w,setInteractiveQuality:u,setInteractiveRatio:f,setStillQuality:h,setStillRatio:d,getInteractiveQuality:v,getInteractiveRatio:m,getStillQuality:x,getStillRatio:y,captureImage:_}},template:` + `)),e.enabled=i,t.modified())},t.computeDisplayToWorld=(i,o,s,u)=>i?e._interactor.getView().displayToWorld(o,s,u,i):null,t.computeWorldToDisplay=(i,o,s,u)=>i?e._interactor.getView().worldToDisplay(o,s,u,i):null,t.setPriority=i=>{a.setPriority(i)&&e._interactor&&(n(),r())}}var p_={enabled:!0,priority:0,processEvents:!0,subscribedEvents:[]};function eg(t,e,a={}){Object.assign(e,p_,a),A.obj(t,e),A.event(t,e,"InteractionEvent"),A.event(t,e,"StartInteractionEvent"),A.event(t,e,"EndInteractionEvent"),A.get(t,e,["_interactor","enabled"]),A.setGet(t,e,["priority","processEvents"]),A.moveToProtected(t,e,["interactor"]),f_(t,e)}var h_=A.newInstance(eg,"vtkInteractorObserver"),g_={newInstance:h_,extend:eg,...l_},tg={IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025},ng={States:tg},{States:_n}=ng,Nc={Rotate:_n.IS_ROTATE,Pan:_n.IS_PAN,Spin:_n.IS_SPIN,Dolly:_n.IS_DOLLY,CameraPose:_n.IS_CAMERA_POSE,WindowLevel:_n.IS_WINDOW_LEVEL,Slice:_n.IS_SLICE};function d_(t,e){e.classHierarchy.push("vtkInteractorStyle"),Object.keys(Nc).forEach(a=>{A.event(t,e,`Start${a}Event`),t[`start${a}`]=()=>{e.state===_n.IS_NONE&&(e.state=Nc[a],e._interactor.requestAnimation(t),t.invokeStartInteractionEvent({type:"StartInteractionEvent"}),t[`invokeStart${a}Event`]({type:`Start${a}Event`}))},A.event(t,e,`End${a}Event`),t[`end${a}`]=()=>{e.state===Nc[a]&&(e.state=_n.IS_NONE,e._interactor.cancelAnimation(t),t.invokeEndInteractionEvent({type:"EndInteractionEvent"}),t[`invokeEnd${a}Event`]({type:`End${a}Event`}),e._interactor.render())}}),e.getRenderer=a=>e.focusedRenderer||a.pokedRenderer,t.handleKeyPress=a=>{const n=e._interactor;let r=null;switch(a.key){case"r":case"R":e.getRenderer(a).resetCamera(),n.render();break;case"w":case"W":r=e.getRenderer(a).getActors(),r.forEach(i=>{const o=i.getProperty();o.setRepresentationToWireframe&&o.setRepresentationToWireframe()}),n.render();break;case"s":case"S":r=e.getRenderer(a).getActors(),r.forEach(i=>{const o=i.getProperty();o.setRepresentationToSurface&&o.setRepresentationToSurface()}),n.render();break;case"v":case"V":r=e.getRenderer(a).getActors(),r.forEach(i=>{const o=i.getProperty();o.setRepresentationToPoints&&o.setRepresentationToPoints()}),n.render();break}}}var v_={state:_n.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function rg(t,e,a={}){Object.assign(e,v_,a),g_.extend(t,e,a),A.setGet(t,e,["focusedRenderer"]),d_(t,e)}var y_=A.newInstance(rg,"vtkInteractorStyle"),Rc={newInstance:y_,extend:rg,...ng},li={type:"StartInteractionEvent"},ag={type:"InteractionEvent"},fi={type:"EndInteractionEvent"};function m_(t,e){e.classHierarchy.push("vtkInteractorStyleRemoteMouse");function a(n){const{buttonLeft:r,buttonMiddle:i,buttonRight:o}=e,s=n.shiftKey?1:0,u=n.controlKey?1:0,c=n.altKey?1:0,p=n.metaKey?1:0,l=r||i||o?"down":"up",[f,h]=e._interactor.getView().getSizeByReference();let{x:v,y:m}=n.position;return v/=f,m/=h,{action:l,x:v,y:m,buttonLeft:r,buttonMiddle:i,buttonRight:o,shiftKey:s,altKey:c,ctrlKey:u,metaKey:p,...e.remoteEventAddOn}}t.handleLeftButtonPress=n=>{e.previousPosition=n.position,e.buttonLeft=1,t.onButtonDown(1,n)},t.handleMiddleButtonPress=n=>{e.previousPosition=n.position,e.buttonMiddle=1,t.onButtonDown(2,n)},t.handleRightButtonPress=n=>{e.previousPosition=n.position,e.buttonRight=1,t.onButtonDown(3,n)},t.handleLeftButtonRelease=n=>{e.buttonLeft=0,t.onButtonUp(1,n)},t.handleMiddleButtonRelease=n=>{e.buttonMiddle=0,t.onButtonUp(2,n)},t.handleRightButtonRelease=n=>{e.buttonRight=0,t.onButtonUp(3,n)},t.onButtonDown=(n,r)=>{e._interactor.requestAnimation(t.onButtonDown),t.invokeStartInteractionEvent(li),t.invokeRemoteMouseEvent(a(r))},t.onButtonUp=(n,r)=>{t.invokeRemoteMouseEvent(a(r)),t.invokeEndInteractionEvent(fi),e._interactor.cancelAnimation(t.onButtonDown)},t.handleStartMouseWheel=n=>{e._interactor.requestAnimation(t.handleStartMouseWheel),t.invokeStartInteractionEvent(li),t.invokeRemoteWheelEvent({type:"StartMouseWheel",...a(n),spinY:n.spinY})},t.handleMouseWheel=n=>{let r=!0;if(e.wheelThrottleDelay){const i=Date.now();r=e.wheelThrottleDelay{t.invokeRemoteWheelEvent({type:"EndMouseWheel",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartMouseWheel),t.invokeEndInteractionEvent(fi)},t.handleMouseMove=n=>{const r=Date.now();e.throttleDelay{},t.handleStartPinch=n=>{t.startDolly();const{scale:r}=n;e._interactor.requestAnimation(t.handleStartPinch),t.invokeStartInteractionEvent(li),t.invokeRemoteGestureEvent({type:"StartPinch",scale:r,...e.remoteEventAddOn})},t.handlePinch=n=>{const{scale:r}=n;t.invokeRemoteGestureEvent({type:"Pinch",scale:r,...e.remoteEventAddOn})},t.handleEndPinch=()=>{t.endDolly(),t.invokeRemoteGestureEvent({type:"EndPinch",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartPinch),t.invokeEndInteractionEvent(fi)},t.handleStartRotate=n=>{t.startRotate();const{rotation:r}=n;e._interactor.requestAnimation(t.handleStartRotate),t.invokeStartInteractionEvent(li),t.invokeRemoteGestureEvent({type:"StartRotate",rotation:r,...e.remoteEventAddOn})},t.handleRotate=n=>{const{rotation:r}=n;t.invokeRemoteGestureEvent({type:"Rotate",rotation:r,...e.remoteEventAddOn})},t.handleEndRotate=()=>{t.endRotate(),t.invokeRemoteGestureEvent({type:"EndRotate",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartRotate),t.invokeEndInteractionEvent(fi)},t.handleStartPan=n=>{t.startPan();const{translation:r}=n;e._interactor.requestAnimation(t.handleStartPan),t.invokeStartInteractionEvent(li),t.invokeRemoteGestureEvent({type:"StartPan",translation:r,...e.remoteEventAddOn})},t.handlePan=n=>{const{translation:r}=n;t.invokeRemoteGestureEvent({type:"Pan",translation:r,...e.remoteEventAddOn})},t.handleEndPan=()=>{t.endPan(),t.invokeRemoteGestureEvent({type:"EndPan",...e.remoteEventAddOn}),e._interactor.cancelAnimation(t.handleStartPan),t.invokeEndInteractionEvent(fi)}}var x_={buttonLeft:0,buttonMiddle:0,buttonRight:0,sendMouseMove:!1,throttleDelay:33.3,lastThrottleTime:0,wheelThrottleDelay:0,wheelLastThrottleTime:0};function ig(t,e,a={}){Object.assign(e,x_,a),Rc.extend(t,e,a),A.setGet(t,e,["sendMouseMove","remoteEventAddOn","throttleDelay","wheelThrottleDelay"]),A.event(t,e,"RemoteMouseEvent"),A.event(t,e,"RemoteWheelEvent"),A.event(t,e,"RemoteGestureEvent"),m_(t,e)}var C_=A.newInstance(ig,"vtkInteractorStyleRemoteMouse"),S_={newInstance:C_,extend:ig};function T_(t){return{subscribeToImageStream:e=>t.subscribe("viewport.image.push.subscription",e),unsubscribeToImageStream:e=>t.unsubscribe(e),registerView:e=>t.call("viewport.image.push.observer.add",[e]),unregisterView:e=>t.call("viewport.image.push.observer.remove",[e]),enableView:(e,a)=>t.call("viewport.image.push.enabled",[e,a]),render:(e={size:[400,400],view:-1})=>t.call("viewport.image.push",[e]),resetCamera:(e=-1)=>t.call("viewport.camera.reset",[e]),invalidateCache:e=>t.call("viewport.image.push.invalidate.cache",[e]),setQuality:(e,a,n=1)=>t.call("viewport.image.push.quality",[e,a,n]),setSize:(e,a=400,n=400)=>t.call("viewport.image.push.original.size",[e,a,n]),setServerAnimationFPS:(e=30)=>t.call("viewport.image.animation.fps.max",[e]),getServerAnimationFPS:()=>t.call("viewport.image.animation.fps.get",[]),startAnimation:(e=-1)=>t.call("viewport.image.animation.start",[e]),stopAnimation:(e=-1)=>t.call("viewport.image.animation.stop",[e]),updateCamera:(e,a,n,r,i=!0)=>t.call("viewport.camera.update",[e??-1,a,n,r,i]),updateCameraParameters:(e=-1,a={},n=!0)=>t.call("viewport.camera.update.params",[e,a,n])}}function w_(t,e){e.classHierarchy.push("vtkViewStream"),e.imageDecodingPool=[new Image,new Image],e.eventPool=[],e.nextPoolImageIndex=0,e.urlToRevoke=[],e.activeURL=null,e.fps=[],e.lastTime=Date.now(),e.lastImageEvent=null;function a(i){if(e.deleted)return;const o=Number(this.dataset.id);t.invokeImageReady(e.eventPool[o])}function n(i=2){for(;e.imageDecodingPool.length{const i=e.camera.getReferenceByName("focalPoint"),o=e.camera.getReferenceByName("viewUp"),s=e.camera.getReferenceByName("position"),u=e.camera.getParallelProjection(),c=e.camera.getViewAngle(),p=e.camera.getParallelScale();let l=null;return e.useCameraParameters?l=e.protocol.updateCameraParameters(e.viewId,{focalPoint:i,viewUp:o,position:s,parallelProjection:u,viewAngle:c,parallelScale:p},!1):l=e.protocol.updateCamera(e.viewId,i,o,s,!1),e.isAnimating&&setTimeout(t.pushCamera,1e3/e.cameraUpdateRate),l},t.invalidateCache=()=>e.protocol.invalidateCache(e.viewId),t.render=()=>e.protocol.render({view:e.viewId,size:e.size}),t.resetCamera=()=>e.protocol.resetCamera(e.viewId),t.startAnimation=()=>e.protocol.startAnimation(e.viewId),t.stopAnimation=()=>e.protocol.stopAnimation(e.viewId),t.setSize=(i,o)=>{let s=!1;return(e.size[0]!==i||e.size[1]!==o)&&(e.size=[i,o],s=!0),s&&(t.modified(),e.protocol)?e.protocol.setSize(e.viewId,i,o):Promise.resolve(!1)},t.startInteraction=()=>{const i=[e.protocol.setQuality(e.viewId,e.interactiveQuality,e.interactiveRatio)];return e.camera&&(i.push(t.startAnimation()),e.isAnimating=!0,i.push(t.pushCamera())),Promise.all(i)},t.endInteraction=()=>{const i=[];return i.push(e.protocol.setQuality(e.viewId,e.stillQuality,e.stillRatio)),e.camera?(i.push(t.stopAnimation()),e.isAnimating=!1,i.push(t.pushCamera())):i.push(t.render()),Promise.all(i)},t.setViewId=i=>e.viewId===i||!e.protocol?!1:(e.viewId&&e.protocol.unregisterView(e.viewId),e.viewId=i,e.viewId&&e.protocol.registerView(e.viewId).then(({viewId:o})=>{e.viewId=o}),!0),t.processMessage=i=>{if(i.id!=e.viewId)return;const o=new Blob([i.image],{type:e.mimeType});if(e.activeURL)for(e.urlToRevoke.push(e.activeURL),e.activeURL=null;e.urlToRevoke.length>60;){const c=e.urlToRevoke.shift();window.URL.revokeObjectURL(c)}e.activeURL=URL.createObjectURL(o);const s=Date.now(),u=Math.floor(1e4/(s-e.lastTime))/10;for(e.fps.push(u),e.lastTime=s,e.lastImageEvent={url:e.activeURL,fps:u,metadata:{size:i.size,id:i.id,memory:i.memsize,workTime:i.workTime}},e.decodeImage?r(e.lastImageEvent):t.invokeImageReady(e.lastImageEvent);e.fps.length>e.fpsWindowSize;)e.fps.shift()},t.delete=A.chain(()=>{for(e.unregisterViewStream(t),t.setViewId(null);e.urlToRevoke.length;)window.URL.revokeObjectURL(e.urlToRevoke.pop())},t.delete),n()}var __={cameraUpdateRate:30,decodeImage:!0,fpsWindowSize:250,interactiveQuality:80,interactiveRatio:1,isAnimating:!1,mimeType:"image/jpeg",size:[-1,-1],stillQuality:100,stillRatio:1,useCameraParameters:!1,viewId:null};function og(t,e,a={}){Object.assign(e,__,a),A.obj(t,e),A.event(t,e,"ImageReady"),A.get(t,e,["viewId","size","fps","lastImageEvent"]),A.setGet(t,e,["camera","cameraUpdateRate","decodeImage","fpsWindowSize","interactiveQuality","interactiveRatio","stillQuality","stillRatio","useCameraParameters"]),w_(t,e),Object.assign(t,e.sharedAPI)}var E_=A.newInstance(og,"vtkViewStream"),D_={newInstance:E_,extend:og};function O_(t,e){e.classHierarchy.push("vtkImageStream");function a(n){const r=n[0];if(!(!r||!r.image))for(let i=0;i{let r=!1;return e.serverAnimationFPS!==n&&(e.serverAnimationFPS=n,r=!0),e.protocol?(r&&t.modified(),e.protocol.setServerAnimationFPS(n)):Promise.resolve(!0)},t.connect=(n,r=T_)=>{e.connected||!n||!r||(e.protocol=r(n),e.protocol.subscribeToImageStream(a).promise.then(i=>{e.renderTopicSubscription=i,e.connected=!0}).catch(i=>{e.connected=!1,console.error(i)}))},t.disconnect=()=>{e.protocol&&e.connected&&e.renderTopicSubscription&&(e.protocol.unsubscribeToImageStream(e.renderTopicSubscription),e.renderTopicSubscription=null),e.connected=!1},t.registerViewStream=n=>{e.viewStreams.push(n)},t.unregisterViewStream=n=>{e.viewStreams=e.viewStreams.filter(r=>r!==n)},t.createViewStream=(n="-1",r=[400,400])=>{const{setServerAnimationFPS:i,getServerAnimationFPS:o,unregisterViewStream:s}=t,u=D_.newInstance({protocol:e.protocol,unregisterViewStream:s,sharedAPI:{setServerAnimationFPS:i,getServerAnimationFPS:o}});return u.setViewId(n),u.setSize(r[0],r[1]),t.registerViewStream(u),u},t.delete=A.chain(()=>{for(;e.viewStreams.length;)e.viewStreams.pop().delete();t.disconnect()},t.delete)}var b_={viewStreams:[],serverAnimationFPS:-1};function sg(t,e,a={}){Object.assign(e,b_,a),A.obj(t,e),A.get(t,e,["serverAnimationFPS","protocol"]),O_(t,e)}var M_=A.newInstance(sg,"vtkImageStream"),N_={newInstance:M_,extend:sg},{vtkErrorMacro:R_}=A;function L_(t,e){e.classHierarchy.push("vtkCanvasView");function a(){e._renderable&&(e.canvas.setAttribute("width",e.size[0]),e.canvas.setAttribute("height",e.size[1])),e.viewStream&&e.viewStream.setSize(e.size[0],e.size[1]),e.canvas.style.display=e.useOffScreen?"none":"block",e.el&&(e.el.style.cursor=e.cursorVisibility?e.cursor:"none")}t.onModified(a),t.setContainer=n=>{e.el&&e.el!==n&&(e.canvas.parentNode!==e.el&&R_("Error: canvas parent node does not match container"),e.el.removeChild(e.canvas),e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)),e.el!==n&&(e.el=n,e.el&&e.el.appendChild(e.canvas),e.useBackgroundImage&&e.el.appendChild(e.bgImage),t.modified())},t.setBackgroundImage=n=>{e.bgImage.src=n.src},t.setUseBackgroundImage=n=>{e.useBackgroundImage=n,e.useBackgroundImage&&e.el&&!e.el.contains(e.bgImage)?e.el.appendChild(e.bgImage):!e.useBackgroundImage&&e.el&&e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)},t.setViewStream=n=>e.viewStream===n?!1:(e.subscription&&(e.subscription.unsubscribe(),e.subscription=null),e.viewStream=n,e.viewStream&&(t.setUseBackgroundImage(!0),e.subscription=e.viewStream.onImageReady(r=>t.setBackgroundImage(r.image)),e.viewStream.setSize(e.size[0],e.size[1]),e.viewStream.invalidateCache(),e.viewStream.render(),t.modified()),!0),t.delete=A.chain(t.setViewStream,t.delete),e._renderable=t,e._renderers=[t],t.traverseAllPasses=()=>{},t.isInViewport=()=>!0,t.getInteractive=()=>!0}var F_={canvas:null,size:[300,300],cursorVisibility:!0,cursor:"pointer",useOffScreen:!1,useBackgroundImage:!1};function cg(t,e,a={}){Object.assign(e,F_,a),e.canvas||(e.canvas=document.createElement("canvas"),e.canvas.style.width="100%"),e.bgImage=new Image,e.bgImage.style.position="absolute",e.bgImage.style.left="0",e.bgImage.style.top="0",e.bgImage.style.width="100%",e.bgImage.style.height="100%",e.bgImage.style.zIndex="-1",A.obj(t,e,a),A.get(t,e,["useBackgroundImage","_renderable"]),A.setGet(t,e,["canvas","cursor","useOffScreen","interactor"]),A.setGetArray(t,e,["size"],2),A.getArray(t,e,["_renderers"]),A.moveToProtected(t,e,["renderable","renderers"]),L_(t,e)}var k_=A.newInstance(cg,"vtkCanvasView"),A_={newInstance:k_,extend:cg},rs=N_.newInstance(),V_=rs.connect,B_=rs.disconnect;function U_(t,e){e.classHierarchy.push("vtkRemoteView"),e.canvasView=A_.newInstance({canvas:e.canvasElement}),e.interactorStyle=S_.newInstance(),e.interactor=ns.newInstance(),e.interactor.setView(e.canvasView),e.interactor.initialize(),e.interactor.setInteractorStyle(e.interactorStyle),e.interactorStyle.onRemoteMouseEvent(n=>{e.session&&e.rpcMouseEvent&&e.session.call(e.rpcMouseEvent,[n])}),e.interactorStyle.onRemoteWheelEvent(n=>{e.session&&e.rpcWheelEvent&&e.session.call(e.rpcWheelEvent,[n])}),e.interactorStyle.onRemoteGestureEvent(n=>{e.session&&e.rpcGestureEvent&&e.session.call(e.rpcGestureEvent,[n])}),t.delete=A.chain(()=>{e.session=null,e.canvasView&&(e.canvasView.setViewStream(null),e.canvasView.delete()),e.interactor&&e.interactor.delete(),e.viewStream&&e.viewStream.delete()},t.delete),t.getCanvasElement=()=>e.canvasView.getCanvas(),t.setViewStream=n=>{e.viewStream=n,e.canvasView.setViewStream(e.viewStream),e.viewStream.setStillQuality(e.stillQuality),e.viewStream.setStillRatio(e.stillRatio),e.viewStream.setInteractiveQuality(e.interactiveQuality),e.viewStream.setInteractiveRatio(e.interactiveRatio),e.interactor.onStartAnimation(e.viewStream.startInteraction),e.interactor.onEndAnimation(e.viewStream.endInteraction),t.setViewId(n.getViewId())},t.setViewId=n=>{e.viewStream||t.setViewStream(rs.createViewStream(n)),e.viewStream.setViewId(n),e.interactorStyle.setRemoteEventAddOn({view:n}),t.modified()},t.setContainer=n=>{e.container&&e.interactor.unbindEvents(n),e.container=n,e.canvasView.setContainer(e.container),n&&(e.interactor.bindEvents(n),t.resize())},t.resize=()=>{if(e.container&&e.canvasView){const{width:n,height:r}=e.container.getBoundingClientRect();e.canvasView.setSize(n,r),t.render()}},t.render=()=>{e.viewStream&&e.viewStream.render()},t.resetCamera=()=>{e.viewStream&&e.viewStream.resetCamera()};const a={modified:t.modified};A.set(a,e,["interactiveQuality","interactiveRatio","stillQuality","stillRatio"]),t.setInteractiveQuality=n=>{const r=a.setInteractiveQuality(n);return e.viewStream&&r&&e.viewStream.setInteractiveQuality(e.interactiveQuality),r},t.setInteractiveRatio=n=>{const r=a.setInteractiveRatio(n);return e.viewStream&&r&&e.viewStream.setInteractiveRatio(e.interactiveRatio),r},t.setStillQuality=n=>{const r=a.setStillQuality(n);return e.viewStream&&r&&e.viewStream.setStillQuality(e.stillQuality),r},t.setStillRatio=n=>{const r=a.setStillRatio(n);return e.viewStream&&r&&e.viewStream.setStillRatio(e.stillRatio),r},e.viewStream&&t.setViewStream(e.viewStream)}var G_={viewId:"-1",interactiveQuality:60,interactiveRatio:1/window.devicePixelRatio,stillQuality:100,stillRatio:1,rpcMouseEvent:"viewport.mouse.interaction",rpcGestureEvent:null,rpcWheelEvent:null,canvasElement:null};function ug(t,e,a={}){Object.assign(e,G_,a),A.obj(t,e,a),A.get(t,e,["container","viewStream","canvasView","interactor","interactorStyle","interactiveQuality","interactiveRatio","stillQuality","stillRatio","canvasElement"]),A.setGet(t,e,["session","rpcMouseEvent","rpcGestureEvent","rpcWheelEvent"]),U_(t,e)}var I_=A.newInstance(ug,"vtkRemoteView"),P_={newInstance:I_,extend:ug,SHARED_IMAGE_STREAM:rs,connectImageStream:V_,disconnectImageStream:B_};function z_(t,e){e.classHierarchy.push("vtkCompositeMouseManipulator"),t.startInteraction=()=>{},t.endInteraction=()=>{},t.onButtonDown=(a,n,r)=>{},t.onButtonUp=a=>{},t.onMouseMove=(a,n,r)=>{},t.onStartScroll=(a,n,r)=>{},t.onScroll=(a,n,r)=>{},t.onEndScroll=a=>{},t.isDragEnabled=()=>e.dragEnabled,t.isScrollEnabled=()=>e.scrollEnabled}var W_={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1};function j_(t,e,a={}){Object.assign(e,W_,a),A.setGet(t,e,["button","shift","control","alt"]),A.set(t,e,["dragEnabled","scrollEnabled"]),z_(t,e)}var ha={extend:j_},$_=[-2,-1,-2,-1],H_={position:"absolute",zIndex:1,border:"2px solid #F44336",backgroundColor:"rgba(0, 0, 0, 0.1)",borderRadius:"4px",boxSizing:"border-box"};function K_(t,e){Object.keys(e).forEach(a=>{t.style[a]=e[a]})}function X_(t,e){e.classHierarchy.push("vtkMouseBoxSelectionManipulator");let a=null,n=null,r=null,i=null,o=null,s=!1;function u(){return!r||!i?$_:[Math.min(r.x,i.x),Math.max(r.x,i.x),Math.min(r.y,i.y),Math.max(r.y,i.y)]}function c(){if(!a||!n)return;const[p,l]=a.getSize(),{width:f,height:h}=n.getBoundingClientRect(),[v,m,x,y]=u();o.style.left=`${f*v/p}px`,o.style.top=`${h-h*y/l}px`,o.style.width=`${f*(m-v)/p}px`,o.style.height=`${h*(y-x)/l}px`}t.onButtonDown=(p,l,f)=>{r=f,e.renderSelection&&(a||(a=p.getView()),!n&&(a!=null&&a.getContainer)&&(n=a.getContainer()),n||(n=e.container),o||(o=document.createElement("div"),K_(o,e.selectionStyle)),c(),n&&!s&&(s=!0,n.appendChild(o)))},t.onMouseMove=(p,l,f)=>{r&&f&&(i=f,t.invokeBoxSelectInput({view:a,container:n,selection:u()}),e.renderSelection&&c())},t.onButtonUp=(p,l)=>{!r||!i&&!e.boxChangeOnClick||(i||(i=r),t.invokeBoxSelectChange({view:a,container:n,selection:u()}),s&&(o.parentElement.removeChild(o),s=!1),a=null,n=null,r=null,i=null)}}function q_(t){return{boxChangeOnClick:!1,renderSelection:!0,...t,selectionStyle:{...H_,...t.selectionStyle}}}function lg(t,e,a={}){Object.assign(e,q_(a)),lt(t,e),ha.extend(t,e,a),jr(t,e,"BoxSelectChange"),jr(t,e,"BoxSelectInput"),ht(t,e,["renderSelection","boxChangeOnClick","selectionStyle","container"]),X_(t,e)}var Y_=qe(lg,"vtkMouseBoxSelectionManipulator"),fg={newInstance:Y_,extend:lg},{vtkDebugMacro:Lc}=A,{States:J_}=Rc,pi={type:"StartInteractionEvent"},Zn={type:"InteractionEvent"},hi={type:"EndInteractionEvent"};function Fc(t,e,a,n,r,i){const o=t.getActiveCamera();let s=o.getFocalPoint();s=e.getInteractorStyle().computeWorldToDisplay(t,s[0],s[1],s[2]);const u=s[2],c=e.getInteractorStyle().computeDisplayToWorld(t,a,n,u),p=e.getInteractorStyle().computeDisplayToWorld(t,r,i,u),l=[p[0]-c[0],p[1]-c[1],p[2]-c[2]];s=o.getFocalPoint();const f=o.getPosition();o.setFocalPoint(l[0]+s[0],l[1]+s[1],l[2]+s[2]),o.setPosition(l[0]+f[0],l[1]+f[1],l[2]+f[2])}function Z_(t,e,a,n){const r=a.getActiveCamera();if(r.getParallelProjection()){const i=n.getView(),o=i.getViewportSize(a),s=a.getViewport(),u=i.getSize(),c=o[0],p=o[1],l=c/2,f=p/2,h=e.x-s[0]*u[0],v=e.y-s[1]*u[1];Fc(a,n,l,f,h,v),r.setParallelScale(r.getParallelScale()/t),Fc(a,n,h,v,l,f)}else{let i=r.getFocalPoint();const o=r.getViewPlaneNormal();i=n.getInteractorStyle().computeWorldToDisplay(a,i[0],i[1],i[2]);const s=n.getInteractorStyle().computeDisplayToWorld(a,e.x,e.y,i[2]);r.setFocalPoint(s[0],s[1],s[2]),r.dolly(t),a.resetCameraClippingRange();const u=r.getPosition();i=r.getFocalPoint();const c=[0,0,0];let p=o[0]*(i[0]-u[0])+o[1]*(i[1]-u[1])+o[2]*(i[2]-u[2]);p/=o[0]**2+o[1]**2+o[2]**2,c[0]=u[0]+o[0]*p,c[1]=u[1]+o[1]*p,c[2]=u[2]+o[2]*p,r.setFocalPoint(c[0],c[1],c[2]),a.resetCameraClippingRange()}}function Q_(t,e,a){if(Number.isNaN(a))return;const n=e.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/a):(n.dolly(a),e.resetCameraClippingRange()),t.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()}var eE={dollyToPosition:Z_,translateCamera:Fc,dollyByFactor:Q_};function tE(t,e){e.classHierarchy.push("vtkInteractorStyleManipulator"),e.currentVRManipulators=new Map,e.mouseManipulators=[],e.keyboardManipulators=[],e.vrManipulators=[],e.gestureManipulators=[],e.currentManipulator=null,e.currentWheelManipulator=null,e.centerOfRotation=[0,0,0],e.rotationFactor=1,t.removeAllManipulators=()=>{t.removeAllMouseManipulators(),t.removeAllKeyboardManipulators(),t.removeAllVRManipulators(),t.removeAllGestureManipulators()},t.removeAllMouseManipulators=()=>{e.mouseManipulators=[]},t.removeAllKeyboardManipulators=()=>{e.keyboardManipulators=[]},t.removeAllVRManipulators=()=>{e.vrManipulators=[]},t.removeAllGestureManipulators=()=>{e.gestureManipulators=[]};const a=(r,i)=>{const o=i.indexOf(r);return o===-1?!1:(i.splice(o,1),t.modified(),!0)};t.removeMouseManipulator=r=>a(r,e.mouseManipulators),t.removeKeyboardManipulator=r=>a(r,e.keyboardManipulators),t.removeVRManipulator=r=>a(r,e.vrManipulators),t.removeGestureManipulator=r=>a(r,e.gestureManipulators);const n=(r,i)=>i.indexOf(r)!==-1?!1:(i.push(r),t.modified(),!0);t.addMouseManipulator=r=>n(r,e.mouseManipulators),t.addKeyboardManipulator=r=>n(r,e.keyboardManipulators),t.addVRManipulator=r=>n(r,e.vrManipulators),t.addGestureManipulator=r=>n(r,e.gestureManipulators),t.getNumberOfMouseManipulators=()=>e.mouseManipulators.length,t.getNumberOfKeyboardManipulators=()=>e.keyboardManipulators.length,t.getNumberOfVRManipulators=()=>e.vrManipulators.length,t.getNumberOfGestureManipulators=()=>e.gestureManipulators.length,t.resetCurrentManipulator=()=>{e.currentManipulator=null,e.currentWheelManipulator=null},t.handleLeftButtonPress=r=>{e.previousPosition=r.position,t.onButtonDown(Ar.LeftButton,r)},t.handleMiddleButtonPress=r=>{e.previousPosition=r.position,t.onButtonDown(Ar.MiddleButton,r)},t.handleRightButtonPress=r=>{e.previousPosition=r.position,t.onButtonDown(Ar.RightButton,r)},t.handleButton3D=r=>{if(!r)return;const i=t.findVRManipulator(r.device,r.input,r.pressed);i?(e.currentVRManipulators.set(r.device,i),i.onButton3D(t,e.getRenderer(r),e.state,r),r.pressed?t.startCameraPose():(e.currentVRManipulators.delete(r.device),e.currentVRManipulators.size===0&&t.endCameraPose())):Lc("No manipulator found")},t.handleMove3D=r=>{const i=e.currentVRManipulators.get(r.device);i&&e.state===J_.IS_CAMERA_POSE&&i.onMove3D(t,e.getRenderer(r),e.state,r)},t.onButtonDown=(r,i)=>{e.currentManipulator||(e.currentManipulator=t.findMouseManipulator(r,i.shiftKey,i.controlKey,i.altKey),e.currentManipulator?(e.currentManipulator.setCenter&&e.currentManipulator.setCenter(e.centerOfRotation),e.currentManipulator.setRotationFactor&&e.currentManipulator.setRotationFactor(e.rotationFactor),e.currentManipulator.startInteraction(),e.currentManipulator.onButtonDown(e._interactor,e.getRenderer(i),i.position),e._interactor.requestAnimation(t.onButtonDown),t.invokeStartInteractionEvent(pi)):Lc("No manipulator found"))},t.findMouseManipulator=(r,i,o,s)=>{let u=null,c=e.mouseManipulators.length;for(;c--;){const p=e.mouseManipulators[c];p&&p.getButton()===r&&p.getShift()===i&&p.getControl()===o&&p.getAlt()===s&&p.isDragEnabled()&&(u=p)}return u},t.findVRManipulator=(r,i)=>{let o=null,s=e.vrManipulators.length;for(;s--;){const u=e.vrManipulators[s];u&&u.getDevice()===r&&u.getInput()===i&&(o=u)}return o},t.handleLeftButtonRelease=()=>{t.onButtonUp(Ar.LeftButton)},t.handleMiddleButtonRelease=()=>{t.onButtonUp(Ar.MiddleButton)},t.handleRightButtonRelease=()=>{t.onButtonUp(Ar.RightButton)},t.onButtonUp=r=>{e.currentManipulator&&e.currentManipulator.getButton&&e.currentManipulator.getButton()===r&&(e.currentManipulator.onButtonUp(e._interactor),e.currentManipulator.endInteraction(),e._interactor.isPointerLocked()||(e.currentManipulator=null),e._interactor.cancelAnimation(t.onButtonDown),t.invokeEndInteractionEvent(hi))},t.handleEndPointerLock=()=>{e.currentManipulator=null},t.handleStartMouseWheel=r=>{if(e.currentWheelManipulator)return;let i=null,o=e.mouseManipulators.length;for(;o--;){const s=e.mouseManipulators[o];s&&s.isScrollEnabled()&&s.getShift()===r.shiftKey&&s.getControl()===r.controlKey&&s.getAlt()===r.altKey&&(i=s)}i?(e.currentWheelManipulator=i,e.currentWheelManipulator.onStartScroll(e._interactor,e.getRenderer(r),r.spinY),e.currentWheelManipulator.startInteraction(),e._interactor.requestAnimation(t.handleStartMouseWheel),t.invokeStartInteractionEvent(pi)):Lc("No manipulator found")},t.handleEndMouseWheel=()=>{e.currentWheelManipulator&&e.currentWheelManipulator.onEndScroll&&(e.currentWheelManipulator.onEndScroll(e._interactor),e.currentWheelManipulator.endInteraction(),e.currentWheelManipulator=null,e._interactor.cancelAnimation(t.handleStartMouseWheel),t.invokeEndInteractionEvent(hi))},t.handleMouseWheel=r=>{e.currentWheelManipulator&&e.currentWheelManipulator.onScroll&&(e.currentWheelManipulator.onScroll(e._interactor,e.getRenderer(r),r.spinY,e.cachedMousePosition),t.invokeInteractionEvent(Zn))},t.handleMouseMove=r=>{e.cachedMousePosition=r.position,e.currentManipulator&&e.currentManipulator.onMouseMove&&(e.currentManipulator.onMouseMove(e._interactor,e.getRenderer(r),r.position),t.invokeInteractionEvent(Zn))},t.handleKeyPress=r=>{e.keyboardManipulators.filter(i=>i.onKeyPress).forEach(i=>{i.onKeyPress(e._interactor,e.getRenderer(r),r.key),t.invokeInteractionEvent(Zn)})},t.handleKeyDown=r=>{e.keyboardManipulators.filter(i=>i.onKeyDown).forEach(i=>{i.onKeyDown(e._interactor,e.getRenderer(r),r.key),t.invokeInteractionEvent(Zn)})},t.handleKeyUp=r=>{e.keyboardManipulators.filter(i=>i.onKeyUp).forEach(i=>{i.onKeyUp(e._interactor,e.getRenderer(r),r.key),t.invokeInteractionEvent(Zn)})},t.handleStartPinch=r=>{t.startDolly();let i=e.gestureManipulators.length;for(;i--;){const o=e.gestureManipulators[i];o&&o.isPinchEnabled()&&(o.onStartPinch(e._interactor,r.scale),o.startInteraction())}e._interactor.requestAnimation(t.handleStartPinch),t.invokeStartInteractionEvent(pi)},t.handleEndPinch=()=>{t.endDolly();let r=e.gestureManipulators.length;for(;r--;){const i=e.gestureManipulators[r];i&&i.isPinchEnabled()&&(i.onEndPinch(e._interactor),i.endInteraction())}e._interactor.cancelAnimation(t.handleStartPinch),t.invokeEndInteractionEvent(hi)},t.handleStartRotate=r=>{t.startRotate();let i=e.gestureManipulators.length;for(;i--;){const o=e.gestureManipulators[i];o&&o.isRotateEnabled()&&(o.onStartRotate(e._interactor,r.rotation),o.startInteraction())}e._interactor.requestAnimation(t.handleStartRotate),t.invokeStartInteractionEvent(pi)},t.handleEndRotate=()=>{t.endRotate();let r=e.gestureManipulators.length;for(;r--;){const i=e.gestureManipulators[r];i&&i.isRotateEnabled()&&(i.onEndRotate(e._interactor),i.endInteraction())}e._interactor.cancelAnimation(t.handleStartRotate),t.invokeEndInteractionEvent(hi)},t.handleStartPan=r=>{t.startPan();let i=e.gestureManipulators.length;for(;i--;){const o=e.gestureManipulators[i];o&&o.isPanEnabled()&&(o.onStartPan(e._interactor,r.translation),o.startInteraction())}e._interactor.requestAnimation(t.handleStartPan),t.invokeStartInteractionEvent(pi)},t.handleEndPan=()=>{t.endPan();let r=e.gestureManipulators.length;for(;r--;){const i=e.gestureManipulators[r];i&&i.isPanEnabled()&&(i.onEndPan(e._interactor),i.endInteraction())}e._interactor.cancelAnimation(t.handleStartPan),t.invokeEndInteractionEvent(hi)},t.handlePinch=r=>{let i=e.gestureManipulators.length,o=0;for(;i--;){const s=e.gestureManipulators[i];s&&s.isPinchEnabled()&&(s.onPinch(e._interactor,e.getRenderer(r),r.scale),o++)}o&&t.invokeInteractionEvent(Zn)},t.handlePan=r=>{const i=e.getRenderer(r);let o=e.gestureManipulators.length,s=0;for(;o--;){const u=e.gestureManipulators[o];u&&u.isPanEnabled()&&(u.onPan(e._interactor,i,r.translation),s++)}s&&t.invokeInteractionEvent(Zn)},t.handleRotate=r=>{let i=e.gestureManipulators.length,o=0;for(;i--;){const s=e.gestureManipulators[i];s&&s.isRotateEnabled()&&(s.onRotate(e._interactor,e.getRenderer(r),r.rotation),o++)}o&&t.invokeInteractionEvent(Zn)}}var nE=t=>({cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1,...t});function pg(t,e,a={}){Object.assign(e,nE(a)),Rc.extend(t,e,a),A.setGet(t,e,["rotationFactor"]),A.get(t,e,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),A.setGetArray(t,e,["centerOfRotation"],3),tE(t,e)}var rE=A.newInstance(pg,"vtkInteractorStyleManipulator"),Br={newInstance:rE,extend:pg,...eE};const hg={props:{viewId:{type:String,default:"-1"},wsClient:{type:Object},interactiveRatio:{type:[Number,String]},interactiveQuality:{type:[Number,String]},stillRatio:{type:[Number,String]},stillQuality:{type:[Number,String]},enablePicking:{type:Boolean,default:!1},interactorEvents:{type:Array,default:()=>["EndAnimation"]},boxSelection:{type:Boolean,default:!1},visible:{type:Boolean,default:!1},pickingModes:{type:Array,default:()=>[]}},emits:["onImageCapture","BoxSelection","select","hover","click","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],setup(t,{emit:e}){const a=se.ref(!1),n=se.ref(null),r=se.inject("trame"),i=t.wsClient||(r==null?void 0:r.client);let o=null;if(!i)throw new Error("VtkRemoteView can not be created without a wsClient");const s=i.getImageStream().createViewStream(t.viewId);s.get("protocol").protocol.setQuality(t.viewId,5,.1);const u=P_.newInstance({rpcWheelEvent:"viewport.mouse.zoom.wheel",viewStream:s});t.interactiveRatio&&u.setInteractiveRatio(Number(t.interactiveRatio)),t.interactiveQuality&&u.setInteractiveQuality(Number(t.interactiveQuality)),t.stillRatio&&u.setStillRatio(Number(t.stillRatio)),t.stillQuality&&u.setStillQuality(Number(t.stillQuality));const c=u.render,p=u.resetCamera,l=u.setInteractiveQuality,f=u.setInteractiveRatio,h=u.setStillQuality,v=u.setStillRatio,m=u.getInteractiveQuality,x=u.getInteractiveRatio,y=u.getStillQuality,d=u.getStillRatio,g=u.getInteractor(),C=[];t.interactorEvents.forEach(b=>{const R=`on${b}`;C.push(g[R](N=>e(b,N)))});const S=Br.newInstance({enabled:t.boxSelection}),T=fg.newInstance({button:1});S.addMouseManipulator(T),C.push(T.onBoxSelectChange(({container:b,selection:R})=>{if(b){const{width:N,height:L}=b.getBoundingClientRect(),B={selection:R,size:[N,L],mode:"remote"};e("BoxSelection",B),t.pickingModes.includes("select")&&e("select",{...B,action:"select"})}})),S.setInteractor(g);function w(){const b=u.getCanvasView(),[R,N]=b.getSize();b.setSize(R+2,N+2),se.nextTick(u.resize)}const _=async()=>{const b=u.getCanvasView().get("bgImage").bgImage.src,N=await(await fetch(b)).blob();return e("onImageCapture",N),N};se.onMounted(async()=>{const b=se.unref(n);u.getCanvasView().setUseBackgroundImage(0),u.setContainer(b),T.setContainer(b),T.setBoxChangeOnClick(t.enablePicking);const R=i.getConnection().getSession();u.setSession(R),u.setViewId(t.viewId),await se.nextTick();const{width:N,height:L}=b.getBoundingClientRect(),B=N<10||L<10?10:0;u.getCanvasView().setSize(Math.round(N+B),Math.round(L+B)),await new Promise(P=>{const F=s.onImageReady(({image:k,metadata:G})=>{const[W,H]=G.size;if(W!==k.width||H!==k.height){s.render();return}const X=s.getStillRatio()*Math.round(B+N),Y=s.getStillRatio()*Math.round(B+L);W===X&&H===Y?(F.unsubscribe(),u.getCanvasView().setBackgroundImage(k),P()):s.render()});s.endInteraction()}),u.getCanvasView().setUseBackgroundImage(1),a.value=!0,window.ResizeObserver?(o=new ResizeObserver(u.resize),o.observe(b)):window.addEventListener("resize",u.resize)}),se.onBeforeUnmount(()=>{for(o?(o.disconnect(),o=null):window.removeEventListener("resize",u.resize);C.length;)C.pop().unsubscribe();S.setEnabled(!1),S.delete(),T.delete(),u.delete()}),se.watch(()=>t.viewId,b=>{a.value&&(u.setViewId(se.unref(b)),u.resize())}),se.watch(()=>t.visible,b=>{se.unref(b)&&w()}),se.watch(()=>t.enablePicking,b=>{u.getInteractorStyle().setSendMouseMove(b),T.setBoxChangeOnClick(b)}),se.watch(()=>t.interactiveRatio,b=>{u.setInteractiveRatio(b)}),se.watch(()=>t.interactiveQuality,b=>{u.setInteractiveQuality(b)}),se.watch(()=>t.stillRatio,b=>{u.setStillRatio(b)}),se.watch(()=>t.stillQuality,b=>{u.setStillQuality(b)}),se.watch(()=>[t.pickingModes.includes("select"),t.boxSelection],([b,R])=>{S.setEnabled(b||R),u.getInteractorStyle().setEnabled(!b||t.enablePicking)});function E(b){const R=n.value;if(!R)return;const N=R.getBoundingClientRect(),[L,B]=u.getCanvasView().getSize(),P=L/N.width,F=B/N.height;return{position:{x:P*(b.clientX-N.left),y:F*(N.height-b.clientY+N.top),z:0},size:[L,B],scale:[P,F]}}function D(b){t.pickingModes.includes("click")&&e("click",{mode:"remote",action:"click",...E(b)})}function O(b){t.pickingModes.includes("hover")&&e("hover",{mode:"remote",action:"hover",...E(b)})}return{connected:a,vtkContainer:n,onClick:D,onMouseMove:O,render:c,resetCamera:p,resize:w,setInteractiveQuality:l,setInteractiveRatio:f,setStillQuality:h,setStillRatio:v,getInteractiveQuality:m,getInteractiveRatio:x,getStillQuality:y,getStillRatio:d,captureImage:_}},template:`
- `},P_="WebGL",Jo=Object.create(null);function eg(t,e){Jo[t]=e}function z_(){return Object.keys(Jo)}function tg(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Jo[t]&&Jo[t](e)}function j_(t,e){e.classHierarchy.push("vtkRenderWindow"),t.addRenderer=a=>{t.hasRenderer(a)||(a.setRenderWindow(t),e.renderers.push(a),t.modified())},t.removeRenderer=a=>{e.renderers=e.renderers.filter(n=>n!==a),t.modified()},t.hasRenderer=a=>e.renderers.indexOf(a)!==-1,t.newAPISpecificView=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return tg(a||e.defaultViewAPI,n)},t.addView=a=>{t.hasView(a)||(a.setRenderable(t),e._views.push(a),t.modified())},t.removeView=a=>{e._views=e._views.filter(n=>n!==a),t.modified()},t.hasView=a=>e._views.indexOf(a)!==-1,t.preRender=()=>{e.renderers.forEach(a=>{a.isActiveCameraCreated()||a.resetCamera()})},t.render=()=>{t.preRender(),e.interactor?e.interactor.render():e._views.forEach(a=>a.traverseAllPasses())},t.getStatistics=()=>{const a={propCount:0,invisiblePropCount:0,gpuMemoryMB:0};return e._views.forEach(n=>{n.getGraphicsMemoryInfo&&(a.gpuMemoryMB+=n.getGraphicsMemoryInfo()/1e6)}),e.renderers.forEach(n=>{const r=n.getViewProps(),i=e._views[0].getViewNodeFor(n);r.forEach(o=>{if(o.getVisibility()){a.propCount+=1;const s=o.getMapper&&o.getMapper();if(s&&s.getPrimitiveCount){const c=i.getViewNodeFor(s);if(c){c.getAllocatedGPUMemoryInBytes&&(a.gpuMemoryMB+=c.getAllocatedGPUMemoryInBytes()/1e6);const l=s.getPrimitiveCount();Object.keys(l).forEach(p=>{a[p]||(a[p]=0),a[p]+=l[p]})}}}else a.invisiblePropCount+=1})}),a.str=Object.keys(a).map(n=>`${n}: ${a[n]}`).join(` -`),a},t.captureImages=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"image/png",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V.setImmediate(t.render),e._views.map(r=>r.captureNextImage?r.captureNextImage(a,n):void 0).filter(r=>!!r)},t.addRenderWindow=a=>e.childRenderWindows.includes(a)?!1:(e.childRenderWindows.push(a),t.modified(),!0),t.removeRenderWindow=a=>{const n=e.childRenderWindows.findIndex(r=>r===a);return n<0?!1:(e.childRenderWindows.splice(n,1),t.modified(),!0)}}const W_={defaultViewAPI:P_,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1,childRenderWindows:[]};function ng(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,W_,a),V.obj(t,e),V.setGet(t,e,["interactor","numberOfLayers","_views","defaultViewAPI"]),V.get(t,e,["neverRendered"]),V.getArray(t,e,["renderers","childRenderWindows"]),V.moveToProtected(t,e,["views"]),V.event(t,e,"completion"),j_(t,e)}var Ec={newInstance:V.newInstance(ng,"vtkRenderWindow"),extend:ng,registerViewConstructor:eg,listViewAPIs:z_,newAPISpecificView:tg};const{vtkDebugMacro:Zo}=V;function $_(t,e){e.classHierarchy.push("vtkCamera");const a=new Float64Array(3),n=new Float64Array([0,0,-1]),r=new Float64Array([0,1,0]),i=Te(new Float64Array(16)),o=Te(new Float64Array(16)),s=new Float64Array(3),c=new Float64Array(3),l=new Float64Array(3),p=Te(new Float64Array(16)),u=Te(new Float64Array(16)),f=new Float64Array(3),h=new Float64Array(3);function d(){e.viewPlaneNormal[0]=-e.directionOfProjection[0],e.viewPlaneNormal[1]=-e.directionOfProjection[1],e.viewPlaneNormal[2]=-e.directionOfProjection[2]}t.orthogonalizeViewUp=()=>{const v=t.getViewMatrix();e.viewUp[0]=v[4],e.viewUp[1]=v[5],e.viewUp[2]=v[6],t.modified()},t.setPosition=(v,m,x)=>{v===e.position[0]&&m===e.position[1]&&x===e.position[2]||(e.position[0]=v,e.position[1]=m,e.position[2]=x,t.computeDistance(),t.modified())},t.setFocalPoint=(v,m,x)=>{v===e.focalPoint[0]&&m===e.focalPoint[1]&&x===e.focalPoint[2]||(e.focalPoint[0]=v,e.focalPoint[1]=m,e.focalPoint[2]=x,t.computeDistance(),t.modified())},t.setDistance=v=>{if(e.distance===v)return;e.distance=v,e.distance<1e-20&&(e.distance=1e-20,Zo("Distance is set to minimum."));const m=e.directionOfProjection;e.focalPoint[0]=e.position[0]+m[0]*e.distance,e.focalPoint[1]=e.position[1]+m[1]*e.distance,e.focalPoint[2]=e.position[2]+m[2]*e.distance,t.modified()},t.computeDistance=()=>{const v=e.focalPoint[0]-e.position[0],m=e.focalPoint[1]-e.position[1],x=e.focalPoint[2]-e.position[2];if(e.distance=Math.sqrt(v*v+m*m+x*x),e.distance<1e-20){e.distance=1e-20,Zo("Distance is set to minimum.");const y=e.directionOfProjection;e.focalPoint[0]=e.position[0]+y[0]*e.distance,e.focalPoint[1]=e.position[1]+y[1]*e.distance,e.focalPoint[2]=e.position[2]+y[2]*e.distance}e.directionOfProjection[0]=v/e.distance,e.directionOfProjection[1]=m/e.distance,e.directionOfProjection[2]=x/e.distance,d()},t.dolly=v=>{if(v<=0)return;const m=e.distance/v;t.setPosition(e.focalPoint[0]-m*e.directionOfProjection[0],e.focalPoint[1]-m*e.directionOfProjection[1],e.focalPoint[2]-m*e.directionOfProjection[2])},t.roll=v=>{const m=e.position,x=e.focalPoint,y=e.viewUp,g=new Float64Array([y[0],y[1],y[2],0]);Te(p);const C=new Float64Array([x[0]-m[0],x[1]-m[1],x[2]-m[2]]);mt(p,p,Qe(v),C),er(g,g,p),e.viewUp[0]=g[0],e.viewUp[1]=g[1],e.viewUp[2]=g[2],t.modified()},t.azimuth=v=>{const m=e.focalPoint;Te(u),Ye(u,u,m),mt(u,u,Qe(v),e.viewUp),Ye(u,u,[-m[0],-m[1],-m[2]]),_e(f,e.position,u),t.setPosition(f[0],f[1],f[2])},t.yaw=v=>{const m=e.position;Te(u),Ye(u,u,m),mt(u,u,Qe(v),e.viewUp),Ye(u,u,[-m[0],-m[1],-m[2]]),_e(h,e.focalPoint,u),t.setFocalPoint(h[0],h[1],h[2])},t.elevation=v=>{const m=e.focalPoint,x=t.getViewMatrix(),y=[-x[0],-x[1],-x[2]];Te(u),Ye(u,u,m),mt(u,u,Qe(v),y),Ye(u,u,[-m[0],-m[1],-m[2]]),_e(f,e.position,u),t.setPosition(f[0],f[1],f[2])},t.pitch=v=>{const m=e.position,x=t.getViewMatrix(),y=[x[0],x[1],x[2]];Te(u),Ye(u,u,m),mt(u,u,Qe(v),y),Ye(u,u,[-m[0],-m[1],-m[2]]),_e(h,e.focalPoint,u),t.setFocalPoint(...h)},t.zoom=v=>{v<=0||(e.parallelProjection?e.parallelScale/=v:e.viewAngle/=v,t.modified())},t.translate=(v,m,x)=>{const y=[v,m,x];ur(e.position,y,e.position),ur(e.focalPoint,y,e.focalPoint),t.computeDistance(),t.modified()},t.applyTransform=v=>{const m=[...e.viewUp,1],x=[],y=[],g=[];m[0]+=e.position[0],m[1]+=e.position[1],m[2]+=e.position[2],er(x,[...e.position,1],v),er(y,[...e.focalPoint,1],v),er(g,m,v),g[0]-=x[0],g[1]-=x[1],g[2]-=x[2],t.setPosition(...x.slice(0,3)),t.setFocalPoint(...y.slice(0,3)),t.setViewUp(...g.slice(0,3))},t.getThickness=()=>e.clippingRange[1]-e.clippingRange[0],t.setThickness=v=>{let m=v;m<1e-20&&(m=1e-20,Zo("Thickness is set to minimum.")),t.setClippingRange(e.clippingRange[0],e.clippingRange[0]+m)},t.setThicknessFromFocalPoint=v=>{let m=v;m<1e-20&&(m=1e-20,Zo("Thickness is set to minimum.")),t.setClippingRange(e.distance-m/2,e.distance+m/2)},t.setRoll=v=>{},t.getRoll=()=>{},t.setObliqueAngles=(v,m)=>{},t.getOrientation=()=>{},t.getOrientationWXYZ=()=>{},t.getFrustumPlanes=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Float64Array(24);const x=[[1,0,0,1],[-1,0,0,1],[0,1,0,1],[0,-1,0,1],[0,0,1,1],[0,0,-1,1]],y=t.getCompositeProjectionMatrix(v,-1,1);for(let g=0;g<6;g++)er(x[g],x[g],y),$y(x[g]),m[4*g+0]=x[g][0],m[4*g+1]=x[g][1],m[4*g+2]=x[g][2],m[4*g+3]=x[g][3];return m},t.getCameraLightTransformMatrix=v=>(gt(v,e.cameraLightTransform),v),t.computeCameraLightTransform=()=>{gt(i,t.getViewMatrix()),Et(i,i),yi(o,[e.distance,e.distance,e.distance]),Ee(i,i,o),Te(e.cameraLightTransform),Ye(e.cameraLightTransform,i,[0,0,-1])},t.deepCopy=v=>{},t.physicalOrientationToWorldDirection=v=>{const m=pu(v[0],v[1],v[2],v[3]),x=Bn(),y=pu(0,0,1,0);return ps(x,m),Oi(y,m,y),Oi(y,y,x),[y[0],y[1],y[2]]},t.getPhysicalToWorldMatrix=v=>{t.getWorldToPhysicalMatrix(v),Et(v,v)},t.getWorldToPhysicalMatrix=v=>{Te(v);const m=[3];et(e.physicalViewNorth,e.physicalViewUp,m),v[0]=m[0],v[1]=m[1],v[2]=m[2],v[4]=e.physicalViewUp[0],v[5]=e.physicalViewUp[1],v[6]=e.physicalViewUp[2],v[8]=-e.physicalViewNorth[0],v[9]=-e.physicalViewNorth[1],v[10]=-e.physicalViewNorth[2],We(v,v),on(s,1/e.physicalScale,1/e.physicalScale,1/e.physicalScale),An(v,v,s),Ye(v,v,e.physicalTranslation)},t.computeViewParametersFromViewMatrix=v=>{Et(i,v),_e(s,a,i),t.computeDistance();const m=e.distance;t.setPosition(s[0],s[1],s[2]),_e(c,n,i),sn(c,c,s),cn(c,c),t.setDirectionOfProjection(c[0],c[1],c[2]),_e(l,r,i),sn(l,l,s),cn(l,l),t.setViewUp(l[0],l[1],l[2]),t.setDistance(m)},t.computeViewParametersFromPhysicalMatrix=v=>{t.getWorldToPhysicalMatrix(i),Ee(i,v,i),t.computeViewParametersFromViewMatrix(i)},t.setModelTransformMatrix=v=>{e.modelTransformMatrix=v},t.getModelTransformMatrix=()=>e.modelTransformMatrix,t.setViewMatrix=v=>{e.viewMatrix=v,e.viewMatrix&&(gt(i,e.viewMatrix),t.computeViewParametersFromViewMatrix(i),We(e.viewMatrix,e.viewMatrix))},t.getViewMatrix=()=>{if(e.viewMatrix)return e.modelTransformMatrix?(Ee(i,e.viewMatrix,e.modelTransformMatrix),i):e.viewMatrix;ru(i,e.position,e.focalPoint,e.viewUp),We(i,i);const v=new Float64Array(16);return e.modelTransformMatrix?Ee(v,i,e.modelTransformMatrix):gt(v,i),v},t.setProjectionMatrix=v=>{e.projectionMatrix=v},t.getProjectionMatrix=(v,m,x)=>{const y=new Float64Array(16);if(Te(y),e.projectionMatrix){const S=1/e.physicalScale;return on(s,S,S,S),gt(y,e.projectionMatrix),An(y,y,s),We(y,y),y}Te(i);const g=e.clippingRange[1]-e.clippingRange[0],C=[e.clippingRange[0]+(m+1)*g/2,e.clippingRange[0]+(x+1)*g/2];if(e.parallelProjection){const S=e.parallelScale*v,T=e.parallelScale,w=(e.windowCenter[0]-1)*S,_=(e.windowCenter[0]+1)*S,E=(e.windowCenter[1]-1)*T,D=(e.windowCenter[1]+1)*T;nu(i,w,_,E,D,C[0],C[1]),We(i,i)}else{if(e.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");{const S=Math.tan(Qe(e.viewAngle)/2);let T,w;e.useHorizontalViewAngle===!0?(T=e.clippingRange[0]*S,w=e.clippingRange[0]*S/v):(T=e.clippingRange[0]*S*v,w=e.clippingRange[0]*S);const _=(e.windowCenter[0]-1)*T,E=(e.windowCenter[0]+1)*T,D=(e.windowCenter[1]-1)*w,O=(e.windowCenter[1]+1)*w,M=C[0],N=C[1];i[0]=2*M/(E-_),i[5]=2*M/(O-D),i[2]=(_+E)/(E-_),i[6]=(D+O)/(O-D),i[10]=-(M+N)/(N-M),i[14]=-1,i[11]=-2*M*N/(N-M),i[15]=0}}return gt(y,i),y},t.getCompositeProjectionMatrix=(v,m,x)=>{const y=t.getViewMatrix(),g=t.getProjectionMatrix(v,m,x);return Ee(g,y,g),g},t.setDirectionOfProjection=(v,m,x)=>{if(e.directionOfProjection[0]===v&&e.directionOfProjection[1]===m&&e.directionOfProjection[2]===x)return;e.directionOfProjection[0]=v,e.directionOfProjection[1]=m,e.directionOfProjection[2]=x;const y=e.directionOfProjection;e.focalPoint[0]=e.position[0]+y[0]*e.distance,e.focalPoint[1]=e.position[1]+y[1]*e.distance,e.focalPoint[2]=e.position[2]+y[2]*e.distance,d()},t.setDeviceAngles=(v,m,x,y)=>{const g=[3];et(e.physicalViewNorth,e.physicalViewUp,g);const C=Te(new Float64Array(16));mt(C,C,Qe(v),e.physicalViewUp),mt(C,C,Qe(m),g),mt(C,C,Qe(x),e.physicalViewNorth),mt(C,C,Qe(-y),e.physicalViewUp);const S=new Float64Array([-e.physicalViewUp[0],-e.physicalViewUp[1],-e.physicalViewUp[2]]),T=new Float64Array(e.physicalViewNorth);_e(S,S,C),_e(T,T,C),t.setDirectionOfProjection(S[0],S[1],S[2]),t.setViewUp(T[0],T[1],T[2]),t.modified()},t.setOrientationWXYZ=(v,m,x,y)=>{const g=Te(new Float64Array(16));if(v!==0&&(m!==0||x!==0||y!==0)){const T=Qe(v),w=Bn();Di(w,[m,x,y],T),Gr(g,w)}const C=new Float64Array(3);_e(C,[0,0,-1],g);const S=new Float64Array(3);_e(S,[0,1,0],g),t.setDirectionOfProjection(...C),t.setViewUp(...S),t.modified()},t.computeClippingRange=v=>{let m=null,x=null;m=e.viewPlaneNormal,x=e.position;const y=-m[0],g=-m[1],C=-m[2],S=-(y*x[0]+g*x[1]+C*x[2]),T=[y*v[0]+g*v[2]+C*v[4]+S,1e-18];for(let w=0;w<2;w++)for(let _=0;_<2;_++)for(let E=0;E<2;E++){const D=y*v[E]+g*v[2+_]+C*v[4+w]+S;T[0]=DT[1]?D:T[1]}return T}}const H_={position:[0,0,1],focalPoint:[0,0,0],viewUp:[0,1,0],directionOfProjection:[0,0,-1],parallelProjection:!1,useHorizontalViewAngle:!1,viewAngle:30,parallelScale:1,clippingRange:[.01,1000.01],windowCenter:[0,0],viewPlaneNormal:[0,0,1],useOffAxisProjection:!1,screenBottomLeft:[-.5,-.5,-.5],screenBottomRight:[.5,-.5,-.5],screenTopRight:[.5,.5,-.5],freezeFocalPoint:!1,projectionMatrix:null,viewMatrix:null,modelTransformMatrix:null,cameraLightTransform:Ur(),physicalTranslation:[0,0,0],physicalScale:1,physicalViewUp:[0,1,0],physicalViewNorth:[0,0,-1]};function rg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,H_,a),V.obj(t,e),V.get(t,e,["distance"]),V.setGet(t,e,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),V.getArray(t,e,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),V.setGetArray(t,e,["clippingRange","windowCenter"],2),V.setGetArray(t,e,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),$_(t,e)}var Dc={newInstance:V.newInstance(rg,"vtkCamera"),extend:rg};const K_=["HeadLight","CameraLight","SceneLight"];function X_(t,e){e.classHierarchy.push("vtkLight");const a=new Float64Array(3);t.getTransformedPosition=()=>(e.transformMatrix?_e(a,e.position,e.transformMatrix):on(a,e.position[0],e.position[1],e.position[2]),a),t.getTransformedFocalPoint=()=>(e.transformMatrix?_e(a,e.focalPoint,e.transformMatrix):on(a,e.focalPoint[0],e.focalPoint[1],e.focalPoint[2]),a),t.getDirection=()=>(e.directionMTime{const r=new Float64Array(3);lu(r,e.position,n),e.focalPoint=r},t.setDirectionAngle=(n,r)=>{const i=Qe(n),o=Qe(r);t.setPosition(Math.cos(i)*Math.sin(o),Math.sin(i),Math.cos(i)*Math.cos(o)),t.setFocalPoint(0,0,0),t.setPositional(0)},t.setLightTypeToHeadLight=()=>{t.setLightType("HeadLight")},t.setLightTypeToCameraLight=()=>{t.setLightType("CameraLight")},t.setLightTypeToSceneLight=()=>{t.setTransformMatrix(null),t.setLightType("SceneLight")},t.lightTypeIsHeadLight=()=>e.lightType==="HeadLight",t.lightTypeIsSceneLight=()=>e.lightType==="SceneLight",t.lightTypeIsCameraLight=()=>e.lightType==="CameraLight"}const q_={switch:!0,intensity:1,color:[1,1,1],position:[0,0,1],focalPoint:[0,0,0],positional:!1,exponent:1,coneAngle:30,coneFalloff:5,attenuationValues:[1,0,0],transformMatrix:null,lightType:"SceneLight",shadowAttenuation:1,direction:[0,0,0],directionMTime:0};function ag(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,q_,a),V.obj(t,e),V.setGet(t,e,["intensity","switch","positional","exponent","coneAngle","coneFalloff","transformMatrix","lightType","shadowAttenuation","attenuationValues"]),V.setGetArray(t,e,["color","position","focalPoint","attenuationValues"],3),X_(t,e)}var ig={newInstance:V.newInstance(ag,"vtkLight"),extend:ag,LIGHT_TYPES:K_};const{vtkErrorMacro:Qo}=V;function Y_(t){return()=>Qo(`vtkViewport::${t} - NOT IMPLEMENTED`)}function J_(t,e){e.classHierarchy.push("vtkViewport"),t.getViewProps=()=>e.props,t.hasViewProp=n=>e.props.includes(n),t.addViewProp=n=>{n&&!t.hasViewProp(n)&&e.props.push(n)},t.removeViewProp=n=>{const r=e.props.filter(i=>i!==n);e.props.length!==r.length&&(e.props=r)},t.removeAllViewProps=()=>{e.props=[]};function a(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];r.push(n);const i=n.getNestedProps();if(i&&i.length)for(let o=0;o{let n=[];e.actors2D=[];for(let r=0;r0)?e.actors2D=e.actors2D.concat(i):a(e.props[r],n)}return e.actors2D.sort((r,i)=>r.getLayerNumber()-i.getLayerNumber()),n=n.concat(e.actors2D),n},t.addActor2D=t.addViewProp,t.removeActor2D=n=>{t.removeViewProp(n)},t.getActors2D=()=>(e.actors2D=[],e.props.forEach(n=>{e.actors2D=e.actors2D.concat(n.getActors2D())}),e.actors2D),t.displayToView=()=>Qo("call displayToView on your view instead"),t.viewToDisplay=()=>Qo("callviewtodisplay on your view instead"),t.getSize=()=>Qo("call getSize on your View instead"),t.normalizedDisplayToProjection=(n,r,i)=>{const o=t.normalizedDisplayToNormalizedViewport(n,r,i);return t.normalizedViewportToProjection(o[0],o[1],o[2])},t.normalizedDisplayToNormalizedViewport=(n,r,i)=>{const o=[e.viewport[2]-e.viewport[0],e.viewport[3]-e.viewport[1]];return[(n-e.viewport[0])/o[0],(r-e.viewport[1])/o[1],i]},t.normalizedViewportToProjection=(n,r,i)=>[n*2-1,r*2-1,i*2-1],t.projectionToNormalizedDisplay=(n,r,i)=>{const o=t.projectionToNormalizedViewport(n,r,i);return t.normalizedViewportToNormalizedDisplay(o[0],o[1],o[2])},t.normalizedViewportToNormalizedDisplay=(n,r,i)=>{const o=[e.viewport[2]-e.viewport[0],e.viewport[3]-e.viewport[1]];return[n*o[0]+e.viewport[0],r*o[1]+e.viewport[1],i]},t.projectionToNormalizedViewport=(n,r,i)=>[(n+1)*.5,(r+1)*.5,(i+1)*.5],t.PickPropFrom=Y_("PickPropFrom")}const Z_={background:[0,0,0],background2:[.2,.2,.2],gradientBackground:!1,viewport:[0,0,1,1],aspect:[1,1],pixelAspect:[1,1],props:[],actors2D:[]};function og(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,Z_,a),V.obj(t,e),V.event(t,e,"event"),V.setGetArray(t,e,["viewport"],4),V.setGetArray(t,e,["background","background2"],3),J_(t,e)}var Q_={newInstance:V.newInstance(og,"vtkViewport"),extend:og};const{vtkDebugMacro:li,vtkErrorMacro:Jn,vtkWarningMacro:eE}=Dt;function sg(t){return()=>Jn(`vtkRenderer::${t} - NOT IMPLEMENTED`)}function tE(t,e){e.classHierarchy.push("vtkRenderer");const a={type:"ComputeVisiblePropBoundsEvent",renderer:t},n={type:"ResetCameraClippingRangeEvent",renderer:t},r={type:"ResetCameraEvent",renderer:t};t.updateCamera=()=>(e.activeCamera||(li("No cameras are on, creating one."),t.getActiveCameraAndResetIfCreated()),e.activeCamera.render(t),!0),t.updateLightsGeometryToFollowCamera=()=>{const i=t.getActiveCameraAndResetIfCreated();e.lights.forEach(o=>{o.lightTypeIsSceneLight()||(o.lightTypeIsHeadLight()?(o.setPositionFrom(i.getPositionByReference()),o.setFocalPointFrom(i.getFocalPointByReference()),o.modified(i.getMTime())):o.lightTypeIsCameraLight()?o.setTransformMatrix(i.getCameraLightTransformMatrix(Ur())):Jn("light has unknown light type",o.get()))})},t.updateLightGeometry=()=>e.lightFollowCamera?t.updateLightsGeometryToFollowCamera():!0,t.allocateTime=sg("allocateTime"),t.updateGeometry=sg("updateGeometry"),t.getVTKWindow=()=>e._renderWindow,t.setLayer=i=>{li(t.getClassName(),t,"setting Layer to ",i),e.layer!==i&&(e.layer=i,t.modified()),t.setPreserveColorBuffer(!!i)},t.setActiveCamera=i=>e.activeCamera===i?!1:(e.activeCamera=i,t.modified(),t.invokeEvent({type:"ActiveCameraEvent",camera:i}),!0),t.makeCamera=()=>{const i=Dc.newInstance();return t.invokeEvent({type:"CreateCameraEvent",camera:i}),i},t.getActiveCamera=()=>(e.activeCamera||(e.activeCamera=t.makeCamera()),e.activeCamera),t.getActiveCameraAndResetIfCreated=()=>(e.activeCamera||(t.getActiveCamera(),t.resetCamera()),e.activeCamera),t.getActors=()=>(e.actors=[],e.props.forEach(i=>{e.actors=e.actors.concat(i.getActors())}),e.actors),t.addActor=t.addViewProp,t.removeActor=i=>{e.actors=e.actors.filter(o=>o!==i),t.removeViewProp(i),t.modified()},t.removeAllActors=()=>{t.getActors().forEach(o=>{t.removeViewProp(o)}),e.actors=[],t.modified()},t.getVolumes=()=>(e.volumes=[],e.props.forEach(i=>{e.volumes=e.volumes.concat(i.getVolumes())}),e.volumes),t.addVolume=t.addViewProp,t.removeVolume=i=>{e.volumes=e.volumes.filter(o=>o!==i),t.removeViewProp(i),t.modified()},t.removeAllVolumes=()=>{t.getVolumes().forEach(o=>{t.removeViewProp(o)}),e.volumes=[],t.modified()},t.hasLight=i=>e.lights.includes(i),t.addLight=i=>{i&&!t.hasLight(i)&&(e.lights.push(i),t.modified())},t.removeLight=i=>{e.lights=e.lights.filter(o=>o!==i),t.modified()},t.removeAllLights=()=>{e.lights=[],t.modified()},t.setLightCollection=i=>{e.lights=i,t.modified()},t.makeLight=ig.newInstance,t.createLight=()=>{e.automaticLightCreation&&(e._createdLight&&(t.removeLight(e._createdLight),e._createdLight.delete(),e._createdLight=null),e._createdLight=t.makeLight(),t.addLight(e._createdLight),e._createdLight.setLightTypeToHeadLight(),e._createdLight.setPosition(t.getActiveCamera().getPosition()),e._createdLight.setFocalPoint(t.getActiveCamera().getFocalPoint()))},t.normalizedDisplayToWorld=(i,o,s,c)=>{let l=t.normalizedDisplayToProjection(i,o,s);return l=t.projectionToView(l[0],l[1],l[2],c),t.viewToWorld(l[0],l[1],l[2])},t.worldToNormalizedDisplay=(i,o,s,c)=>{let l=t.worldToView(i,o,s);return l=t.viewToProjection(l[0],l[1],l[2],c),t.projectionToNormalizedDisplay(l[0],l[1],l[2])},t.viewToWorld=(i,o,s)=>{if(e.activeCamera===null)return Jn("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];const c=e.activeCamera.getViewMatrix();Et(c,c),We(c,c);const l=new Float64Array([i,o,s]);return _e(l,l,c),l},t.projectionToView=(i,o,s,c)=>{if(e.activeCamera===null)return Jn("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];const l=e.activeCamera.getProjectionMatrix(c,-1,1);Et(l,l),We(l,l);const p=new Float64Array([i,o,s]);return _e(p,p,l),p},t.worldToView=(i,o,s)=>{if(e.activeCamera===null)return Jn("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];const c=e.activeCamera.getViewMatrix();We(c,c);const l=new Float64Array([i,o,s]);return _e(l,l,c),l},t.viewToProjection=(i,o,s,c)=>{if(e.activeCamera===null)return Jn("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];const l=e.activeCamera.getProjectionMatrix(c,-1,1);We(l,l);const p=new Float64Array([i,o,s]);return _e(p,p,l),p},t.computeVisiblePropBounds=()=>{e.allBounds[0]=we.INIT_BOUNDS[0],e.allBounds[1]=we.INIT_BOUNDS[1],e.allBounds[2]=we.INIT_BOUNDS[2],e.allBounds[3]=we.INIT_BOUNDS[3],e.allBounds[4]=we.INIT_BOUNDS[4],e.allBounds[5]=we.INIT_BOUNDS[5];let i=!0;t.invokeEvent(a);for(let o=0;oe.allBounds[1]&&(e.allBounds[1]=c[1]),c[2]e.allBounds[3]&&(e.allBounds[3]=c[3]),c[4]e.allBounds[5]&&(e.allBounds[5]=c[5]))}}return i&&(o0(e.allBounds),li("Can't compute bounds, no 3D props are visible")),e.allBounds},t.resetCamera=function(){const o=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:null)||t.computeVisiblePropBounds(),s=[0,0,0];if(!eo(o))return li("Cannot reset camera!"),!1;let c=null;if(t.getActiveCamera())c=e.activeCamera.getViewPlaneNormal();else return Jn("Trying to reset non-existent camera"),!1;e.activeCamera.setViewAngle(30),s[0]=(o[0]+o[1])/2,s[1]=(o[2]+o[3])/2,s[2]=(o[4]+o[5])/2;let l=o[1]-o[0],p=o[3]-o[2],u=o[5]-o[4];l*=l,p*=p,u*=u;let f=l+p+u;f=f===0?1:f,f=Math.sqrt(f)*.5;const h=Qe(e.activeCamera.getViewAngle()),d=f,v=f/Math.sin(h*.5),m=e.activeCamera.getViewUp();return Math.abs(xe(m,c))>.999&&(eE("Resetting view-up since view plane normal is parallel"),e.activeCamera.setViewUp(-m[2],m[0],m[1])),e.activeCamera.setFocalPoint(s[0],s[1],s[2]),e.activeCamera.setPosition(s[0]+v*c[0],s[1]+v*c[1],s[2]+v*c[2]),t.resetCameraClippingRange(o),e.activeCamera.setParallelScale(d),e.activeCamera.setPhysicalScale(f),e.activeCamera.setPhysicalTranslation(-s[0],-s[1],-s[2]),t.invokeEvent(r),!0},t.resetCameraClippingRange=function(){const o=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:null)||t.computeVisiblePropBounds();if(!eo(o))return li("Cannot reset camera clipping range!"),!1;if(t.getActiveCameraAndResetIfCreated(),!e.activeCamera)return Jn("Trying to reset clipping range of non-existent camera"),!1;const s=e.activeCamera.computeClippingRange(o);let c=0;if(e.activeCamera.getParallelProjection())c=.2*e.activeCamera.getParallelScale();else{const l=Qe(e.activeCamera.getViewAngle());c=.2*Math.tan(l/2)*s[1]}return s[1]-s[0]=s[1]?.01*s[1]:s[0],e.nearClippingPlaneTolerance||(e.nearClippingPlaneTolerance=.01),s[0]{i!==e._renderWindow&&(e._vtkWindow=i,e._renderWindow=i)},t.visibleActorCount=()=>e.props.filter(i=>i.getVisibility()).length,t.visibleVolumeCount=t.visibleActorCount,t.getMTime=()=>{let i=e.mtime;const o=e.activeCamera?e.activeCamera.getMTime():0;o>i&&(i=o);const s=e._createdLight?e._createdLight.getMTime():0;return s>i&&(i=s),i},t.getTransparent=()=>!!e.preserveColorBuffer,t.isActiveCameraCreated=()=>!!e.activeCamera}const nE={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:In(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,environmentTexture:null,environmentTextureDiffuseStrength:1,environmentTextureSpecularStrength:1,useEnvironmentTextureAsBackground:!1,pass:0};function cg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(Object.assign(e,nE,a),Q_.extend(t,e,a),e.background||(e.background=[0,0,0,1]);e.background.length<3;)e.background.push(0);e.background.length===3&&e.background.push(1),At(t,e,["_renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),pt(t,e,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","environmentTexture","environmentTextureDiffuseStrength","environmentTextureSpecularStrength","useEnvironmentTextureAsBackground","useShadows","pass"]),Sa(t,e,["actors","volumes","lights"]),Bi(t,e,["background"],4,1),Ta(t,e,["renderWindow"]),tE(t,e)}var ug={newInstance:Je(cg,"vtkRenderer"),extend:cg};const{vtkErrorMacro:es}=V;function rE(t,e){e.classHierarchy.push("vtkPiecewiseFunction"),t.getSize=()=>e.nodes.length,t.getType=()=>{let a,n=0,r=0;e.nodes.length>0&&(n=e.nodes[0].y);for(let i=1;in)switch(r){case 0:case 1:r=1;break;case 2:default:r=3;break}else switch(r){case 0:case 2:r=2;break;case 1:default:r=3;break}if(n=a,r===3)break}switch(r){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";case 3:default:return"Varied"}},t.getDataPointer=()=>{const a=e.nodes.length;if(e.function=null,a>0){e.function=[];for(let n=0;n{if(e.nodes.length===0)return 0;let a=1,n=0,r=0;for(;r0?n=e.nodes[r-1].x:e.clamping?n=-Number.MAX_VALUE:n=e.nodes[0].x,n},t.getNodeValue=(a,n)=>{const r=e.nodes.length;return a<0||a>=r?(es("Index out of range!"),-1):(n[0]=e.nodes[a].x,n[1]=e.nodes[a].y,n[2]=e.nodes[a].midpoint,n[3]=e.nodes[a].sharpness,1)},t.setNodeValue=(a,n)=>{const r=e.nodes.length;if(a<0||a>=r)return es("Index out of range!"),-1;const i=e.nodes[a].x;return e.nodes[a].x=n[0],e.nodes[a].y=n[1],e.nodes[a].midpoint=n[2],e.nodes[a].sharpness=n[3],i!==n[0]?t.sortAndUpdateRange():t.modified(),1},t.addPoint=(a,n)=>t.addPointLong(a,n,.5,0),t.addPointLong=(a,n,r,i)=>{if(r<0||r>1)return es("Midpoint outside range [0.0, 1.0]"),-1;if(i<0||i>1)return es("Sharpness outside range [0.0, 1.0]"),-1;e.allowDuplicateScalars||t.removePoint(a);const o={x:a,y:n,midpoint:r,sharpness:i};e.nodes.push(o),t.sortAndUpdateRange();let s;for(s=0;s{e.nodes!==a&&(e.nodes=a,t.sortAndUpdateRange())},t.sortAndUpdateRange=()=>{e.nodes.sort((n,r)=>n.x-r.x),t.updateRange()||t.modified()},t.updateRange=()=>{const a=e.range.slice(),n=e.nodes.length;return n?(e.range[0]=e.nodes[0].x,e.range[1]=e.nodes[n-1].x):(e.range[0]=0,e.range[1]=0),a[0]===e.range[0]&&a[1]===e.range[1]?!1:(t.modified(),!0)},t.removePoint=a=>{let n;for(n=0;n=e.nodes.length)return-1;const r=n;let i=!1;return e.nodes.splice(n,1),(n===0||n===e.nodes.length)&&(i=t.updateRange()),i||t.modified(),r},t.removeAllPoints=()=>{e.nodes=[],t.sortAndUpdateRange()},t.addSegment=(a,n,r,i)=>{t.sortAndUpdateRange();for(let o=0;o=a&&e.nodes[o].x<=r?e.nodes.splice(o,1):o++;t.addPoint(a,n,.5,0),t.addPoint(r,i,.5,0)},t.getValue=a=>{const n=[];return t.getTable(a,a,1,n),n[0]},t.adjustRange=a=>{if(a.length<2)return 0;const n=t.getRange();n[0]a[1]?t.addPoint(a[1],t.getValue(a[1])):t.addPoint(a[1],t.getValue(n[1])),t.sortAndUpdateRange();for(let r=0;r=a[0]&&e.nodes[r].x<=a[1]?e.nodes.splice(r,1):++r;return t.sortAndUpdateRange(),1},t.estimateMinNumberOfSamples=(a,n)=>{const r=t.findMinimumXDistance();return Math.ceil((n-a)/r)},t.findMinimumXDistance=()=>{const a=e.nodes.length;if(a<2)return-1;let n=e.nodes[1].x-e.nodes[0].x;for(let r=0;r4&&arguments[4]!==void 0?arguments[4]:1,s,c=0;const l=e.nodes.length;let p=0;l!==0&&(p=e.nodes[l-1].y);let u=0,f=0,h=0,d=0,v=0,m=0,x=0;for(s=0;s1?u=a+s/(r-1)*(n-a):u=.5*(a+n);ce.nodes[c].x;)c++,c.99999&&(m=.99999));if(c>=l)i[y]=e.clamping?p:0;else if(c===0)i[y]=e.clamping?e.nodes[0].y:0;else{let g=(u-f)/(h-f);if(g.99)if(g<.5){i[y]=d;continue}else{i[y]=v;continue}if(x<.01){i[y]=(1-g)*d+g*v;continue}g<.5?g=.5*(g*2)**(1+10*x):g>.5&&(g=1-.5*((1-g)*2)**(1+10*x));const C=g*g,S=C*g,T=2*S-3*C+1,w=-2*S+3*C,_=S-2*C+g,E=S-C,D=v-d,O=(1-x)*D;i[y]=T*d+w*v+_*O+E*O;const M=dv?d:v;i[y]=i[y]N?N:i[y]}}}}const aE={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function lg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,aE,a),V.obj(t,e),e.nodes=[],V.setGet(t,e,["allowDuplicateScalars","clamping"]),V.setArray(t,e,["range"],2),V.getArray(t,e,["range"]),rE(t,e)}var ts={newInstance:V.newInstance(lg,"vtkPiecewiseFunction"),extend:lg};const{InterpolationType:fi,OpacityMode:iE,FilterMode:pi,ColorMixPreset:oE}=Uh,{vtkErrorMacro:Oc}=V,ns=4;function sE(t,e){e.classHierarchy.push("vtkVolumeProperty");const a={...t};t.getMTime=()=>{let i=e.mtime,o;for(let s=0;so?i:o):e.componentData[s].colorChannels===3&&e.componentData[s].rGBTransferFunction&&(o=e.componentData[s].rGBTransferFunction.getMTime(),i=i>o?i:o),e.componentData[s].scalarOpacity&&(o=e.componentData[s].scalarOpacity.getMTime(),i=i>o?i:o),e.componentData[s].gradientOpacity&&(e.componentData[s].disableGradientOpacity||(o=e.componentData[s].gradientOpacity.getMTime(),i=i>o?i:o));return i},t.getColorChannels=i=>i<0||i>3?(Oc("Bad index - must be between 0 and 3"),0):e.componentData[i].colorChannels,t.setGrayTransferFunction=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=!1;return e.componentData[i].grayTransferFunction!==o&&(e.componentData[i].grayTransferFunction=o,s=!0),e.componentData[i].colorChannels!==1&&(e.componentData[i].colorChannels=1,s=!0),s&&t.modified(),s},t.getGrayTransferFunction=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.componentData[i].grayTransferFunction===null&&(e.componentData[i].grayTransferFunction=ts.newInstance(),e.componentData[i].grayTransferFunction.addPoint(0,0),e.componentData[i].grayTransferFunction.addPoint(1024,1),e.componentData[i].colorChannels!==1&&(e.componentData[i].colorChannels=1),t.modified()),e.componentData[i].grayTransferFunction},t.setRGBTransferFunction=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=!1;return e.componentData[i].rGBTransferFunction!==o&&(e.componentData[i].rGBTransferFunction=o,s=!0),e.componentData[i].colorChannels!==3&&(e.componentData[i].colorChannels=3,s=!0),s&&t.modified(),s},t.getRGBTransferFunction=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.componentData[i].rGBTransferFunction===null&&(e.componentData[i].rGBTransferFunction=mc.newInstance(),e.componentData[i].rGBTransferFunction.addRGBPoint(0,0,0,0),e.componentData[i].rGBTransferFunction.addRGBPoint(1024,1,1,1),e.componentData[i].colorChannels!==3&&(e.componentData[i].colorChannels=3),t.modified()),e.componentData[i].rGBTransferFunction},t.setScalarOpacity=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e.componentData[i].scalarOpacity!==o?(e.componentData[i].scalarOpacity=o,t.modified(),!0):!1},t.getScalarOpacity=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.componentData[i].scalarOpacity===null&&(e.componentData[i].scalarOpacity=ts.newInstance(),e.componentData[i].scalarOpacity.addPoint(0,1),e.componentData[i].scalarOpacity.addPoint(1024,1),t.modified()),e.componentData[i].scalarOpacity},t.setComponentWeight=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;if(i<0||i>=ns)return Oc("Invalid index"),!1;const s=Math.min(1,Math.max(0,o));return e.componentData[i].componentWeight!==s?(e.componentData[i].componentWeight=s,t.modified(),!0):!1},t.getComponentWeight=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return i<0||i>=ns?(Oc("Invalid index"),0):e.componentData[i].componentWeight},t.setInterpolationTypeToNearest=()=>t.setInterpolationType(fi.NEAREST),t.setInterpolationTypeToLinear=()=>t.setInterpolationType(fi.LINEAR),t.setInterpolationTypeToFastLinear=()=>t.setInterpolationType(fi.FAST_LINEAR),t.getInterpolationTypeAsString=()=>V.enumToString(fi,e.interpolationType),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode","forceNearestInterpolation"].forEach(i=>{const o=V.capitalize(i);t[`set${o}`]=(s,c)=>e.componentData[s][`${i}`]!==c?(e.componentData[s][`${i}`]=c,t.modified(),!0):!1}),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode","forceNearestInterpolation"].forEach(i=>{const o=V.capitalize(i);t[`get${o}`]=s=>e.componentData[s][`${i}`]}),t.setAverageIPScalarRange=(i,o)=>{console.warn("setAverageIPScalarRange is deprecated use setIpScalarRange"),t.setIpScalarRange(i,o)},t.getFilterModeAsString=()=>V.enumToString(pi,e.filterMode),t.setFilterModeToOff=()=>{t.setFilterMode(pi.OFF)},t.setFilterModeToNormalized=()=>{t.setFilterMode(pi.NORMALIZED)},t.setFilterModeToRaw=()=>{t.setFilterMode(pi.RAW)},t.setGlobalIlluminationReach=i=>a.setGlobalIlluminationReach(Yt(i,0,1)),t.setVolumetricScatteringBlending=i=>a.setVolumetricScatteringBlending(Yt(i,0,1)),t.setAnisotropy=i=>a.setAnisotropy(Yt(i,-.99,.99)),t.setLAOKernelSize=i=>a.setLAOKernelSize(Ys(Yt(i,1,32))),t.setLAOKernelRadius=i=>a.setLAOKernelRadius(i>=1?i:1)}const cE=t=>({colorMixPreset:oE.DEFAULT,independentComponents:!0,interpolationType:fi.FAST_LINEAR,shade:!1,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:[1],labelOutlineOpacity:1,ipScalarRange:[-1e6,1e6],filterMode:pi.OFF,preferSizeOverAccuracy:!1,computeNormalFromOpacity:!1,volumetricScatteringBlending:0,globalIlluminationReach:0,anisotropy:0,localAmbientOcclusion:!1,LAOKernelSize:15,LAOKernelRadius:7,updatedExtents:[],...t});function fg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(Object.assign(e,cE(a)),V.obj(t,e),!e.componentData){e.componentData=[];for(let n=0;n[t],t.makeProperty=pg.newInstance,t.getRedrawMTime=()=>{let a=e.mtime;if(e.mapper!==null){let n=e.mapper.getMTime();a=n>a?n:a,e.mapper.getInput()!==null&&(e.mapper.getInputAlgorithm().update(),n=e.mapper.getInput().getMTime(),a=n>a?n:a)}return a}}const lE={mapper:null};function hg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,lE,a),x0.extend(t,e,a),e.boundsMTime={},V.obj(e.boundsMTime),V.setGet(t,e,["mapper"]),uE(t,e)}var fE={newInstance:V.newInstance(hg,"vtkVolume"),extend:hg};const{BlendMode:Zn}=R8;function pE(t,e,a,n,r){let i=null;return r?(i=r,i.removeAllPoints()):i=ts.newInstance(),i.addPointLong(-1024,0,1,1),i.addPoint(t,e),i.addPoint(a,n),i}const hE=["getAnisotropy","getComputeNormalFromOpacity","getFilterMode","getFilterModeAsString","getGlobalIlluminationReach","getIpScalarRange","getIpScalarRangeByReference","getLAOKernelRadius","getLAOKernelSize","getLocalAmbientOcclusion","getPreferSizeOverAccuracy","getVolumetricScatteringBlending","setAnisotropy","setAverageIPScalarRange","setComputeNormalFromOpacity","setFilterMode","setFilterModeToNormalized","setFilterModeToOff","setFilterModeToRaw","setGlobalIlluminationReach","setIpScalarRange","setIpScalarRangeFrom","setLAOKernelRadius","setLAOKernelSize","setLocalAmbientOcclusion","setPreferSizeOverAccuracy","setVolumetricScatteringBlending"],gE={createRadonTransferFunction:pE};function dE(t,e){e.classHierarchy.push("vtkVolumeMapper");const a={...t};t.getBounds=()=>(e.static||t.update(),e.bounds=[...t.getInputData().getBounds()],e.bounds),t.setBlendModeToComposite=()=>{t.setBlendMode(Zn.COMPOSITE_BLEND)},t.setBlendModeToMaximumIntensity=()=>{t.setBlendMode(Zn.MAXIMUM_INTENSITY_BLEND)},t.setBlendModeToMinimumIntensity=()=>{t.setBlendMode(Zn.MINIMUM_INTENSITY_BLEND)},t.setBlendModeToAverageIntensity=()=>{t.setBlendMode(Zn.AVERAGE_INTENSITY_BLEND)},t.setBlendModeToAdditiveIntensity=()=>{t.setBlendMode(Zn.ADDITIVE_INTENSITY_BLEND)},t.setBlendModeToRadonTransform=()=>{t.setBlendMode(Zn.RADON_TRANSFORM_BLEND)},t.getBlendModeAsString=()=>V.enumToString(Zn,e.blendMode),t.setVolumeShadowSamplingDistFactor=n=>a.setVolumeShadowSamplingDistFactor(n>=1?n:1),hE.forEach(n=>{const r=()=>{throw new Error(`The method "volumeMapper.${n}()" doesn't exist anymore. It is a rendering property that has been moved to the volume property. Replace your code with: + `};var aE="WebGL",as=Object.create(null);function gg(t,e){as[t]=e}function iE(){return Object.keys(as)}function dg(t,e={}){return as[t]&&as[t](e)}function oE(t,e){e.classHierarchy.push("vtkRenderWindow"),t.addRenderer=a=>{t.hasRenderer(a)||(a.setRenderWindow(t),e.renderers.push(a),t.modified())},t.removeRenderer=a=>{e.renderers=e.renderers.filter(n=>n!==a),t.modified()},t.hasRenderer=a=>e.renderers.indexOf(a)!==-1,t.newAPISpecificView=(a,n={})=>dg(a||e.defaultViewAPI,n),t.addView=a=>{t.hasView(a)||(a.setRenderable(t),e._views.push(a),t.modified())},t.removeView=a=>{e._views=e._views.filter(n=>n!==a),t.modified()},t.hasView=a=>e._views.indexOf(a)!==-1,t.preRender=()=>{e.renderers.forEach(a=>{a.isActiveCameraCreated()||a.resetCamera()})},t.render=()=>{t.preRender(),e.interactor?e.interactor.render():e._views.forEach(a=>a.traverseAllPasses())},t.getStatistics=()=>{const a={propCount:0,invisiblePropCount:0,gpuMemoryMB:0};return e._views.forEach(n=>{n.getGraphicsMemoryInfo&&(a.gpuMemoryMB+=n.getGraphicsMemoryInfo()/1e6)}),e.renderers.forEach(n=>{const r=n.getViewProps(),i=e._views[0].getViewNodeFor(n);r.forEach(o=>{if(o.getVisibility()){a.propCount+=1;const s=o.getMapper&&o.getMapper();if(s&&s.getPrimitiveCount){const u=i.getViewNodeFor(s);if(u){u.getAllocatedGPUMemoryInBytes&&(a.gpuMemoryMB+=u.getAllocatedGPUMemoryInBytes()/1e6);const c=s.getPrimitiveCount();Object.keys(c).forEach(p=>{a[p]||(a[p]=0),a[p]+=c[p]})}}}else a.invisiblePropCount+=1})}),a.str=Object.keys(a).map(n=>`${n}: ${a[n]}`).join(` +`),a},t.captureImages=(a="image/png",n={})=>(A.setImmediate(t.render),e._views.map(r=>r.captureNextImage?r.captureNextImage(a,n):void 0).filter(r=>!!r)),t.addRenderWindow=a=>e.childRenderWindows.includes(a)?!1:(e.childRenderWindows.push(a),t.modified(),!0),t.removeRenderWindow=a=>{const n=e.childRenderWindows.findIndex(r=>r===a);return n<0?!1:(e.childRenderWindows.splice(n,1),t.modified(),!0)}}var sE={defaultViewAPI:aE,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1,childRenderWindows:[]};function vg(t,e,a={}){Object.assign(e,sE,a),A.obj(t,e),A.setGet(t,e,["interactor","numberOfLayers","_views","defaultViewAPI"]),A.get(t,e,["neverRendered"]),A.getArray(t,e,["renderers","childRenderWindows"]),A.moveToProtected(t,e,["views"]),A.event(t,e,"completion"),oE(t,e)}var cE=A.newInstance(vg,"vtkRenderWindow"),kc={newInstance:cE,extend:vg,registerViewConstructor:gg,listViewAPIs:iE,newAPISpecificView:dg},{vtkErrorMacro:is}=A;function uE(t,e){e.classHierarchy.push("vtkPiecewiseFunction"),t.getSize=()=>e.nodes.length,t.getType=()=>{let a,n=0,r=0;e.nodes.length>0&&(n=e.nodes[0].y);for(let i=1;in)switch(r){case 0:case 1:r=1;break;default:r=3;break}else switch(r){case 0:case 2:r=2;break;default:r=3;break}if(n=a,r===3)break}switch(r){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:return"Varied"}},t.getDataPointer=()=>{const a=e.nodes.length;if(e.function=null,a>0){e.function=[];for(let n=0;n{if(e.nodes.length===0)return 0;let a=1,n=0,r=0;for(;r0?n=e.nodes[r-1].x:e.clamping?n=-Number.MAX_VALUE:n=e.nodes[0].x,n},t.getNodeValue=(a,n)=>{const r=e.nodes.length;return a<0||a>=r?(is("Index out of range!"),-1):(n[0]=e.nodes[a].x,n[1]=e.nodes[a].y,n[2]=e.nodes[a].midpoint,n[3]=e.nodes[a].sharpness,1)},t.setNodeValue=(a,n)=>{const r=e.nodes.length;if(a<0||a>=r)return is("Index out of range!"),-1;const i=e.nodes[a].x;return e.nodes[a].x=n[0],e.nodes[a].y=n[1],e.nodes[a].midpoint=n[2],e.nodes[a].sharpness=n[3],i!==n[0]?t.sortAndUpdateRange():t.modified(),1},t.addPoint=(a,n)=>t.addPointLong(a,n,.5,0),t.addPointLong=(a,n,r,i)=>{if(r<0||r>1)return is("Midpoint outside range [0.0, 1.0]"),-1;if(i<0||i>1)return is("Sharpness outside range [0.0, 1.0]"),-1;e.allowDuplicateScalars||t.removePoint(a);const o={x:a,y:n,midpoint:r,sharpness:i};e.nodes.push(o),t.sortAndUpdateRange();let s;for(s=0;s{e.nodes!==a&&(e.nodes=a,t.sortAndUpdateRange())},t.sortAndUpdateRange=()=>{e.nodes.sort((a,n)=>a.x-n.x),t.updateRange()||t.modified()},t.updateRange=()=>{const a=e.range.slice(),n=e.nodes.length;return n?(e.range[0]=e.nodes[0].x,e.range[1]=e.nodes[n-1].x):(e.range[0]=0,e.range[1]=0),a[0]===e.range[0]&&a[1]===e.range[1]?!1:(t.modified(),!0)},t.removePoint=a=>{let n;for(n=0;n=e.nodes.length)return-1;const r=n;let i=!1;return e.nodes.splice(n,1),(n===0||n===e.nodes.length)&&(i=t.updateRange()),i||t.modified(),r},t.removeAllPoints=()=>{e.nodes=[],t.sortAndUpdateRange()},t.addSegment=(a,n,r,i)=>{t.sortAndUpdateRange();for(let o=0;o=a&&e.nodes[o].x<=r?e.nodes.splice(o,1):o++;t.addPoint(a,n,.5,0),t.addPoint(r,i,.5,0)},t.getValue=a=>{const n=[];return t.getTable(a,a,1,n),n[0]},t.adjustRange=a=>{if(a.length<2)return 0;const n=t.getRange();n[0]a[1]?t.addPoint(a[1],t.getValue(a[1])):t.addPoint(a[1],t.getValue(n[1])),t.sortAndUpdateRange();for(let r=0;r=a[0]&&e.nodes[r].x<=a[1]?e.nodes.splice(r,1):++r;return t.sortAndUpdateRange(),1},t.estimateMinNumberOfSamples=(a,n)=>{const r=t.findMinimumXDistance();return Math.ceil((n-a)/r)},t.findMinimumXDistance=()=>{const a=e.nodes.length;if(a<2)return-1;let n=e.nodes[1].x-e.nodes[0].x;for(let r=0;r{let s,u=0;const c=e.nodes.length;let p=0;c!==0&&(p=e.nodes[c-1].y);let l=0,f=0,h=0,v=0,m=0,x=0,y=0;for(s=0;s1?l=a+s/(r-1)*(n-a):l=.5*(a+n);ue.nodes[u].x;)u++,u.99999&&(x=.99999));if(u>=c)i[d]=e.clamping?p:0;else if(u===0)i[d]=e.clamping?e.nodes[0].y:0;else{let g=(l-f)/(h-f);if(g.99)if(g<.5){i[d]=v;continue}else{i[d]=m;continue}if(y<.01){i[d]=(1-g)*v+g*m;continue}g<.5?g=.5*(g*2)**(1+10*y):g>.5&&(g=1-.5*((1-g)*2)**(1+10*y));const C=g*g,S=C*g,T=2*S-3*C+1,w=-2*S+3*C,_=S-2*C+g,E=S-C,D=m-v,O=(1-y)*D;i[d]=T*v+w*m+_*O+E*O;const b=vm?v:m;i[d]=i[d]R?R:i[d]}}}}var lE={range:[0,0],clamping:!0,allowDuplicateScalars:!1};function yg(t,e,a={}){Object.assign(e,lE,a),A.obj(t,e),e.nodes=[],A.setGet(t,e,["allowDuplicateScalars","clamping"]),A.setArray(t,e,["range"],2),A.getArray(t,e,["range"]),uE(t,e)}var fE=A.newInstance(yg,"vtkPiecewiseFunction"),os={newInstance:fE,extend:yg},{vtkDebugMacro:ss}=A;function pE(t,e){e.classHierarchy.push("vtkCamera");const a=new Float64Array(3),n=new Float64Array([0,0,-1]),r=new Float64Array([0,1,0]),i=we(new Float64Array(16)),o=we(new Float64Array(16)),s=new Float64Array(3),u=new Float64Array(3),c=new Float64Array(3),p=we(new Float64Array(16)),l=we(new Float64Array(16)),f=new Float64Array(3),h=new Float64Array(3);function v(){e.viewPlaneNormal[0]=-e.directionOfProjection[0],e.viewPlaneNormal[1]=-e.directionOfProjection[1],e.viewPlaneNormal[2]=-e.directionOfProjection[2]}t.orthogonalizeViewUp=()=>{const m=t.getViewMatrix();e.viewUp[0]=m[4],e.viewUp[1]=m[5],e.viewUp[2]=m[6],t.modified()},t.setPosition=(m,x,y)=>{m===e.position[0]&&x===e.position[1]&&y===e.position[2]||(e.position[0]=m,e.position[1]=x,e.position[2]=y,t.computeDistance(),t.modified())},t.setFocalPoint=(m,x,y)=>{m===e.focalPoint[0]&&x===e.focalPoint[1]&&y===e.focalPoint[2]||(e.focalPoint[0]=m,e.focalPoint[1]=x,e.focalPoint[2]=y,t.computeDistance(),t.modified())},t.setDistance=m=>{if(e.distance===m)return;e.distance=m,e.distance<1e-20&&(e.distance=1e-20,ss("Distance is set to minimum."));const x=e.directionOfProjection;e.focalPoint[0]=e.position[0]+x[0]*e.distance,e.focalPoint[1]=e.position[1]+x[1]*e.distance,e.focalPoint[2]=e.position[2]+x[2]*e.distance,t.modified()},t.computeDistance=()=>{const m=e.focalPoint[0]-e.position[0],x=e.focalPoint[1]-e.position[1],y=e.focalPoint[2]-e.position[2];if(e.distance=Math.sqrt(m*m+x*x+y*y),e.distance<1e-20){e.distance=1e-20,ss("Distance is set to minimum.");const d=e.directionOfProjection;e.focalPoint[0]=e.position[0]+d[0]*e.distance,e.focalPoint[1]=e.position[1]+d[1]*e.distance,e.focalPoint[2]=e.position[2]+d[2]*e.distance}e.directionOfProjection[0]=m/e.distance,e.directionOfProjection[1]=x/e.distance,e.directionOfProjection[2]=y/e.distance,v()},t.dolly=m=>{if(m<=0)return;const x=e.distance/m;t.setPosition(e.focalPoint[0]-x*e.directionOfProjection[0],e.focalPoint[1]-x*e.directionOfProjection[1],e.focalPoint[2]-x*e.directionOfProjection[2])},t.roll=m=>{const x=e.position,y=e.focalPoint,d=e.viewUp,g=new Float64Array([d[0],d[1],d[2],0]);we(p);const C=new Float64Array([y[0]-x[0],y[1]-x[1],y[2]-x[2]]);Tt(p,p,et(m),C),On(g,g,p),e.viewUp[0]=g[0],e.viewUp[1]=g[1],e.viewUp[2]=g[2],t.modified()},t.azimuth=m=>{const x=e.focalPoint;we(l),Ye(l,l,x),Tt(l,l,et(m),e.viewUp),Ye(l,l,[-x[0],-x[1],-x[2]]),_e(f,e.position,l),t.setPosition(f[0],f[1],f[2])},t.yaw=m=>{const x=e.position;we(l),Ye(l,l,x),Tt(l,l,et(m),e.viewUp),Ye(l,l,[-x[0],-x[1],-x[2]]),_e(h,e.focalPoint,l),t.setFocalPoint(h[0],h[1],h[2])},t.elevation=m=>{const x=e.focalPoint,y=t.getViewMatrix(),d=[-y[0],-y[1],-y[2]];we(l),Ye(l,l,x),Tt(l,l,et(m),d),Ye(l,l,[-x[0],-x[1],-x[2]]),_e(f,e.position,l),t.setPosition(f[0],f[1],f[2])},t.pitch=m=>{const x=e.position,y=t.getViewMatrix(),d=[y[0],y[1],y[2]];we(l),Ye(l,l,x),Tt(l,l,et(m),d),Ye(l,l,[-x[0],-x[1],-x[2]]),_e(h,e.focalPoint,l),t.setFocalPoint(...h)},t.zoom=m=>{m<=0||(e.parallelProjection?e.parallelScale/=m:e.viewAngle/=m,t.modified())},t.translate=(m,x,y)=>{const d=[m,x,y];sr(e.position,d,e.position),sr(e.focalPoint,d,e.focalPoint),t.computeDistance(),t.modified()},t.applyTransform=m=>{const x=[...e.viewUp,1],y=[],d=[],g=[];x[0]+=e.position[0],x[1]+=e.position[1],x[2]+=e.position[2],On(y,[...e.position,1],m),On(d,[...e.focalPoint,1],m),On(g,x,m),g[0]-=y[0],g[1]-=y[1],g[2]-=y[2],t.setPosition(...y.slice(0,3)),t.setFocalPoint(...d.slice(0,3)),t.setViewUp(...g.slice(0,3))},t.getThickness=()=>e.clippingRange[1]-e.clippingRange[0],t.setThickness=m=>{let x=m;x<1e-20&&(x=1e-20,ss("Thickness is set to minimum.")),t.setClippingRange(e.clippingRange[0],e.clippingRange[0]+x)},t.setThicknessFromFocalPoint=m=>{let x=m;x<1e-20&&(x=1e-20,ss("Thickness is set to minimum.")),t.setClippingRange(e.distance-x/2,e.distance+x/2)},t.setRoll=m=>{},t.getRoll=()=>{},t.setObliqueAngles=(m,x)=>{},t.getOrientation=()=>{},t.getOrientationWXYZ=()=>{},t.getFrustumPlanes=(m=1,x=new Float64Array(24))=>{const y=[[1,0,0,1],[-1,0,0,1],[0,1,0,1],[0,-1,0,1],[0,0,1,1],[0,0,-1,1]],d=t.getCompositeProjectionMatrix(m,-1,1);for(let g=0;g<6;g++)On(y[g],y[g],d),Tv(y[g]),x[4*g+0]=y[g][0],x[4*g+1]=y[g][1],x[4*g+2]=y[g][2],x[4*g+3]=y[g][3];return x},t.getCameraLightTransformMatrix=m=>(vt(m,e.cameraLightTransform),m),t.computeCameraLightTransform=()=>{vt(i,t.getViewMatrix()),Et(i,i),Ii(o,[e.distance,e.distance,e.distance]),Ee(i,i,o),we(e.cameraLightTransform),Ye(e.cameraLightTransform,i,[0,0,-1])},t.deepCopy=m=>{},t.physicalOrientationToWorldDirection=m=>{const x=zl(m[0],m[1],m[2],m[3]),y=Wn(),d=zl(0,0,1,0);return c0(y,x),Yi(d,x,d),Yi(d,d,y),[d[0],d[1],d[2]]},t.getPhysicalToWorldMatrix=m=>{t.getWorldToPhysicalMatrix(m),Et(m,m)},t.getWorldToPhysicalMatrix=m=>{we(m);const x=[3];tt(e.physicalViewNorth,e.physicalViewUp,x),m[0]=x[0],m[1]=x[1],m[2]=x[2],m[4]=e.physicalViewUp[0],m[5]=e.physicalViewUp[1],m[6]=e.physicalViewUp[2],m[8]=-e.physicalViewNorth[0],m[9]=-e.physicalViewNorth[1],m[10]=-e.physicalViewNorth[2],We(m,m),un(s,1/e.physicalScale,1/e.physicalScale,1/e.physicalScale),zn(m,m,s),Ye(m,m,e.physicalTranslation)},t.computeViewParametersFromViewMatrix=m=>{Et(i,m),_e(s,a,i),t.computeDistance();const x=e.distance;t.setPosition(s[0],s[1],s[2]),_e(u,n,i),ln(u,u,s),fn(u,u),t.setDirectionOfProjection(u[0],u[1],u[2]),_e(c,r,i),ln(c,c,s),fn(c,c),t.setViewUp(c[0],c[1],c[2]),t.setDistance(x)},t.computeViewParametersFromPhysicalMatrix=m=>{t.getWorldToPhysicalMatrix(i),Ee(i,m,i),t.computeViewParametersFromViewMatrix(i)},t.setModelTransformMatrix=m=>{e.modelTransformMatrix=m},t.getModelTransformMatrix=()=>e.modelTransformMatrix,t.setViewMatrix=m=>{e.viewMatrix=m,e.viewMatrix&&(vt(i,e.viewMatrix),t.computeViewParametersFromViewMatrix(i),We(e.viewMatrix,e.viewMatrix))},t.getViewMatrix=()=>{if(e.viewMatrix)return e.modelTransformMatrix?(Ee(i,e.viewMatrix,e.modelTransformMatrix),i):e.viewMatrix;kl(i,e.position,e.focalPoint,e.viewUp),We(i,i);const m=new Float64Array(16);return e.modelTransformMatrix?Ee(m,i,e.modelTransformMatrix):vt(m,i),m},t.setProjectionMatrix=m=>{e.projectionMatrix=m},t.getProjectionMatrix=(m,x,y)=>{const d=new Float64Array(16);if(we(d),e.projectionMatrix){const S=1/e.physicalScale;return un(s,S,S,S),vt(d,e.projectionMatrix),zn(d,d,s),We(d,d),d}we(i);const g=e.clippingRange[1]-e.clippingRange[0],C=[e.clippingRange[0]+(x+1)*g/2,e.clippingRange[0]+(y+1)*g/2];if(e.parallelProjection){const S=e.parallelScale*m,T=e.parallelScale,w=(e.windowCenter[0]-1)*S,_=(e.windowCenter[0]+1)*S,E=(e.windowCenter[1]-1)*T,D=(e.windowCenter[1]+1)*T;Fl(i,w,_,E,D,C[0],C[1]),We(i,i)}else{if(e.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");{const S=Math.tan(et(e.viewAngle)/2);let T,w;e.useHorizontalViewAngle===!0?(T=e.clippingRange[0]*S,w=e.clippingRange[0]*S/m):(T=e.clippingRange[0]*S*m,w=e.clippingRange[0]*S);const _=(e.windowCenter[0]-1)*T,E=(e.windowCenter[0]+1)*T,D=(e.windowCenter[1]-1)*w,O=(e.windowCenter[1]+1)*w,b=C[0],R=C[1];i[0]=2*b/(E-_),i[5]=2*b/(O-D),i[2]=(_+E)/(E-_),i[6]=(D+O)/(O-D),i[10]=-(b+R)/(R-b),i[14]=-1,i[11]=-2*b*R/(R-b),i[15]=0}}return vt(d,i),d},t.getCompositeProjectionMatrix=(m,x,y)=>{const d=t.getViewMatrix(),g=t.getProjectionMatrix(m,x,y);return Ee(g,d,g),g},t.setDirectionOfProjection=(m,x,y)=>{if(e.directionOfProjection[0]===m&&e.directionOfProjection[1]===x&&e.directionOfProjection[2]===y)return;e.directionOfProjection[0]=m,e.directionOfProjection[1]=x,e.directionOfProjection[2]=y;const d=e.directionOfProjection;e.focalPoint[0]=e.position[0]+d[0]*e.distance,e.focalPoint[1]=e.position[1]+d[1]*e.distance,e.focalPoint[2]=e.position[2]+d[2]*e.distance,v()},t.setDeviceAngles=(m,x,y,d)=>{const g=[3];tt(e.physicalViewNorth,e.physicalViewUp,g);const C=we(new Float64Array(16));Tt(C,C,et(m),e.physicalViewUp),Tt(C,C,et(x),g),Tt(C,C,et(y),e.physicalViewNorth),Tt(C,C,et(-d),e.physicalViewUp);const S=new Float64Array([-e.physicalViewUp[0],-e.physicalViewUp[1],-e.physicalViewUp[2]]),T=new Float64Array(e.physicalViewNorth);_e(S,S,C),_e(T,T,C),t.setDirectionOfProjection(S[0],S[1],S[2]),t.setViewUp(T[0],T[1],T[2]),t.modified()},t.setOrientationWXYZ=(m,x,y,d)=>{const g=we(new Float64Array(16));if(m!==0&&(x!==0||y!==0||d!==0)){const T=et(m),w=Wn();qi(w,[x,y,d],T),Yr(g,w)}const C=new Float64Array(3);_e(C,[0,0,-1],g);const S=new Float64Array(3);_e(S,[0,1,0],g),t.setDirectionOfProjection(...C),t.setViewUp(...S),t.modified()},t.computeClippingRange=m=>{let x=null,y=null;x=e.viewPlaneNormal,y=e.position;const d=-x[0],g=-x[1],C=-x[2],S=-(d*y[0]+g*y[1]+C*y[2]),T=[d*m[0]+g*m[2]+C*m[4]+S,1e-18];for(let w=0;w<2;w++)for(let _=0;_<2;_++)for(let E=0;E<2;E++){const D=d*m[E]+g*m[2+_]+C*m[4+w]+S;T[0]=DT[1]?D:T[1]}return T}}var hE={position:[0,0,1],focalPoint:[0,0,0],viewUp:[0,1,0],directionOfProjection:[0,0,-1],parallelProjection:!1,useHorizontalViewAngle:!1,viewAngle:30,parallelScale:1,clippingRange:[.01,1000.01],windowCenter:[0,0],viewPlaneNormal:[0,0,1],useOffAxisProjection:!1,screenBottomLeft:[-.5,-.5,-.5],screenBottomRight:[.5,-.5,-.5],screenTopRight:[.5,.5,-.5],freezeFocalPoint:!1,projectionMatrix:null,viewMatrix:null,modelTransformMatrix:null,cameraLightTransform:qr(),physicalTranslation:[0,0,0],physicalScale:1,physicalViewUp:[0,1,0],physicalViewNorth:[0,0,-1]};function mg(t,e,a={}){Object.assign(e,hE,a),A.obj(t,e),A.get(t,e,["distance"]),A.setGet(t,e,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),A.getArray(t,e,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),A.setGetArray(t,e,["clippingRange","windowCenter"],2),A.setGetArray(t,e,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),pE(t,e)}var gE=A.newInstance(mg,"vtkCamera"),Ac={newInstance:gE,extend:mg},dE=["HeadLight","CameraLight","SceneLight"];function vE(t,e){e.classHierarchy.push("vtkLight");const a=new Float64Array(3);t.getTransformedPosition=()=>(e.transformMatrix?_e(a,e.position,e.transformMatrix):un(a,e.position[0],e.position[1],e.position[2]),a),t.getTransformedFocalPoint=()=>(e.transformMatrix?_e(a,e.focalPoint,e.transformMatrix):un(a,e.focalPoint[0],e.focalPoint[1],e.focalPoint[2]),a),t.getDirection=()=>(e.directionMTime{const r=new Float64Array(3);Il(r,e.position,n),e.focalPoint=r},t.setDirectionAngle=(n,r)=>{const i=et(n),o=et(r);t.setPosition(Math.cos(i)*Math.sin(o),Math.sin(i),Math.cos(i)*Math.cos(o)),t.setFocalPoint(0,0,0),t.setPositional(0)},t.setLightTypeToHeadLight=()=>{t.setLightType("HeadLight")},t.setLightTypeToCameraLight=()=>{t.setLightType("CameraLight")},t.setLightTypeToSceneLight=()=>{t.setTransformMatrix(null),t.setLightType("SceneLight")},t.lightTypeIsHeadLight=()=>e.lightType==="HeadLight",t.lightTypeIsSceneLight=()=>e.lightType==="SceneLight",t.lightTypeIsCameraLight=()=>e.lightType==="CameraLight"}var yE={switch:!0,intensity:1,color:[1,1,1],position:[0,0,1],focalPoint:[0,0,0],positional:!1,exponent:1,coneAngle:30,coneFalloff:5,attenuationValues:[1,0,0],transformMatrix:null,lightType:"SceneLight",shadowAttenuation:1,direction:[0,0,0],directionMTime:0};function xg(t,e,a={}){Object.assign(e,yE,a),A.obj(t,e),A.setGet(t,e,["intensity","switch","positional","exponent","coneAngle","coneFalloff","transformMatrix","lightType","shadowAttenuation","attenuationValues"]),A.setGetArray(t,e,["color","position","focalPoint","attenuationValues"],3),vE(t,e)}var mE=A.newInstance(xg,"vtkLight"),Cg={newInstance:mE,extend:xg,LIGHT_TYPES:dE},{vtkErrorMacro:cs}=A;function xE(t){return()=>cs(`vtkViewport::${t} - NOT IMPLEMENTED`)}function CE(t,e){e.classHierarchy.push("vtkViewport"),t.getViewProps=()=>e.props,t.hasViewProp=n=>e.props.includes(n),t.addViewProp=n=>{n&&!t.hasViewProp(n)&&e.props.push(n)},t.removeViewProp=n=>{const r=e.props.filter(i=>i!==n);e.props.length!==r.length&&(e.props=r)},t.removeAllViewProps=()=>{e.props=[]};function a(n,r=[]){r.push(n);const i=n.getNestedProps();if(i&&i.length)for(let o=0;o{let n=[];e.actors2D=[];for(let r=0;r0)?e.actors2D=e.actors2D.concat(i):a(e.props[r],n)}return e.actors2D.sort((r,i)=>r.getLayerNumber()-i.getLayerNumber()),n=n.concat(e.actors2D),n},t.addActor2D=t.addViewProp,t.removeActor2D=n=>{t.removeViewProp(n)},t.getActors2D=()=>(e.actors2D=[],e.props.forEach(n=>{e.actors2D=e.actors2D.concat(n.getActors2D())}),e.actors2D),t.displayToView=()=>cs("call displayToView on your view instead"),t.viewToDisplay=()=>cs("callviewtodisplay on your view instead"),t.getSize=()=>cs("call getSize on your View instead"),t.normalizedDisplayToProjection=(n,r,i)=>{const o=t.normalizedDisplayToNormalizedViewport(n,r,i);return t.normalizedViewportToProjection(o[0],o[1],o[2])},t.normalizedDisplayToNormalizedViewport=(n,r,i)=>{const o=[e.viewport[2]-e.viewport[0],e.viewport[3]-e.viewport[1]];return[(n-e.viewport[0])/o[0],(r-e.viewport[1])/o[1],i]},t.normalizedViewportToProjection=(n,r,i)=>[n*2-1,r*2-1,i*2-1],t.projectionToNormalizedDisplay=(n,r,i)=>{const o=t.projectionToNormalizedViewport(n,r,i);return t.normalizedViewportToNormalizedDisplay(o[0],o[1],o[2])},t.normalizedViewportToNormalizedDisplay=(n,r,i)=>{const o=[e.viewport[2]-e.viewport[0],e.viewport[3]-e.viewport[1]];return[n*o[0]+e.viewport[0],r*o[1]+e.viewport[1],i]},t.projectionToNormalizedViewport=(n,r,i)=>[(n+1)*.5,(r+1)*.5,(i+1)*.5],t.PickPropFrom=xE("PickPropFrom")}var SE={background:[0,0,0],background2:[.2,.2,.2],gradientBackground:!1,viewport:[0,0,1,1],aspect:[1,1],pixelAspect:[1,1],props:[],actors2D:[]};function Sg(t,e,a={}){Object.assign(e,SE,a),A.obj(t,e),A.event(t,e,"event"),A.setGet(t,e,["gradientBackground"]),A.setGetArray(t,e,["viewport"],4),A.setGetArray(t,e,["background","background2"],3),CE(t,e)}var TE=A.newInstance(Sg,"vtkViewport"),wE={newInstance:TE,extend:Sg},{vtkDebugMacro:gi,vtkErrorMacro:Qn,vtkWarningMacro:_E}=bt;function Tg(t){return()=>Qn(`vtkRenderer::${t} - NOT IMPLEMENTED`)}function EE(t,e){e.classHierarchy.push("vtkRenderer");const a={type:"ComputeVisiblePropBoundsEvent",renderer:t},n={type:"ResetCameraClippingRangeEvent",renderer:t},r={type:"ResetCameraEvent",renderer:t};t.updateCamera=()=>(e.activeCamera||(gi("No cameras are on, creating one."),t.getActiveCameraAndResetIfCreated()),e.activeCamera.render(t),!0),t.updateLightsGeometryToFollowCamera=()=>{const i=t.getActiveCameraAndResetIfCreated();e.lights.forEach(o=>{o.lightTypeIsSceneLight()||(o.lightTypeIsHeadLight()?(o.setPositionFrom(i.getPositionByReference()),o.setFocalPointFrom(i.getFocalPointByReference()),o.modified(i.getMTime())):o.lightTypeIsCameraLight()?o.setTransformMatrix(i.getCameraLightTransformMatrix(qr())):Qn("light has unknown light type",o.get()))})},t.updateLightGeometry=()=>e.lightFollowCamera?t.updateLightsGeometryToFollowCamera():!0,t.allocateTime=Tg("allocateTime"),t.updateGeometry=Tg("updateGeometry"),t.getVTKWindow=()=>e._renderWindow,t.setLayer=i=>{gi(t.getClassName(),t,"setting Layer to ",i),e.layer!==i&&(e.layer=i,t.modified()),t.setPreserveColorBuffer(!!i)},t.setActiveCamera=i=>e.activeCamera===i?!1:(e.activeCamera=i,t.modified(),t.invokeEvent({type:"ActiveCameraEvent",camera:i}),!0),t.makeCamera=()=>{const i=Ac.newInstance();return t.invokeEvent({type:"CreateCameraEvent",camera:i}),i},t.getActiveCamera=()=>(e.activeCamera||(e.activeCamera=t.makeCamera()),e.activeCamera),t.getActiveCameraAndResetIfCreated=()=>(e.activeCamera||(t.getActiveCamera(),t.resetCamera()),e.activeCamera),t.getActors=()=>(e.actors=[],e.props.forEach(i=>{e.actors=e.actors.concat(i.getActors())}),e.actors),t.addActor=t.addViewProp,t.removeActor=i=>{e.actors=e.actors.filter(o=>o!==i),t.removeViewProp(i),t.modified()},t.removeAllActors=()=>{t.getActors().forEach(i=>{t.removeViewProp(i)}),e.actors=[],t.modified()},t.getVolumes=()=>(e.volumes=[],e.props.forEach(i=>{e.volumes=e.volumes.concat(i.getVolumes())}),e.volumes),t.addVolume=t.addViewProp,t.removeVolume=i=>{e.volumes=e.volumes.filter(o=>o!==i),t.removeViewProp(i),t.modified()},t.removeAllVolumes=()=>{t.getVolumes().forEach(i=>{t.removeViewProp(i)}),e.volumes=[],t.modified()},t.hasLight=i=>e.lights.includes(i),t.addLight=i=>{i&&!t.hasLight(i)&&(e.lights.push(i),t.modified())},t.removeLight=i=>{e.lights=e.lights.filter(o=>o!==i),t.modified()},t.removeAllLights=()=>{e.lights=[],t.modified()},t.setLightCollection=i=>{e.lights=i,t.modified()},t.makeLight=Cg.newInstance,t.createLight=()=>{e.automaticLightCreation&&(e._createdLight&&(t.removeLight(e._createdLight),e._createdLight.delete(),e._createdLight=null),e._createdLight=t.makeLight(),t.addLight(e._createdLight),e._createdLight.setLightTypeToHeadLight(),e._createdLight.setPosition(t.getActiveCamera().getPosition()),e._createdLight.setFocalPoint(t.getActiveCamera().getFocalPoint()))},t.normalizedDisplayToWorld=(i,o,s,u)=>{let c=t.normalizedDisplayToProjection(i,o,s);return c=t.projectionToView(c[0],c[1],c[2],u),t.viewToWorld(c[0],c[1],c[2])},t.worldToNormalizedDisplay=(i,o,s,u)=>{let c=t.worldToView(i,o,s);return c=t.viewToProjection(c[0],c[1],c[2],u),t.projectionToNormalizedDisplay(c[0],c[1],c[2])},t.viewToWorld=(i,o,s)=>{if(e.activeCamera===null)return Qn("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];const u=e.activeCamera.getViewMatrix();Et(u,u),We(u,u);const c=new Float64Array([i,o,s]);return _e(c,c,u),c},t.projectionToView=(i,o,s,u)=>{if(e.activeCamera===null)return Qn("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];const c=e.activeCamera.getProjectionMatrix(u,-1,1);Et(c,c),We(c,c);const p=new Float64Array([i,o,s]);return _e(p,p,c),p},t.worldToView=(i,o,s)=>{if(e.activeCamera===null)return Qn("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];const u=e.activeCamera.getViewMatrix();We(u,u);const c=new Float64Array([i,o,s]);return _e(c,c,u),c},t.viewToProjection=(i,o,s,u)=>{if(e.activeCamera===null)return Qn("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];const c=e.activeCamera.getProjectionMatrix(u,-1,1);We(c,c);const p=new Float64Array([i,o,s]);return _e(p,p,c),p},t.computeVisiblePropBounds=()=>{e.allBounds[0]=de.INIT_BOUNDS[0],e.allBounds[1]=de.INIT_BOUNDS[1],e.allBounds[2]=de.INIT_BOUNDS[2],e.allBounds[3]=de.INIT_BOUNDS[3],e.allBounds[4]=de.INIT_BOUNDS[4],e.allBounds[5]=de.INIT_BOUNDS[5];let i=!0;t.invokeEvent(a);for(let o=0;oe.allBounds[1]&&(e.allBounds[1]=u[1]),u[2]e.allBounds[3]&&(e.allBounds[3]=u[3]),u[4]e.allBounds[5]&&(e.allBounds[5]=u[5]))}}return i&&(Qs(e.allBounds),gi("Can't compute bounds, no 3D props are visible")),e.allBounds},t.resetCamera=(i=null)=>{const o=i||t.computeVisiblePropBounds(),s=[0,0,0];if(!Fi(o))return gi("Cannot reset camera!"),!1;let u=null;if(t.getActiveCamera())u=e.activeCamera.getViewPlaneNormal();else return Qn("Trying to reset non-existent camera"),!1;e.activeCamera.setViewAngle(30),s[0]=(o[0]+o[1])/2,s[1]=(o[2]+o[3])/2,s[2]=(o[4]+o[5])/2;let c=o[1]-o[0],p=o[3]-o[2],l=o[5]-o[4];c*=c,p*=p,l*=l;let f=c+p+l;f=f===0?1:f,f=Math.sqrt(f)*.5;const h=et(e.activeCamera.getViewAngle()),v=f,m=f/Math.sin(h*.5),x=e.activeCamera.getViewUp();return Math.abs(xe(x,u))>.999&&(_E("Resetting view-up since view plane normal is parallel"),e.activeCamera.setViewUp(-x[2],x[0],x[1])),e.activeCamera.setFocalPoint(s[0],s[1],s[2]),e.activeCamera.setPosition(s[0]+m*u[0],s[1]+m*u[1],s[2]+m*u[2]),t.resetCameraClippingRange(o),e.activeCamera.setParallelScale(v),e.activeCamera.setPhysicalScale(f),e.activeCamera.setPhysicalTranslation(-s[0],-s[1],-s[2]),t.invokeEvent(r),!0},t.resetCameraClippingRange=(i=null)=>{const o=i||t.computeVisiblePropBounds();if(!Fi(o))return gi("Cannot reset camera clipping range!"),!1;if(t.getActiveCameraAndResetIfCreated(),!e.activeCamera)return Qn("Trying to reset clipping range of non-existent camera"),!1;const s=e.activeCamera.computeClippingRange(o);let u=0;if(e.activeCamera.getParallelProjection())u=.2*e.activeCamera.getParallelScale();else{const c=et(e.activeCamera.getViewAngle());u=.2*Math.tan(c/2)*s[1]}return s[1]-s[0]=s[1]?.01*s[1]:s[0],e.nearClippingPlaneTolerance||(e.nearClippingPlaneTolerance=.01),s[0]{i!==e._renderWindow&&(e._vtkWindow=i,e._renderWindow=i)},t.visibleActorCount=()=>e.props.filter(i=>i.getVisibility()).length,t.visibleVolumeCount=t.visibleActorCount,t.getMTime=()=>{let i=e.mtime;const o=e.activeCamera?e.activeCamera.getMTime():0;o>i&&(i=o);const s=e._createdLight?e._createdLight.getMTime():0;return s>i&&(i=s),i},t.getTransparent=()=>!!e.preserveColorBuffer,t.isActiveCameraCreated=()=>!!e.activeCamera}var DE={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:Ai(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,environmentTexture:null,environmentTextureDiffuseStrength:1,environmentTextureSpecularStrength:1,useEnvironmentTextureAsBackground:!1,pass:0};function wg(t,e,a={}){for(Object.assign(e,DE,a),wE.extend(t,e,a),e.background||(e.background=[0,0,0,1]);e.background.length<3;)e.background.push(0);e.background.length===3&&e.background.push(1),Bt(t,e,["_renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),ht(t,e,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","environmentTexture","environmentTextureDiffuseStrength","environmentTextureSpecularStrength","useEnvironmentTextureAsBackground","useShadows","pass"]),ma(t,e,["actors","volumes","lights"]),Di(t,e,["background"],4,1),xa(t,e,["renderWindow"]),EE(t,e)}var OE=qe(wg,"vtkRenderer"),_g={newInstance:OE,extend:wg},{InterpolationType:di,OpacityMode:bE,FilterMode:vi,ColorMixPreset:ME}=Y1,{vtkErrorMacro:Vc}=A,us=4;function NE(t,e){e.classHierarchy.push("vtkVolumeProperty");const a={...t};t.getMTime=()=>{let n=e.mtime,r;for(let i=0;ir?n:r):e.componentData[i].colorChannels===3&&e.componentData[i].rGBTransferFunction&&(r=e.componentData[i].rGBTransferFunction.getMTime(),n=n>r?n:r),e.componentData[i].scalarOpacity&&(r=e.componentData[i].scalarOpacity.getMTime(),n=n>r?n:r),e.componentData[i].gradientOpacity&&(e.componentData[i].disableGradientOpacity||(r=e.componentData[i].gradientOpacity.getMTime(),n=n>r?n:r));return n},t.getColorChannels=n=>n<0||n>3?(Vc("Bad index - must be between 0 and 3"),0):e.componentData[n].colorChannels,t.setGrayTransferFunction=(n=0,r=null)=>{let i=!1;return e.componentData[n].grayTransferFunction!==r&&(e.componentData[n].grayTransferFunction=r,i=!0),e.componentData[n].colorChannels!==1&&(e.componentData[n].colorChannels=1,i=!0),i&&t.modified(),i},t.getGrayTransferFunction=(n=0)=>(e.componentData[n].grayTransferFunction===null&&(e.componentData[n].grayTransferFunction=os.newInstance(),e.componentData[n].grayTransferFunction.addPoint(0,0),e.componentData[n].grayTransferFunction.addPoint(1024,1),e.componentData[n].colorChannels!==1&&(e.componentData[n].colorChannels=1),t.modified()),e.componentData[n].grayTransferFunction),t.setRGBTransferFunction=(n=0,r=null)=>{let i=!1;return e.componentData[n].rGBTransferFunction!==r&&(e.componentData[n].rGBTransferFunction=r,i=!0),e.componentData[n].colorChannels!==3&&(e.componentData[n].colorChannels=3,i=!0),i&&t.modified(),i},t.getRGBTransferFunction=(n=0)=>(e.componentData[n].rGBTransferFunction===null&&(e.componentData[n].rGBTransferFunction=Oc.newInstance(),e.componentData[n].rGBTransferFunction.addRGBPoint(0,0,0,0),e.componentData[n].rGBTransferFunction.addRGBPoint(1024,1,1,1),e.componentData[n].colorChannels!==3&&(e.componentData[n].colorChannels=3),t.modified()),e.componentData[n].rGBTransferFunction),t.setScalarOpacity=(n=0,r=null)=>e.componentData[n].scalarOpacity!==r?(e.componentData[n].scalarOpacity=r,t.modified(),!0):!1,t.getScalarOpacity=(n=0)=>(e.componentData[n].scalarOpacity===null&&(e.componentData[n].scalarOpacity=os.newInstance(),e.componentData[n].scalarOpacity.addPoint(0,1),e.componentData[n].scalarOpacity.addPoint(1024,1),t.modified()),e.componentData[n].scalarOpacity),t.setComponentWeight=(n=0,r=1)=>{if(n<0||n>=us)return Vc("Invalid index"),!1;const i=Math.min(1,Math.max(0,r));return e.componentData[n].componentWeight!==i?(e.componentData[n].componentWeight=i,t.modified(),!0):!1},t.getComponentWeight=(n=0)=>n<0||n>=us?(Vc("Invalid index"),0):e.componentData[n].componentWeight,t.setInterpolationTypeToNearest=()=>t.setInterpolationType(di.NEAREST),t.setInterpolationTypeToLinear=()=>t.setInterpolationType(di.LINEAR),t.setInterpolationTypeToFastLinear=()=>t.setInterpolationType(di.FAST_LINEAR),t.getInterpolationTypeAsString=()=>A.enumToString(di,e.interpolationType),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode","forceNearestInterpolation"].forEach(n=>{const r=A.capitalize(n);t[`set${r}`]=(i,o)=>e.componentData[i][`${n}`]!==o?(e.componentData[i][`${n}`]=o,t.modified(),!0):!1}),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode","forceNearestInterpolation"].forEach(n=>{const r=A.capitalize(n);t[`get${r}`]=i=>e.componentData[i][`${n}`]}),t.setAverageIPScalarRange=(n,r)=>{console.warn("setAverageIPScalarRange is deprecated use setIpScalarRange"),t.setIpScalarRange(n,r)},t.getFilterModeAsString=()=>A.enumToString(vi,e.filterMode),t.setFilterModeToOff=()=>{t.setFilterMode(vi.OFF)},t.setFilterModeToNormalized=()=>{t.setFilterMode(vi.NORMALIZED)},t.setFilterModeToRaw=()=>{t.setFilterMode(vi.RAW)},t.setGlobalIlluminationReach=n=>a.setGlobalIlluminationReach(qt(n,0,1)),t.setVolumetricScatteringBlending=n=>a.setVolumetricScatteringBlending(qt(n,0,1)),t.setAnisotropy=n=>a.setAnisotropy(qt(n,-.99,.99)),t.setLAOKernelSize=n=>a.setLAOKernelSize(Ws(qt(n,1,32))),t.setLAOKernelRadius=n=>a.setLAOKernelRadius(n>=1?n:1)}var RE=t=>({colorMixPreset:ME.DEFAULT,independentComponents:!0,interpolationType:di.FAST_LINEAR,shade:!1,ambient:.1,diffuse:.7,specular:.2,specularPower:10,useLabelOutline:!1,labelOutlineThickness:[1],labelOutlineOpacity:1,ipScalarRange:[-1e6,1e6],filterMode:vi.OFF,preferSizeOverAccuracy:!1,computeNormalFromOpacity:!1,volumetricScatteringBlending:0,globalIlluminationReach:0,anisotropy:0,localAmbientOcclusion:!1,LAOKernelSize:15,LAOKernelRadius:7,updatedExtents:[],...t});function Eg(t,e,a={}){if(Object.assign(e,RE(a)),A.obj(t,e),!e.componentData){e.componentData=[];for(let n=0;n[t],t.makeProperty=Dg.newInstance,t.getRedrawMTime=()=>{let a=e.mtime;if(e.mapper!==null){let n=e.mapper.getMTime();a=n>a?n:a,e.mapper.getInput()!==null&&(e.mapper.getInputAlgorithm().update(),n=e.mapper.getInput().getMTime(),a=n>a?n:a)}return a}}var kE={mapper:null};function Og(t,e,a={}){Object.assign(e,kE,a),w0.extend(t,e,a),e.boundsMTime={},A.obj(e.boundsMTime),A.setGet(t,e,["mapper"]),FE(t,e)}var AE=A.newInstance(Og,"vtkVolume"),VE={newInstance:AE,extend:Og},{BlendMode:er}=E7;function BE(t,e,a,n,r){let i=null;return r?(i=r,i.removeAllPoints()):i=os.newInstance(),i.addPointLong(-1024,0,1,1),i.addPoint(t,e),i.addPoint(a,n),i}var UE=["getAnisotropy","getComputeNormalFromOpacity","getFilterMode","getFilterModeAsString","getGlobalIlluminationReach","getIpScalarRange","getIpScalarRangeByReference","getLAOKernelRadius","getLAOKernelSize","getLocalAmbientOcclusion","getPreferSizeOverAccuracy","getVolumetricScatteringBlending","setAnisotropy","setAverageIPScalarRange","setComputeNormalFromOpacity","setFilterMode","setFilterModeToNormalized","setFilterModeToOff","setFilterModeToRaw","setGlobalIlluminationReach","setIpScalarRange","setIpScalarRangeFrom","setLAOKernelRadius","setLAOKernelSize","setLocalAmbientOcclusion","setPreferSizeOverAccuracy","setVolumetricScatteringBlending"],GE={createRadonTransferFunction:BE};function IE(t,e){e.classHierarchy.push("vtkVolumeMapper");const a={...t};t.computeBounds=()=>{const n=t.getInputData();if(!n){de.reset(e.bounds);return}e.static||t.update(),de.setBounds(e.bounds,n.getBounds())},t.setBlendModeToComposite=()=>{t.setBlendMode(er.COMPOSITE_BLEND)},t.setBlendModeToMaximumIntensity=()=>{t.setBlendMode(er.MAXIMUM_INTENSITY_BLEND)},t.setBlendModeToMinimumIntensity=()=>{t.setBlendMode(er.MINIMUM_INTENSITY_BLEND)},t.setBlendModeToAverageIntensity=()=>{t.setBlendMode(er.AVERAGE_INTENSITY_BLEND)},t.setBlendModeToAdditiveIntensity=()=>{t.setBlendMode(er.ADDITIVE_INTENSITY_BLEND)},t.setBlendModeToRadonTransform=()=>{t.setBlendMode(er.RADON_TRANSFORM_BLEND)},t.getBlendModeAsString=()=>A.enumToString(er,e.blendMode),t.setVolumeShadowSamplingDistFactor=n=>a.setVolumeShadowSamplingDistFactor(n>=1?n:1),UE.forEach(n=>{const r=()=>{throw new Error(`The method "volumeMapper.${n}()" doesn't exist anymore. It is a rendering property that has been moved to the volume property. Replace your code with: volumeActor.getProperty().${n}() -`)};t[n]=r})}const vE=t=>({bounds:[...we.INIT_BOUNDS],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,initialInteractionScale:1,interactionSampleDistanceFactor:1,blendMode:Zn.COMPOSITE_BLEND,volumeShadowSamplingDistFactor:5,colorTextureWidth:1024,opacityTextureWidth:1024,labelOutlineTextureWidth:1024,...t});function gg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,vE(a)),T0.extend(t,e,a),V.setGet(t,e,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","initialInteractionScale","interactionSampleDistanceFactor","blendMode","volumeShadowSamplingDistFactor","colorTextureWidth","opacityTextureWidth","labelOutlineTextureWidth"]),V.event(t,e,"lightingActivated"),dE(t,e)}var yE={newInstance:V.newInstance(gg,"vtkVolumeMapper"),extend:gg,...gE};const{InterpolationType:rs}=u8,{vtkErrorMacro:dg}=V,as=4;function mE(t,e){e.classHierarchy.push("vtkImageProperty"),t.getMTime=()=>{let a=e.mtime,n;for(let r=0;rn?a:n),e.componentData[r].piecewiseFunction&&(n=e.componentData[r].piecewiseFunction.getMTime(),a=a>n?a:n);return a},t.setRGBTransferFunction=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=a,i=n;return Number.isInteger(a)||(i=a,r=0),e.componentData[r].rGBTransferFunction!==i?(e.componentData[r].rGBTransferFunction=i,t.modified(),!0):!1},t.getRGBTransferFunction=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.componentData[a].rGBTransferFunction},t.setPiecewiseFunction=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=a,i=n;return Number.isInteger(a)||(i=a,r=0),e.componentData[r].piecewiseFunction!==i?(e.componentData[r].piecewiseFunction=i,t.modified(),!0):!1},t.getPiecewiseFunction=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.componentData[a].piecewiseFunction},t.setScalarOpacity=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=a,i=n;return Number.isInteger(a)||(i=a,r=0),t.setPiecewiseFunction(r,i)},t.getScalarOpacity=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t.getPiecewiseFunction(a)},t.setComponentWeight=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;if(a<0||a>=as)return dg("Invalid index"),!1;const r=Math.min(1,Math.max(0,n));return e.componentData[a].componentWeight!==r?(e.componentData[a].componentWeight=r,t.modified(),!0):!1},t.getComponentWeight=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return a<0||a>=as?(dg("Invalid index"),0):e.componentData[a].componentWeight},t.setInterpolationTypeToNearest=()=>t.setInterpolationType(rs.NEAREST),t.setInterpolationTypeToLinear=()=>t.setInterpolationType(rs.LINEAR),t.getInterpolationTypeAsString=()=>V.enumToString(rs,e.interpolationType)}const xE=t=>({independentComponents:!1,interpolationType:rs.LINEAR,colorWindow:255,colorLevel:127.5,ambient:1,diffuse:0,opacity:1,useLookupTableScalarRange:!1,useLabelOutline:!1,labelOutlineThickness:[1],labelOutlineOpacity:1,updatedExtents:[],...t});function vg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(Object.assign(e,xE(a)),V.obj(t,e),!e.componentData){e.componentData=[];for(let n=0;nt,t.getImages=()=>t,t.getIsOpaque=()=>{if(e.forceOpaque)return!0;if(e.forceTranslucent)return!1;e.properties[0]||t.getProperty();let a=e.properties[0].getOpacity()>=1;return a=a&&(!e.mapper||e.mapper.getIsOpaque()),a},t.hasTranslucentPolygonalGeometry=()=>!1,t.makeProperty=yg.newInstance,t.getBoundsForSlice=(a,n)=>{const r=e.mapper.getBoundsForSlice(a,n);if(!we.isValid(r))return r;t.computeMatrix();const i=new Float64Array(16);return We(i,e.matrix),we.transformBounds(r,i)},t.getMinXBound=()=>t.getBounds()[0],t.getMaxXBound=()=>t.getBounds()[1],t.getMinYBound=()=>t.getBounds()[2],t.getMaxYBound=()=>t.getBounds()[3],t.getMinZBound=()=>t.getBounds()[4],t.getMaxZBound=()=>t.getBounds()[5],t.getRedrawMTime=()=>{let a=e.mtime;if(e.mapper!==null){let n=e.mapper.getMTime();a=n>a?n:a,e.mapper.getInput()!==null&&(e.mapper.getInputAlgorithm().update(),n=e.mapper.getInput().getMTime(),a=n>a?n:a)}return e.properties.forEach(n=>{a=Math.max(a,n.getMTime());const r=n.getRGBTransferFunction();r!==null&&(a=Math.max(a,r.getMTime()))}),a},t.getSupportsSelection=()=>e.mapper?e.mapper.getSupportsSelection():!1}const SE={mapper:null,forceOpaque:!1,forceTranslucent:!1};function mg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,SE,a),x0.extend(t,e,a),e.boundsMTime={},V.obj(e.boundsMTime),V.setGet(t,e,["mapper","forceOpaque","forceTranslucent"]),CE(t,e)}var TE={newInstance:V.newInstance(mg,"vtkImageSlice"),extend:mg};function wE(t,e){e.classHierarchy.push("vtkAbstractImageMapper"),t.getIsOpaque=()=>!0,t.getCurrentImage=()=>null,t.getBoundsForSlice=()=>(V.vtkErrorMacro("vtkAbstractImageMapper.getBoundsForSlice - NOT IMPLEMENTED"),In())}const _E={slice:0,customDisplayExtent:[0,0,0,0,0,0],useCustomExtents:!1,backgroundColor:[0,0,0,1],colorTextureWidth:1024,opacityTextureWidth:1024,labelOutlineTextureWidth:1024};function EE(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,_E,a),T0.extend(t,e,a),V.setGet(t,e,["slice","useCustomExtents","colorTextureWidth","opacityTextureWidth","labelOutlineTextureWidth"]),V.setGetArray(t,e,["customDisplayExtent"],6),V.setGetArray(t,e,["backgroundColor"],4),wE(t,e)}var DE={extend:EE};function xg(t,e,a){const n=a.getCurrentImage(),r=n.getExtent(),i=[r[0],r[2],r[4]],{ijkMode:o}=a.getClosestIJKAxis();let s=a.isA("vtkImageArrayMapper")?a.getSubSlice():a.getSlice();o!==a.getSlicingMode()&&(s=a.getSliceAtPosition(s)),i[o]+=s;const c=[0,0,0];n.indexToWorld(i,c),i[o]+=1;const l=[0,0,0];n.indexToWorld(i,l),l[0]-=c[0],l[1]-=c[1],l[2]-=c[2],cn(l,l);const p=fn.intersectWithLine(t,e,c,l);if(p.intersection){const u=p.x,f=[0,0,0];return n.worldToIndex(u,f),{t:p.t,absoluteIJK:f}}return null}function OE(t,e,a){const n=xg(t,e,a);if(n){const i=a.getCurrentImage().getExtent(),o=[Math.round(n.absoluteIJK[0]),Math.round(n.absoluteIJK[1]),Math.round(n.absoluteIJK[2])];return o[0]i[1]||o[1]i[3]||o[2]i[5]?null:{t:n.t,ijk:o}}return null}function bE(t,e,a){const n=xg(t,e,a);if(n){const i=a.getCurrentImage().getExtent(),o=n.absoluteIJK,s=[Math.floor(o[0]),Math.floor(o[1]),Math.floor(o[2])];if(s[0]i[1]-1||s[1]i[3]-1||s[2](i[5]?i[5]-1:i[5]))return null;const c=[o[0]-s[0],o[1]-s[1],o[2]-s[2]];return{t:n.t,ijk:s,pCoords:c}}return null}const{staticOffsetAPI:ME,otherStaticMethods:NE}=yo,{SlicingMode:Ge}=q0;function RE(t,e){e.classHierarchy.push("vtkImageMapper"),t.getSliceAtPosition=n=>{const r=t.getCurrentImage();let i;if(n.length===3)i=n;else if(Number.isFinite(n)){const p=r.getBounds();switch(e.slicingMode){case Ge.X:i=[n,(p[3]+p[2])/2,(p[5]+p[4])/2];break;case Ge.Y:i=[(p[1]+p[0])/2,n,(p[5]+p[4])/2];break;case Ge.Z:i=[(p[1]+p[0])/2,(p[3]+p[2])/2,n];break}}const o=[0,0,0];r.worldToIndex(i,o);const s=r.getExtent(),{ijkMode:c}=t.getClosestIJKAxis();let l=0;switch(c){case Ge.I:l=Yt(o[0],s[0],s[1]);break;case Ge.J:l=Yt(o[1],s[2],s[3]);break;case Ge.K:l=Yt(o[2],s[4],s[5]);break;default:return 0}return l},t.setSliceFromCamera=n=>{const r=n.getFocalPoint();switch(e.slicingMode){case Ge.I:case Ge.J:case Ge.K:{const i=t.getSliceAtPosition(r);t.setSlice(i)}break;case Ge.X:t.setSlice(r[0]);break;case Ge.Y:t.setSlice(r[1]);break;case Ge.Z:t.setSlice(r[2]);break}},t.setXSlice=n=>{t.setSlicingMode(Ge.X),t.setSlice(n)},t.setYSlice=n=>{t.setSlicingMode(Ge.Y),t.setSlice(n)},t.setZSlice=n=>{t.setSlicingMode(Ge.Z),t.setSlice(n)},t.setISlice=n=>{t.setSlicingMode(Ge.I),t.setSlice(n)},t.setJSlice=n=>{t.setSlicingMode(Ge.J),t.setSlice(n)},t.setKSlice=n=>{t.setSlicingMode(Ge.K),t.setSlice(n)},t.getSlicingModeNormal=()=>{const n=[0,0,0],r=t.getCurrentImage().getDirection();switch(e.slicingMode){case Ge.X:n[0]=1;break;case Ge.Y:n[1]=1;break;case Ge.Z:n[2]=1;break;case Ge.I:Yi(r,[1,0,0],n);break;case Ge.J:Yi(r,[0,1,0],n);break;case Ge.K:Yi(r,[0,0,1],n);break}return n};function a(){let n;switch(e.slicingMode){case Ge.X:n=0;break;case Ge.Y:n=1;break;case Ge.Z:n=2;break;default:e.closestIJKAxis={ijkMode:e.slicingMode,flip:!1};return}const r=t.getCurrentImage().getDirection(),i=Kl(r);let o=0;for(;o<3&&i[n+3*o]===0;++o);const s=i[n+3*o]<0;e.closestIJKAxis={ijkMode:o,flip:s}}t.setSlicingMode=n=>{e.slicingMode!==n&&(e.slicingMode=n,t.getCurrentImage()&&a(),t.modified())},t.getClosestIJKAxis=()=>((e.closestIJKAxis===void 0||e.closestIJKAxis.ijkMode===Ge.NONE)&&t.getCurrentImage()&&a(),e.closestIJKAxis),t.getBounds=()=>{const n=t.getCurrentImage();if(!n)return In();if(!e.useCustomExtents)return n.getBounds();const r=e.customDisplayExtent.slice(),{ijkMode:i}=t.getClosestIJKAxis();let o=e.slice;switch(i!==e.slicingMode&&(o=t.getSliceAtPosition(e.slice)),i){case Ge.I:r[0]=o,r[1]=o;break;case Ge.J:r[2]=o,r[3]=o;break;case Ge.K:r[4]=o,r[5]=o;break}return n.extentToBounds(r)},t.getBoundsForSlice=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.slice,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const i=t.getCurrentImage();if(!i)return In();const o=i.getSpatialExtent(),{ijkMode:s}=t.getClosestIJKAxis();let c=n;switch(s!==e.slicingMode&&(c=t.getSliceAtPosition(n)),s){case Ge.I:o[0]=c-r,o[1]=c+r;break;case Ge.J:o[2]=c-r,o[3]=c+r;break;case Ge.K:o[4]=c-r,o[5]=c+r;break}return i.extentToBounds(o)},t.intersectWithLineForPointPicking=(n,r)=>OE(n,r,t),t.intersectWithLineForCellPicking=(n,r)=>bE(n,r,t),t.getCurrentImage=()=>t.getInputData()}const LE={slicingMode:Ge.NONE,closestIJKAxis:{ijkMode:Ge.NONE,flip:!1},renderToRectangle:!1,sliceAtFocalPoint:!1,preferSizeOverAccuracy:!1};function Cg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,LE,a),DE.extend(t,e,a),V.get(t,e,["slicingMode"]),V.setGet(t,e,["closestIJKAxis","renderToRectangle","sliceAtFocalPoint","preferSizeOverAccuracy"]),yo.implementCoincidentTopologyMethods(t,e),RE(t,e)}var FE={newInstance:V.newInstance(Cg,"vtkImageMapper"),extend:Cg,...ME,...NE,...q0};const{vtkErrorMacro:kE}=V;function VE(t,e){let a=0;return t.map((n,r)=>r===a?(a+=n+1,n):n+e)}function is(t,e,a,n){t.set(VE(e,a),n)}function AE(t,e){e.classHierarchy.push("vtkAppendPolyData"),t.requestData=(a,n)=>{const r=t.getNumberOfInputPorts();if(!r){kE("No input specified.");return}if(r===1){n[0]=a[0];return}const i=n[0]&&a[0]!==n[0]?n[0].initialize():Xe.newInstance();let o=0,s=0,c=1,l=1,p=0,u=0,f=0,h=0,d=!0,v=!0,m=!0;for(let O=0;Oc?s:c);const R=M.getPointData();R?(d=d&&R.getNormals()!==null,v=v&&R.getTCoords()!==null,m=m&&R.getScalars()!==null):(d=!1,v=!1,m=!1)}e.outputPointsPrecision===hr.SINGLE?s=Ne.FLOAT:e.outputPointsPrecision===hr.DOUBLE&&(s=Ne.DOUBLE);const x=dn.newInstance({dataType:s});x.setNumberOfPoints(o);const y=x.getData(),g=new Uint32Array(p),C=new Uint32Array(u),S=new Uint32Array(f),T=new Uint32Array(h);let w=null,_=null,E=null;const D=a[r-1];if(d){const O=D.getPointData().getNormals();w=pe.newInstance({numberOfComponents:3,numberOfTuples:o,size:3*o,dataType:O.getDataType(),name:O.getName()})}if(v){const O=D.getPointData().getTCoords();_=pe.newInstance({numberOfComponents:2,numberOfTuples:o,size:2*o,dataType:O.getDataType(),name:O.getName()})}if(m){const O=D.getPointData().getScalars();E=pe.newInstance({numberOfComponents:O.getNumberOfComponents(),numberOfTuples:o,size:o*O.getNumberOfComponents(),dataType:O.getDataType(),name:O.getName()})}o=0,p=0,u=0,f=0,h=0;for(let O=0;O2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,BE,a),V.setGet(t,e,["outputPointsPrecision"]),V.obj(t,e),V.algo(t,e,1,1),AE(t,e)}var Tg={newInstance:V.newInstance(Sg,"vtkAppendPolyData"),extend:Sg};function UE(t,e){e.classHierarchy.push("vtkArrowSource"),t.requestData=(a,n)=>{const r=L7.newInstance({capping:!0});r.setResolution(e.shaftResolution),r.setRadius(e.shaftRadius),r.setHeight(1-e.tipLength),r.setCenter(0,(1-e.tipLength)*.5,0);const i=r.getOutputData(),o=i.getPoints().getData(),s=i.getPointData().getNormals().getData();bt.buildFromDegree().rotateZ(-90).apply(o).apply(s);const c=M7.newInstance();c.setResolution(e.tipResolution),c.setHeight(e.tipLength),c.setRadius(e.tipRadius);const l=c.getOutputData(),p=l.getPoints().getData();bt.buildFromRadian().translate(1-e.tipLength*.5,0,0).apply(p);const u=Tg.newInstance();u.setInputData(i),u.addInputData(l);const f=u.getOutputData(),h=f.getPoints().getData();bt.buildFromRadian().translate(-.5+e.tipLength*.5,0,0).apply(h),e.invert?(bt.buildFromRadian().rotateFromDirections([1,0,0],e.direction).scale(-1,-1,-1).apply(h),n[0]=f):(bt.buildFromRadian().rotateFromDirections([1,0,0],e.direction).scale(1,1,1).apply(h),n[0]=u.getOutputData())}}const GE={tipResolution:6,tipRadius:.1,tipLength:.35,shaftResolution:6,shaftRadius:.03,invert:!1,direction:[1,0,0],pointType:"Float64Array"};function wg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,GE,a),V.obj(t,e),V.setGet(t,e,["tipResolution","tipRadius","tipLength","shaftResolution","shaftRadius","invert"]),V.setGetArray(t,e,["direction"],3),V.algo(t,e,0,1),UE(t,e)}var bc={newInstance:V.newInstance(wg,"vtkArrowSource"),extend:wg};function Mc(t){const e=t.getPoints().getBounds(),a=[-(e[0]+e[1])*.5,-(e[2]+e[3])*.5,-(e[4]+e[5])*.5];bt.buildFromDegree().translate(...a).apply(t.getPoints().getData())}function Nc(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=t.getPoints().getBounds(),r=[0,0,0];a?r[e]=-n[e*2+1]:r[e]=-n[e*2],bt.buildFromDegree().translate(...r).apply(t.getPoints().getData())}function Rc(t,e,a,n){const r=t.getPoints().getData().length,i=new Uint8ClampedArray(r);let o=0;for(;o{let r={...e.config,...e.xConfig};const i=bc.newInstance({direction:[1,0,0],...r}).getOutputData();e.config.recenter?Mc(i):Nc(i,0,r.invert),Rc(i,...r.color),r={...e.config,...e.yConfig};const o=bc.newInstance({direction:[0,1,0],...r}).getOutputData();e.config.recenter?Mc(o):Nc(o,1,r.invert),Rc(o,...r.color),r={...e.config,...e.zConfig};const s=bc.newInstance({direction:[0,0,1],...r}).getOutputData();e.config.recenter?Mc(s):Nc(s,2,r.invert),Rc(s,...r.color);const c=Tg.newInstance();c.setInputData(i),c.addInputData(o),c.addInputData(s),a.setInputConnection(c.getOutputPort())},t.update();const n=V.debounce(t.update,0);t.setXAxisColor=r=>t.setXConfig({...t.getXConfig(),color:r}),t.setYAxisColor=r=>t.setYConfig({...t.getYConfig(),color:r}),t.setZAxisColor=r=>t.setZConfig({...t.getZConfig(),color:r}),t.getXAxisColor=()=>e.getXConfig().color,t.getYAxisColor=()=>e.getYConfig().color,t.getZAxisColor=()=>e.getZConfig().color,e._onConfigChanged=n,e._onXConfigChanged=n,e._onYConfigChanged=n,e._onZConfigChanged=n}function PE(t){return{config:{recenter:!0,tipResolution:60,tipRadius:.1,tipLength:.2,shaftResolution:60,shaftRadius:.03,invert:!1,...t==null?void 0:t.config},xConfig:{color:[255,0,0],invert:!1,...t==null?void 0:t.xConfig},yConfig:{color:[255,255,0],invert:!1,...t==null?void 0:t.yConfig},zConfig:{color:[0,128,0],invert:!1,...t==null?void 0:t.zConfig}}}function _g(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};pn.extend(t,e,PE(a)),V.setGet(t,e,["config","xConfig","yConfig","zConfig"]),IE(t,e)}var zE={newInstance:V.newInstance(_g,"vtkAxesActor"),extend:_g};const Eg="resetcamera",Lc="orientation",jE={MODE_RESET_CAMERA:Eg,MODE_ORIENTATION:Lc,MODE_SAME:"same"};function WE(t,e){e.classHierarchy.push("vtkCameraSynchronizer");const a=new Float64Array(9),n=new Float64Array(3),r=[];function i(){for(;r.length;)r.pop().unsubscribe();if(!e.srcRenderer||!e.dstRenderer)return;const s=e.srcRenderer.getActiveCamera(),c=e.srcRenderer.getRenderWindow().getInteractor();r.push(s.onModified(()=>{c.isAnimating()||t.update()})),r.push(c.onAnimation(t.update)),r.push(c.onEndAnimation(t.update))}e._onSrcRendererChanged=i,e._onDstRendererChanged=i;function o(s,c,l){return a[0]!==s[0]||a[1]!==s[1]||a[2]!==s[2]||a[3]!==c[0]||a[4]!==c[1]||a[5]!==c[2]||a[6]!==l[0]||a[7]!==l[1]||a[8]!==l[2]?(a[0]=s[0],a[1]=s[1],a[2]=s[2],a[3]=c[0],a[4]=c[1],a[5]=c[2],a[6]=l[0],a[7]=l[1],a[8]=l[2],a):!1}t.update=()=>{if(!e.active||!e.srcRenderer||!e.dstRenderer)return;const s=e.srcRenderer.getActiveCamera(),c=e.dstRenderer.getActiveCamera(),l=s.getReferenceByName("position"),p=s.getReferenceByName("focalPoint"),u=s.getReferenceByName("viewUp"),f=o(l,p,u);f&&(e.mode===Lc?(n[0]=f[0]-f[3],n[1]=f[1]-f[4],n[2]=f[2]-f[5],Ke(n),c.setPosition(e.focalPoint[0]+e.distance*n[0],e.focalPoint[1]+e.distance*n[1],e.focalPoint[2]+e.distance*n[2]),c.setFocalPoint(e.focalPoint[0],e.focalPoint[1],e.focalPoint[2]),c.setViewUp(f[6],f[7],f[8])):(c.setPosition(f[0],f[1],f[2]),c.setFocalPoint(f[3],f[4],f[5]),c.setViewUp(f[6],f[7],f[8])),e.mode===Eg&&e.dstRenderer.resetCamera())},t.delete=Gn(()=>t.setSrcRenderer(null),t.delete),i()}const $E={mode:Lc,focalPoint:[0,0,0],distance:6.8,active:!0};function Dg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,$E,a),ut(t,e),pt(t,e,["mode","active","srcRenderer","dstRenderer","distance"]),Bi(t,e,["focalPoint"],3,0),WE(t,e)}var Fc={newInstance:Je(Dg,"vtkCameraSynchronizer"),extend:Dg,SynchronizationMode:jE};const kc={};class HE{constructor(e,a){this.ctx=e,this.behavior=Fc.newInstance(this.getProperties(a)),this.behavior.update()}getProperties(e){let{actorBounds:a,srcRenderer:n,dstRenderer:r}=e;const i=3.4*Math.max(a[1]-a[0],a[3]-a[2],a[5]-a[4]),o=[.5*(a[0]+a[1]),.5*(a[2]+a[3]),.5*(a[4]+a[5])],s=Fc.SynchronizationMode.MODE_ORIENTATION;return{distance:i,focalPoint:o,mode:s,srcRenderer:this.ctx.getInstance(n),dstRenderer:this.ctx.getInstance(r)}}update(e){this.behavior.set(this.getProperties(e)),this.behavior.update()}delete(){this.behavior.delete()}}const Og={CameraSync:HE};function KE(t,e,a){const n=t.get("synchronizedViewId").synchronizedViewId;if(!e.behaviors||!n)return;kc[n]||(kc[n]={});const r=kc[n];if(e.behaviors.autoOrientation){const s=t.getRenderers();if(!r.autoOrientationAxes&&s.length===2){let c=null,l=null;for(let p=0;p`instance:\${${t}}`,hi={},Vc=[],os={},YE={vtkPoints:dn,vtkCellArray:jn,vtkDataArray:pe};function JE(t,e){return e.map(a=>{const n=bg.exec(a);return n?t.getInstance(n[1]):a})}function Mg(t){return t.map(e=>bg.exec(e)).filter(e=>e).map(e=>e[1])}function Ng(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.dependencies&&t.dependencies.forEach(a=>{e.push(a.id),Ng(a,e)}),e}function ZE(t){for(;t.length;){const[e,a]=t.shift();e(...a)}}function QE(t,e,a){return n=>{const r=e.registration?e.registration:"addArray",i=e.location?t.getReferenceByName(e.location):t;let o=null;if(e.location?o=t.getReferenceByName(e.location).getArray(e.name):o=t[`get${r.substring(3)}`](),o)return o.getData()!==n&&a.push([o.setData,[n,e.numberOfComponents]]),o;const s=e.vtkClass?e.vtkClass:"vtkDataArray",c=YE[s].newInstance({...e,values:n});return a.push([i[r],[c]]),c}}function ss(t,e,a,n){if(!e)return Promise.reject(new Error("No instance provided."));const r=Fn[t];return r&&r.update?r.update(e,a,n):Promise.reject(new Error(`No updater for ${t}`))}function Ac(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const a=Fn[t];return a&&a.build?a.build(e):(console.log("No builder for",t),null)}function eD(t,e,a){os[t]={key:e,value:a}}function tD(){return Object.keys(Fn)}function Rg(){Object.keys(Fn).forEach(t=>{delete Fn[t]})}function nD(t,e,a){return ss("vtkRenderWindow",t,e,a)}function rD(){Object.keys(hi).forEach(t=>{delete hi[t]})}function aD(){for(var t=arguments.length,e=new Array(t),a=0;a{delete hi[r]}),n}function Bc(t){if(t[1].length===1)return Vc.indexOf(t[1][0])===-1;let e=!1;for(let a=0;a{const{id:i,type:o}=r;if(os[o]){const{key:c,value:l}=os[o];if(!c||r.properties[c]===l){Vc.push(qE(i));return}}let s=a.getInstance(i);s||(s=Ac(o,{managedInstanceId:i}),a.registerInstance(i,s)),ss(o,s,r,a)}),e.calls&&e.calls.filter(Bc).forEach(r=>{t[r[0]].apply(null,JE(a,r[1]))});const n=[];if(e.arrays){const r=[],i=Object.values(e.arrays).map(o=>(a.start(),a.getArray(o.hash,o.dataType,a).then(QE(t,o,r)).catch(s=>{console.log("Error fetching array",JSON.stringify(o),s)}).finally(a.end)));a.start(),n.push(Promise.all(i).then(()=>(r.length&&t.modified(),ZE(r),!0)).catch(o=>{console.error("Error in array handling for state",JSON.stringify(e),o)}).finally(a.end))}return a.end(),Promise.all(n)}function Lg(t,e,a){hi[e.id]||ct(t,e,a),hi[e.id]=!0}function iD(t,e,a){ct(t,e,a);const n=new Set;e.dependencies&&e.dependencies.forEach(o=>{const s=a.getInstance(o.id);if(s){const c=Ng(o);s.set({flattenedDepIds:c},!0),c.forEach(l=>n.add(l))}});const r=new Set;e.calls&&e.calls.filter(Bc).filter(o=>o[0]==="removeViewProp").forEach(o=>{Mg(o[1]).forEach(s=>{var l;const c=(l=a.getInstance(s))==null?void 0:l.get("flattenedDepIds").flattenedDepIds;c&&c.forEach(p=>r.add(p)),r.add(s)})}),[...r].filter(o=>!n.has(o)).forEach(o=>a.unregisterInstance(o))}function oD(t,e,a){e.calls&&e.calls.filter(Bc).filter(n=>n[0]==="removeRenderer").forEach(n=>{Mg(n[1]).forEach(r=>{a.getInstance(r).getViewProps().forEach(s=>{const c=s.get("flattenedDepIds").flattenedDepIds;c&&c.forEach(l=>a.unregisterInstance(l)),a.unregisterInstance(a.getInstanceId(s))})})}),t.render(),ct(t,e,a),XE.applyBehaviors(t,e,a)}function sD(t,e,a){if(a.start(),!e.properties.nodes)t.set(e.properties);else{const n=e.properties.nodes.map(r=>{let[i,o,s,c,l,p]=r;return{x:i,r:o,g:s,b:c,midpoint:l,sharpness:p}});t.set({...e.properties,nodes:n},!0)}a.end()}function cD(t,e,a){if(a.start(),!e.properties.nodes)t.set(e.properties);else{const n=e.properties.nodes.map(r=>{let[i,o,s,c]=r;return{x:i,y:o,midpoint:s,sharpness:c}});t.set({...e.properties,nodes:n},!0),t.sortAndUpdateRange()}a.end()}function Fg(t,e){const a=[],n=t.getNumberOfArrays();for(let r=0;r0&&arguments[0]!==void 0?arguments[0]:[];return(e,a,n)=>{n.start();const r={...a.properties};a.arrays||(a.arrays={});for(let l=0;l{let{location:p,name:u}=l;o[p].add(u)}),Fg(e.getPointData(),o.pointData),Fg(e.getCellData(),o.cellData);const s={...a};s.properties=r;const c=ct(e,s,n);return n.end(),c}}const uD=Vg(["points","polys","verts","lines","strips"]),lD=Vg([]);function Uc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ct;if(!Ac&&!ss){delete Fn[t];return}Fn[t]={build:e,update:a}}const Ag={vtkMapper:["vtkOpenGLPolyDataMapper","vtkCompositePolyDataMapper2","vtkDataSetMapper"],vtkProperty:["vtkOpenGLProperty"],vtkRenderer:["vtkOpenGLRenderer"],vtkCamera:["vtkOpenGLCamera"],vtkColorTransferFunction:["vtkPVDiscretizableColorTransferFunction"],vtkActor:["vtkOpenGLActor","vtkPVLODActor"],vtkLight:["vtkOpenGLLight","vtkPVLight"],vtkTexture:["vtkOpenGLTexture"],vtkImageMapper:["vtkOpenGLImageSliceMapper"],vtkVolumeMapper:["vtkFixedPointVolumeRayCastMapper"]},Bg={vtkAxesActor:{build:zE.newInstance,update:ct},vtkRenderWindow:{build:Ec.newInstance,update:oD},vtkRenderer:{build:ug.newInstance,update:iD},vtkLookupTable:{build:ap.newInstance,update:ct},vtkCamera:{build:Dc.newInstance,update:Lg},vtkPolyData:{build:Xe.newInstance,update:uD},vtkImageData:{build:_0.newInstance,update:lD},vtkMapper:{build:gn.newInstance,update:ct},vtkGlyph3DMapper:{build:V1.newInstance,update:ct},vtkProperty:{build:pr.newInstance,update:ct},vtkActor:{build:pn.newInstance,update:ct},vtkLight:{build:ig.newInstance,update:ct},vtkColorTransferFunction:{build:mc.newInstance,update:sD},vtkTexture:{build:A0.newInstance,update:ct},vtkVolume:{build:fE.newInstance,update:ct},vtkVolumeMapper:{build:yE.newInstance,update:ct},vtkVolumeProperty:{build:pg.newInstance,update:ct},vtkImageSlice:{build:TE.newInstance,update:ct},vtkImageMapper:{build:FE.newInstance,update:ct},vtkImageProperty:{build:yg.newInstance,update:ct},vtkPiecewiseFunction:{build:ts.newInstance,update:cD},vtkCubeAxesActor:{build:G0.newInstance,update:ct},vtkScalarBarActor:{build:hh.newInstance,update:ct}};function Ug(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)&&Rg(),Object.keys(Bg).forEach(e=>{const a=Bg[e];Uc(e,a.build,a.update)})}function Gc(){Object.keys(Ag).forEach(t=>{Ag[t].forEach(a=>{Fn[a]=Fn[t]})})}function fD(){Uc("vtkCamera",Dc.newInstance),Gc()}Ug(),Gc(),os.vtkPVLight={};var Ic={build:Ac,update:ss,genericUpdater:ct,oneTimeGenericUpdater:Lg,setTypeMapping:Uc,clearTypeMapping:Rg,getSupportedTypes:tD,clearOneTimeUpdaters:aD,updateRenderWindow:nD,excludeInstance:eD,setDefaultMapping:Ug,applyDefaultAliases:Gc,alwaysUpdateCamera:fD};const Ar={};function Gg(){const t={};let e=null;function a(o){e=o}function n(o,s,c){const l=t[o];return l?(l.mtimes[c.getActiveViewId()]=c.getMTime(),new Promise((p,u)=>{p(l.array)})):e?new Promise((p,u)=>{e(o).then(f=>{let h=f;if(typeof f=="string"&&(h=Rr.toArrayBuffer(f)),h instanceof Blob){const d=new FileReader;d.onload=()=>{const v=ar(s,d.result),m={[c.getActiveViewId()]:c.getMTime()};t[o]={mtimes:m,array:v},p(v)},d.readAsArrayBuffer(h)}else{const d=ar(s,h),v={[c.getActiveViewId()]:c.getMTime()};t[o]={mtimes:v,array:d},p(d)}},f=>{console.log("Error getting data array:"),console.log(f),u(f)})}):Promise.reject(new Error('No array fetcher found, please use "setArrayFetcher" to provide one'))}function r(){Object.keys(t).forEach(o=>{delete t[o]})}function i(o,s){const c=s.getMTime()-o;Object.keys(t).filter(l=>t[l].mtimes[s.getActiveViewId()]).filter(l=>t[l].mtimes[s.getActiveViewId()]{delete t[l]})}return{setFetchArrayFunction:a,getArray:n,emptyCachedArrays:r,freeOldArrays:i}}function Ig(){const t={};function e(o){return t[o]}function a(o){let s=null;return Object.keys(t).forEach(c=>{o===t[c]&&(s=c)}),s}function n(o,s){t[o]=s,s.set({remoteId:o},!0,!0)}function r(o){delete t[o]}function i(){Object.keys(t).forEach(o=>{delete t[o]})}return{getInstance:e,getInstanceId:a,registerInstance:n,unregisterInstance:r,emptyCachedInstances:i}}function Pg(){let t=0;const e={start(){t+=1,e.invokeProgressEvent(t)},end(){t-=1,e.invokeProgressEvent(t),t===0&&e.invokeProgressDone()},resetProgress(){t=0}},a={};return Hr(e,a,"progressEvent"),Hr(e,a,"progressDone"),e}function zg(){const t={};let e="default";function a(o){return t[o||e]||1}function n(o){const s=o||e;t[s]||(t[s]=1),t[s]+=1}function r(o){e=o}function i(){return e}return{getMTime:a,incrementMTime:n,setActiveViewId:r,getActiveViewId:i}}function Pc(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"default",e=Ar[t];return e||(e={...Gg(),...Ig(),...Pg(),...zg()},Ar[t]=e),e}function pD(t,e){Ar[t]=e}function hD(t){if(t&&Ar[t]&&delete Ar[t],!t){const e=Object.keys(Ar);for(let a=0;au.get("managedInstanceId").managedInstanceId,i=()=>wa(t,r);function o(){Ic.clearOneTimeUpdaters(i())}function s(u){t.set({synchronizedViewId:u},!0,!0)}function c(){return t.get("synchronizedViewId").synchronizedViewId}function l(u){n=u}function p(u){c()||s(u.id);const f=u.mtime||0;return c()===u.id&&a{const v=e.onProgressDone(()=>{v.unsubscribe(),t.render(),h(!0)});a=f,e.setActiveViewId(u.id),e.incrementMTime(),Ic.updateRenderWindow(t,u,e),e.freeOldArrays(n,e)}):Promise.resolve(!1)}return{synchronize:p,setSynchronizedViewId:s,getSynchronizedViewId:c,updateGarbageCollectorThreshold:l,getManagedInstanceIds:i,clearOneTimeUpdaters:o}}function gD(t,e){e.classHierarchy.push("vtkSynchronizableRenderWindow"),e.synchronizerContext||(e.synchronizerContext=Pc(e.synchronizerContextName));const a=jg(t,e.synchronizerContext);Object.keys(a).forEach(n=>{t[n]?t[n]=Gn(t[n],a[n]):t[n]=a[n]})}const dD={synchronizerContextName:"default",synchronizerContext:null,synchronizedViewId:null};function Wg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,dD,a),Ec.extend(t,e),At(t,e,["synchronizerContext"]),gD(t,e)}const vD=Je(Wg,"vtkSynchronizableRenderWindow");function yD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default";const a=jg(t,Pc(e));return{...a,...t,delete:Gn(t.delete,a.delete)}}var $g={newInstance:vD,extend:Wg,getSynchronizerContext:Pc,setSynchronizerContext:pD,clearSynchronizerContext:hD,decorate:yD,createInstanceMap:Ig,createArrayHandler:Gg,createProgressHandler:Pg,createSceneMtimeHandler:zg,vtkObjectManager:Ic};function mD(t,e){e.classHierarchy.push("vtkRenderPass"),t.getOperation=()=>e.currentOperation,t.setCurrentOperation=a=>{e.currentOperation=a,e.currentTraverseOperation=`traverse${V.capitalize(e.currentOperation)}`},t.getTraverseOperation=()=>e.currentTraverseOperation,t.traverse=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.deleted||(e._currentParent=n,e.preDelegateOperations.forEach(r=>{t.setCurrentOperation(r),a.traverse(t)}),e.delegates.forEach(r=>{r.traverse(a,t)}),e.postDelegateOperations.forEach(r=>{t.setCurrentOperation(r),a.traverse(t)}))}}const xD={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function Hg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,xD,a),V.obj(t,e),V.get(t,e,["currentOperation"]),V.setGet(t,e,["delegates","_currentParent","preDelegateOperations","postDelegateOperations"]),V.moveToProtected(t,e,["currentParent"]),mD(t,e)}var zc={newInstance:V.newInstance(Hg,"vtkRenderPass"),extend:Hg};const{Representation:CD}=pr,{vtkErrorMacro:Kg}=V;function SD(t){const e=Q.substitute(t.Fragment,"//VTK::RenderPassFragmentShader::Impl",` +`)};t[n]=r})}var PE=t=>({bounds:[...de.INIT_BOUNDS],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,initialInteractionScale:1,interactionSampleDistanceFactor:1,blendMode:er.COMPOSITE_BLEND,volumeShadowSamplingDistFactor:5,colorTextureWidth:1024,opacityTextureWidth:1024,labelOutlineTextureWidth:1024,...t});function bg(t,e,a={}){Object.assign(e,PE(a)),M0.extend(t,e,a),A.setGet(t,e,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","initialInteractionScale","interactionSampleDistanceFactor","blendMode","volumeShadowSamplingDistFactor","colorTextureWidth","opacityTextureWidth","labelOutlineTextureWidth"]),A.event(t,e,"lightingActivated"),IE(t,e)}var zE=A.newInstance(bg,"vtkVolumeMapper"),WE={newInstance:zE,extend:bg,...GE},{vtkErrorMacro:jE}=A;function $E(t,e){let a=0;return t.map((n,r)=>r===a?(a+=n+1,n):n+e)}function ls(t,e,a,n){t.set($E(e,a),n)}function HE(t,e){e.classHierarchy.push("vtkAppendPolyData"),t.requestData=(a,n)=>{const r=t.getNumberOfInputPorts();if(!r){jE("No input specified.");return}if(r===1){n[0]=a[0];return}const i=n[0]&&a[0]!==n[0]?n[0].initialize():Je.newInstance();let o=0,s=0,u=1,c=1,p=0,l=0,f=0,h=0,v=!0,m=!0,x=!0;for(let O=0;Ou?s:u);const N=b.getPointData();N?(v=v&&N.getNormals()!==null,m=m&&N.getTCoords()!==null,x=x&&N.getScalars()!==null):(v=!1,m=!1,x=!1)}e.outputPointsPrecision===hr.SINGLE?s=be.FLOAT:e.outputPointsPrecision===hr.DOUBLE&&(s=be.DOUBLE);const y=kt.newInstance({dataType:s});y.setNumberOfPoints(o);const d=y.getData(),g=new Uint32Array(p),C=new Uint32Array(l),S=new Uint32Array(f),T=new Uint32Array(h);let w=null,_=null,E=null;const D=a[r-1];if(v){const O=D.getPointData().getNormals();w=pe.newInstance({numberOfComponents:3,numberOfTuples:o,size:3*o,dataType:O.getDataType(),name:O.getName()})}if(m){const O=D.getPointData().getTCoords();_=pe.newInstance({numberOfComponents:2,numberOfTuples:o,size:2*o,dataType:O.getDataType(),name:O.getName()})}if(x){const O=D.getPointData().getScalars();E=pe.newInstance({numberOfComponents:O.getNumberOfComponents(),numberOfTuples:o,size:o*O.getNumberOfComponents(),dataType:O.getDataType(),name:O.getName()})}o=0,p=0,l=0,f=0,h=0;for(let O=0;O{const r=CS.newInstance({capping:!0});r.setResolution(e.shaftResolution),r.setRadius(e.shaftRadius),r.setHeight(1-e.tipLength),r.setCenter(0,(1-e.tipLength)*.5,0);const i=r.getOutputData(),o=i.getPoints().getData(),s=i.getPointData().getNormals().getData();Dt.buildFromDegree().rotateZ(-90).apply(o).apply(s);const u=vS.newInstance();u.setResolution(e.tipResolution),u.setHeight(e.tipLength),u.setRadius(e.tipRadius);const c=u.getOutputData(),p=c.getPoints().getData();Dt.buildFromRadian().translate(1-e.tipLength*.5,0,0).apply(p);const l=Ng.newInstance();l.setInputData(i),l.addInputData(c);const f=l.getOutputData(),h=f.getPoints().getData();Dt.buildFromRadian().translate(-.5+e.tipLength*.5,0,0).apply(h),e.invert?(Dt.buildFromRadian().rotateFromDirections([1,0,0],e.direction).scale(-1,-1,-1).apply(h),n[0]=f):(Dt.buildFromRadian().rotateFromDirections([1,0,0],e.direction).scale(1,1,1).apply(h),n[0]=l.getOutputData())}}var YE={tipResolution:6,tipRadius:.1,tipLength:.35,shaftResolution:6,shaftRadius:.03,invert:!1,direction:[1,0,0],pointType:"Float64Array"};function Rg(t,e,a={}){Object.assign(e,YE,a),A.obj(t,e),A.setGet(t,e,["tipResolution","tipRadius","tipLength","shaftResolution","shaftRadius","invert"]),A.setGetArray(t,e,["direction"],3),A.algo(t,e,0,1),qE(t,e)}var JE=A.newInstance(Rg,"vtkArrowSource"),Bc={newInstance:JE,extend:Rg};function Uc(t){const e=t.getPoints().getBounds(),a=[-(e[0]+e[1])*.5,-(e[2]+e[3])*.5,-(e[4]+e[5])*.5];Dt.buildFromDegree().translate(...a).apply(t.getPoints().getData())}function Gc(t,e,a=!1){const n=t.getPoints().getBounds(),r=[0,0,0];a?r[e]=-n[e*2+1]:r[e]=-n[e*2],Dt.buildFromDegree().translate(...r).apply(t.getPoints().getData())}function Ic(t,e,a,n){const r=t.getPoints().getData().length,i=new Uint8ClampedArray(r);let o=0;for(;o{let r={...e.config,...e.xConfig};const i=Bc.newInstance({direction:[1,0,0],...r}).getOutputData();e.config.recenter?Uc(i):Gc(i,0,r.invert),Ic(i,...r.color),r={...e.config,...e.yConfig};const o=Bc.newInstance({direction:[0,1,0],...r}).getOutputData();e.config.recenter?Uc(o):Gc(o,1,r.invert),Ic(o,...r.color),r={...e.config,...e.zConfig};const s=Bc.newInstance({direction:[0,0,1],...r}).getOutputData();e.config.recenter?Uc(s):Gc(s,2,r.invert),Ic(s,...r.color);const u=Ng.newInstance();u.setInputData(i),u.addInputData(o),u.addInputData(s),a.setInputConnection(u.getOutputPort())},t.update();const n=A.debounce(t.update,0);t.setXAxisColor=r=>t.setXConfig({...t.getXConfig(),color:r}),t.setYAxisColor=r=>t.setYConfig({...t.getYConfig(),color:r}),t.setZAxisColor=r=>t.setZConfig({...t.getZConfig(),color:r}),t.getXAxisColor=()=>e.getXConfig().color,t.getYAxisColor=()=>e.getYConfig().color,t.getZAxisColor=()=>e.getZConfig().color,e._onConfigChanged=n,e._onXConfigChanged=n,e._onYConfigChanged=n,e._onZConfigChanged=n}function QE(t){return{config:{recenter:!0,tipResolution:60,tipRadius:.1,tipLength:.2,shaftResolution:60,shaftRadius:.03,invert:!1,...t==null?void 0:t.config},xConfig:{color:[255,0,0],invert:!1,...t==null?void 0:t.xConfig},yConfig:{color:[255,255,0],invert:!1,...t==null?void 0:t.yConfig},zConfig:{color:[0,128,0],invert:!1,...t==null?void 0:t.zConfig}}}function Lg(t,e,a={}){hn.extend(t,e,QE(a)),A.setGet(t,e,["config","xConfig","yConfig","zConfig"]),ZE(t,e)}var eD=A.newInstance(Lg,"vtkAxesActor"),tD={newInstance:eD,extend:Lg};function nD(t,e){e.classHierarchy.push("vtkAbstractImageMapper"),t.getIsOpaque=()=>!0,t.getCurrentImage=()=>null,t.getBoundsForSlice=()=>(A.vtkErrorMacro("vtkAbstractImageMapper.getBoundsForSlice - NOT IMPLEMENTED"),Ai())}var rD={slice:0,customDisplayExtent:[0,0,0,0,0,0],useCustomExtents:!1,backgroundColor:[0,0,0,1],colorTextureWidth:1024,opacityTextureWidth:1024,labelOutlineTextureWidth:1024};function aD(t,e,a={}){Object.assign(e,rD,a),M0.extend(t,e,a),A.setGet(t,e,["slice","useCustomExtents","colorTextureWidth","opacityTextureWidth","labelOutlineTextureWidth"]),A.setGetArray(t,e,["customDisplayExtent"],6),A.setGetArray(t,e,["backgroundColor"],4),nD(t,e)}var iD={extend:aD};function Fg(t,e,a){const n=a.getCurrentImage(),r=n.getExtent(),i=[r[0],r[2],r[4]],{ijkMode:o}=a.getClosestIJKAxis();let s=a.isA("vtkImageArrayMapper")?a.getSubSlice():a.getSlice();o!==a.getSlicingMode()&&(s=a.getSliceAtPosition(s)),i[o]+=s;const u=[0,0,0];n.indexToWorld(i,u),i[o]+=1;const c=[0,0,0];n.indexToWorld(i,c),c[0]-=u[0],c[1]-=u[1],c[2]-=u[2],fn(c,c);const p=pn.intersectWithLine(t,e,u,c);if(p.intersection){const l=p.x,f=[0,0,0];return n.worldToIndex(l,f),{t:p.t,absoluteIJK:f}}return null}function oD(t,e,a){const n=Fg(t,e,a);if(n){const r=a.getCurrentImage().getExtent(),i=[Math.round(n.absoluteIJK[0]),Math.round(n.absoluteIJK[1]),Math.round(n.absoluteIJK[2])];return i[0]r[1]||i[1]r[3]||i[2]r[5]?null:{t:n.t,ijk:i}}return null}function sD(t,e,a){const n=Fg(t,e,a);if(n){const r=a.getCurrentImage().getExtent(),i=n.absoluteIJK,o=[Math.floor(i[0]),Math.floor(i[1]),Math.floor(i[2])];if(o[0]r[1]-1||o[1]r[3]-1||o[2](r[5]?r[5]-1:r[5]))return null;const s=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];return{t:n.t,ijk:o,pCoords:s}}return null}var{staticOffsetAPI:cD,otherStaticMethods:uD}=go,{SlicingMode:Ge}=Q0;function lD(t,e){e.classHierarchy.push("vtkImageMapper"),t.getSliceAtPosition=n=>{const r=t.getCurrentImage();let i;if(n.length===3)i=n;else if(Number.isFinite(n)){const p=r.getBounds();switch(e.slicingMode){case Ge.X:i=[n,(p[3]+p[2])/2,(p[5]+p[4])/2];break;case Ge.Y:i=[(p[1]+p[0])/2,n,(p[5]+p[4])/2];break;case Ge.Z:i=[(p[1]+p[0])/2,(p[3]+p[2])/2,n];break}}const o=[0,0,0];r.worldToIndex(i,o);const s=r.getExtent(),{ijkMode:u}=t.getClosestIJKAxis();let c=0;switch(u){case Ge.I:c=qt(o[0],s[0],s[1]);break;case Ge.J:c=qt(o[1],s[2],s[3]);break;case Ge.K:c=qt(o[2],s[4],s[5]);break;default:return 0}return c},t.setSliceFromCamera=n=>{const r=n.getFocalPoint();switch(e.slicingMode){case Ge.I:case Ge.J:case Ge.K:{const i=t.getSliceAtPosition(r);t.setSlice(i)}break;case Ge.X:t.setSlice(r[0]);break;case Ge.Y:t.setSlice(r[1]);break;case Ge.Z:t.setSlice(r[2]);break}},t.setXSlice=n=>{t.setSlicingMode(Ge.X),t.setSlice(n)},t.setYSlice=n=>{t.setSlicingMode(Ge.Y),t.setSlice(n)},t.setZSlice=n=>{t.setSlicingMode(Ge.Z),t.setSlice(n)},t.setISlice=n=>{t.setSlicingMode(Ge.I),t.setSlice(n)},t.setJSlice=n=>{t.setSlicingMode(Ge.J),t.setSlice(n)},t.setKSlice=n=>{t.setSlicingMode(Ge.K),t.setSlice(n)},t.getSlicingModeNormal=()=>{const n=[0,0,0],r=t.getCurrentImage().getDirection();switch(e.slicingMode){case Ge.X:n[0]=1;break;case Ge.Y:n[1]=1;break;case Ge.Z:n[2]=1;break;case Ge.I:Mi(r,[1,0,0],n);break;case Ge.J:Mi(r,[0,1,0],n);break;case Ge.K:Mi(r,[0,0,1],n);break}return n};function a(){let n;switch(e.slicingMode){case Ge.X:n=0;break;case Ge.Y:n=1;break;case Ge.Z:n=2;break;default:e.closestIJKAxis={ijkMode:e.slicingMode,flip:!1};return}const r=ll(t.getCurrentImage().getDirection());let i=0;for(;i<3&&r[n+3*i]===0;++i);const o=r[n+3*i]<0;e.closestIJKAxis={ijkMode:i,flip:o}}t.setSlicingMode=n=>{e.slicingMode!==n&&(e.slicingMode=n,t.getCurrentImage()&&a(),t.modified())},t.getClosestIJKAxis=()=>((e.closestIJKAxis===void 0||e.closestIJKAxis.ijkMode===Ge.NONE)&&t.getCurrentImage()&&a(),e.closestIJKAxis),t.computeBounds=()=>{const n=t.getCurrentImage();if(!n){de.reset(e.bounds);return}if(!e.useCustomExtents){de.setBounds(e.bounds,n.getBounds());return}const r=e.customDisplayExtent.slice(),{ijkMode:i}=t.getClosestIJKAxis();let o=e.slice;switch(i!==e.slicingMode&&(o=t.getSliceAtPosition(e.slice)),i){case Ge.I:r[0]=o,r[1]=o;break;case Ge.J:r[2]=o,r[3]=o;break;case Ge.K:r[4]=o,r[5]=o;break}de.setBounds(e.bounds,n.extentToBounds(r))},t.getBoundsForSlice=(n=e.slice,r=0)=>{const i=t.getCurrentImage();if(!i)return Ai();const o=i.getSpatialExtent(),{ijkMode:s}=t.getClosestIJKAxis();let u=n;switch(s!==e.slicingMode&&(u=t.getSliceAtPosition(n)),s){case Ge.I:o[0]=u-r,o[1]=u+r;break;case Ge.J:o[2]=u-r,o[3]=u+r;break;case Ge.K:o[4]=u-r,o[5]=u+r;break}return i.extentToBounds(o)},t.intersectWithLineForPointPicking=(n,r)=>oD(n,r,t),t.intersectWithLineForCellPicking=(n,r)=>sD(n,r,t),t.getCurrentImage=()=>t.getInputData()}var fD={slicingMode:Ge.NONE,closestIJKAxis:{ijkMode:Ge.NONE,flip:!1},renderToRectangle:!1,sliceAtFocalPoint:!1,preferSizeOverAccuracy:!1};function kg(t,e,a={}){Object.assign(e,fD,a),iD.extend(t,e,a),A.get(t,e,["slicingMode"]),A.setGet(t,e,["closestIJKAxis","renderToRectangle","sliceAtFocalPoint","preferSizeOverAccuracy"]),go.implementCoincidentTopologyMethods(t,e),lD(t,e)}var pD=A.newInstance(kg,"vtkImageMapper"),hD={newInstance:pD,extend:kg,...cD,...uD,...Q0},{InterpolationType:fs}=M8,{vtkErrorMacro:Ag}=A,ps=4;function gD(t,e){e.classHierarchy.push("vtkImageProperty"),t.getMTime=()=>{let a=e.mtime,n;for(let r=0;rn?a:n),e.componentData[r].piecewiseFunction&&(n=e.componentData[r].piecewiseFunction.getMTime(),a=a>n?a:n);return a},t.setRGBTransferFunction=(a=0,n=null)=>{let r=a,i=n;return Number.isInteger(a)||(i=a,r=0),e.componentData[r].rGBTransferFunction!==i?(e.componentData[r].rGBTransferFunction=i,t.modified(),!0):!1},t.getRGBTransferFunction=(a=0)=>e.componentData[a].rGBTransferFunction,t.setPiecewiseFunction=(a=0,n=null)=>{let r=a,i=n;return Number.isInteger(a)||(i=a,r=0),e.componentData[r].piecewiseFunction!==i?(e.componentData[r].piecewiseFunction=i,t.modified(),!0):!1},t.getPiecewiseFunction=(a=0)=>e.componentData[a].piecewiseFunction,t.setScalarOpacity=(a=0,n=null)=>{let r=a,i=n;return Number.isInteger(a)||(i=a,r=0),t.setPiecewiseFunction(r,i)},t.getScalarOpacity=(a=0)=>t.getPiecewiseFunction(a),t.setComponentWeight=(a=0,n=1)=>{if(a<0||a>=ps)return Ag("Invalid index"),!1;const r=Math.min(1,Math.max(0,n));return e.componentData[a].componentWeight!==r?(e.componentData[a].componentWeight=r,t.modified(),!0):!1},t.getComponentWeight=(a=0)=>a<0||a>=ps?(Ag("Invalid index"),0):e.componentData[a].componentWeight,t.setInterpolationTypeToNearest=()=>t.setInterpolationType(fs.NEAREST),t.setInterpolationTypeToLinear=()=>t.setInterpolationType(fs.LINEAR),t.getInterpolationTypeAsString=()=>A.enumToString(fs,e.interpolationType)}var dD=t=>({independentComponents:!1,interpolationType:fs.LINEAR,colorWindow:255,colorLevel:127.5,ambient:1,diffuse:0,opacity:1,useLookupTableScalarRange:!1,useLabelOutline:!1,labelOutlineThickness:[1],labelOutlineOpacity:1,updatedExtents:[],...t});function Vg(t,e,a={}){if(Object.assign(e,dD(a)),A.obj(t,e),!e.componentData){e.componentData=[];for(let n=0;nt,t.getImages=()=>t,t.getIsOpaque=()=>{if(e.forceOpaque)return!0;if(e.forceTranslucent)return!1;e.properties[0]||t.getProperty();let a=e.properties[0].getOpacity()>=1;return a=a&&(!e.mapper||e.mapper.getIsOpaque()),a},t.hasTranslucentPolygonalGeometry=()=>!1,t.makeProperty=Bg.newInstance,t.getBoundsForSlice=(a,n)=>{const r=e.mapper.getBoundsForSlice(a,n);if(!de.isValid(r))return r;t.computeMatrix();const i=new Float64Array(16);return We(i,e.matrix),de.transformBounds(r,i)},t.getMinXBound=()=>t.getBoundsByReference()[0],t.getMaxXBound=()=>t.getBoundsByReference()[1],t.getMinYBound=()=>t.getBoundsByReference()[2],t.getMaxYBound=()=>t.getBoundsByReference()[3],t.getMinZBound=()=>t.getBoundsByReference()[4],t.getMaxZBound=()=>t.getBoundsByReference()[5],t.getRedrawMTime=()=>{let a=e.mtime;if(e.mapper!==null){let n=e.mapper.getMTime();a=n>a?n:a,e.mapper.getInput()!==null&&(e.mapper.getInputAlgorithm().update(),n=e.mapper.getInput().getMTime(),a=n>a?n:a)}return e.properties.forEach(n=>{a=Math.max(a,n.getMTime());const r=n.getRGBTransferFunction();r!==null&&(a=Math.max(a,r.getMTime()))}),a},t.getSupportsSelection=()=>e.mapper?e.mapper.getSupportsSelection():!1}var mD={mapper:null,forceOpaque:!1,forceTranslucent:!1};function Ug(t,e,a={}){Object.assign(e,mD,a),w0.extend(t,e,a),e.boundsMTime={},A.obj(e.boundsMTime),A.setGet(t,e,["mapper","forceOpaque","forceTranslucent"]),yD(t,e)}var xD=A.newInstance(Ug,"vtkImageSlice"),CD={newInstance:xD,extend:Ug},SD="resetcamera",Gg="orientation",TD="same",wD={MODE_RESET_CAMERA:SD,MODE_ORIENTATION:Gg,MODE_SAME:TD};function _D(t,e){e.classHierarchy.push("vtkCameraSynchronizer");const a=new Float64Array(9),n=new Float64Array(3),r=[];function i(){for(;r.length;)r.pop().unsubscribe();if(!e.srcRenderer||!e.dstRenderer)return;const s=e.srcRenderer.getActiveCamera(),u=e.srcRenderer.getRenderWindow().getInteractor();r.push(s.onModified(()=>{u.isAnimating()||t.update()})),r.push(u.onAnimation(t.update)),r.push(u.onEndAnimation(t.update))}e._onSrcRendererChanged=i,e._onDstRendererChanged=i;function o(s,u,c){return a[0]!==s[0]||a[1]!==s[1]||a[2]!==s[2]||a[3]!==u[0]||a[4]!==u[1]||a[5]!==u[2]||a[6]!==c[0]||a[7]!==c[1]||a[8]!==c[2]?(a[0]=s[0],a[1]=s[1],a[2]=s[2],a[3]=u[0],a[4]=u[1],a[5]=u[2],a[6]=c[0],a[7]=c[1],a[8]=c[2],a):!1}t.update=()=>{if(!e.active||!e.srcRenderer||!e.dstRenderer)return;const s=e.srcRenderer.getActiveCamera(),u=e.dstRenderer.getActiveCamera(),c=o(s.getReferenceByName("position"),s.getReferenceByName("focalPoint"),s.getReferenceByName("viewUp"));c&&(e.mode==="orientation"?(n[0]=c[0]-c[3],n[1]=c[1]-c[4],n[2]=c[2]-c[5],He(n),u.setPosition(e.focalPoint[0]+e.distance*n[0],e.focalPoint[1]+e.distance*n[1],e.focalPoint[2]+e.distance*n[2]),u.setFocalPoint(e.focalPoint[0],e.focalPoint[1],e.focalPoint[2]),u.setViewUp(c[6],c[7],c[8])):(u.setPosition(c[0],c[1],c[2]),u.setFocalPoint(c[3],c[4],c[5]),u.setViewUp(c[6],c[7],c[8])),e.mode==="resetcamera"&&e.dstRenderer.resetCamera())},t.delete=In(()=>t.setSrcRenderer(null),t.delete),i()}var ED={mode:Gg,focalPoint:[0,0,0],distance:6.8,active:!0};function Ig(t,e,a={}){Object.assign(e,ED,a),lt(t,e),ht(t,e,["mode","active","srcRenderer","dstRenderer","distance"]),Di(t,e,["focalPoint"],3,0),_D(t,e)}var DD=qe(Ig,"vtkCameraSynchronizer"),Pc={newInstance:DD,extend:Ig,SynchronizationMode:wD},zc={},OD=class{constructor(t,e){this.ctx=t,this.behavior=Pc.newInstance(this.getProperties(e)),this.behavior.update()}getProperties({actorBounds:t,srcRenderer:e,dstRenderer:a}){return{distance:3.4*Math.max(t[1]-t[0],t[3]-t[2],t[5]-t[4]),focalPoint:[.5*(t[0]+t[1]),.5*(t[2]+t[3]),.5*(t[4]+t[5])],mode:Pc.SynchronizationMode.MODE_ORIENTATION,srcRenderer:this.ctx.getInstance(e),dstRenderer:this.ctx.getInstance(a)}}update(t){this.behavior.set(this.getProperties(t)),this.behavior.update()}delete(){this.behavior.delete()}},Pg={CameraSync:OD};function bD(t,e,a){const n=t.get("synchronizedViewId").synchronizedViewId;if(!e.behaviors||!n)return;zc[n]||(zc[n]={});const r=zc[n];if(e.behaviors.autoOrientation){const s=t.getRenderers();if(!r.autoOrientationAxes&&s.length===2){let u=null,c=null;for(let p=0;p`instance:\${${t}}`,yi={},Wc=[],hs={},RD={vtkPoints:kt,vtkCellArray:Mn,vtkDataArray:pe};function LD(t,e){return e.map(a=>{const n=zg.exec(a);return n?t.getInstance(n[1]):a})}function Wg(t){return t.map(e=>zg.exec(e)).filter(e=>e).map(e=>e[1])}function jg(t,e=[]){return t.dependencies&&t.dependencies.forEach(a=>{e.push(a.id),jg(a,e)}),e}function FD(t){for(;t.length;){const[e,a]=t.shift();e(...a)}}function kD(t,e,a){return n=>{const r=e.registration?e.registration:"addArray",i=e.location?t.getReferenceByName(e.location):t;let o=null;if(e.location?o=t.getReferenceByName(e.location).getArray(e.name):o=t[`get${r.substring(3)}`](),o)return o.getData()!==n&&a.push([o.setData,[n,e.numberOfComponents]]),o;const s=RD[e.vtkClass?e.vtkClass:"vtkDataArray"].newInstance({...e,values:n});return a.push([i[r],[s]]),s}}function gs(t,e,a,n){if(!e)return Promise.reject(new Error("No instance provided."));const r=Bn[t];return r&&r.update?r.update(e,a,n):Promise.reject(new Error(`No updater for ${t}`))}function jc(t,e={}){const a=Bn[t];return a&&a.build?a.build(e):(console.log("No builder for",t),null)}function AD(t,e,a){hs[t]={key:e,value:a}}function VD(){return Object.keys(Bn)}function $g(){Object.keys(Bn).forEach(t=>{delete Bn[t]})}function BD(t,e,a){return gs("vtkRenderWindow",t,e,a)}function UD(){Object.keys(yi).forEach(t=>{delete yi[t]})}function GD(...t){if(t.length===0)return UD();let e=t;return e.length===1&&Array.isArray(e[0])&&(e=e[0]),e.forEach(a=>{delete yi[a]}),e}function $c(t){if(t[1].length===1)return Wc.indexOf(t[1][0])===-1;let e=!1;for(let a=0;a{const{id:i,type:o}=r;if(hs[o]){const{key:u,value:c}=hs[o];if(!u||r.properties[u]===c){Wc.push(ND(i));return}}let s=a.getInstance(i);s||(s=jc(o,{managedInstanceId:i}),a.registerInstance(i,s)),gs(o,s,r,a)}),e.calls&&e.calls.filter($c).forEach(r=>{t[r[0]].apply(null,LD(a,r[1]))});const n=[];if(e.arrays){const r=[],i=Object.values(e.arrays).map(o=>(a.start(),a.getArray(o.hash,o.dataType,a).then(kD(t,o,r)).catch(s=>{console.log("Error fetching array",JSON.stringify(o),s)}).finally(a.end)));a.start(),n.push(Promise.all(i).then(()=>(r.length&&t.modified(),FD(r),!0)).catch(o=>{console.error("Error in array handling for state",JSON.stringify(e),o)}).finally(a.end))}return a.end(),Promise.all(n)}function Hg(t,e,a){yi[e.id]||ut(t,e,a),yi[e.id]=!0}function ID(t,e,a){ut(t,e,a);const n=new Set;e.dependencies&&e.dependencies.forEach(i=>{const o=a.getInstance(i.id);if(o){const s=jg(i);o.set({flattenedDepIds:s},!0),s.forEach(u=>n.add(u))}});const r=new Set;e.calls&&e.calls.filter($c).filter(i=>i[0]==="removeViewProp").forEach(i=>{Wg(i[1]).forEach(o=>{var u;const s=(u=a.getInstance(o))==null?void 0:u.get("flattenedDepIds").flattenedDepIds;s&&s.forEach(c=>r.add(c)),r.add(o)})}),[...r].filter(i=>!n.has(i)).forEach(i=>a.unregisterInstance(i))}function PD(t,e,a){e.calls&&e.calls.filter($c).filter(n=>n[0]==="removeRenderer").forEach(n=>{Wg(n[1]).forEach(r=>{a.getInstance(r).getViewProps().forEach(i=>{const o=i.get("flattenedDepIds").flattenedDepIds;o&&o.forEach(s=>a.unregisterInstance(s)),a.unregisterInstance(a.getInstanceId(i))})})}),t.render(),ut(t,e,a),MD.applyBehaviors(t,e,a)}function zD(t,e,a){if(a.start(),!e.properties.nodes)t.set(e.properties);else{const n=e.properties.nodes.map(([r,i,o,s,u,c])=>({x:r,r:i,g:o,b:s,midpoint:u,sharpness:c}));t.set({...e.properties,nodes:n},!0)}a.end()}function WD(t,e,a){if(a.start(),!e.properties.nodes)t.set(e.properties);else{const n=e.properties.nodes.map(([r,i,o,s])=>({x:r,y:i,midpoint:o,sharpness:s}));t.set({...e.properties,nodes:n},!0),t.sortAndUpdateRange()}a.end()}function Kg(t,e){const a=[],n=t.getNumberOfArrays();for(let r=0;r{n.start();const r={...a.properties};a.arrays||(a.arrays={});for(let c=0;c{o[c].add(p)}),Kg(e.getPointData(),o.pointData),Kg(e.getCellData(),o.cellData);const s={...a};s.properties=r;const u=ut(e,s,n);return n.end(),u}}var jD=qg(["points","polys","verts","lines","strips"]),$D=qg([]);function Hc(t,e=null,a=ut){if(!jc&&!gs){delete Bn[t];return}Bn[t]={build:e,update:a}}var Yg={vtkMapper:["vtkOpenGLPolyDataMapper","vtkCompositePolyDataMapper2","vtkDataSetMapper"],vtkProperty:["vtkOpenGLProperty"],vtkRenderer:["vtkOpenGLRenderer"],vtkCamera:["vtkOpenGLCamera"],vtkColorTransferFunction:["vtkPVDiscretizableColorTransferFunction"],vtkActor:["vtkOpenGLActor","vtkPVLODActor"],vtkLight:["vtkOpenGLLight","vtkPVLight"],vtkTexture:["vtkOpenGLTexture"],vtkImageMapper:["vtkOpenGLImageSliceMapper"],vtkVolumeMapper:["vtkFixedPointVolumeRayCastMapper"]},Jg={vtkAxesActor:{build:tD.newInstance,update:ut},vtkRenderWindow:{build:kc.newInstance,update:PD},vtkRenderer:{build:_g.newInstance,update:ID},vtkLookupTable:{build:yp.newInstance,update:ut},vtkCamera:{build:Ac.newInstance,update:Hg},vtkPolyData:{build:Je.newInstance,update:jD},vtkImageData:{build:_0.newInstance,update:$D},vtkMapper:{build:dn.newInstance,update:ut},vtkGlyph3DMapper:{build:qh.newInstance,update:ut},vtkProperty:{build:yr.newInstance,update:ut},vtkActor:{build:hn.newInstance,update:ut},vtkLight:{build:Cg.newInstance,update:ut},vtkColorTransferFunction:{build:Oc.newInstance,update:zD},vtkTexture:{build:k0.newInstance,update:ut},vtkVolume:{build:VE.newInstance,update:ut},vtkVolumeMapper:{build:WE.newInstance,update:ut},vtkVolumeProperty:{build:Dg.newInstance,update:ut},vtkImageSlice:{build:CD.newInstance,update:ut},vtkImageMapper:{build:hD.newInstance,update:ut},vtkImageProperty:{build:Bg.newInstance,update:ut},vtkPiecewiseFunction:{build:os.newInstance,update:WD},vtkCubeAxesActor:{build:X0.newInstance,update:ut},vtkScalarBarActor:{build:H1.newInstance,update:ut}};function Zg(t=!0){t&&$g(),Object.keys(Jg).forEach(e=>{const a=Jg[e];Hc(e,a.build,a.update)})}function Kc(){Object.keys(Yg).forEach(t=>{Yg[t].forEach(e=>{Bn[e]=Bn[t]})})}function HD(){Hc("vtkCamera",Ac.newInstance),Kc()}Zg(),Kc(),hs.vtkPVLight={};var Xc={build:jc,update:gs,genericUpdater:ut,oneTimeGenericUpdater:Hg,setTypeMapping:Hc,clearTypeMapping:$g,getSupportedTypes:VD,clearOneTimeUpdaters:GD,updateRenderWindow:BD,excludeInstance:AD,setDefaultMapping:Zg,applyDefaultAliases:Kc,alwaysUpdateCamera:HD},Ur={};function Qg(){const t={};let e=null;function a(o){e=o}function n(o,s,u){const c=t[o];return c?(c.mtimes[u.getActiveViewId()]=u.getMTime(),new Promise((p,l)=>{p(c.array)})):e?new Promise((p,l)=>{e(o).then(f=>{let h=f;if(typeof f=="string"&&(h=Fr.toArrayBuffer(f)),h instanceof Blob){const v=new FileReader;v.onload=()=>{const m=ar(s,v.result);t[o]={mtimes:{[u.getActiveViewId()]:u.getMTime()},array:m},p(m)},v.readAsArrayBuffer(h)}else{const v=ar(s,h);t[o]={mtimes:{[u.getActiveViewId()]:u.getMTime()},array:v},p(v)}},f=>{console.log("Error getting data array:"),console.log(f),l(f)})}):Promise.reject(new Error('No array fetcher found, please use "setArrayFetcher" to provide one'))}function r(){Object.keys(t).forEach(o=>{delete t[o]})}function i(o,s){const u=s.getMTime()-o;Object.keys(t).filter(c=>t[c].mtimes[s.getActiveViewId()]).filter(c=>t[c].mtimes[s.getActiveViewId()]{delete t[c]})}return{setFetchArrayFunction:a,getArray:n,emptyCachedArrays:r,freeOldArrays:i}}function ed(){const t={};function e(o){return t[o]}function a(o){let s=null;return Object.keys(t).forEach(u=>{o===t[u]&&(s=u)}),s}function n(o,s){t[o]=s,s.set({remoteId:o},!0,!0)}function r(o){delete t[o]}function i(){Object.keys(t).forEach(o=>{delete t[o]})}return{getInstance:e,getInstanceId:a,registerInstance:n,unregisterInstance:r,emptyCachedInstances:i}}function td(){let t=0;const e={start(){t+=1,e.invokeProgressEvent(t)},end(){t-=1,e.invokeProgressEvent(t),t===0&&e.invokeProgressDone()},resetProgress(){t=0}},a={};return jr(e,a,"progressEvent"),jr(e,a,"progressDone"),e}function nd(){const t={};let e="default";function a(o){return t[o||e]||1}function n(o){const s=o||e;t[s]||(t[s]=1),t[s]+=1}function r(o){e=o}function i(){return e}return{getMTime:a,incrementMTime:n,setActiveViewId:r,getActiveViewId:i}}function qc(t="default"){let e=Ur[t];return e||(e={...Qg(),...ed(),...td(),...nd()},Ur[t]=e),e}function KD(t,e){Ur[t]=e}function XD(t){if(t&&Ur[t]&&delete Ur[t],!t){const e=Object.keys(Ur);for(let a=0;al.get("managedInstanceId").managedInstanceId,i=()=>Ca(t,r);function o(){Xc.clearOneTimeUpdaters(i())}function s(l){t.set({synchronizedViewId:l},!0,!0)}function u(){return t.get("synchronizedViewId").synchronizedViewId}function c(l){n=l}function p(l){u()||s(l.id);const f=l.mtime||0;return u()===l.id&&a{const m=e.onProgressDone(()=>{m.unsubscribe(),t.render(),h(!0)});a=f,e.setActiveViewId(l.id),e.incrementMTime(),Xc.updateRenderWindow(t,l,e),e.freeOldArrays(n,e)}):Promise.resolve(!1)}return{synchronize:p,setSynchronizedViewId:s,getSynchronizedViewId:u,updateGarbageCollectorThreshold:c,getManagedInstanceIds:i,clearOneTimeUpdaters:o}}function qD(t,e){e.classHierarchy.push("vtkSynchronizableRenderWindow"),e.synchronizerContext||(e.synchronizerContext=qc(e.synchronizerContextName));const a=rd(t,e.synchronizerContext);Object.keys(a).forEach(n=>{t[n]?t[n]=In(t[n],a[n]):t[n]=a[n]})}var YD={synchronizerContextName:"default",synchronizerContext:null,synchronizedViewId:null};function ad(t,e,a={}){Object.assign(e,YD,a),kc.extend(t,e),Bt(t,e,["synchronizerContext"]),qD(t,e)}var JD=qe(ad,"vtkSynchronizableRenderWindow");function ZD(t,e="default"){const a=rd(t,qc(e));return{...a,...t,delete:In(t.delete,a.delete)}}var id={newInstance:JD,extend:ad,getSynchronizerContext:qc,setSynchronizerContext:KD,clearSynchronizerContext:XD,decorate:ZD,createInstanceMap:ed,createArrayHandler:Qg,createProgressHandler:td,createSceneMtimeHandler:nd,vtkObjectManager:Xc};function QD(t,e){e.classHierarchy.push("vtkRenderPass"),t.getOperation=()=>e.currentOperation,t.setCurrentOperation=a=>{e.currentOperation=a,e.currentTraverseOperation=`traverse${A.capitalize(e.currentOperation)}`},t.getTraverseOperation=()=>e.currentTraverseOperation,t.traverse=(a,n=null)=>{e.deleted||(e._currentParent=n,e.preDelegateOperations.forEach(r=>{t.setCurrentOperation(r),a.traverse(t)}),e.delegates.forEach(r=>{r.traverse(a,t)}),e.postDelegateOperations.forEach(r=>{t.setCurrentOperation(r),a.traverse(t)}))}}var eO={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function od(t,e,a={}){Object.assign(e,eO,a),A.obj(t,e),A.get(t,e,["currentOperation"]),A.setGet(t,e,["delegates","_currentParent","preDelegateOperations","postDelegateOperations"]),A.moveToProtected(t,e,["currentParent"]),QD(t,e)}var tO=A.newInstance(od,"vtkRenderPass"),Yc={newInstance:tO,extend:od},{Representation:nO}=yr,{vtkErrorMacro:sd}=A;function rO(t){t.Fragment=Z.substitute(t.Fragment,"//VTK::RenderPassFragmentShader::Impl",` float weight = gl_FragData[0].a * pow(max(1.1 - gl_FragCoord.z, 0.0), 2.0); gl_FragData[0] = vec4(gl_FragData[0].rgb*weight, gl_FragData[0].a); gl_FragData[1].r = weight; - `,!1);t.Fragment=e.result}const TD=`//VTK::System::Dec + `,!1).result}var aO=`//VTK::System::Dec in vec2 tcoord; @@ -3784,10 +3944,10 @@ void main() float t2Color = texture(translucentRTexture, tcoord).r; gl_FragData[0] = vec4(t1Color.rgb/max(t2Color,0.01), 1.0 - t1Color.a); } -`;function wD(t,e){e.classHierarchy.push("vtkOpenGLOrderIndependentTranslucentPass"),t.createVertexBuffer=()=>{const a=new Float32Array([-1,-1,-1,1,-1,-1,-1,1,-1,1,1,-1]),n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array([4,0,1,3,2]),i=pe.newInstance({numberOfComponents:3,values:a});i.setName("points");const o=pe.newInstance({numberOfComponents:2,values:n});o.setName("tcoords");const s=pe.newInstance({numberOfComponents:1,values:r});e.tris.getCABO().createVBO(s,"polys",CD.SURFACE,{points:i,tcoords:o,cellOffset:0}),e.VBOBuildTime.modified()},t.createFramebuffer=a=>{const n=a.getSize(),r=a.getContext();e.framebuffer=Er.newInstance(),e.framebuffer.setOpenGLRenderWindow(a),e.framebuffer.create(...n),e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.bind(),e.translucentRGBATexture=Re.newInstance(),e.translucentRGBATexture.setInternalFormat(r.RGBA16F),e.translucentRGBATexture.setFormat(r.RGBA),e.translucentRGBATexture.setOpenGLDataType(r.HALF_FLOAT),e.translucentRGBATexture.setOpenGLRenderWindow(a),e.translucentRGBATexture.create2DFromRaw({width:n[0],height:n[1],numComps:4,dataType:"Float32Array",data:null}),e.translucentRTexture=Re.newInstance(),e.translucentRTexture.setInternalFormat(r.R16F),e.translucentRTexture.setFormat(r.RED),e.translucentRTexture.setOpenGLDataType(r.HALF_FLOAT),e.translucentRTexture.setOpenGLRenderWindow(a),e.translucentRTexture.create2DFromRaw({width:n[0],height:n[1],numComps:1,dataType:"Float32Array",data:null}),e.translucentZTexture=Re.newInstance(),e.translucentZTexture.setOpenGLRenderWindow(a),e.translucentZTexture.createDepthFromRaw({width:n[0],height:n[1],dataType:"Float32Array",data:null}),e.framebuffer.setColorBuffer(e.translucentRGBATexture,0),e.framebuffer.setColorBuffer(e.translucentRTexture,1),e.framebuffer.setDepthBuffer(e.translucentZTexture)},t.createCopyShader=a=>{e.copyShader=a.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","attribute vec2 tcoordTC;","varying vec2 tcoord;","void main() { tcoord = tcoordTC; gl_Position = vertexDC; }"].join(` -`),TD,"")},t.createVBO=a=>{const n=a.getContext();e.tris.setOpenGLRenderWindow(a),t.createVertexBuffer();const r=e.copyShader;e.tris.getCABO().bind(),e.copyVAO.addAttributeArray(r,e.tris.getCABO(),"vertexDC",e.tris.getCABO().getVertexOffset(),e.tris.getCABO().getStride(),n.FLOAT,3,n.FALSE)||Kg("Error setting vertexDC in copy shader VAO."),e.copyVAO.addAttributeArray(r,e.tris.getCABO(),"tcoordTC",e.tris.getCABO().getTCoordOffset(),e.tris.getCABO().getStride(),n.FLOAT,2,n.FALSE)||Kg("Error setting vertexDC in copy shader VAO.")},t.traverse=(a,n,r)=>{if(e.deleted)return;const i=a.getSize(),o=a.getContext();if(e._supported=!1,n.getSelector()||!o||!a.getWebgl2()||!o.getExtension("EXT_color_buffer_half_float")&&!o.getExtension("EXT_color_buffer_float")){t.setCurrentOperation("translucentPass"),n.traverse(t);return}if(e._supported=!0,e.framebuffer===null)t.createFramebuffer(a);else{const c=e.framebuffer.getSize();c===null||c[0]!==i[0]||c[1]!==i[1]?(e.framebuffer.releaseGraphicsResources(),e.translucentRGBATexture.releaseGraphicsResources(a),e.translucentRTexture.releaseGraphicsResources(a),e.translucentZTexture.releaseGraphicsResources(a),t.createFramebuffer(a)):(e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.bind())}o.drawBuffers([o.COLOR_ATTACHMENT0]),o.clearBufferfv(o.COLOR,0,[0,0,0,0]),o.clearBufferfv(o.DEPTH,0,[1]),o.colorMask(!1,!1,!1,!1),r.getOpaqueActorCount()>0&&(r.setCurrentOperation("opaqueZBufferPass"),n.traverse(r)),o.colorMask(!0,!0,!0,!0),o.drawBuffers([o.COLOR_ATTACHMENT0,o.COLOR_ATTACHMENT1]),o.viewport(0,0,i[0],i[1]),o.scissor(0,0,i[0],i[1]),o.clearBufferfv(o.COLOR,0,[0,0,0,1]),o.clearBufferfv(o.COLOR,1,[0,0,0,0]),o.enable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFuncSeparate(o.ONE,o.ONE,o.ZERO,o.ONE_MINUS_SRC_ALPHA),t.setCurrentOperation("translucentPass"),n.traverse(t),o.drawBuffers([o.NONE]),e.framebuffer.restorePreviousBindingsAndBuffers(),e.copyShader===null?t.createCopyShader(a):a.getShaderCache().readyShaderProgram(e.copyShader),e.copyVAO||(e.copyVAO=ja.newInstance(),e.copyVAO.setOpenGLRenderWindow(a)),e.copyVAO.bind(),e.VBOBuildTime.getMTime()e._supported?SD:null,t.releaseGraphicsResources=a=>{e.framebuffer&&(e.framebuffer.releaseGraphicsResources(a),e.framebuffer=null),e.translucentRGBATexture&&(e.translucentRGBATexture.releaseGraphicsResources(a),e.translucentRGBATexture=null),e.translucentRTexture&&(e.translucentRTexture.releaseGraphicsResources(a),e.translucentRTexture=null),e.translucentZTexture&&(e.translucentZTexture.releaseGraphicsResources(a),e.translucentZTexture=null),e.copyVAO&&(e.copyVAO.releaseGraphicsResources(a),e.copyVAO=null),e.copyShader&&(e.copyShader.releaseGraphicsResources(a),e.copyShader=null),e.tris&&(e.tris.releaseGraphicsResources(a),e.tris=null),t.modified()}}const _D={framebuffer:null,copyShader:null,tris:null};function Xg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,_D,a),zc.extend(t,e,a),e.VBOBuildTime={},V.obj(e.VBOBuildTime,{mtime:0}),e.tris=jt.newInstance(),V.get(t,e,["framebuffer"]),wD(t,e)}var ED={newInstance:V.newInstance(Xg,"vtkOpenGLOrderIndependentTranslucentPass"),extend:Xg};function DD(t,e){e.classHierarchy.push("vtkForwardPass"),t.traverse=function(a){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(e.deleted)return;e._currentParent=n,t.setCurrentOperation("buildPass"),a.traverse(t);const r=a.getRenderable().getNumberOfLayers(),i=a.getRenderable().getRenderersByReference();for(let o=0;o0||e.translucentActorCount>0)&&e.volumeCount>0||e.depthRequested){const p=a.getFramebufferSize();e.framebuffer===null&&(e.framebuffer=Er.newInstance()),e.framebuffer.setOpenGLRenderWindow(a),e.framebuffer.saveCurrentBindingsAndBuffers();const u=e.framebuffer.getSize();(u===null||u[0]!==p[0]||u[1]!==p[1])&&(e.framebuffer.create(p[0],p[1]),e.framebuffer.populateFramebuffer()),e.framebuffer.bind(),t.setCurrentOperation("zBufferPass"),l.traverse(t),e.framebuffer.restorePreviousBindingsAndBuffers(),e.depthRequested=!1}t.setCurrentOperation("cameraPass"),l.traverse(t),e.opaqueActorCount>0&&(t.setCurrentOperation("opaquePass"),l.traverse(t)),e.translucentActorCount>0&&(e.translucentPass||(e.translucentPass=ED.newInstance()),e.translucentPass.traverse(a,l,t)),e.volumeCount>0&&(t.setCurrentOperation("volumePass"),l.traverse(t)),e.overlayActorCount>0&&(t.setCurrentOperation("overlayPass"),l.traverse(t))}}},t.getZBufferTexture=()=>e.framebuffer?e.framebuffer.getColorTexture():null,t.requestDepth=()=>{e.depthRequested=!0},t.incrementOpaqueActorCount=()=>e.opaqueActorCount++,t.incrementTranslucentActorCount=()=>e.translucentActorCount++,t.incrementVolumeCount=()=>e.volumeCount++,t.incrementOverlayActorCount=()=>e.overlayActorCount++}const OD={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function qg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,OD,a),zc.extend(t,e,a),V.get(t,e,["framebuffer","opaqueActorCount","translucentActorCount","volumeCount"]),DD(t,e)}var bD={newInstance:V.newInstance(qg,"vtkForwardPass"),extend:qg},jc={},MD={get exports(){return jc},set exports(t){jc=t}};(function(t,e){(function(a){t.exports=a()})(function(a){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(x,y){var g=x[0],C=x[1],S=x[2],T=x[3];g+=(C&S|~C&T)+y[0]-680876936|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+y[1]-389564586|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+y[2]+606105819|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+y[3]-1044525330|0,C=(C<<22|C>>>10)+S|0,g+=(C&S|~C&T)+y[4]-176418897|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+y[5]+1200080426|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+y[6]-1473231341|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+y[7]-45705983|0,C=(C<<22|C>>>10)+S|0,g+=(C&S|~C&T)+y[8]+1770035416|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+y[9]-1958414417|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+y[10]-42063|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+y[11]-1990404162|0,C=(C<<22|C>>>10)+S|0,g+=(C&S|~C&T)+y[12]+1804603682|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+y[13]-40341101|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+y[14]-1502002290|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+y[15]+1236535329|0,C=(C<<22|C>>>10)+S|0,g+=(C&T|S&~T)+y[1]-165796510|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+y[6]-1069501632|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+y[11]+643717713|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+y[0]-373897302|0,C=(C<<20|C>>>12)+S|0,g+=(C&T|S&~T)+y[5]-701558691|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+y[10]+38016083|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+y[15]-660478335|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+y[4]-405537848|0,C=(C<<20|C>>>12)+S|0,g+=(C&T|S&~T)+y[9]+568446438|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+y[14]-1019803690|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+y[3]-187363961|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+y[8]+1163531501|0,C=(C<<20|C>>>12)+S|0,g+=(C&T|S&~T)+y[13]-1444681467|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+y[2]-51403784|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+y[7]+1735328473|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+y[12]-1926607734|0,C=(C<<20|C>>>12)+S|0,g+=(C^S^T)+y[5]-378558|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+y[8]-2022574463|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+y[11]+1839030562|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+y[14]-35309556|0,C=(C<<23|C>>>9)+S|0,g+=(C^S^T)+y[1]-1530992060|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+y[4]+1272893353|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+y[7]-155497632|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+y[10]-1094730640|0,C=(C<<23|C>>>9)+S|0,g+=(C^S^T)+y[13]+681279174|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+y[0]-358537222|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+y[3]-722521979|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+y[6]+76029189|0,C=(C<<23|C>>>9)+S|0,g+=(C^S^T)+y[9]-640364487|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+y[12]-421815835|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+y[15]+530742520|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+y[2]-995338651|0,C=(C<<23|C>>>9)+S|0,g+=(S^(C|~T))+y[0]-198630844|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+y[7]+1126891415|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+y[14]-1416354905|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+y[5]-57434055|0,C=(C<<21|C>>>11)+S|0,g+=(S^(C|~T))+y[12]+1700485571|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+y[3]-1894986606|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+y[10]-1051523|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+y[1]-2054922799|0,C=(C<<21|C>>>11)+S|0,g+=(S^(C|~T))+y[8]+1873313359|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+y[15]-30611744|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+y[6]-1560198380|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+y[13]+1309151649|0,C=(C<<21|C>>>11)+S|0,g+=(S^(C|~T))+y[4]-145523070|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+y[11]-1120210379|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+y[2]+718787259|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+y[9]-343485551|0,C=(C<<21|C>>>11)+S|0,x[0]=g+x[0]|0,x[1]=C+x[1]|0,x[2]=S+x[2]|0,x[3]=T+x[3]|0}function i(x){var y=[],g;for(g=0;g<64;g+=4)y[g>>2]=x.charCodeAt(g)+(x.charCodeAt(g+1)<<8)+(x.charCodeAt(g+2)<<16)+(x.charCodeAt(g+3)<<24);return y}function o(x){var y=[],g;for(g=0;g<64;g+=4)y[g>>2]=x[g]+(x[g+1]<<8)+(x[g+2]<<16)+(x[g+3]<<24);return y}function s(x){var y=x.length,g=[1732584193,-271733879,-1732584194,271733878],C,S,T,w,_,E;for(C=64;C<=y;C+=64)r(g,i(x.substring(C-64,C)));for(x=x.substring(C-64),S=x.length,T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C=0;C>2]|=x.charCodeAt(C)<<(C%4<<3);if(T[C>>2]|=128<<(C%4<<3),C>55)for(r(g,T),C=0;C<16;C+=1)T[C]=0;return w=y*8,w=w.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(w[2],16),E=parseInt(w[1],16)||0,T[14]=_,T[15]=E,r(g,T),g}function c(x){var y=x.length,g=[1732584193,-271733879,-1732584194,271733878],C,S,T,w,_,E;for(C=64;C<=y;C+=64)r(g,o(x.subarray(C-64,C)));for(x=C-64>2]|=x[C]<<(C%4<<3);if(T[C>>2]|=128<<(C%4<<3),C>55)for(r(g,T),C=0;C<16;C+=1)T[C]=0;return w=y*8,w=w.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(w[2],16),E=parseInt(w[1],16)||0,T[14]=_,T[15]=E,r(g,T),g}function l(x){var y="",g;for(g=0;g<4;g+=1)y+=n[x>>g*8+4&15]+n[x>>g*8&15];return y}function p(x){var y;for(y=0;yT?new ArrayBuffer(0):(w=T-S,_=new ArrayBuffer(w),E=new Uint8Array(_),D=new Uint8Array(this,S,w),E.set(D),_)}}();function u(x){return/[\u0080-\uFFFF]/.test(x)&&(x=unescape(encodeURIComponent(x))),x}function f(x,y){var g=x.length,C=new ArrayBuffer(g),S=new Uint8Array(C),T;for(T=0;T>2]|=y.charCodeAt(C)<<(C%4<<3);return this._finish(S,g),T=p(this._hash),x&&(T=v(T)),this.reset(),T},m.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},m.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},m.prototype.setState=function(x){return this._buff=x.buff,this._length=x.length,this._hash=x.hash,this},m.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},m.prototype._finish=function(x,y){var g=y,C,S,T;if(x[g>>2]|=128<<(g%4<<3),g>55)for(r(this._hash,x),g=0;g<16;g+=1)x[g]=0;C=this._length*8,C=C.toString(16).match(/(.*?)(.{0,8})$/),S=parseInt(C[2],16),T=parseInt(C[1],16)||0,x[14]=S,x[15]=T,r(this._hash,x)},m.hash=function(x,y){return m.hashBinary(u(x),y)},m.hashBinary=function(x,y){var g=s(x),C=p(g);return y?v(C):C},m.ArrayBuffer=function(){this.reset()},m.ArrayBuffer.prototype.append=function(x){var y=d(this._buff.buffer,x,!0),g=y.length,C;for(this._length+=x.byteLength,C=64;C<=g;C+=64)r(this._hash,o(y.subarray(C-64,C)));return this._buff=C-64>2]|=y[S]<<(S%4<<3);return this._finish(C,g),T=p(this._hash),x&&(T=v(T)),this.reset(),T},m.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},m.ArrayBuffer.prototype.getState=function(){var x=m.prototype.getState.call(this);return x.buff=h(x.buff),x},m.ArrayBuffer.prototype.setState=function(x){return x.buff=f(x.buff,!0),m.prototype.setState.call(this,x)},m.ArrayBuffer.prototype.destroy=m.prototype.destroy,m.ArrayBuffer.prototype._finish=m.prototype._finish,m.ArrayBuffer.hash=function(x,y){var g=c(new Uint8Array(x)),C=p(g);return y?v(C):C},m})})(MD);const ND=jc,RD=["lastShaderProgramBound","context","_openGLRenderWindow"];function LD(t,e){e.classHierarchy.push("vtkShaderCache"),t.replaceShaderValues=(a,n,r)=>{let i=n;r.length>0&&(i=Q.substitute(i,"VSOut","GSOut").result);const o=e._openGLRenderWindow.getWebgl2();let s=` -`,c=`#version 100 -`;o?c=`#version 300 es +`;function iO(t,e){e.classHierarchy.push("vtkOpenGLOrderIndependentTranslucentPass"),t.createVertexBuffer=()=>{const a=new Float32Array([-1,-1,-1,1,-1,-1,-1,1,-1,1,1,-1]),n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array([4,0,1,3,2]),i=pe.newInstance({numberOfComponents:3,values:a});i.setName("points");const o=pe.newInstance({numberOfComponents:2,values:n});o.setName("tcoords");const s=pe.newInstance({numberOfComponents:1,values:r});e.tris.getCABO().createVBO(s,"polys",nO.SURFACE,{points:i,tcoords:o,cellOffset:0}),e.VBOBuildTime.modified()},t.createFramebuffer=a=>{const n=a.getSize(),r=a.getContext();e.framebuffer=Or.newInstance(),e.framebuffer.setOpenGLRenderWindow(a),e.framebuffer.create(...n),e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.bind(),e.translucentRGBATexture=Ne.newInstance(),e.translucentRGBATexture.setInternalFormat(r.RGBA16F),e.translucentRGBATexture.setFormat(r.RGBA),e.translucentRGBATexture.setOpenGLDataType(r.HALF_FLOAT),e.translucentRGBATexture.setOpenGLRenderWindow(a),e.translucentRGBATexture.create2DFromRaw({width:n[0],height:n[1],numComps:4,dataType:"Float32Array",data:null}),e.translucentRTexture=Ne.newInstance(),e.translucentRTexture.setInternalFormat(r.R16F),e.translucentRTexture.setFormat(r.RED),e.translucentRTexture.setOpenGLDataType(r.HALF_FLOAT),e.translucentRTexture.setOpenGLRenderWindow(a),e.translucentRTexture.create2DFromRaw({width:n[0],height:n[1],numComps:1,dataType:"Float32Array",data:null}),e.translucentZTexture=Ne.newInstance(),e.translucentZTexture.setOpenGLRenderWindow(a),e.translucentZTexture.createDepthFromRaw({width:n[0],height:n[1],dataType:"Float32Array",data:null}),e.framebuffer.setColorBuffer(e.translucentRGBATexture,0),e.framebuffer.setColorBuffer(e.translucentRTexture,1),e.framebuffer.setDepthBuffer(e.translucentZTexture)},t.createCopyShader=a=>{e.copyShader=a.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","attribute vec2 tcoordTC;","varying vec2 tcoord;","void main() { tcoord = tcoordTC; gl_Position = vertexDC; }"].join(` +`),aO,"")},t.createVBO=a=>{const n=a.getContext();e.tris.setOpenGLRenderWindow(a),t.createVertexBuffer();const r=e.copyShader;e.tris.getCABO().bind(),e.copyVAO.addAttributeArray(r,e.tris.getCABO(),"vertexDC",e.tris.getCABO().getVertexOffset(),e.tris.getCABO().getStride(),n.FLOAT,3,n.FALSE)||sd("Error setting vertexDC in copy shader VAO."),e.copyVAO.addAttributeArray(r,e.tris.getCABO(),"tcoordTC",e.tris.getCABO().getTCoordOffset(),e.tris.getCABO().getStride(),n.FLOAT,2,n.FALSE)||sd("Error setting vertexDC in copy shader VAO.")},t.traverse=(a,n,r)=>{if(e.deleted)return;const i=a.getSize(),o=a.getContext();if(e._supported=!1,n.getSelector()||!o||!a.getWebgl2()||!o.getExtension("EXT_color_buffer_half_float")&&!o.getExtension("EXT_color_buffer_float")){t.setCurrentOperation("translucentPass"),n.traverse(t);return}if(e._supported=!0,e.framebuffer===null)t.createFramebuffer(a);else{const p=e.framebuffer.getSize();p===null||p[0]!==i[0]||p[1]!==i[1]?(e.framebuffer.releaseGraphicsResources(),e.translucentRGBATexture.releaseGraphicsResources(a),e.translucentRTexture.releaseGraphicsResources(a),e.translucentZTexture.releaseGraphicsResources(a),t.createFramebuffer(a)):(e.framebuffer.saveCurrentBindingsAndBuffers(),e.framebuffer.bind())}o.drawBuffers([o.COLOR_ATTACHMENT0]),o.clearBufferfv(o.COLOR,0,[0,0,0,0]),o.clearBufferfv(o.DEPTH,0,[1]),o.colorMask(!1,!1,!1,!1),r.getOpaqueActorCount()>0&&(r.setCurrentOperation("opaqueZBufferPass"),n.traverse(r)),o.colorMask(!0,!0,!0,!0),o.drawBuffers([o.COLOR_ATTACHMENT0,o.COLOR_ATTACHMENT1]),o.viewport(0,0,i[0],i[1]),o.scissor(0,0,i[0],i[1]),o.clearBufferfv(o.COLOR,0,[0,0,0,1]),o.clearBufferfv(o.COLOR,1,[0,0,0,0]),o.enable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFuncSeparate(o.ONE,o.ONE,o.ZERO,o.ONE_MINUS_SRC_ALPHA),t.setCurrentOperation("translucentPass"),n.traverse(t),o.drawBuffers([o.NONE]),e.framebuffer.restorePreviousBindingsAndBuffers(),e.copyShader===null?t.createCopyShader(a):a.getShaderCache().readyShaderProgram(e.copyShader),e.copyVAO||(e.copyVAO=$a.newInstance(),e.copyVAO.setOpenGLRenderWindow(a)),e.copyVAO.bind(),e.VBOBuildTime.getMTime()e._supported?rO:null,t.releaseGraphicsResources=a=>{e.framebuffer&&(e.framebuffer.releaseGraphicsResources(a),e.framebuffer=null),e.translucentRGBATexture&&(e.translucentRGBATexture.releaseGraphicsResources(a),e.translucentRGBATexture=null),e.translucentRTexture&&(e.translucentRTexture.releaseGraphicsResources(a),e.translucentRTexture=null),e.translucentZTexture&&(e.translucentZTexture.releaseGraphicsResources(a),e.translucentZTexture=null),e.copyVAO&&(e.copyVAO.releaseGraphicsResources(a),e.copyVAO=null),e.copyShader&&(e.copyShader.releaseGraphicsResources(a),e.copyShader=null),e.tris&&(e.tris.releaseGraphicsResources(a),e.tris=null),t.modified()}}var oO={framebuffer:null,copyShader:null,tris:null};function cd(t,e,a={}){Object.assign(e,oO,a),Yc.extend(t,e,a),e.VBOBuildTime={},A.obj(e.VBOBuildTime,{mtime:0}),e.tris=jt.newInstance(),A.get(t,e,["framebuffer"]),iO(t,e)}var sO=A.newInstance(cd,"vtkOpenGLOrderIndependentTranslucentPass"),cO={newInstance:sO,extend:cd};function uO(t,e){e.classHierarchy.push("vtkForwardPass"),t.traverse=(a,n=null)=>{if(e.deleted)return;e._currentParent=n,t.setCurrentOperation("buildPass"),a.traverse(t);const r=a.getRenderable().getNumberOfLayers(),i=a.getRenderable().getRenderersByReference();for(let o=0;o0||e.translucentActorCount>0)&&e.volumeCount>0||e.depthRequested){const p=a.getFramebufferSize();e.framebuffer===null&&(e.framebuffer=Or.newInstance()),e.framebuffer.setOpenGLRenderWindow(a),e.framebuffer.saveCurrentBindingsAndBuffers();const l=e.framebuffer.getSize();(l===null||l[0]!==p[0]||l[1]!==p[1])&&(e.framebuffer.create(p[0],p[1]),e.framebuffer.populateFramebuffer()),e.framebuffer.bind(),t.setCurrentOperation("zBufferPass"),c.traverse(t),e.framebuffer.restorePreviousBindingsAndBuffers(),e.depthRequested=!1}t.setCurrentOperation("cameraPass"),c.traverse(t),e.opaqueActorCount>0&&(t.setCurrentOperation("opaquePass"),c.traverse(t)),e.translucentActorCount>0&&(e.translucentPass||(e.translucentPass=cO.newInstance()),e.translucentPass.traverse(a,c,t)),e.volumeCount>0&&(t.setCurrentOperation("volumePass"),c.traverse(t)),e.overlayActorCount>0&&(t.setCurrentOperation("overlayPass"),c.traverse(t))}}},t.getZBufferTexture=()=>e.framebuffer?e.framebuffer.getColorTexture():null,t.requestDepth=()=>{e.depthRequested=!0},t.incrementOpaqueActorCount=()=>e.opaqueActorCount++,t.incrementTranslucentActorCount=()=>e.translucentActorCount++,t.incrementVolumeCount=()=>e.volumeCount++,t.incrementOverlayActorCount=()=>e.overlayActorCount++}var lO={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function ud(t,e,a={}){Object.assign(e,lO,a),Yc.extend(t,e,a),A.get(t,e,["framebuffer","opaqueActorCount","translucentActorCount","volumeCount"]),uO(t,e)}var fO=A.newInstance(ud,"vtkForwardPass"),pO={newInstance:fO,extend:ud},Jc={},hO={get exports(){return Jc},set exports(t){Jc=t}};(function(t,e){(function(a){t.exports=a()})(function(a){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(y,d){var g=y[0],C=y[1],S=y[2],T=y[3];g+=(C&S|~C&T)+d[0]-680876936|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+d[1]-389564586|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+d[2]+606105819|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+d[3]-1044525330|0,C=(C<<22|C>>>10)+S|0,g+=(C&S|~C&T)+d[4]-176418897|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+d[5]+1200080426|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+d[6]-1473231341|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+d[7]-45705983|0,C=(C<<22|C>>>10)+S|0,g+=(C&S|~C&T)+d[8]+1770035416|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+d[9]-1958414417|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+d[10]-42063|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+d[11]-1990404162|0,C=(C<<22|C>>>10)+S|0,g+=(C&S|~C&T)+d[12]+1804603682|0,g=(g<<7|g>>>25)+C|0,T+=(g&C|~g&S)+d[13]-40341101|0,T=(T<<12|T>>>20)+g|0,S+=(T&g|~T&C)+d[14]-1502002290|0,S=(S<<17|S>>>15)+T|0,C+=(S&T|~S&g)+d[15]+1236535329|0,C=(C<<22|C>>>10)+S|0,g+=(C&T|S&~T)+d[1]-165796510|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+d[6]-1069501632|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+d[11]+643717713|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+d[0]-373897302|0,C=(C<<20|C>>>12)+S|0,g+=(C&T|S&~T)+d[5]-701558691|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+d[10]+38016083|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+d[15]-660478335|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+d[4]-405537848|0,C=(C<<20|C>>>12)+S|0,g+=(C&T|S&~T)+d[9]+568446438|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+d[14]-1019803690|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+d[3]-187363961|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+d[8]+1163531501|0,C=(C<<20|C>>>12)+S|0,g+=(C&T|S&~T)+d[13]-1444681467|0,g=(g<<5|g>>>27)+C|0,T+=(g&S|C&~S)+d[2]-51403784|0,T=(T<<9|T>>>23)+g|0,S+=(T&C|g&~C)+d[7]+1735328473|0,S=(S<<14|S>>>18)+T|0,C+=(S&g|T&~g)+d[12]-1926607734|0,C=(C<<20|C>>>12)+S|0,g+=(C^S^T)+d[5]-378558|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+d[8]-2022574463|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+d[11]+1839030562|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+d[14]-35309556|0,C=(C<<23|C>>>9)+S|0,g+=(C^S^T)+d[1]-1530992060|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+d[4]+1272893353|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+d[7]-155497632|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+d[10]-1094730640|0,C=(C<<23|C>>>9)+S|0,g+=(C^S^T)+d[13]+681279174|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+d[0]-358537222|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+d[3]-722521979|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+d[6]+76029189|0,C=(C<<23|C>>>9)+S|0,g+=(C^S^T)+d[9]-640364487|0,g=(g<<4|g>>>28)+C|0,T+=(g^C^S)+d[12]-421815835|0,T=(T<<11|T>>>21)+g|0,S+=(T^g^C)+d[15]+530742520|0,S=(S<<16|S>>>16)+T|0,C+=(S^T^g)+d[2]-995338651|0,C=(C<<23|C>>>9)+S|0,g+=(S^(C|~T))+d[0]-198630844|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+d[7]+1126891415|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+d[14]-1416354905|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+d[5]-57434055|0,C=(C<<21|C>>>11)+S|0,g+=(S^(C|~T))+d[12]+1700485571|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+d[3]-1894986606|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+d[10]-1051523|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+d[1]-2054922799|0,C=(C<<21|C>>>11)+S|0,g+=(S^(C|~T))+d[8]+1873313359|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+d[15]-30611744|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+d[6]-1560198380|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+d[13]+1309151649|0,C=(C<<21|C>>>11)+S|0,g+=(S^(C|~T))+d[4]-145523070|0,g=(g<<6|g>>>26)+C|0,T+=(C^(g|~S))+d[11]-1120210379|0,T=(T<<10|T>>>22)+g|0,S+=(g^(T|~C))+d[2]+718787259|0,S=(S<<15|S>>>17)+T|0,C+=(T^(S|~g))+d[9]-343485551|0,C=(C<<21|C>>>11)+S|0,y[0]=g+y[0]|0,y[1]=C+y[1]|0,y[2]=S+y[2]|0,y[3]=T+y[3]|0}function i(y){var d=[],g;for(g=0;g<64;g+=4)d[g>>2]=y.charCodeAt(g)+(y.charCodeAt(g+1)<<8)+(y.charCodeAt(g+2)<<16)+(y.charCodeAt(g+3)<<24);return d}function o(y){var d=[],g;for(g=0;g<64;g+=4)d[g>>2]=y[g]+(y[g+1]<<8)+(y[g+2]<<16)+(y[g+3]<<24);return d}function s(y){var d=y.length,g=[1732584193,-271733879,-1732584194,271733878],C,S,T,w,_,E;for(C=64;C<=d;C+=64)r(g,i(y.substring(C-64,C)));for(y=y.substring(C-64),S=y.length,T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C=0;C>2]|=y.charCodeAt(C)<<(C%4<<3);if(T[C>>2]|=128<<(C%4<<3),C>55)for(r(g,T),C=0;C<16;C+=1)T[C]=0;return w=d*8,w=w.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(w[2],16),E=parseInt(w[1],16)||0,T[14]=_,T[15]=E,r(g,T),g}function u(y){var d=y.length,g=[1732584193,-271733879,-1732584194,271733878],C,S,T,w,_,E;for(C=64;C<=d;C+=64)r(g,o(y.subarray(C-64,C)));for(y=C-64>2]|=y[C]<<(C%4<<3);if(T[C>>2]|=128<<(C%4<<3),C>55)for(r(g,T),C=0;C<16;C+=1)T[C]=0;return w=d*8,w=w.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(w[2],16),E=parseInt(w[1],16)||0,T[14]=_,T[15]=E,r(g,T),g}function c(y){var d="",g;for(g=0;g<4;g+=1)d+=n[y>>g*8+4&15]+n[y>>g*8&15];return d}function p(y){var d;for(d=0;dT?new ArrayBuffer(0):(w=T-S,_=new ArrayBuffer(w),E=new Uint8Array(_),D=new Uint8Array(this,S,w),E.set(D),_)}}();function l(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function f(y,d){var g=y.length,C=new ArrayBuffer(g),S=new Uint8Array(C),T;for(T=0;T>2]|=d.charCodeAt(C)<<(C%4<<3);return this._finish(S,g),T=p(this._hash),y&&(T=m(T)),this.reset(),T},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(y,d){var g=d,C,S,T;if(y[g>>2]|=128<<(g%4<<3),g>55)for(r(this._hash,y),g=0;g<16;g+=1)y[g]=0;C=this._length*8,C=C.toString(16).match(/(.*?)(.{0,8})$/),S=parseInt(C[2],16),T=parseInt(C[1],16)||0,y[14]=S,y[15]=T,r(this._hash,y)},x.hash=function(y,d){return x.hashBinary(l(y),d)},x.hashBinary=function(y,d){var g=s(y),C=p(g);return d?m(C):C},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(y){var d=v(this._buff.buffer,y,!0),g=d.length,C;for(this._length+=y.byteLength,C=64;C<=g;C+=64)r(this._hash,o(d.subarray(C-64,C)));return this._buff=C-64>2]|=d[S]<<(S%4<<3);return this._finish(C,g),T=p(this._hash),y&&(T=m(T)),this.reset(),T},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var y=x.prototype.getState.call(this);return y.buff=h(y.buff),y},x.ArrayBuffer.prototype.setState=function(y){return y.buff=f(y.buff,!0),x.prototype.setState.call(this,y)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(y,d){var g=u(new Uint8Array(y)),C=p(g);return d?m(C):C},x})})(hO);const gO=Jc;var dO=["lastShaderProgramBound","context","_openGLRenderWindow"];function vO(t,e){e.classHierarchy.push("vtkShaderCache"),t.replaceShaderValues=(a,n,r)=>{let i=n;r.length>0&&(i=Z.substitute(i,"VSOut","GSOut").result);const o=e._openGLRenderWindow.getWebgl2();let s=` +`,u=`#version 100 +`;o?u=`#version 300 es #define attribute in #define textureCube texture #define texture2D texture @@ -3796,11 +3956,11 @@ void main() `:(e.context.getExtension("OES_standard_derivatives"),e.context.getExtension("EXT_frag_depth")&&(s=`#extension GL_EXT_frag_depth : enable `),e.context.getExtension("EXT_shader_texture_lod")&&(s+=`#extension GL_EXT_shader_texture_lod : enable #define textureCubeLod textureCubeLodEXT -#define texture2DLod texture2DLodEXT`)),i=Q.substitute(i,"//VTK::System::Dec",[`${c} +#define texture2DLod texture2DLodEXT`)),i=Z.substitute(i,"//VTK::System::Dec",[`${u} `,o?"":`#extension GL_OES_standard_derivatives : enable -`,s,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;let l=Q.substitute(a,"//VTK::System::Dec",[`${c} -`,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;if(o){l=Q.substitute(l,"varying","out").result,i=Q.substitute(i,"varying","in").result;let u="",f=0;for(;i.includes(`gl_FragData[${f}]`);)i=Q.substitute(i,`gl_FragData\\[${f}\\]`,`fragOutput${f}`).result,u+=`layout(location = ${f}) out vec4 fragOutput${f}; -`,f++;i=Q.substitute(i,"//VTK::Output::Dec",u).result}const p=Q.substitute(r,"//VTK::System::Dec",c).result;return{VSSource:l,FSSource:i,GSSource:p}},t.readyShaderProgramArray=(a,n,r)=>{const i=t.replaceShaderValues(a,n,r),o=t.getShaderProgram(i.VSSource,i.FSSource,i.GSSource);return t.readyShaderProgram(o)},t.readyShaderProgram=a=>!a||!a.getCompiled()&&!a.compileShader()||!t.bindShaderProgram(a)?null:a,t.getShaderProgram=(a,n,r)=>{const i=`${a}${n}${r}`,o=ND.hash(i);if(!(o in e.shaderPrograms)){const s=Q.newInstance();return s.setContext(e.context),s.getVertexShader().setSource(a),s.getFragmentShader().setSource(n),r&&s.getGeometryShader().setSource(r),s.setMd5Hash(o),e.shaderPrograms[o]=s,s}return e.shaderPrograms[o]},t.releaseGraphicsResources=a=>{t.releaseCurrentShaderProgram(),Object.keys(e.shaderPrograms).map(n=>e.shaderPrograms[n]).forEach(n=>n.cleanup()),e.shaderPrograms={}},t.releaseCurrentShaderProgram=()=>{e.lastShaderProgramBound&&(e.lastShaderProgramBound.cleanup(),e.lastShaderProgramBound=null)},t.bindShaderProgram=a=>(e.lastShaderProgramBound===a||(e.lastShaderProgramBound&&e.lastShaderProgramBound.release(),a.bind(),e.lastShaderProgramBound=a),1)}const FD={lastShaderProgramBound:null,shaderPrograms:null,context:null};function Yg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,FD,a),e.shaderPrograms={},V.obj(t,e),V.setGet(t,e,RD),V.moveToProtected(t,e,["openGLRenderWindow"]),LD(t,e)}var kD={newInstance:V.newInstance(Yg,"vtkShaderCache"),extend:Yg};const{vtkErrorMacro:VD}=V;function AD(t,e){e.classHierarchy.push("vtkOpenGLTextureUnitManager"),t.deleteTable=()=>{for(let a=0;a{if(e.context!==a){if(e.context!==0&&t.deleteTable(),e.context=a,e.context){e.numberOfTextureUnits=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);for(let n=0;n{for(let a=0;at.isAllocated(a)?-1:(e.textureUnits[a]=!0,a),t.isAllocated=a=>e.textureUnits[a],t.free=a=>{e.textureUnits[a]=!1},t.freeAll=()=>{for(let a=0;a2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,BD,a),V.obj(t,e),e.textureUnits=[],V.get(t,e,["numberOfTextureUnits"]),V.setGet(t,e,["context"]),AD(t,e)}var UD={newInstance:V.newInstance(Jg,"vtkOpenGLTextureUnitManager"),extend:Jg};function GD(t,e){e.classHierarchy.push("vtkRenderWindowViewNode"),t.getViewNodeFactory=()=>null,t.getAspectRatio=()=>e.size[0]/e.size[1],t.getAspectRatioForRenderer=a=>{const n=a.getViewportByReference();return e.size[0]*(n[2]-n[0])/((n[3]-n[1])*e.size[1])},t.isInViewport=(a,n,r)=>{const i=r.getViewportByReference(),o=t.getFramebufferSize();return i[0]*o[0]<=a&&i[2]*o[0]>=a&&i[1]*o[1]<=n&&i[3]*o[1]>=n},t.getViewportSize=a=>{const n=a.getViewportByReference(),r=t.getFramebufferSize();return[(n[2]-n[0])*r[0],(n[3]-n[1])*r[1]]},t.getViewportCenter=a=>{const n=t.getViewportSize(a);return[n[0]*.5,n[1]*.5]},t.displayToNormalizedDisplay=(a,n,r)=>{const i=t.getFramebufferSize();return[a/i[0],n/i[1],r]},t.normalizedDisplayToDisplay=(a,n,r)=>{const i=t.getFramebufferSize();return[a*i[0],n*i[1],r]},t.worldToView=(a,n,r,i)=>i.worldToView(a,n,r),t.viewToWorld=(a,n,r,i)=>i.viewToWorld(a,n,r),t.worldToDisplay=(a,n,r,i)=>{const o=i.worldToView(a,n,r),s=t.getViewportSize(i),c=i.viewToProjection(o[0],o[1],o[2],s[0]/s[1]),l=i.projectionToNormalizedDisplay(c[0],c[1],c[2]);return t.normalizedDisplayToDisplay(l[0],l[1],l[2])},t.displayToWorld=(a,n,r,i)=>{const o=t.displayToNormalizedDisplay(a,n,r),s=i.normalizedDisplayToProjection(o[0],o[1],o[2]),c=t.getViewportSize(i),l=i.projectionToView(s[0],s[1],s[2],c[0]/c[1]);return i.viewToWorld(l[0],l[1],l[2])},t.normalizedDisplayToViewport=(a,n,r,i)=>{let o=i.getViewportByReference();o=t.normalizedDisplayToDisplay(o[0],o[1],0);const s=t.normalizedDisplayToDisplay(a,n,r);return[s[0]-o[0]-.5,s[1]-o[1]-.5,r]},t.viewportToNormalizedViewport=(a,n,r,i)=>{const o=t.getViewportSize(i);return o&&o[0]!==0&&o[1]!==0?[a/(o[0]-1),n/(o[1]-1),r]:[a,n,r]},t.normalizedViewportToViewport=(a,n,r,i)=>{const o=t.getViewportSize(i);return[a*(o[0]-1),n*(o[1]-1),r]},t.displayToLocalDisplay=(a,n,r)=>{const i=t.getFramebufferSize();return[a,i[1]-n-1,r]},t.viewportToNormalizedDisplay=(a,n,r,i)=>{let o=i.getViewportByReference();o=t.normalizedDisplayToDisplay(o[0],o[1],0);const s=a+o[0]+.5,c=n+o[1]+.5;return t.displayToNormalizedDisplay(s,c,r)},t.getComputedDevicePixelRatio=()=>e.size[0]/t.getContainerSize()[0],t.getContainerSize=()=>{V.vtkErrorMacro("not implemented")},t.getPixelData=(a,n,r,i)=>{V.vtkErrorMacro("not implemented")},t.createSelector=()=>{V.vtkErrorMacro("not implemented")}}const ID={size:void 0,selector:void 0};function Zg(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,ID,a),e.size||(e.size=[300,300]),V.getArray(t,e,["size"],2),V.get(t,e,["selector"]),Ct.extend(t,e,a),GD(t,e)}var PD={newInstance:V.newInstance(Zg,"vtkRenderWindowViewNode"),extend:Zg};const Qg="__getUnderlyingContext";function zD(){const t=new Map,e={apply(r,i,o){return t.has(o[0])?t.get(o[0]):r.apply(i,o)}};function a(r){return{apply(i,o,s){return t.set(r,s[0]),i.apply(o,s)}}}const n=Object.create(null);return n.getParameter=(r,i,o,s)=>new Proxy(s.bind(r),e),n.depthMask=(r,i,o,s)=>new Proxy(s.bind(r),a(r.DEPTH_WRITEMASK)),{get(r,i,o){if(i===Qg)return()=>r;let s=Reflect.get(r,i,r);s instanceof Function&&(s=s.bind(r));const c=n[i];return c?c(r,i,o,s):s}}}const{vtkDebugMacro:ed,vtkErrorMacro:Wc}=V,jD={position:"absolute",top:0,left:0,width:"100%",height:"100%"},WD=["activateTexture","deactivateTexture","disableCullFace","enableCullFace","get3DContext","getActiveFramebuffer","getContext","getDefaultTextureByteSize","getDefaultTextureInternalFormat","getDefaultToWebgl2","getGLInformations","getGraphicsMemoryInfo","getGraphicsResourceForObject","getHardwareMaximumLineWidth","getPixelData","getShaderCache","getTextureUnitForTexture","getTextureUnitManager","getWebgl2","makeCurrent","releaseGraphicsResources","registerGraphicsResourceUser","unregisterGraphicsResourceUser","restoreContext","setActiveFramebuffer","setContext","setDefaultToWebgl2","setGraphicsResourceForObject"];function Lt(t,e,a){const n=t.createFramebuffer(),r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,e,2,2,0,e,a,null),t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);const i=t.checkFramebufferStatus(t.FRAMEBUFFER);return t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindTexture(t.TEXTURE_2D,null),i===t.FRAMEBUFFER_COMPLETE}let cs=0;const us=[];function $D(){cs++,us.forEach(t=>t(cs))}function HD(){cs--,us.forEach(t=>t(cs))}function KD(t){us.push(t)}function XD(t){return us.pop()}function td(t){t.preventDefault()}function qD(t,e){e.classHierarchy.push("vtkOpenGLRenderWindow");let a;function n(){return a||(a=zD()),a}t.getViewNodeFactory=()=>e.myFactory,e.canvas.addEventListener("webglcontextlost",td,!1),e.canvas.addEventListener("webglcontextrestored",t.restoreContext,!1);const r=[0,0];function i(){e.renderable&&(e.size[0]!==r[0]||e.size[1]!==r[1])&&(r[0]=e.size[0],r[1]=e.size[1],e.canvas.setAttribute("width",e.size[0]),e.canvas.setAttribute("height",e.size[1])),e.viewStream&&e.viewStream.setSize(e.size[0],e.size[1]),e.canvas.style.display=e.useOffScreen?"none":"block",e.el&&(e.el.style.cursor=e.cursorVisibility?e.cursor:"none"),e.containerSize=null}t.onModified(i),t.buildPass=u=>{if(u){if(!e.renderable)return;t.prepareNodes(),t.addMissingNodes(e.renderable.getRenderersByReference()),t.addMissingNodes(e.renderable.getChildRenderWindowsByReference()),t.removeUnusedNodes(),t.initialize(),e.children.forEach(f=>{var h;(h=f.setOpenGLRenderWindow)==null||h.call(f,t)})}},t.initialize=()=>{if(!e.initialized){if(e.rootOpenGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e.rootOpenGLRenderWindow)e.context2D=t.get2DContext();else{e.context=t.get3DContext(),t.resizeFromChildRenderWindows(),e.context&&$D(),e.textureUnitManager=UD.newInstance(),e.textureUnitManager.setContext(e.context),e.shaderCache.setContext(e.context);const u=e.context;u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.depthFunc(u.LEQUAL),u.enable(u.BLEND)}e.initialized=!0}},t.makeCurrent=()=>{e.context.makeCurrent()},t.setContainer=u=>{e.el&&e.el!==u&&(e.canvas.parentNode!==e.el&&Wc("Error: canvas parent node does not match container"),e.el.removeChild(e.canvas),e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)),e.el!==u&&(e.el=u,e.el&&(e.el.appendChild(e.canvas),e.useBackgroundImage&&e.el.appendChild(e.bgImage)),t.modified())},t.getContainer=()=>e.el,t.getContainerSize=()=>{if(!e.containerSize&&e.el){const{width:u,height:f}=e.el.getBoundingClientRect();e.containerSize=[u,f]}return e.containerSize||e.size},t.getFramebufferSize=()=>{var f;return((f=e.activeFramebuffer)==null?void 0:f.getSize())||e.size},t.getPixelData=(u,f,h,d)=>{const v=new Uint8Array((h-u+1)*(d-f+1)*4);return e.context.readPixels(u,f,h-u+1,d-f+1,e.context.RGBA,e.context.UNSIGNED_BYTE,v),v},t.get3DContext=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0,powerPreference:"high-performance"},f=null;const h=typeof WebGL2RenderingContext<"u";return e.webgl2=!1,e.defaultToWebgl2&&h&&(f=e.canvas.getContext("webgl2",u),f&&(e.webgl2=!0,ed("using webgl2"))),f||(ed("using webgl1"),f=e.canvas.getContext("webgl",u)||e.canvas.getContext("experimental-webgl",u)),f||Wc("no webgl context"),new Proxy(f,n())},t.get2DContext=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.canvas.getContext("2d",u)},t.restoreContext=()=>{const u=zc.newInstance();u.setCurrentOperation("Release"),u.traverse(t,null)},t.activateTexture=u=>{const f=e._textureResourceIds.get(u);if(f!==void 0){e.context.activeTexture(e.context.TEXTURE0+f);return}const h=t.getTextureUnitManager().allocate();if(h<0){Wc("Hardware does not support the number of textures defined.");return}e._textureResourceIds.set(u,h),e.context.activeTexture(e.context.TEXTURE0+h)},t.deactivateTexture=u=>{const f=e._textureResourceIds.get(u);f!==void 0&&(t.getTextureUnitManager().free(f),e._textureResourceIds.delete(u))},t.getTextureUnitForTexture=u=>{const f=e._textureResourceIds.get(u);return f!==void 0?f:-1},t.getDefaultTextureByteSize=function(u){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e.webgl2)switch(u){case Ne.CHAR:case Ne.SIGNED_CHAR:case Ne.UNSIGNED_CHAR:return 1;case f:case h:case Ne.UNSIGNED_SHORT:case Ne.SHORT:case Ne.VOID:return 2;default:return 4}return 1},t.getDefaultTextureInternalFormat=function(u,f){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e.webgl2)switch(u){case Ne.UNSIGNED_CHAR:switch(f){case 1:return e.context.R8;case 2:return e.context.RG8;case 3:return e.context.RGB8;case 4:default:return e.context.RGBA8}case(h&&!d&&Ne.UNSIGNED_SHORT):switch(f){case 1:return h.R16_EXT;case 2:return h.RG16_EXT;case 3:return h.RGB16_EXT;case 4:default:return h.RGBA16_EXT}case(h&&!d&&Ne.SHORT):switch(f){case 1:return h.R16_SNORM_EXT;case 2:return h.RG16_SNORM_EXT;case 3:return h.RGB16_SNORM_EXT;case 4:default:return h.RGBA16_SNORM_EXT}case Ne.UNSIGNED_SHORT:case Ne.SHORT:case Ne.FLOAT:default:switch(f){case 1:return d?e.context.R16F:e.context.R32F;case 2:return d?e.context.RG16F:e.context.RG32F;case 3:return d?e.context.RGB16F:e.context.RGB32F;case 4:default:return d?e.context.RGBA16F:e.context.RGBA32F}}switch(f){case 1:return e.context.LUMINANCE;case 2:return e.context.LUMINANCE_ALPHA;case 3:return e.context.RGB;case 4:default:return e.context.RGBA}},t.setBackgroundImage=u=>{e.bgImage.src=u.src},t.setUseBackgroundImage=u=>{e.useBackgroundImage=u,e.useBackgroundImage&&!e.el.contains(e.bgImage)?e.el.appendChild(e.bgImage):!e.useBackgroundImage&&e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)};function o(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.imageFormat;const f=document.createElement("canvas"),h=f.getContext("2d");f.width=e.canvas.width,f.height=e.canvas.height,h.drawImage(e.canvas,0,0);const d=e.canvas.getBoundingClientRect();e.renderable.getRenderers().forEach(y=>{y.getViewProps().forEach(C=>{if(C.getContainer){const T=C.getContainer().getElementsByTagName("canvas");for(let w=0;w0&&arguments[0]!==void 0?arguments[0]:"image/png",{resetCamera:f=!1,size:h=null,scale:d=1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e.deleted)return null;e.imageFormat=u;const v=e.notifyStartCaptureImage;return e.notifyStartCaptureImage=!0,e._screenshot={size:h||d!==1?h||e.size.map(m=>m*d):null},new Promise((m,x)=>{const y=t.onImageReady(g=>{var C;if(e._screenshot.size===null)e.notifyStartCaptureImage=v,y.unsubscribe(),e._screenshot.placeHolder&&(e.size=e._screenshot.originalSize,t.modified(),e._screenshot.cameras&&e._screenshot.cameras.forEach(S=>{let{restoreParamsFn:T,arg:w}=S;return T(w)}),t.traverseAllPasses(),e.el.removeChild(e._screenshot.placeHolder),e._screenshot.placeHolder.remove(),e._screenshot=null),m(g);else{const S=document.createElement("img");if(S.style=jD,S.src=g,e._screenshot.placeHolder=e.el.appendChild(S),e.canvas.style.display="none",e._screenshot.originalSize=e.size,e.size=e._screenshot.size,(C=e.rootOpenGLRenderWindow)==null||C.resizeFromChildRenderWindows(),e._screenshot.size=null,t.modified(),f){const T=f!==!0;e._screenshot.cameras=e.renderable.getRenderers().map(w=>{const _=w.getActiveCamera(),E=_.get("focalPoint","position","parallelScale");return{resetCameraArgs:T?{renderer:w}:void 0,resetCameraFn:T?f:w.resetCamera,restoreParamsFn:_.set,arg:JSON.parse(JSON.stringify(E))}}),e._screenshot.cameras.forEach(w=>{let{resetCameraFn:_,resetCameraArgs:E}=w;return _(E)})}t.traverseAllPasses()}})})};let s;t.getHardwareMaximumLineWidth=()=>{if(s!=null)return s;const u=t.get3DContext(),f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);return s=f[1],f[1]},t.getGLInformations=()=>{if(e._glInformation)return e._glInformation;const u=t.get3DContext(),f=u.getExtension("OES_texture_float"),h=u.getExtension("OES_texture_half_float"),d=u.getExtension("WEBGL_debug_renderer_info"),v=u.getExtension("WEBGL_draw_buffers"),m=u.getExtension("EXT_texture_filter_anisotropic")||u.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),x=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",u.getParameter(u.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",u.getParameter(u.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",u.getParameter(u.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",m&&u.getParameter(m.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",u.getParameter(u.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",u.getParameter(u.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",u.getParameter(u.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",u.getParameter(u.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",u.getParameter(u.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",u.getParameter(u.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",u.getParameter(u.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",u.getParameter(u.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",u.getParameter(u.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",u.getParameter(u.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",u.getParameter(u.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",u.getParameter(u.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",u.getParameter(u.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[f&&Lt(u,u.RGBA,u.UNSIGNED_BYTE)?"RGBA":"",f&&Lt(u,u.RGB,u.UNSIGNED_BYTE)?"RGB":"",f&&Lt(u,u.LUMINANCE,u.UNSIGNED_BYTE)?"LUMINANCE":"",f&&Lt(u,u.ALPHA,u.UNSIGNED_BYTE)?"ALPHA":"",f&&Lt(u,u.LUMINANCE_ALPHA,u.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[h&&Lt(u,u.RGBA,h.HALF_FLOAT_OES)?"RGBA":"",h&&Lt(u,u.RGB,h.HALF_FLOAT_OES)?"RGB":"",h&&Lt(u,u.LUMINANCE,h.HALF_FLOAT_OES)?"LUMINANCE":"",h&&Lt(u,u.ALPHA,h.HALF_FLOAT_OES)?"ALPHA":"",h&&Lt(u,u.LUMINANCE_ALPHA,h.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[f&&Lt(u,u.RGBA,u.FLOAT)?"RGBA":"",f&&Lt(u,u.RGB,u.FLOAT)?"RGB":"",f&&Lt(u,u.LUMINANCE,u.FLOAT)?"LUMINANCE":"",f&&Lt(u,u.ALPHA,u.FLOAT)?"ALPHA":"",f&&Lt(u,u.LUMINANCE_ALPHA,u.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",v?u.getParameter(v.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.HIGH_FLOAT).precision," (-2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.HIGH_FLOAT).rangeMin," - 2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.MEDIUM_FLOAT).precision," (-2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.MEDIUM_FLOAT).rangeMin," - 2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.LOW_FLOAT).precision," (-2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.LOW_FLOAT).rangeMin," - 2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT).precision," (-2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT).rangeMin," - 2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.MEDIUM_FLOAT).precision," (-2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.MEDIUM_FLOAT).rangeMin," - 2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.LOW_FLOAT).precision," (-2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.LOW_FLOAT).rangeMin," - 2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.HIGH_INT).precision," (-2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.HIGH_INT).rangeMin," - 2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.MEDIUM_INT).precision," (-2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.MEDIUM_INT).rangeMin," - 2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.LOW_INT).precision," (-2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.LOW_INT).rangeMin," - 2",u.getShaderPrecisionFormat(u.VERTEX_SHADER,u.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT).precision," (-2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT).rangeMin," - 2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.MEDIUM_INT).precision," (-2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.MEDIUM_INT).rangeMin," - 2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.LOW_INT).precision," (-2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.LOW_INT).rangeMin," - 2",u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",u.getSupportedExtensions().join("
")],["WebGL Renderer","RENDERER",u.getParameter(u.RENDERER)],["WebGL Vendor","VENDOR",u.getParameter(u.VENDOR)],["WebGL Version","VERSION",u.getParameter(u.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",u.getParameter(u.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",d&&u.getParameter(d.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",d&&u.getParameter(d.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",e.webgl2?2:1]],y={};for(;x.length;){const[g,C,S]=x.pop();C&&(y[C]={label:g,value:S})}return e._glInformation=y,y},t.traverseAllPasses=()=>{var f;if(e.renderPasses)for(let h=0;h{const u=e.rootOpenGLRenderWindow;if(!u||!e.context2D||e.children.some(d=>{var v;return!!((v=d.getSelector)!=null&&v.call(d))}))return;const f=u.getCanvas(),h=e.canvas;e.context2D.drawImage(f,0,f.height-h.height,h.width,h.height,0,0,h.width,h.height)},t.resizeFromChildRenderWindows=()=>{var f;const u=e.renderable.getChildRenderWindowsByReference();if(u.length>0){const h=[0,0];for(let d=0;dh[0]?v[0]:h[0],h[1]=v[1]>h[1]?v[1]:h[1])}t.setSize(...h)}},t.disableCullFace=()=>{e.cullFaceEnabled&&(e.context.disable(e.context.CULL_FACE),e.cullFaceEnabled=!1)},t.enableCullFace=()=>{e.cullFaceEnabled||(e.context.enable(e.context.CULL_FACE),e.cullFaceEnabled=!0)},t.setViewStream=u=>{if(e.viewStream===u)return!1;if(e.subscription&&(e.subscription.unsubscribe(),e.subscription=null),e.viewStream=u,e.viewStream){const f=e.renderable.getRenderers()[0];f.getBackgroundByReference()[3]=0,t.setUseBackgroundImage(!0),e.subscription=e.viewStream.onImageReady(h=>t.setBackgroundImage(h.image)),e.viewStream.setSize(e.size[0],e.size[1]),e.viewStream.invalidateCache(),e.viewStream.render(),t.modified()}return!0},t.createSelector=()=>{const u=Xa.newInstance();return u.setOpenGLRenderWindow(t),u};function c(){e.canvas.removeEventListener("webglcontextlost",td),e.canvas.removeEventListener("webglcontextrestored",t.restoreContext)}t.delete=V.chain(()=>{e.context&&HD(),t.setContainer(),t.setViewStream()},c,t.delete),t.setActiveFramebuffer=u=>{e.activeFramebuffer=u};const l=t.setSize;t.setSize=(u,f)=>{const h=l(u,f);return h&&t.invokeWindowResizeEvent({width:u,height:f}),h},t.registerGraphicsResourceUser=(u,f)=>{e._graphicsResources.has(u)||t.setGraphicsResourceForObject(u,null,null);const h=e._graphicsResources.get(u);h==null||h.users.add(f)},t.unregisterGraphicsResourceUser=(u,f)=>{var d;const h=e._graphicsResources.get(u);h&&(h.users.delete(f),h.users.size||((d=h.oglObject)==null||d.releaseGraphicsResources(t),e._graphicsResources.delete(u)))},t.getGraphicsResourceForObject=u=>e._graphicsResources.get(u),t.setGraphicsResourceForObject=(u,f,h)=>{var v;if(!u)return;const d=e._graphicsResources.get(u);(v=d==null?void 0:d.oglObject)==null||v.releaseGraphicsResources(t),e._graphicsResources.set(u,{coreObject:u,oglObject:f,hash:h,users:(d==null?void 0:d.users)??new Set})},t.getGraphicsMemoryInfo=()=>{let u=0;return e._graphicsResources.forEach(f=>{let{oglObject:h}=f;u+=h.getAllocatedGPUMemoryInBytes()}),u},t.releaseGraphicsResources=()=>{e.shaderCache!==null&&e.shaderCache.releaseGraphicsResources(t),e._graphicsResources.forEach(u=>{let{oglObject:f}=u;f.releaseGraphicsResources(t)}),e._graphicsResources.clear(),e.textureUnitManager!==null&&e.textureUnitManager.freeAll(),e.renderable.getRenderersByReference().forEach(u=>{const f=t.getViewNodeFor(u);f==null||f.releaseGraphicsResources()})};const p={...t};WD.forEach(u=>{t[u]=function(){return e.rootOpenGLRenderWindow?e.rootOpenGLRenderWindow[u](...arguments):p[u](...arguments)}})}const YD={cullFaceEnabled:!1,shaderCache:null,initialized:!1,context:null,context2D:null,canvas:null,cursorVisibility:!0,cursor:"pointer",textureUnitManager:null,textureResourceIds:null,containerSize:null,renderPasses:[],notifyStartCaptureImage:!1,webgl2:!1,defaultToWebgl2:!0,activeFramebuffer:null,imageFormat:"image/png",useOffScreen:!1,useBackgroundImage:!1};function nd(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,YD,a),PD.extend(t,e,a),e.canvas||(e.canvas=document.createElement("canvas"),e.canvas.style.width="100%"),e.selector||(e.selector=Xa.newInstance(),e.selector.setOpenGLRenderWindow(t)),e.bgImage=new Image,e.bgImage.style.position="absolute",e.bgImage.style.left="0",e.bgImage.style.top="0",e.bgImage.style.width="100%",e.bgImage.style.height="100%",e.bgImage.style.zIndex="-1",e._textureResourceIds=new Map,e._graphicsResources=new Map,e._glInformation=null,e.myFactory=H3.newInstance(),e.shaderCache=kD.newInstance(),e.shaderCache.setOpenGLRenderWindow(t),e.renderPasses[0]=bD.newInstance(),V.get(t,e,["shaderCache","textureUnitManager","webgl2","useBackgroundImage","activeFramebuffer","rootOpenGLRenderWindow"]),V.setGet(t,e,["initialized","context","context2D","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen"]),V.setGetArray(t,e,["size"],2),V.event(t,e,"imageReady"),V.event(t,e,"windowResizeEvent"),qD(t,e)}const $c=V.newInstance(nd,"vtkOpenGLRenderWindow");eg("WebGL",$c);var rd={newInstance:$c,extend:nd,pushMonitorGLContextCount:KD,popMonitorGLContextCount:XD};st("vtkRenderWindow",$c);function JD(t,e){e.classHierarchy.push("vtkCompositeCameraManipulator"),t.computeDisplayCenter=(a,n)=>{const r=a.computeWorldToDisplay(n,e.center[0],e.center[1],e.center[2]);e.displayCenter[0]=r[0],e.displayCenter[1]=r[1]}}const ZD={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]};function QD(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,ZD,a),V.setGet(t,e,["rotationFactor"]),V.setGetArray(t,e,["displayCenter"],2),V.setGetArray(t,e,["center"],3),JD(t,e)}var ha={extend:QD};function eO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");const a=new Float64Array(3),n=new Float64Array(3),r=new Float64Array(3),i=new Float64Array(16),o=new Float64Array(3),s=new Float64Array(3),c=new Float64Array(3);t.onButtonDown=(l,p,u)=>{e.previousPosition=u},t.onMouseMove=(l,p,u)=>{if(!u)return;const f=p.getActiveCamera(),h=f.getPosition(),d=f.getFocalPoint();Te(i);const{center:v,rotationFactor:m}=e;e.useFocalPointAsCenterOfRotation&&(v[0]=d[0],v[1]=d[1],v[2]=d[2]);const x=e.previousPosition.x-u.x,y=e.previousPosition.y-u.y,g=l.getView().getViewportSize(p),C=f.getViewUp();if(e.useWorldUpVec){const S=new Float64Array(3);Si(S,e.worldUpVec),Js(S,xe(h,e.worldUpVec)/xe(e.worldUpVec,e.worldUpVec)),ur(v,S,S),Ye(i,i,S),mt(i,i,Qe(360*x/g[0]*m),e.worldUpVec),S[0]=-S[0],S[1]=-S[1],S[2]=-S[2],Ye(i,i,S),Ye(i,i,v)}else Ye(i,i,v),mt(i,i,Qe(360*x/g[0]*m),C);et(f.getDirectionOfProjection(),C,o),mt(i,i,Qe(-360*y/g[1]*m),o),s[0]=-v[0],s[1]=-v[1],s[2]=-v[2],Ye(i,i,s),_e(a,h,i),_e(n,d,i),c[0]=C[0]+h[0],c[1]=C[1]+h[1],c[2]=C[2]+h[2],_e(r,c,i),f.setPosition(a[0],a[1],a[2]),f.setFocalPoint(n[0],n[1],n[2]),f.setViewUp(r[0]-a[0],r[1]-a[1],r[2]-a[2]),f.orthogonalizeViewUp(),p.resetCameraClippingRange(),l.getLightFollowCamera()&&p.updateLightsGeometryToFollowCamera(),e.previousPosition=u}}const tO={useWorldUpVec:!1,worldUpVec:[0,1,0],useFocalPointAsCenterOfRotation:!1};function ad(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,tO,a),V.obj(t,e),pa.extend(t,e,a),ha.extend(t,e,a),V.setGet(t,e,["useWorldUpVec"]),V.setGetArray(t,e,["worldUpVec"],3),V.setGet(t,e,["useFocalPointAsCenterOfRotation"]),eO(t,e)}var id={newInstance:V.newInstance(ad,"vtkMouseCameraTrackballRotateManipulator"),extend:ad};function nO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballRollManipulator");const a=new Float64Array(3),n=new Float64Array(3),r=new Float64Array(3),i=new Float64Array(16),o=new Float64Array(3),s=new Float64Array(3),c=new Float64Array(3);t.onButtonDown=(l,p,u)=>{e.previousPosition=u},t.onMouseMove=(l,p,u)=>{if(!u)return;const f=p.getActiveCamera(),h=f.getPosition(),d=f.getFocalPoint(),v=f.getViewUp();a[0]=d[0]-h[0],a[1]=d[1]-h[1],a[2]=d[2]-h[2],t.computeDisplayCenter(l.getInteractorStyle(),p);const m=e.previousPosition.x-e.displayCenter[0],x=u.x-e.displayCenter[0],y=e.previousPosition.y-e.displayCenter[1],g=u.y-e.displayCenter[1];if(x===0&&g===0||m===0&&y===0)return;const C=Ra((m*g-y*x)/(Math.sqrt(m*m+y*y)*Math.sqrt(x*x+g*g))),{center:S}=e;Te(i),r[0]=-S[0],r[1]=-S[1],r[2]=-S[2],Ye(i,i,S),mt(i,i,Qe(C),a),Ye(i,i,r),_e(o,h,i),_e(s,d,i),n[0]=v[0]+h[0],n[1]=v[1]+h[1],n[2]=v[2]+h[2],_e(c,n,i),f.setPosition(o[0],o[1],o[2]),f.setFocalPoint(s[0],s[1],s[2]),f.setViewUp(c[0]-o[0],c[1]-o[1],c[2]-o[2]),f.orthogonalizeViewUp(),p.resetCameraClippingRange(),l.getLightFollowCamera()&&p.updateLightsGeometryToFollowCamera(),e.previousPosition=u}}const rO={};function od(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,rO,a),V.obj(t,e),ha.extend(t,e,a),pa.extend(t,e,a),nO(t,e)}var sd={newInstance:V.newInstance(od,"vtkMouseCameraTrackballRollManipulator"),extend:od};function aO(t,e){return t{const c=i.getView().getViewportSize(o),l=[.5*c[0],.5*c[1]],p=.9*aO(l[0],l[1]),u=cd(l[0]-s.x)+cd(l[1]-s.y);p*p>u?r=a:r=n,r.setButton(t.getButton()),r.setShift(t.getShift()),r.setControl(t.getControl()),r.setCenter(t.getCenter()),r.onButtonDown(i,s)},t.onButtonUp=i=>{r&&r.onButtonUp(i)},t.onMouseMove=(i,o,s)=>{r&&r.onMouseMove(i,o,s)}}const oO={};function ud(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,oO,a),V.obj(t,e),pa.extend(t,e,a),ha.extend(t,e,a),iO(t,e)}var sO={newInstance:V.newInstance(ud,"vtkMouseCameraTrackballMultiRotateManipulator"),extend:ud};function cO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),t.onButtonDown=(a,n,r)=>{e.previousPosition=r},t.onMouseMove=(a,n,r)=>{if(!r)return;const i=r,o=e.previousPosition;e.previousPosition=r;const s=n.getActiveCamera(),c=s.getPosition(),l=s.getFocalPoint();if(s.getParallelProjection()){s.orthogonalizeViewUp();const p=s.getViewUp(),u=s.getViewPlaneNormal(),f=[0,0,0];et(u,p,f);const h=a.getView().getViewportSize(n)[1];let d=(i.x-o.x)/h,v=(o.y-i.y)/h;const m=s.getParallelScale();d*=m*2,v*=m*2;let x=f[0]*d+p[0]*v;c[0]+=x,l[0]+=x,x=f[1]*d+p[1]*v,c[1]+=x,l[1]+=x,x=f[2]*d+p[2]*v,c[2]+=x,l[2]+=x,s.setPosition(c[0],c[1],c[2]),s.setFocalPoint(l[0],l[1],l[2])}else{const{center:p}=e,u=a.getInteractorStyle(),f=u.computeWorldToDisplay(n,p[0],p[1],p[2])[2],h=u.computeDisplayToWorld(n,i.x,i.y,f),d=u.computeDisplayToWorld(n,o.x,o.y,f),v=[c[0]+(d[0]-h[0]),c[1]+(d[1]-h[1]),c[2]+(d[2]-h[2])],m=[l[0]+(d[0]-h[0]),l[1]+(d[1]-h[1]),l[2]+(d[2]-h[2])];s.setPosition(v[0],v[1],v[2]),s.setFocalPoint(m[0],m[1],m[2])}n.resetCameraClippingRange(),a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}const uO={};function ld(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,uO,a),V.obj(t,e),ha.extend(t,e,a),pa.extend(t,e,a),cO(t,e)}var lO={newInstance:V.newInstance(ld,"vtkMouseCameraTrackballPanManipulator"),extend:ld};function fO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),t.onButtonDown=(a,n,r)=>{e.previousPosition=r;const i=a.getView().getViewportSize(n),o=n.getActiveCamera(),s=e.flipDirection?-1:1;if(o.getParallelProjection())e.zoomScale=1.5/i[1]*s;else{const c=o.getClippingRange();e.zoomScale=1.5*(c[1]/i[1])*s}},t.onMouseMove=(a,n,r)=>{if(!r)return;const i=e.previousPosition.y-r.y,o=n.getActiveCamera();if(o.getParallelProjection()){const s=i*e.zoomScale;o.setParallelScale((1-s)*o.getParallelScale())}else{const s=o.getPosition(),c=o.getFocalPoint(),l=o.getDirectionOfProjection(),p=i*e.zoomScale;let u=p*l[0];s[0]+=u,c[0]+=u,u=p*l[1],s[1]+=u,c[1]+=u,u=p*l[2],s[2]+=u,c[2]+=u,o.getFreezeFocalPoint()||o.setFocalPoint(c[0],c[1],c[2]),o.setPosition(s[0],s[1],s[2]),n.resetCameraClippingRange()}a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),e.previousPosition=r},t.onScroll=(a,n,r)=>{if(!r)return;const i=n.getActiveCamera(),o=1-r/10;i.getParallelProjection()?i.setParallelScale(i.getParallelScale()/o):(i.dolly(o),n.resetCameraClippingRange()),a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}const pO={zoomScale:0,flipDirection:!1};function fd(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,pO,a),V.obj(t,e),pa.extend(t,e,a),ha.extend(t,e,a),V.setGet(t,e,["flipDirection"]),fO(t,e)}var pd={newInstance:V.newInstance(fd,"vtkMouseCameraTrackballZoomManipulator"),extend:fd};function hO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballZoomToMouseManipulator");const a=t.onButtonDown;t.onButtonDown=(n,r,i)=>{a(n,r,i),e.zoomPosition=i},t.onMouseMove=(n,r,i)=>{if(!i)return;const s=(e.previousPosition.y-i.y)*e.zoomScale;Vr.dollyToPosition(1-s,e.zoomPosition,r,n),n.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera(),e.previousPosition=i},t.onScroll=(n,r,i,o)=>{if(!i||!o)return;const s=1-i*.1;Vr.dollyToPosition(s,o,r,n),n.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}const gO={zoomPosition:null};function hd(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,gO,a),pd.extend(t,e,a),hO(t,e)}var dO={newInstance:V.newInstance(hd,"vtkMouseCameraTrackballZoomToMouseManipulator"),extend:hd};function vO(t,e){e.classHierarchy.push("vtkCompositeGestureManipulator"),t.startInteraction=()=>{},t.endInteraction=()=>{},t.onStartPinch=(a,n)=>{},t.onStartRotate=(a,n)=>{},t.onStartPan=(a,n)=>{},t.onPinch=(a,n,r)=>{},t.onRotate=(a,n,r)=>{},t.onPan=(a,n,r)=>{},t.onEndPinch=a=>{},t.onEndRotate=a=>{},t.onEndPan=a=>{},t.isPinchEnabled=()=>e.pinchEnabled,t.isPanEnabled=()=>e.panEnabled,t.isRotateEnabled=()=>e.rotateEnabled}const yO={pinchEnabled:!0,panEnabled:!0,rotateEnabled:!0};function mO(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,yO,a),V.set(t,e,["pinchEnabled","panEnabled","rotateEnabled"]),V.setGet(t,e,["interactorStyle"]),vO(t,e)}var xO={extend:mO};function CO(t,e){e.classHierarchy.push("vtkGestureCameraManipulator"),t.onStartPinch=(a,n)=>{e.previousScale=n},t.onStartRotate=(a,n)=>{e.previousRotation=n},t.onStartPan=(a,n)=>{e.previousTranslation=n},t.onPinch=(a,n,r)=>{Vr.dollyByFactor(a,n,r/e.previousScale),e.previousScale=r},t.onPan=(a,n,r)=>{const i=n.getActiveCamera(),o=a.getInteractorStyle();let s=i.getFocalPoint();s=o.computeWorldToDisplay(n,s[0],s[1],s[2]);const c=s[2],l=r,p=e.previousTranslation,u=o.computeDisplayToWorld(n,s[0]+l[0]-p[0],s[1]+l[1]-p[1],c),f=o.computeDisplayToWorld(n,s[0],s[1],c),h=[];h[0]=f[0]-u[0],h[1]=f[1]-u[1],h[2]=f[2]-u[2],s=i.getFocalPoint();const d=i.getPosition();i.setFocalPoint(h[0]+s[0],h[1]+s[1],h[2]+s[2]),i.setPosition(h[0]+d[0],h[1]+d[1],h[2]+d[2]),a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),i.orthogonalizeViewUp(),e.previousTranslation=r},t.onRotate=(a,n,r)=>{const i=n.getActiveCamera();i.roll(r-e.previousRotation),i.orthogonalizeViewUp(),e.previousRotation=r}}const SO={};function gd(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,SO,a),V.obj(t,e),xO.extend(t,e,a),ha.extend(t,e,a),CO(t,e)}var TO={newInstance:V.newInstance(gd,"vtkGestureCameraManipulator"),extend:gd};const dd=["focalPoint","parallelProjection","parallelScale","position","viewAngle","viewUp"],wO={None:null,Pan:lO,Zoom:pd,Roll:sd,Rotate:id,MultiRotate:sO,ZoomToMouse:dO,Select:J1};function vd(t,e,a){t.removeAllMouseManipulators(),e.forEach(n=>{const r=wO[n.action];if(r){const{button:i,shift:o,control:s,alt:c,scrollEnabled:l,dragEnabled:p}=n,u=r.newInstance();u.setButton(i),u.setShift(!!o),u.setControl(!!s),u.setAlt(!!c),l!==void 0&&u.setScrollEnabled(l),p!==void 0&&u.setDragEnabled(p),t.addMouseManipulator(u),u.onBoxSelectChange&&a&&u.onBoxSelectChange(a)}}),t.addGestureManipulator(TO.newInstance())}class _O{constructor(e){this.readyRef=e,this.count=0,this.start=()=>{this.count++,this.readyRef.value&&(this.readyRef.value=!1)},this.stop=()=>{this.count--,this.count===0&&(this.readyRef.value=!0)},this.reset=()=>this.count=0}async wrap(e){this.start();try{await e}finally{setTimeout(this.stop,1)}return e}}class EO{constructor(e,a,n,r,i){this.vueCtx=i,this.pickingModes=a,this.container=null,this.rwId=0,this.mtime=0,this.busy=new _O(i.ready),this.renderer=null,this.activeCamera=null,this.subscriptions=[],this.ctx=$g.getSynchronizerContext(e),this.ctx.setFetchArrayFunction((c,l=!0)=>(this.render(),this.busy.wrap(n(c,l)))),this.renderWindow=$g.newInstance({synchronizerContext:this.ctx}),this.openglRenderWindow=rd.newInstance({cursor:"default"}),this.renderWindow.addView(this.openglRenderWindow),this.interactor=qo.newInstance(),this.interactor.setView(this.openglRenderWindow),this.interactor.initialize(),r.forEach(c=>{const l=`on${c}`;this.subscriptions.push(this.interactor[l](p=>this.vueCtx.emit(c,p)))}),this.style=Vr.newInstance(),this.interactor.setInteractorStyle(this.style),this.render=wn(()=>{this.renderer&&this.renderer.resetCameraClippingRange(),this.renderWindow.render()},0),this.selector=Xa.newInstance({captureZValues:!0}),this.selector.setFieldAssociation(w0.FIELD_ASSOCIATION_POINTS);const o=({x:c,y:l})=>{if(!this.pickingModes.includes("click"))return;const p=this.pick(c,l,c,l);this.vueCtx.emit("click",p[0])};this.debouncedHover=wn(({x:c,y:l})=>{if(!this.pickingModes.includes("hover"))return;const p=this.pick(c,l,c,l);this.lastSelection.length===0&&p.length===0||(this.lastSelection=p,this.vueCtx.emit("hover",p[0]))},10);const s=({selection:c})=>{if(!this.pickingModes.includes("select"))return;const[l,p,u,f]=c,h=this.pick(l,u,p,f);this.vueCtx.emit("select",h)};this.onClick=c=>o(this.getScreenEventPositionFor(c)),this.onMouseMove=c=>this.debouncedHover(this.getScreenEventPositionFor(c)),this.lastSelection=[],this.onBoxSelectChange=s}setContainer(e){this.container=e,this.openglRenderWindow.setContainer(e),this.interactor.bindEvents(e),this.resize(),this.resetCamera()}setSynchronizedViewId(e){const a=this.renderWindow.getRenderersByReference();for(;a.length;)a.pop();this.renderWindow.setSynchronizedViewId(e),this.rwId=e}async updateViewState(e){this.renderWindow.getInteractor().setEnableRender(!1),this.vueCtx.emit("beforeSceneLoaded"),this.mtime=Math.max(this.mtime,e.mtime)+1,this.busy.reset(),this.busy.start(),e.mtime=this.mtime;const a=this.renderWindow.synchronize(e);a&&(this.renderWindow.getRenderersByReference().length&&([this.renderer]=this.renderWindow.getRenderersByReference(),this.activeCamera=this.renderer.getActiveCamera()),e.extra&&e.extra.camera&&this.activeCamera&&this.ctx.registerInstance(e.extra.camera,this.activeCamera)),await a&&(e.extra&&(e.extra.camera&&(this.remoteCamera=this.ctx.getInstance(e.extra.camera),this.remoteCamera&&this.style.setCenterOfRotation(this.remoteCamera.getFocalPoint())),e.extra.centerOfRotation&&this.style.setCenterOfRotation(e.extra.centerOfRotation),e.extra.resetCamera&&this.resetCamera()),this.vueCtx.nextTick(this.render),this.vueCtx.emit("viewStateChange",e),this.busy.stop(),this.vueCtx.emit("afterSceneLoaded"),this.renderWindow.getInteractor().setEnableRender(!0))}resize(){if(this.container){const e=window.devicePixelRatio||1,{width:a,height:n}=this.container.getBoundingClientRect();this.openglRenderWindow.setSize(Math.floor(Math.max(a*e,10)),Math.floor(Math.max(n*e,10))),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resize")}}resetCamera(){this.renderer&&(this.renderer.resetCamera(),this.style.setCenterOfRotation(this.renderer.getActiveCamera().getFocalPoint()),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resetCamera"))}getCamera(){const e=this.style.getCenterOfRotation();return this.activeCamera=this.interactor.getCurrentRenderer().getActiveCamera(),{centerOfRotation:e,...this.activeCamera.get("position","focalPoint","viewUp","parallelProjection","parallelScale","viewAngle")}}setCamera(e){if(this.activeCamera){const a={};dd.forEach(n=>{e[n]!==void 0&&(a[n]=e[n])}),this.activeCamera.set(a),e.centerOfRotation&&this.style.setCenterOfRotation(e.centerOfRotation),this.vueCtx.nextTick(this.render)}}updateStyle(e,a){vd(this.style,e,a)}captureImage(e,a){return this.renderWindow.captureImages(e,a)[0]}getScreenEventPositionFor(e){if(!this.container)return;const a=this.container.getBoundingClientRect(),[n,r]=this.openglRenderWindow.getSize(),i=n/a.width,o=r/a.height;return{x:i*(e.clientX-a.left),y:o*(a.height-e.clientY+a.top),z:0}}pick(e,a,n,r){if(this.selector.attach(this.openglRenderWindow,this.renderer),!!this.renderer){if(this.selector.setArea(e,a,n,r),this.previousSelectedData=null,this.selector.captureBuffers()){if(this.selections=this.selector.generateSelection(e,a,n,r)||[],e!==n||a!==r){const o=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,1,this.renderer))],s=[];return this.selections.forEach(c=>{const{prop:l}=c.getProperties(),{remoteId:p}=l.get("remoteId");p&&s.push(p)}),{frustrum:o,remoteIds:s}}const i=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer))];return this.selections.map(o=>{const{prop:s,compositeID:c,displayPosition:l}=o.getProperties();return{mode:"local",worldPosition:Array.from(this.openglRenderWindow.displayToWorld(l[0],l[1],l[2],this.renderer)),displayPosition:l,compositeID:c,...s.get("remoteId"),ray:i}})}return[]}}beforeDelete(){for(this.render.cancel();this.subscriptions.length;)this.subscriptions.pop().unsubscribe();this.interactor.unbindEvents(),this.openglRenderWindow.setContainer(null),this.renderWindow.removeRenderer(this.renderer),this.renderWindow.removeView(this.openglRenderWindow),this.interactor.delete(),this.interactor=null,this.renderer=null,this.renderWindow.delete(),this.renderWindow=null,this.openglRenderWindow.delete(),this.openglRenderWindow=null}}function yd(t){let e=!1;function a(){e=!0}function n(){e=!1}function r(i){if(e)switch(i.code){case"KeyR":t.resetCamera();break}}return{onEnter:a,onLeave:n,onKeyUp:r}}class DO{constructor(e,a,n,r,i){this.vueCtx=i,this.pickingModes=a,this.renderWindow=Ec.newInstance(),this.renderer=ug.newInstance({background:e}),this.renderWindow.addRenderer(this.renderer),this.activeCamera=this.renderer.getActiveCamera(),this.activeCamera.set(this.camera),this.openglRenderWindow=rd.newInstance({cursor:"default"}),this.renderWindow.addView(this.openglRenderWindow),this.interactor=qo.newInstance(),this.interactor.setView(this.openglRenderWindow),this.interactor.initialize(),this.subscriptions=[],r.forEach(l=>{const p=`on${l}`;this.subscriptions.push(this.interactor[p](u=>this.vueCtx.emit(l,u)))}),this.style=Vr.newInstance(),this.interactor.setInteractorStyle(this.style),this.selector=Xa.newInstance({captureZValues:!0}),this.selector.setFieldAssociation(w0.FIELD_ASSOCIATION_POINTS),this.selector.attach(this.openglRenderWindow,this.renderer),this.render=wn(()=>{this.renderer.resetCameraClippingRange(),this.renderWindow.render()},1),this.cubeAxes=G0.newInstance({dataBounds:[-1,1,-1,1,-1,1],visibility:!1}),this.cubeAxes.setVisibility(!1),this.cubeAxes.getActors().forEach(({setVisibility:l})=>l(!1)),this.renderer.addActor(this.cubeAxes);const o=we.newInstance({bounds:[0,0,0,0,0,0]});this.updateCubeBounds=()=>{o.reset();const{props:l}=this.renderer.get("props");for(let p=0;p{p&&l==="ComputeVisiblePropBoundsEvent"&&this.debouncedCubeBounds()}));const s=({x:l,y:p})=>{if(!this.pickingModes.includes("click"))return;const u=this.pick(l,p,l,p);this.vueCtx.emit("click",u[0])};this.debouncedHover=wn(({x:l,y:p})=>{if(!this.pickingModes.includes("hover"))return;const u=this.pick(l,p,l,p);this.lastSelection.length===0&&u.length===0||(this.lastSelection=u,this.vueCtx.emit("hover",u[0]))},10);const c=({selection:l})=>{if(!this.pickingModes.includes("select"))return;const[p,u,f,h]=l,d=this.pick(p,f,u,h);this.vueCtx.emit("select",d)};this.onClick=l=>s(this.getScreenEventPositionFor(l)),this.onMouseMove=l=>this.debouncedHover(this.getScreenEventPositionFor(l)),this.lastSelection=[],this.onBoxSelectChange=c,this.updateStyle(n)}setContainer(e){this.container=e,this.openglRenderWindow.setContainer(e),this.interactor.bindEvents(e),this.resize(),this.resetCamera(),this.resetCameraTimeout=setTimeout(()=>this.resetCamera(),100)}resize(){if(this.container){const e=window.devicePixelRatio||1,{width:a,height:n}=this.container.getBoundingClientRect();this.openglRenderWindow.setSize(Math.floor(Math.max(a*e,10)),Math.floor(Math.max(n*e,10))),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resize")}}resetCamera(){this.renderer&&(this.renderer.resetCamera(),this.style.setCenterOfRotation(this.renderer.getActiveCamera().getFocalPoint()),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resetCamera"))}getCamera(){const e=this.style.getCenterOfRotation();return this.activeCamera=this.interactor.getCurrentRenderer().getActiveCamera(),{centerOfRotation:e,...this.activeCamera.get("position","focalPoint","viewUp","parallelProjection","parallelScale","viewAngle")}}setCamera(e){if(this.activeCamera){const a={};dd.forEach(n=>{e[n]&&(a[n]=e[n])}),this.activeCamera.set(a),e.centerOfRotation&&this.style.setCenterOfRotation(e.centerOfRotation),this.vueCtx.nextTick(this.render)}}setCubeAxesVisibility(e){this.cubeAxes.setVisibility(e),this.cubeAxes.getActors().forEach(({setVisibility:a})=>a(e)),this.cubeAxes.setCamera(e?this.activeCamera:null),this.vueCtx.nextTick(this.render)}updateStyle(e){vd(this.style,e,this.onBoxSelectChange)}getScreenEventPositionFor(e){if(!this.container)return;const a=this.container.getBoundingClientRect(),[n,r]=this.openglRenderWindow.getSize(),i=n/a.width,o=r/a.height;return{x:i*(e.clientX-a.left),y:o*(a.height-e.clientY+a.top),z:0}}pick(e,a,n,r){if(this.selector.setArea(e,a,n,r),this.previousSelectedData=null,this.selector.captureBuffers()){if(this.selections=this.selector.generateSelection(e,a,n,r)||[],e!==n||a!==r){const o=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,1,this.renderer))],s=[];return this.selections.forEach(c=>{const{prop:l}=c.getProperties(),{representationId:p}=l.get("representationId");p&&s.push(p)}),{frustrum:o,representationIds:s}}const i=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer))];return this.selections.map(o=>{const{prop:s,compositeID:c,displayPosition:l}=o.getProperties();return{worldPosition:Array.from(this.openglRenderWindow.displayToWorld(l[0],l[1],l[2],this.renderer)),displayPosition:l,compositeID:c,...s.get("representationId"),ray:i}})}return[]}beforeDelete(){for(;this.subscriptions.length;)this.subscriptions.pop().unsubscribe();this.debouncedCubeBounds&&this.debouncedCubeBounds.cancel(),this.debouncedHover&&this.debouncedHover.cancel(),this.render&&this.render.cancel(),clearTimeout(this.resetCameraTimeout),this.interactor.unbindEvents(),this.openglRenderWindow.setContainer(null),this.renderWindow.removeRenderer(this.renderer),this.renderWindow.removeView(this.openglRenderWindow),this.interactor.delete(),this.interactor=null,this.renderer.delete(),this.renderer=null,this.renderWindow.delete(),this.renderWindow=null,this.openglRenderWindow.delete(),this.openglRenderWindow=null}}const Hc={props:{camera:{type:Object,default:null},interactorEvents:{type:Array,default:()=>["EndAnimation"]},interactorSettings:{type:Array,default:()=>[{button:1,action:"Rotate"},{button:2,action:"Pan"},{button:3,action:"Zoom",scrollEnabled:!0},{button:1,action:"Pan",alt:!0},{button:1,action:"Zoom",control:!0},{button:1,action:"Select",shift:!0},{button:1,action:"Roll",alt:!0,shift:!0}]},wsClient:{type:Object},contextName:{type:String,default:"LocalRenderingContext"},viewState:{type:Object},boxSelection:{type:Boolean,default:!1},pickingModes:{type:Array,default:()=>[]}},emits:["resetCamera","beforeSceneLoaded","afterSceneLoaded","viewStateChange","onReady","resize","onImageCapture","BoxSelection","select","hover","click","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],setup(t,{emit:e}){var _,E,D,O,M,N;const a=se.inject("trame"),n=se.ref(!1),r=se.ref(null);let i=!1;const o=se.computed(()=>t.wsClient||(a==null?void 0:a.client));let s=()=>Promise.resolve(null);const c=(E=(_=o.value)==null?void 0:_.getConnection())==null?void 0:E.getSession();c&&(s=(R,B)=>c.call("viewport.geometry.array.get",[R,B])),(O=(D=o.value.getRemote())==null?void 0:D.SyncView)!=null&&O.getArray&&(s=(N=(M=o.value.getRemote())==null?void 0:M.SyncView)==null?void 0:N.getArray);const l=new EO(t.contextName,t.pickingModes,s,t.interactorEvents,{emit:e,nextTick:se.nextTick,ready:n});l.updateStyle(t.interactorSettings,d);const{onEnter:p,onLeave:u,onKeyUp:f}=yd(l),h=new ResizeObserver(()=>l.resize());function d({container:R,selection:B}){if(t.pickingModes.includes("select")){l.onBoxSelectChange({selection:B});return}!t.boxSelection||!R||e("BoxSelection",{selection:B,mode:"local",size:l.openglRenderWindow.getSize(),camera:l.getCamera()})}se.watch(n,R=>{e("onReady",R)}),se.watch(()=>t.interactorSettings,()=>l.updateStyle(t.interactorSettings,d)),se.watch(()=>t.pickingModes,()=>{l.pickingModes=t.pickingModes}),se.watch(()=>t.viewState,({id:R})=>{R===i&&(i=!1,l.updateViewState(t.viewState))});let v=null;se.onMounted(()=>{const R=r.value;l.setContainer(R),h.observe(R),document.addEventListener("keyup",f),t.viewState&&(l.rwId=t.viewState.id,l.updateViewState(t.viewState)),v=o.value.getConnection().getSession().subscribe("trame.vtk.delta",([B])=>{B.id===l.rwId&&l.updateViewState(B)})}),se.onBeforeUnmount(()=>{l.beforeDelete(),v&&o.value&&(o.value.getConnection().getSession().unsubscribe(v),v=null),document.removeEventListener("keyup",f),h.disconnect()}),se.provide("view",l);const m=async(R="image/png",B={})=>{const I=await l.captureImage(R,B),L=await(await fetch(I)).blob();return e("onImageCapture",L),L},x=()=>l.resetCamera(),y=()=>l.getCamera(),g=R=>l.setCamera(R),C=R=>{i=R,typeof t.viewState.id=="number"&&(i=Number(i)),l.setSynchronizedViewId(i)},S=()=>l.resize(),{onClick:T,onMouseMove:w}=l;return{vtkContainer:r,onEnter:p,onLeave:u,onClick:T,onMouseMove:w,resetCamera:x,getCamera:y,setCamera:g,setSynchronizedViewId:C,resize:S,captureImage:m}},template:` +`,s,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;let c=Z.substitute(a,"//VTK::System::Dec",[`${u} +`,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;if(o){c=Z.substitute(c,"varying","out").result,i=Z.substitute(i,"varying","in").result;let l="",f=0;for(;i.includes(`gl_FragData[${f}]`);)i=Z.substitute(i,`gl_FragData\\[${f}\\]`,`fragOutput${f}`).result,l+=`layout(location = ${f}) out vec4 fragOutput${f}; +`,f++;i=Z.substitute(i,"//VTK::Output::Dec",l).result}const p=Z.substitute(r,"//VTK::System::Dec",u).result;return{VSSource:c,FSSource:i,GSSource:p}},t.readyShaderProgramArray=(a,n,r)=>{const i=t.replaceShaderValues(a,n,r),o=t.getShaderProgram(i.VSSource,i.FSSource,i.GSSource);return t.readyShaderProgram(o)},t.readyShaderProgram=a=>!a||!a.getCompiled()&&!a.compileShader()||!t.bindShaderProgram(a)?null:a,t.getShaderProgram=(a,n,r)=>{const i=`${a}${n}${r}`,o=gO.hash(i);if(!(o in e.shaderPrograms)){const s=Z.newInstance();return s.setContext(e.context),s.getVertexShader().setSource(a),s.getFragmentShader().setSource(n),r&&s.getGeometryShader().setSource(r),s.setMd5Hash(o),e.shaderPrograms[o]=s,s}return e.shaderPrograms[o]},t.releaseGraphicsResources=a=>{t.releaseCurrentShaderProgram(),Object.keys(e.shaderPrograms).map(n=>e.shaderPrograms[n]).forEach(n=>n.cleanup()),e.shaderPrograms={}},t.releaseCurrentShaderProgram=()=>{e.lastShaderProgramBound&&(e.lastShaderProgramBound.cleanup(),e.lastShaderProgramBound=null)},t.bindShaderProgram=a=>(e.lastShaderProgramBound===a||(e.lastShaderProgramBound&&e.lastShaderProgramBound.release(),a.bind(),e.lastShaderProgramBound=a),1)}var yO={lastShaderProgramBound:null,shaderPrograms:null,context:null};function ld(t,e,a={}){Object.assign(e,yO,a),e.shaderPrograms={},A.obj(t,e),A.setGet(t,e,dO),A.moveToProtected(t,e,["openGLRenderWindow"]),vO(t,e)}var mO=A.newInstance(ld,"vtkShaderCache"),xO={newInstance:mO,extend:ld},{vtkErrorMacro:CO}=A;function SO(t,e){e.classHierarchy.push("vtkOpenGLTextureUnitManager"),t.deleteTable=()=>{for(let a=0;a{if(e.context!==a){if(e.context!==0&&t.deleteTable(),e.context=a,e.context){e.numberOfTextureUnits=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);for(let n=0;n{for(let a=0;at.isAllocated(a)?-1:(e.textureUnits[a]=!0,a),t.isAllocated=a=>e.textureUnits[a],t.free=a=>{e.textureUnits[a]=!1},t.freeAll=()=>{for(let a=0;anull,t.getAspectRatio=()=>e.size[0]/e.size[1],t.getAspectRatioForRenderer=a=>{const n=a.getViewportByReference();return e.size[0]*(n[2]-n[0])/((n[3]-n[1])*e.size[1])},t.isInViewport=(a,n,r)=>{const i=r.getViewportByReference(),o=t.getFramebufferSize();return i[0]*o[0]<=a&&i[2]*o[0]>=a&&i[1]*o[1]<=n&&i[3]*o[1]>=n},t.getViewportSize=a=>{const n=a.getViewportByReference(),r=t.getFramebufferSize();return[(n[2]-n[0])*r[0],(n[3]-n[1])*r[1]]},t.getViewportCenter=a=>{const n=t.getViewportSize(a);return[n[0]*.5,n[1]*.5]},t.displayToNormalizedDisplay=(a,n,r)=>{const i=t.getFramebufferSize();return[a/i[0],n/i[1],r]},t.normalizedDisplayToDisplay=(a,n,r)=>{const i=t.getFramebufferSize();return[a*i[0],n*i[1],r]},t.worldToView=(a,n,r,i)=>i.worldToView(a,n,r),t.viewToWorld=(a,n,r,i)=>i.viewToWorld(a,n,r),t.worldToDisplay=(a,n,r,i)=>{const o=i.worldToView(a,n,r),s=t.getViewportSize(i),u=i.viewToProjection(o[0],o[1],o[2],s[0]/s[1]),c=i.projectionToNormalizedDisplay(u[0],u[1],u[2]);return t.normalizedDisplayToDisplay(c[0],c[1],c[2])},t.displayToWorld=(a,n,r,i)=>{const o=t.displayToNormalizedDisplay(a,n,r),s=i.normalizedDisplayToProjection(o[0],o[1],o[2]),u=t.getViewportSize(i),c=i.projectionToView(s[0],s[1],s[2],u[0]/u[1]);return i.viewToWorld(c[0],c[1],c[2])},t.normalizedDisplayToViewport=(a,n,r,i)=>{let o=i.getViewportByReference();o=t.normalizedDisplayToDisplay(o[0],o[1],0);const s=t.normalizedDisplayToDisplay(a,n,r);return[s[0]-o[0]-.5,s[1]-o[1]-.5,r]},t.viewportToNormalizedViewport=(a,n,r,i)=>{const o=t.getViewportSize(i);return o&&o[0]!==0&&o[1]!==0?[a/(o[0]-1),n/(o[1]-1),r]:[a,n,r]},t.normalizedViewportToViewport=(a,n,r,i)=>{const o=t.getViewportSize(i);return[a*(o[0]-1),n*(o[1]-1),r]},t.displayToLocalDisplay=(a,n,r)=>[a,t.getFramebufferSize()[1]-n-1,r],t.viewportToNormalizedDisplay=(a,n,r,i)=>{let o=i.getViewportByReference();o=t.normalizedDisplayToDisplay(o[0],o[1],0);const s=a+o[0]+.5,u=n+o[1]+.5;return t.displayToNormalizedDisplay(s,u,r)},t.getComputedDevicePixelRatio=()=>e.size[0]/t.getContainerSize()[0],t.getContainerSize=()=>{A.vtkErrorMacro("not implemented")},t.getPixelData=(a,n,r,i)=>{A.vtkErrorMacro("not implemented")},t.createSelector=()=>{A.vtkErrorMacro("not implemented")}}var DO={size:void 0,selector:void 0};function pd(t,e,a={}){Object.assign(e,DO,a),e.size||(e.size=[300,300]),A.getArray(t,e,["size"],2),A.get(t,e,["selector"]),Ct.extend(t,e,a),EO(t,e)}var OO=A.newInstance(pd,"vtkRenderWindowViewNode"),bO={newInstance:OO,extend:pd},MO="__getUnderlyingContext";function NO(){const t=new Map,e={apply(r,i,o){return t.has(o[0])?t.get(o[0]):r.apply(i,o)}};function a(r){return{apply(i,o,s){return t.set(r,s[0]),i.apply(o,s)}}}const n=Object.create(null);return n.getParameter=(r,i,o,s)=>new Proxy(s.bind(r),e),n.depthMask=(r,i,o,s)=>new Proxy(s.bind(r),a(r.DEPTH_WRITEMASK)),{get(r,i,o){if(i==="__getUnderlyingContext")return()=>r;let s=Reflect.get(r,i,r);s instanceof Function&&(s=s.bind(r));const u=n[i];return u?u(r,i,o,s):s}}}var{vtkDebugMacro:hd,vtkErrorMacro:Zc}=A,RO={position:"absolute",top:0,left:0,width:"100%",height:"100%"},LO=["activateTexture","deactivateTexture","disableCullFace","enableCullFace","setCullFaceMode","get3DContext","getActiveFramebuffer","getContext","getDefaultTextureByteSize","getDefaultTextureInternalFormat","getDefaultToWebgl2","getGLInformations","getGraphicsMemoryInfo","getGraphicsResourceForObject","getHardwareMaximumLineWidth","getPixelData","getShaderCache","getTextureUnitForTexture","getTextureUnitManager","getWebgl2","makeCurrent","releaseGraphicsResources","registerGraphicsResourceUser","unregisterGraphicsResourceUser","restoreContext","setActiveFramebuffer","setContext","setDefaultToWebgl2","setGraphicsResourceForObject"];function Lt(t,e,a){const n=t.createFramebuffer(),r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,e,2,2,0,e,a,null),t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);const i=t.checkFramebufferStatus(t.FRAMEBUFFER);return t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindTexture(t.TEXTURE_2D,null),i===t.FRAMEBUFFER_COMPLETE}var ds=0,vs=[];function FO(){ds++,vs.forEach(t=>t(ds))}function kO(){ds--,vs.forEach(t=>t(ds))}function AO(t){vs.push(t)}function VO(t){return vs.pop()}function gd(t){t.preventDefault()}function BO(t,e){e.classHierarchy.push("vtkOpenGLRenderWindow");let a;function n(){return a||(a=NO()),a}t.getViewNodeFactory=()=>e.myFactory,e.canvas.addEventListener("webglcontextlost",gd,!1),e.canvas.addEventListener("webglcontextrestored",t.restoreContext,!1);const r=[0,0];function i(){e.renderable&&(e.size[0]!==r[0]||e.size[1]!==r[1])&&(r[0]=e.size[0],r[1]=e.size[1],e.canvas.setAttribute("width",e.size[0]),e.canvas.setAttribute("height",e.size[1])),e.viewStream&&e.viewStream.setSize(e.size[0],e.size[1]),e.canvas.style.display=e.useOffScreen?"none":"block",e.el&&(e.el.style.cursor=e.cursorVisibility?e.cursor:"none"),e.containerSize=null}t.onModified(i),t.buildPass=l=>{if(l){if(!e.renderable)return;t.prepareNodes(),t.addMissingNodes(e.renderable.getRenderersByReference()),t.addMissingNodes(e.renderable.getChildRenderWindowsByReference()),t.removeUnusedNodes(),t.initialize(),e.children.forEach(f=>{var h;(h=f.setOpenGLRenderWindow)==null||h.call(f,t)})}},t.initialize=()=>{if(!e.initialized){if(e.rootOpenGLRenderWindow=t.getLastAncestorOfType("vtkOpenGLRenderWindow"),e.rootOpenGLRenderWindow)e.context2D=t.get2DContext();else{e.context=t.get3DContext(),t.resizeFromChildRenderWindows(),e.context&&FO(),e.textureUnitManager=_O.newInstance(),e.textureUnitManager.setContext(e.context),e.shaderCache.setContext(e.context);const l=e.context;l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA),l.depthFunc(l.LEQUAL),l.enable(l.BLEND)}e.initialized=!0}},t.makeCurrent=()=>{e.context.makeCurrent()},t.setContainer=l=>{e.el&&e.el!==l&&(e.canvas.parentNode!==e.el&&Zc("Error: canvas parent node does not match container"),e.el.removeChild(e.canvas),e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)),e.el!==l&&(e.el=l,e.el&&(e.el.appendChild(e.canvas),e.useBackgroundImage&&e.el.appendChild(e.bgImage)),t.modified())},t.getContainer=()=>e.el,t.getContainerSize=()=>{if(!e.containerSize&&e.el){const{width:l,height:f}=e.el.getBoundingClientRect();e.containerSize=[l,f]}return e.containerSize||e.size},t.getFramebufferSize=()=>{var l;return((l=e.activeFramebuffer)==null?void 0:l.getSize())||e.size},t.getPixelData=(l,f,h,v)=>{const m=new Uint8Array((h-l+1)*(v-f+1)*4);return e.context.readPixels(l,f,h-l+1,v-f+1,e.context.RGBA,e.context.UNSIGNED_BYTE,m),m},t.get3DContext=(l={preserveDrawingBuffer:!1,depth:!0,alpha:!0,powerPreference:"high-performance"})=>{let f=null;const h=typeof WebGL2RenderingContext<"u";return e.webgl2=!1,e.defaultToWebgl2&&h&&(f=e.canvas.getContext("webgl2",l),f&&(e.webgl2=!0,hd("using webgl2"))),f||(hd("using webgl1"),f=e.canvas.getContext("webgl",l)||e.canvas.getContext("experimental-webgl",l)),f||Zc("no webgl context"),new Proxy(f,n())},t.get2DContext=(l={})=>e.canvas.getContext("2d",l),t.restoreContext=()=>{const l=Yc.newInstance();l.setCurrentOperation("Release"),l.traverse(t,null)},t.activateTexture=l=>{const f=e._textureResourceIds.get(l);if(f!==void 0){e.context.activeTexture(e.context.TEXTURE0+f);return}const h=t.getTextureUnitManager().allocate();if(h<0){Zc("Hardware does not support the number of textures defined.");return}e._textureResourceIds.set(l,h),e.context.activeTexture(e.context.TEXTURE0+h)},t.deactivateTexture=l=>{const f=e._textureResourceIds.get(l);f!==void 0&&(t.getTextureUnitManager().free(f),e._textureResourceIds.delete(l))},t.getTextureUnitForTexture=l=>{const f=e._textureResourceIds.get(l);return f!==void 0?f:-1},t.getDefaultTextureByteSize=(l,f=null,h=!1)=>{if(e.webgl2)switch(l){case be.CHAR:case be.SIGNED_CHAR:case be.UNSIGNED_CHAR:return 1;case f:case h:case be.UNSIGNED_SHORT:case be.SHORT:case be.VOID:return 2;default:return 4}return 1},t.getDefaultTextureInternalFormat=(l,f,h=null,v=!1)=>{if(e.webgl2)switch(l){case be.UNSIGNED_CHAR:switch(f){case 1:return e.context.R8;case 2:return e.context.RG8;case 3:return e.context.RGB8;default:return e.context.RGBA8}case(h&&!v&&be.UNSIGNED_SHORT):switch(f){case 1:return h.R16_EXT;case 2:return h.RG16_EXT;case 3:return h.RGB16_EXT;default:return h.RGBA16_EXT}case(h&&!v&&be.SHORT):switch(f){case 1:return h.R16_SNORM_EXT;case 2:return h.RG16_SNORM_EXT;case 3:return h.RGB16_SNORM_EXT;default:return h.RGBA16_SNORM_EXT}case be.UNSIGNED_SHORT:case be.SHORT:case be.FLOAT:default:switch(f){case 1:return v?e.context.R16F:e.context.R32F;case 2:return v?e.context.RG16F:e.context.RG32F;case 3:return v?e.context.RGB16F:e.context.RGB32F;default:return v?e.context.RGBA16F:e.context.RGBA32F}}switch(f){case 1:return e.context.LUMINANCE;case 2:return e.context.LUMINANCE_ALPHA;case 3:return e.context.RGB;default:return e.context.RGBA}},t.setBackgroundImage=l=>{e.bgImage.src=l.src},t.setUseBackgroundImage=l=>{e.useBackgroundImage=l,e.useBackgroundImage&&!e.el.contains(e.bgImage)?e.el.appendChild(e.bgImage):!e.useBackgroundImage&&e.el.contains(e.bgImage)&&e.el.removeChild(e.bgImage)};function o(l=e.imageFormat){const f=document.createElement("canvas"),h=f.getContext("2d");f.width=e.canvas.width,f.height=e.canvas.height,h.drawImage(e.canvas,0,0);const v=e.canvas.getBoundingClientRect();e.renderable.getRenderers().forEach(x=>{x.getViewProps().forEach(y=>{if(y.getContainer){const d=y.getContainer().getElementsByTagName("canvas");for(let g=0;g{if(e.deleted)return null;e.imageFormat=l;const m=e.notifyStartCaptureImage;return e.notifyStartCaptureImage=!0,e._screenshot={size:h||v!==1?h||e.size.map(x=>x*v):null},new Promise((x,y)=>{const d=t.onImageReady(g=>{var C;if(e._screenshot.size===null)e.notifyStartCaptureImage=m,d.unsubscribe(),e._screenshot.placeHolder&&(e.size=e._screenshot.originalSize,t.modified(),e._screenshot.cameras&&e._screenshot.cameras.forEach(({restoreParamsFn:S,arg:T})=>S(T)),t.traverseAllPasses(),e.el.removeChild(e._screenshot.placeHolder),e._screenshot.placeHolder.remove(),e._screenshot=null),x(g);else{const S=document.createElement("img");if(S.style=RO,S.src=g,e._screenshot.placeHolder=e.el.appendChild(S),e.canvas.style.display="none",e._screenshot.originalSize=e.size,e.size=e._screenshot.size,(C=e.rootOpenGLRenderWindow)==null||C.resizeFromChildRenderWindows(),e._screenshot.size=null,t.modified(),f){const T=f!==!0;e._screenshot.cameras=e.renderable.getRenderers().map(w=>{const _=w.getActiveCamera(),E=_.get("focalPoint","position","parallelScale");return{resetCameraArgs:T?{renderer:w}:void 0,resetCameraFn:T?f:w.resetCamera,restoreParamsFn:_.set,arg:JSON.parse(JSON.stringify(E))}}),e._screenshot.cameras.forEach(({resetCameraFn:w,resetCameraArgs:_})=>w(_))}t.traverseAllPasses()}})})};let s;t.getHardwareMaximumLineWidth=()=>{if(s!=null)return s;const l=t.get3DContext(),f=l.getParameter(l.ALIASED_LINE_WIDTH_RANGE);return s=f[1],f[1]},t.getGLInformations=()=>{if(e._glInformation)return e._glInformation;const l=t.get3DContext(),f=l.getExtension("OES_texture_float"),h=l.getExtension("OES_texture_half_float"),v=l.getExtension("WEBGL_debug_renderer_info"),m=l.getExtension("WEBGL_draw_buffers"),x=l.getExtension("EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),y=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",l.getParameter(l.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",l.getParameter(l.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",l.getParameter(l.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",l.getParameter(l.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",l.getParameter(l.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",x&&l.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",l.getParameter(l.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",l.getParameter(l.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",l.getParameter(l.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",l.getParameter(l.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",l.getParameter(l.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",l.getParameter(l.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",l.getParameter(l.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",l.getParameter(l.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",l.getParameter(l.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",l.getParameter(l.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",l.getParameter(l.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",l.getParameter(l.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",l.getParameter(l.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[f&&Lt(l,l.RGBA,l.UNSIGNED_BYTE)?"RGBA":"",f&&Lt(l,l.RGB,l.UNSIGNED_BYTE)?"RGB":"",f&&Lt(l,l.LUMINANCE,l.UNSIGNED_BYTE)?"LUMINANCE":"",f&&Lt(l,l.ALPHA,l.UNSIGNED_BYTE)?"ALPHA":"",f&&Lt(l,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[h&&Lt(l,l.RGBA,h.HALF_FLOAT_OES)?"RGBA":"",h&&Lt(l,l.RGB,h.HALF_FLOAT_OES)?"RGB":"",h&&Lt(l,l.LUMINANCE,h.HALF_FLOAT_OES)?"LUMINANCE":"",h&&Lt(l,l.ALPHA,h.HALF_FLOAT_OES)?"ALPHA":"",h&&Lt(l,l.LUMINANCE_ALPHA,h.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[f&&Lt(l,l.RGBA,l.FLOAT)?"RGBA":"",f&&Lt(l,l.RGB,l.FLOAT)?"RGB":"",f&&Lt(l,l.LUMINANCE,l.FLOAT)?"LUMINANCE":"",f&&Lt(l,l.ALPHA,l.FLOAT)?"ALPHA":"",f&&Lt(l,l.LUMINANCE_ALPHA,l.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",m?l.getParameter(m.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT).precision," (-2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT).rangeMin," - 2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT).precision," (-2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT).rangeMin," - 2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT).precision," (-2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT).rangeMin," - 2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).precision," (-2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).rangeMin," - 2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT).precision," (-2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT).rangeMin," - 2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT).precision," (-2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT).rangeMin," - 2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_INT).precision," (-2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_INT).rangeMin," - 2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_INT).precision," (-2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_INT).rangeMin," - 2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_INT).precision," (-2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_INT).rangeMin," - 2",l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_INT).precision," (-2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_INT).rangeMin," - 2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_INT).precision," (-2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_INT).rangeMin," - 2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_INT).precision," (-2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_INT).rangeMin," - 2",l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",l.getSupportedExtensions().join("
")],["WebGL Renderer","RENDERER",l.getParameter(l.RENDERER)],["WebGL Vendor","VENDOR",l.getParameter(l.VENDOR)],["WebGL Version","VERSION",l.getParameter(l.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",l.getParameter(l.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",v&&l.getParameter(v.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",v&&l.getParameter(v.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",e.webgl2?2:1]],d={};for(;y.length;){const[g,C,S]=y.pop();C&&(d[C]={label:g,value:S})}return e._glInformation=d,d},t.traverseAllPasses=()=>{var f;if(e.renderPasses)for(let h=0;h{const l=e.rootOpenGLRenderWindow;if(!l||!e.context2D||e.children.some(v=>{var m;return!!((m=v.getSelector)!=null&&m.call(v))}))return;const f=l.getCanvas(),h=e.canvas;e.context2D.drawImage(f,0,f.height-h.height,h.width,h.height,0,0,h.width,h.height)},t.resizeFromChildRenderWindows=()=>{var f;const l=e.renderable.getChildRenderWindowsByReference();if(l.length>0){const h=[0,0];for(let v=0;vh[0]?m[0]:h[0],h[1]=m[1]>h[1]?m[1]:h[1])}t.setSize(...h)}},t.disableCullFace=()=>{e.cullFaceEnabled&&(e.context.disable(e.context.CULL_FACE),e.cullFaceEnabled=!1)},t.enableCullFace=()=>{e.cullFaceEnabled||(e.context.enable(e.context.CULL_FACE),e.cullFaceEnabled=!0)},t.setCullFaceMode=l=>{e.cullFaceMode!==l&&(e.context.cullFace(l),e.cullFaceMode=l)},t.setViewStream=l=>{if(e.viewStream===l)return!1;if(e.subscription&&(e.subscription.unsubscribe(),e.subscription=null),e.viewStream=l,e.viewStream){const f=e.renderable.getRenderers()[0];f.getBackgroundByReference()[3]=0,t.setUseBackgroundImage(!0),e.subscription=e.viewStream.onImageReady(h=>t.setBackgroundImage(h.image)),e.viewStream.setSize(e.size[0],e.size[1]),e.viewStream.invalidateCache(),e.viewStream.render(),t.modified()}return!0},t.createSelector=()=>{const l=qa.newInstance();return l.setOpenGLRenderWindow(t),l};function u(){e.canvas.removeEventListener("webglcontextlost",gd),e.canvas.removeEventListener("webglcontextrestored",t.restoreContext)}t.delete=A.chain(()=>{e.context&&kO(),t.setContainer(),t.setViewStream()},u,t.delete),t.setActiveFramebuffer=l=>{e.activeFramebuffer=l};const c=t.setSize;t.setSize=(l,f)=>{const h=c(l,f);return h&&t.invokeWindowResizeEvent({width:l,height:f}),h},t.registerGraphicsResourceUser=(l,f)=>{var h;e._graphicsResources.has(l)||t.setGraphicsResourceForObject(l,null,null),(h=e._graphicsResources.get(l))==null||h.users.add(f)},t.unregisterGraphicsResourceUser=(l,f)=>{var v;const h=e._graphicsResources.get(l);h&&(h.users.delete(f),h.users.size||((v=h.oglObject)==null||v.releaseGraphicsResources(t),e._graphicsResources.delete(l)))},t.getGraphicsResourceForObject=l=>e._graphicsResources.get(l),t.setGraphicsResourceForObject=(l,f,h)=>{var m;if(!l)return;const v=e._graphicsResources.get(l);(m=v==null?void 0:v.oglObject)==null||m.releaseGraphicsResources(t),e._graphicsResources.set(l,{coreObject:l,oglObject:f,hash:h,users:(v==null?void 0:v.users)??new Set})},t.getGraphicsMemoryInfo=()=>{let l=0;return e._graphicsResources.forEach(({oglObject:f})=>{l+=f.getAllocatedGPUMemoryInBytes()}),l},t.releaseGraphicsResources=()=>{e.shaderCache!==null&&e.shaderCache.releaseGraphicsResources(t),e._graphicsResources.forEach(({oglObject:l})=>{l.releaseGraphicsResources(t)}),e._graphicsResources.clear(),e.textureUnitManager!==null&&e.textureUnitManager.freeAll(),e.renderable.getRenderersByReference().forEach(l=>{var f;(f=t.getViewNodeFor(l))==null||f.releaseGraphicsResources()})};const p={...t};LO.forEach(l=>{t[l]=(...f)=>e.rootOpenGLRenderWindow?e.rootOpenGLRenderWindow[l](...f):p[l](...f)})}var UO={cullFaceEnabled:!1,cullFaceMode:null,shaderCache:null,initialized:!1,context:null,context2D:null,canvas:null,cursorVisibility:!0,cursor:"pointer",textureUnitManager:null,textureResourceIds:null,containerSize:null,renderPasses:[],notifyStartCaptureImage:!1,webgl2:!1,defaultToWebgl2:!0,activeFramebuffer:null,imageFormat:"image/png",useOffScreen:!1,useBackgroundImage:!1};function dd(t,e,a={}){Object.assign(e,UO,a),bO.extend(t,e,a),e.canvas||(e.canvas=document.createElement("canvas"),e.canvas.style.width="100%"),e.selector||(e.selector=qa.newInstance(),e.selector.setOpenGLRenderWindow(t)),e.bgImage=new Image,e.bgImage.style.position="absolute",e.bgImage.style.left="0",e.bgImage.style.top="0",e.bgImage.style.width="100%",e.bgImage.style.height="100%",e.bgImage.style.zIndex="-1",e._textureResourceIds=new Map,e._graphicsResources=new Map,e._glInformation=null,e.myFactory=O3.newInstance(),e.shaderCache=xO.newInstance(),e.shaderCache.setOpenGLRenderWindow(t),e.renderPasses[0]=pO.newInstance(),A.get(t,e,["shaderCache","textureUnitManager","webgl2","useBackgroundImage","activeFramebuffer","rootOpenGLRenderWindow"]),A.setGet(t,e,["initialized","context","context2D","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen"]),A.setGetArray(t,e,["size"],2),A.event(t,e,"imageReady"),A.event(t,e,"windowResizeEvent"),BO(t,e)}var Qc=A.newInstance(dd,"vtkOpenGLRenderWindow");gg("WebGL",Qc);var vd={newInstance:Qc,extend:dd,pushMonitorGLContextCount:AO,popMonitorGLContextCount:VO};ct("vtkRenderWindow",Qc);function GO(t,e){e.classHierarchy.push("vtkCompositeCameraManipulator"),t.computeDisplayCenter=(a,n)=>{const r=a.computeWorldToDisplay(n,e.center[0],e.center[1],e.center[2]);e.displayCenter[0]=r[0],e.displayCenter[1]=r[1]}}var IO={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]};function PO(t,e,a={}){Object.assign(e,IO,a),A.setGet(t,e,["rotationFactor"]),A.setGetArray(t,e,["displayCenter"],2),A.setGetArray(t,e,["center"],3),GO(t,e)}var ga={extend:PO};function zO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");const a=new Float64Array(3),n=new Float64Array(3),r=new Float64Array(3),i=new Float64Array(16),o=new Float64Array(3),s=new Float64Array(3),u=new Float64Array(3);t.onButtonDown=(c,p,l)=>{e.previousPosition=l},t.onMouseMove=(c,p,l)=>{if(!l)return;const f=p.getActiveCamera(),h=f.getPosition(),v=f.getFocalPoint();we(i);const{center:m,rotationFactor:x}=e;e.useFocalPointAsCenterOfRotation&&(m[0]=v[0],m[1]=v[1],m[2]=v[2]);const y=e.previousPosition.x-l.x,d=e.previousPosition.y-l.y,g=c.getView().getViewportSize(p),C=f.getViewUp();if(e.useWorldUpVec){const S=new Float64Array(3);$i(S,e.worldUpVec),js(S,xe(h,e.worldUpVec)/xe(e.worldUpVec,e.worldUpVec)),sr(m,S,S),Ye(i,i,S),Tt(i,i,et(360*y/g[0]*x),e.worldUpVec),S[0]=-S[0],S[1]=-S[1],S[2]=-S[2],Ye(i,i,S),Ye(i,i,m)}else Ye(i,i,m),Tt(i,i,et(360*y/g[0]*x),C);tt(f.getDirectionOfProjection(),C,o),Tt(i,i,et(-360*d/g[1]*x),o),s[0]=-m[0],s[1]=-m[1],s[2]=-m[2],Ye(i,i,s),_e(a,h,i),_e(n,v,i),u[0]=C[0]+h[0],u[1]=C[1]+h[1],u[2]=C[2]+h[2],_e(r,u,i),f.setPosition(a[0],a[1],a[2]),f.setFocalPoint(n[0],n[1],n[2]),f.setViewUp(r[0]-a[0],r[1]-a[1],r[2]-a[2]),f.orthogonalizeViewUp(),p.resetCameraClippingRange(),c.getLightFollowCamera()&&p.updateLightsGeometryToFollowCamera(),e.previousPosition=l}}var WO={useWorldUpVec:!1,worldUpVec:[0,1,0],useFocalPointAsCenterOfRotation:!1};function yd(t,e,a={}){Object.assign(e,WO,a),A.obj(t,e),ha.extend(t,e,a),ga.extend(t,e,a),A.setGet(t,e,["useWorldUpVec"]),A.setGetArray(t,e,["worldUpVec"],3),A.setGet(t,e,["useFocalPointAsCenterOfRotation"]),zO(t,e)}var jO=A.newInstance(yd,"vtkMouseCameraTrackballRotateManipulator"),md={newInstance:jO,extend:yd};function $O(t,e){e.classHierarchy.push("vtkMouseCameraTrackballRollManipulator");const a=new Float64Array(3),n=new Float64Array(3),r=new Float64Array(3),i=new Float64Array(16),o=new Float64Array(3),s=new Float64Array(3),u=new Float64Array(3);t.onButtonDown=(c,p,l)=>{e.previousPosition=l},t.onMouseMove=(c,p,l)=>{if(!l)return;const f=p.getActiveCamera(),h=f.getPosition(),v=f.getFocalPoint(),m=f.getViewUp();a[0]=v[0]-h[0],a[1]=v[1]-h[1],a[2]=v[2]-h[2],t.computeDisplayCenter(c.getInteractorStyle(),p);const x=e.previousPosition.x-e.displayCenter[0],y=l.x-e.displayCenter[0],d=e.previousPosition.y-e.displayCenter[1],g=l.y-e.displayCenter[1];if(y===0&&g===0||x===0&&d===0)return;const C=_a((x*g-d*y)/(Math.sqrt(x*x+d*d)*Math.sqrt(y*y+g*g))),{center:S}=e;we(i),r[0]=-S[0],r[1]=-S[1],r[2]=-S[2],Ye(i,i,S),Tt(i,i,et(C),a),Ye(i,i,r),_e(o,h,i),_e(s,v,i),n[0]=m[0]+h[0],n[1]=m[1]+h[1],n[2]=m[2]+h[2],_e(u,n,i),f.setPosition(o[0],o[1],o[2]),f.setFocalPoint(s[0],s[1],s[2]),f.setViewUp(u[0]-o[0],u[1]-o[1],u[2]-o[2]),f.orthogonalizeViewUp(),p.resetCameraClippingRange(),c.getLightFollowCamera()&&p.updateLightsGeometryToFollowCamera(),e.previousPosition=l}}var HO={};function xd(t,e,a={}){Object.assign(e,HO,a),A.obj(t,e),ga.extend(t,e,a),ha.extend(t,e,a),$O(t,e)}var KO=A.newInstance(xd,"vtkMouseCameraTrackballRollManipulator"),Cd={newInstance:KO,extend:xd};function XO(t,e){return t{const u=i.getView().getViewportSize(o),c=[.5*u[0],.5*u[1]],p=.9*XO(c[0],c[1]),l=Sd(c[0]-s.x)+Sd(c[1]-s.y);p*p>l?r=a:r=n,r.setButton(t.getButton()),r.setShift(t.getShift()),r.setControl(t.getControl()),r.setCenter(t.getCenter()),r.onButtonDown(i,s)},t.onButtonUp=i=>{r&&r.onButtonUp(i)},t.onMouseMove=(i,o,s)=>{r&&r.onMouseMove(i,o,s)}}var YO={};function Td(t,e,a={}){Object.assign(e,YO,a),A.obj(t,e),ha.extend(t,e,a),ga.extend(t,e,a),qO(t,e)}var JO=A.newInstance(Td,"vtkMouseCameraTrackballMultiRotateManipulator"),ZO={newInstance:JO,extend:Td};function QO(t,e){e.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),t.onButtonDown=(a,n,r)=>{e.previousPosition=r},t.onMouseMove=(a,n,r)=>{if(!r)return;const i=r,o=e.previousPosition;e.previousPosition=r;const s=n.getActiveCamera(),u=s.getPosition(),c=s.getFocalPoint();if(s.getParallelProjection()){s.orthogonalizeViewUp();const p=s.getViewUp(),l=s.getViewPlaneNormal(),f=[0,0,0];tt(l,p,f);const h=a.getView().getViewportSize(n)[1];let v=(i.x-o.x)/h,m=(o.y-i.y)/h;const x=s.getParallelScale();v*=x*2,m*=x*2;let y=f[0]*v+p[0]*m;u[0]+=y,c[0]+=y,y=f[1]*v+p[1]*m,u[1]+=y,c[1]+=y,y=f[2]*v+p[2]*m,u[2]+=y,c[2]+=y,s.setPosition(u[0],u[1],u[2]),s.setFocalPoint(c[0],c[1],c[2])}else{const{center:p}=e,l=a.getInteractorStyle(),f=l.computeWorldToDisplay(n,p[0],p[1],p[2])[2],h=l.computeDisplayToWorld(n,i.x,i.y,f),v=l.computeDisplayToWorld(n,o.x,o.y,f),m=[u[0]+(v[0]-h[0]),u[1]+(v[1]-h[1]),u[2]+(v[2]-h[2])],x=[c[0]+(v[0]-h[0]),c[1]+(v[1]-h[1]),c[2]+(v[2]-h[2])];s.setPosition(m[0],m[1],m[2]),s.setFocalPoint(x[0],x[1],x[2])}n.resetCameraClippingRange(),a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}var eb={};function wd(t,e,a={}){Object.assign(e,eb,a),A.obj(t,e),ga.extend(t,e,a),ha.extend(t,e,a),QO(t,e)}var tb=A.newInstance(wd,"vtkMouseCameraTrackballPanManipulator"),nb={newInstance:tb,extend:wd};function rb(t,e){e.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),t.onButtonDown=(a,n,r)=>{e.previousPosition=r;const i=a.getView().getViewportSize(n),o=n.getActiveCamera(),s=e.flipDirection?-1:1;o.getParallelProjection()?e.zoomScale=1.5/i[1]*s:e.zoomScale=1.5*(o.getClippingRange()[1]/i[1])*s},t.onMouseMove=(a,n,r)=>{if(!r)return;const i=e.previousPosition.y-r.y,o=n.getActiveCamera();if(o.getParallelProjection()){const s=i*e.zoomScale;o.setParallelScale((1-s)*o.getParallelScale())}else{const s=o.getPosition(),u=o.getFocalPoint(),c=o.getDirectionOfProjection(),p=i*e.zoomScale;let l=p*c[0];s[0]+=l,u[0]+=l,l=p*c[1],s[1]+=l,u[1]+=l,l=p*c[2],s[2]+=l,u[2]+=l,o.getFreezeFocalPoint()||o.setFocalPoint(u[0],u[1],u[2]),o.setPosition(s[0],s[1],s[2]),n.resetCameraClippingRange()}a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),e.previousPosition=r},t.onScroll=(a,n,r)=>{if(!r)return;const i=n.getActiveCamera(),o=1-r/10;i.getParallelProjection()?i.setParallelScale(i.getParallelScale()/o):(i.dolly(o),n.resetCameraClippingRange()),a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}var ab={zoomScale:0,flipDirection:!1};function _d(t,e,a={}){Object.assign(e,ab,a),A.obj(t,e),ha.extend(t,e,a),ga.extend(t,e,a),A.setGet(t,e,["flipDirection"]),rb(t,e)}var ib=A.newInstance(_d,"vtkMouseCameraTrackballZoomManipulator"),Ed={newInstance:ib,extend:_d};function ob(t,e){e.classHierarchy.push("vtkMouseCameraTrackballZoomToMouseManipulator");const a=t.onButtonDown;t.onButtonDown=(n,r,i)=>{a(n,r,i),e.zoomPosition=i},t.onMouseMove=(n,r,i)=>{if(!i)return;const o=(e.previousPosition.y-i.y)*e.zoomScale;Br.dollyToPosition(1-o,e.zoomPosition,r,n),n.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera(),e.previousPosition=i},t.onScroll=(n,r,i,o)=>{if(!i||!o)return;const s=1-i*.1;Br.dollyToPosition(s,o,r,n),n.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()}}var sb={zoomPosition:null};function Dd(t,e,a={}){Object.assign(e,sb,a),Ed.extend(t,e,a),ob(t,e)}var cb=A.newInstance(Dd,"vtkMouseCameraTrackballZoomToMouseManipulator"),ub={newInstance:cb,extend:Dd};function lb(t,e){e.classHierarchy.push("vtkCompositeGestureManipulator"),t.startInteraction=()=>{},t.endInteraction=()=>{},t.onStartPinch=(a,n)=>{},t.onStartRotate=(a,n)=>{},t.onStartPan=(a,n)=>{},t.onPinch=(a,n,r)=>{},t.onRotate=(a,n,r)=>{},t.onPan=(a,n,r)=>{},t.onEndPinch=a=>{},t.onEndRotate=a=>{},t.onEndPan=a=>{},t.isPinchEnabled=()=>e.pinchEnabled,t.isPanEnabled=()=>e.panEnabled,t.isRotateEnabled=()=>e.rotateEnabled}var fb={pinchEnabled:!0,panEnabled:!0,rotateEnabled:!0};function pb(t,e,a={}){Object.assign(e,fb,a),A.set(t,e,["pinchEnabled","panEnabled","rotateEnabled"]),A.setGet(t,e,["interactorStyle"]),lb(t,e)}var hb={extend:pb};function gb(t,e){e.classHierarchy.push("vtkGestureCameraManipulator"),t.onStartPinch=(a,n)=>{e.previousScale=n},t.onStartRotate=(a,n)=>{e.previousRotation=n},t.onStartPan=(a,n)=>{e.previousTranslation=n},t.onPinch=(a,n,r)=>{Br.dollyByFactor(a,n,r/e.previousScale),e.previousScale=r},t.onPan=(a,n,r)=>{const i=n.getActiveCamera(),o=a.getInteractorStyle();let s=i.getFocalPoint();s=o.computeWorldToDisplay(n,s[0],s[1],s[2]);const u=s[2],c=r,p=e.previousTranslation,l=o.computeDisplayToWorld(n,s[0]+c[0]-p[0],s[1]+c[1]-p[1],u),f=o.computeDisplayToWorld(n,s[0],s[1],u),h=[];h[0]=f[0]-l[0],h[1]=f[1]-l[1],h[2]=f[2]-l[2],s=i.getFocalPoint();const v=i.getPosition();i.setFocalPoint(h[0]+s[0],h[1]+s[1],h[2]+s[2]),i.setPosition(h[0]+v[0],h[1]+v[1],h[2]+v[2]),a.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),i.orthogonalizeViewUp(),e.previousTranslation=r},t.onRotate=(a,n,r)=>{const i=n.getActiveCamera();i.roll(r-e.previousRotation),i.orthogonalizeViewUp(),e.previousRotation=r}}var db={};function Od(t,e,a={}){Object.assign(e,db,a),A.obj(t,e),hb.extend(t,e,a),ga.extend(t,e,a),gb(t,e)}var vb=A.newInstance(Od,"vtkGestureCameraManipulator"),yb={newInstance:vb,extend:Od};const bd=["focalPoint","parallelProjection","parallelScale","position","viewAngle","viewUp"],mb={None:null,Pan:nb,Zoom:Ed,Roll:Cd,Rotate:md,MultiRotate:ZO,ZoomToMouse:ub,Select:fg};function Md(t,e,a){t.removeAllMouseManipulators(),e.forEach(n=>{const r=mb[n.action];if(r){const{button:i,shift:o,control:s,alt:u,scrollEnabled:c,dragEnabled:p}=n,l=r.newInstance();l.setButton(i),l.setShift(!!o),l.setControl(!!s),l.setAlt(!!u),c!==void 0&&l.setScrollEnabled(c),p!==void 0&&l.setDragEnabled(p),t.addMouseManipulator(l),l.onBoxSelectChange&&a&&l.onBoxSelectChange(a)}}),t.addGestureManipulator(yb.newInstance())}class xb{constructor(e){this.readyRef=e,this.count=0,this.start=()=>{this.count++,this.readyRef.value&&(this.readyRef.value=!1)},this.stop=()=>{this.count--,this.count===0&&(this.readyRef.value=!0)},this.reset=()=>this.count=0}async wrap(e){this.start();try{await e}finally{setTimeout(this.stop,1)}return e}}class Cb{constructor(e,a,n,r,i){this.vueCtx=i,this.pickingModes=a,this.container=null,this.rwId=0,this.mtime=0,this.busy=new xb(i.ready),this.renderer=null,this.activeCamera=null,this.subscriptions=[],this.ctx=id.getSynchronizerContext(e),this.ctx.setFetchArrayFunction((u,c=!0)=>(this.render(),this.busy.wrap(n(u,c)))),this.renderWindow=id.newInstance({synchronizerContext:this.ctx}),this.openglRenderWindow=vd.newInstance({cursor:"default"}),this.renderWindow.addView(this.openglRenderWindow),this.interactor=ns.newInstance(),this.interactor.setView(this.openglRenderWindow),this.interactor.initialize(),r.forEach(u=>{const c=`on${u}`;this.subscriptions.push(this.interactor[c](p=>this.vueCtx.emit(u,p)))}),this.style=Br.newInstance(),this.interactor.setInteractorStyle(this.style),this.render=En(()=>{this.renderer&&this.renderer.resetCameraClippingRange(),this.renderWindow.render()},0),this.selector=qa.newInstance({captureZValues:!0}),this.selector.setFieldAssociation(x0.FIELD_ASSOCIATION_POINTS);const o=({x:u,y:c})=>{if(!this.pickingModes.includes("click"))return;const p=this.pick(u,c,u,c);this.vueCtx.emit("click",p[0])};this.debouncedHover=En(({x:u,y:c})=>{if(!this.pickingModes.includes("hover"))return;const p=this.pick(u,c,u,c);this.lastSelection.length===0&&p.length===0||(this.lastSelection=p,this.vueCtx.emit("hover",p[0]))},10);const s=({selection:u})=>{if(!this.pickingModes.includes("select"))return;const[c,p,l,f]=u,h=this.pick(c,l,p,f);this.vueCtx.emit("select",h)};this.onClick=u=>o(this.getScreenEventPositionFor(u)),this.onMouseMove=u=>this.debouncedHover(this.getScreenEventPositionFor(u)),this.lastSelection=[],this.onBoxSelectChange=s}setContainer(e){this.container=e,this.openglRenderWindow.setContainer(e),this.interactor.bindEvents(e),this.resize(),this.resetCamera()}setSynchronizedViewId(e){const a=this.renderWindow.getRenderersByReference();for(;a.length;)a.pop();this.renderWindow.setSynchronizedViewId(e),this.rwId=e}async updateViewState(e){this.renderWindow.getInteractor().setEnableRender(!1),this.vueCtx.emit("beforeSceneLoaded"),this.mtime=Math.max(this.mtime,e.mtime)+1,this.busy.reset(),this.busy.start(),e.mtime=this.mtime;const a=this.renderWindow.synchronize(e);a&&(this.renderWindow.getRenderersByReference().length&&([this.renderer]=this.renderWindow.getRenderersByReference(),this.activeCamera=this.renderer.getActiveCamera()),e.extra&&e.extra.camera&&this.activeCamera&&this.ctx.registerInstance(e.extra.camera,this.activeCamera)),await a&&(e.extra&&(e.extra.camera&&(this.remoteCamera=this.ctx.getInstance(e.extra.camera),this.remoteCamera&&this.style.setCenterOfRotation(this.remoteCamera.getFocalPoint())),e.extra.centerOfRotation&&this.style.setCenterOfRotation(e.extra.centerOfRotation),e.extra.resetCamera&&this.resetCamera()),this.vueCtx.nextTick(this.render),this.vueCtx.emit("viewStateChange",e),this.busy.stop(),this.vueCtx.emit("afterSceneLoaded"),this.renderWindow.getInteractor().setEnableRender(!0))}resize(){if(this.container){const e=window.devicePixelRatio||1,{width:a,height:n}=this.container.getBoundingClientRect();this.openglRenderWindow.setSize(Math.floor(Math.max(a*e,10)),Math.floor(Math.max(n*e,10))),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resize")}}resetCamera(){this.renderer&&(this.renderer.resetCamera(),this.style.setCenterOfRotation(this.renderer.getActiveCamera().getFocalPoint()),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resetCamera"))}getCamera(){const e=this.style.getCenterOfRotation();return this.activeCamera=this.interactor.getCurrentRenderer().getActiveCamera(),{centerOfRotation:e,...this.activeCamera.get("position","focalPoint","viewUp","parallelProjection","parallelScale","viewAngle")}}setCamera(e){if(this.activeCamera){const a={};bd.forEach(n=>{e[n]!==void 0&&(a[n]=e[n])}),this.activeCamera.set(a),e.centerOfRotation&&this.style.setCenterOfRotation(e.centerOfRotation),this.vueCtx.nextTick(this.render)}}updateStyle(e,a){Md(this.style,e,a)}captureImage(e,a){return this.renderWindow.captureImages(e,a)[0]}getScreenEventPositionFor(e){if(!this.container)return;const a=this.container.getBoundingClientRect(),[n,r]=this.openglRenderWindow.getSize(),i=n/a.width,o=r/a.height;return{x:i*(e.clientX-a.left),y:o*(a.height-e.clientY+a.top),z:0}}pick(e,a,n,r){if(this.selector.attach(this.openglRenderWindow,this.renderer),!!this.renderer){if(this.selector.setArea(e,a,n,r),this.previousSelectedData=null,this.selector.captureBuffers()){if(this.selections=this.selector.generateSelection(e,a,n,r)||[],e!==n||a!==r){const o=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,1,this.renderer))],s=[];return this.selections.forEach(u=>{const{prop:c}=u.getProperties(),{remoteId:p}=c.get("remoteId");p&&s.push(p)}),{frustrum:o,remoteIds:s}}const i=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer))];return this.selections.map(o=>{const{prop:s,compositeID:u,displayPosition:c}=o.getProperties();return{mode:"local",worldPosition:Array.from(this.openglRenderWindow.displayToWorld(c[0],c[1],c[2],this.renderer)),displayPosition:c,compositeID:u,...s.get("remoteId"),ray:i}})}return[]}}beforeDelete(){for(this.render.cancel();this.subscriptions.length;)this.subscriptions.pop().unsubscribe();this.interactor.unbindEvents(),this.openglRenderWindow.setContainer(null),this.renderWindow.removeRenderer(this.renderer),this.renderWindow.removeView(this.openglRenderWindow),this.interactor.delete(),this.interactor=null,this.renderer=null,this.renderWindow.delete(),this.renderWindow=null,this.openglRenderWindow.delete(),this.openglRenderWindow=null}}function Nd(t){let e=!1;function a(){e=!0}function n(){e=!1}function r(i){if(e)switch(i.code){case"KeyR":t.resetCamera();break}}return{onEnter:a,onLeave:n,onKeyUp:r}}class Sb{constructor(e,a,n,r,i){this.vueCtx=i,this.pickingModes=a,this.renderWindow=kc.newInstance(),this.renderer=_g.newInstance({background:e}),this.renderWindow.addRenderer(this.renderer),this.activeCamera=this.renderer.getActiveCamera(),this.activeCamera.set(this.camera),this.openglRenderWindow=vd.newInstance({cursor:"default"}),this.renderWindow.addView(this.openglRenderWindow),this.interactor=ns.newInstance(),this.interactor.setView(this.openglRenderWindow),this.interactor.initialize(),this.subscriptions=[],r.forEach(c=>{const p=`on${c}`;this.subscriptions.push(this.interactor[p](l=>this.vueCtx.emit(c,l)))}),this.style=Br.newInstance(),this.interactor.setInteractorStyle(this.style),this.selector=qa.newInstance({captureZValues:!0}),this.selector.setFieldAssociation(x0.FIELD_ASSOCIATION_POINTS),this.selector.attach(this.openglRenderWindow,this.renderer),this.render=En(()=>{this.renderer.resetCameraClippingRange(),this.renderWindow.render()},1),this.cubeAxes=X0.newInstance({dataBounds:[-1,1,-1,1,-1,1],visibility:!1}),this.cubeAxes.setVisibility(!1),this.cubeAxes.getActors().forEach(({setVisibility:c})=>c(!1)),this.renderer.addActor(this.cubeAxes);const o=de.newInstance({bounds:[0,0,0,0,0,0]});this.updateCubeBounds=()=>{o.reset();const{props:c}=this.renderer.get("props");for(let p=0;p{p&&c==="ComputeVisiblePropBoundsEvent"&&this.debouncedCubeBounds()}));const s=({x:c,y:p})=>{if(!this.pickingModes.includes("click"))return;const l=this.pick(c,p,c,p);this.vueCtx.emit("click",l[0])};this.debouncedHover=En(({x:c,y:p})=>{if(!this.pickingModes.includes("hover"))return;const l=this.pick(c,p,c,p);this.lastSelection.length===0&&l.length===0||(this.lastSelection=l,this.vueCtx.emit("hover",l[0]))},10);const u=({selection:c})=>{if(!this.pickingModes.includes("select"))return;const[p,l,f,h]=c,v=this.pick(p,f,l,h);this.vueCtx.emit("select",v)};this.onClick=c=>s(this.getScreenEventPositionFor(c)),this.onMouseMove=c=>this.debouncedHover(this.getScreenEventPositionFor(c)),this.lastSelection=[],this.onBoxSelectChange=u,this.updateStyle(n)}setContainer(e){this.container=e,this.openglRenderWindow.setContainer(e),this.interactor.bindEvents(e),this.resize(),this.resetCamera(),this.resetCameraTimeout=setTimeout(()=>this.resetCamera(),100)}resize(){if(this.container){const e=window.devicePixelRatio||1,{width:a,height:n}=this.container.getBoundingClientRect();this.openglRenderWindow.setSize(Math.floor(Math.max(a*e,10)),Math.floor(Math.max(n*e,10))),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resize")}}resetCamera(){this.renderer&&(this.renderer.resetCamera(),this.style.setCenterOfRotation(this.renderer.getActiveCamera().getFocalPoint()),this.vueCtx.nextTick(this.render),this.vueCtx.emit("resetCamera"))}getCamera(){const e=this.style.getCenterOfRotation();return this.activeCamera=this.interactor.getCurrentRenderer().getActiveCamera(),{centerOfRotation:e,...this.activeCamera.get("position","focalPoint","viewUp","parallelProjection","parallelScale","viewAngle")}}setCamera(e){if(this.activeCamera){const a={};bd.forEach(n=>{e[n]&&(a[n]=e[n])}),this.activeCamera.set(a),e.centerOfRotation&&this.style.setCenterOfRotation(e.centerOfRotation),this.vueCtx.nextTick(this.render)}}setCubeAxesVisibility(e){this.cubeAxes.setVisibility(e),this.cubeAxes.getActors().forEach(({setVisibility:a})=>a(e)),this.cubeAxes.setCamera(e?this.activeCamera:null),this.vueCtx.nextTick(this.render)}updateStyle(e){Md(this.style,e,this.onBoxSelectChange)}getScreenEventPositionFor(e){if(!this.container)return;const a=this.container.getBoundingClientRect(),[n,r]=this.openglRenderWindow.getSize(),i=n/a.width,o=r/a.height;return{x:i*(e.clientX-a.left),y:o*(a.height-e.clientY+a.top),z:0}}pick(e,a,n,r){if(this.selector.setArea(e,a,n,r),this.previousSelectedData=null,this.selector.captureBuffers()){if(this.selections=this.selector.generateSelection(e,a,n,r)||[],e!==n||a!==r){const o=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,r,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,a,1,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(n,r,1,this.renderer))],s=[];return this.selections.forEach(u=>{const{prop:c}=u.getProperties(),{representationId:p}=c.get("representationId");p&&s.push(p)}),{frustrum:o,representationIds:s}}const i=[Array.from(this.openglRenderWindow.displayToWorld(e,a,0,this.renderer)),Array.from(this.openglRenderWindow.displayToWorld(e,a,1,this.renderer))];return this.selections.map(o=>{const{prop:s,compositeID:u,displayPosition:c}=o.getProperties();return{worldPosition:Array.from(this.openglRenderWindow.displayToWorld(c[0],c[1],c[2],this.renderer)),displayPosition:c,compositeID:u,...s.get("representationId"),ray:i}})}return[]}beforeDelete(){for(;this.subscriptions.length;)this.subscriptions.pop().unsubscribe();this.debouncedCubeBounds&&this.debouncedCubeBounds.cancel(),this.debouncedHover&&this.debouncedHover.cancel(),this.render&&this.render.cancel(),clearTimeout(this.resetCameraTimeout),this.interactor.unbindEvents(),this.openglRenderWindow.setContainer(null),this.renderWindow.removeRenderer(this.renderer),this.renderWindow.removeView(this.openglRenderWindow),this.interactor.delete(),this.interactor=null,this.renderer.delete(),this.renderer=null,this.renderWindow.delete(),this.renderWindow=null,this.openglRenderWindow.delete(),this.openglRenderWindow=null}}const eu={props:{camera:{type:Object,default:null},interactorEvents:{type:Array,default:()=>["EndAnimation"]},interactorSettings:{type:Array,default:()=>[{button:1,action:"Rotate"},{button:2,action:"Pan"},{button:3,action:"Zoom",scrollEnabled:!0},{button:1,action:"Pan",alt:!0},{button:1,action:"Zoom",control:!0},{button:1,action:"Select",shift:!0},{button:1,action:"Roll",alt:!0,shift:!0}]},wsClient:{type:Object},contextName:{type:String,default:"LocalRenderingContext"},viewState:{type:Object},boxSelection:{type:Boolean,default:!1},pickingModes:{type:Array,default:()=>[]}},emits:["resetCamera","beforeSceneLoaded","afterSceneLoaded","viewStateChange","onReady","resize","onImageCapture","BoxSelection","select","hover","click","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],setup(t,{emit:e}){var _,E,D,O,b,R;const a=se.inject("trame"),n=se.ref(!1),r=se.ref(null);let i=!1;const o=se.computed(()=>t.wsClient||(a==null?void 0:a.client));let s=()=>Promise.resolve(null);const u=(E=(_=o.value)==null?void 0:_.getConnection())==null?void 0:E.getSession();u&&(s=(N,L)=>u.call("viewport.geometry.array.get",[N,L])),(O=(D=o.value.getRemote())==null?void 0:D.SyncView)!=null&&O.getArray&&(s=(R=(b=o.value.getRemote())==null?void 0:b.SyncView)==null?void 0:R.getArray);const c=new Cb(t.contextName,t.pickingModes,s,t.interactorEvents,{emit:e,nextTick:se.nextTick,ready:n});c.updateStyle(t.interactorSettings,v);const{onEnter:p,onLeave:l,onKeyUp:f}=Nd(c),h=new ResizeObserver(()=>c.resize());function v({container:N,selection:L}){if(t.pickingModes.includes("select")){c.onBoxSelectChange({selection:L});return}!t.boxSelection||!N||e("BoxSelection",{selection:L,mode:"local",size:c.openglRenderWindow.getSize(),camera:c.getCamera()})}se.watch(n,N=>{e("onReady",N)}),se.watch(()=>t.interactorSettings,()=>c.updateStyle(t.interactorSettings,v)),se.watch(()=>t.pickingModes,()=>{c.pickingModes=t.pickingModes}),se.watch(()=>t.viewState,({id:N})=>{N===i&&(i=!1,c.updateViewState(t.viewState))});let m=null;se.onMounted(()=>{const N=r.value;c.setContainer(N),h.observe(N),document.addEventListener("keyup",f),t.viewState&&(c.rwId=t.viewState.id,c.updateViewState(t.viewState)),m=o.value.getConnection().getSession().subscribe("trame.vtk.delta",([L])=>{L.id===c.rwId&&c.updateViewState(L)})}),se.onBeforeUnmount(()=>{c.beforeDelete(),m&&o.value&&(o.value.getConnection().getSession().unsubscribe(m),m=null),document.removeEventListener("keyup",f),h.disconnect()}),se.provide("view",c);const x=async(N="image/png",L={})=>{const B=await c.captureImage(N,L),F=await(await fetch(B)).blob();return e("onImageCapture",F),F},y=()=>c.resetCamera(),d=()=>c.getCamera(),g=N=>c.setCamera(N),C=N=>{i=N,typeof t.viewState.id=="number"&&(i=Number(i)),c.setSynchronizedViewId(i)},S=()=>c.resize(),{onClick:T,onMouseMove:w}=c;return{vtkContainer:r,onEnter:p,onLeave:l,onClick:T,onMouseMove:w,resetCamera:y,getCamera:d,setCamera:g,setSynchronizedViewId:C,resize:S,captureImage:x}},template:`
- `},md={position:"absolute !important",left:"-20000px"},xd={position:"absolute !important",left:0},OO={components:{VtkRemoteView:Q1,VtkSyncView:Hc},emits:["resetCamera","beforeSceneLoaded","afterSceneLoaded","viewStateChange","onReady","resize","onLocalImageCapture","onRemoteImageCapture","BoxSelection","click","hover","select","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],props:{mode:{type:String,default:"local"},disableAutoSwitch:{type:Boolean,default:!1},namespace:{type:String,default:""},refPrefix:{type:String,default:"refName"},viewId:{type:String,default:"-1"},wsClient:{type:Object},interactiveRatio:{type:[Number,String]},interactiveQuality:{type:[Number,String]},stillRatio:{type:[Number,String]},stillQuality:{type:[Number,String]},camera:{type:Object,default:null},interactorEvents:{type:Array,default:()=>["EndAnimation"]},interactorSettings:{type:Array,default:()=>[{button:1,action:"Rotate"},{button:2,action:"Pan"},{button:3,action:"Zoom",scrollEnabled:!0},{button:1,action:"Pan",shift:!0},{button:1,action:"Zoom",alt:!0},{button:1,action:"Zoom",control:!0},{button:1,action:"Roll",alt:!0,shift:!0}]},contextName:{type:String,default:"LocalRenderingContext"},enablePicking:{type:Boolean,default:!1},boxSelection:{type:Boolean,default:!1},viewState:{type:Object},pickingModes:{type:Array,default:()=>[]}},setup(t,{emit:e}){const a=se.inject("trame"),n=se.ref(!1),r=se.ref(null),i=se.ref(null),o=se.computed(()=>t.disableAutoSwitch||n.value),s=se.computed(()=>t.mode==="local"&&o.value),c=se.computed(()=>t.mode==="remote"||!o.value),l=se.computed(()=>s.value?xd:md),p=se.computed(()=>c.value?xd:md),u=se.computed(()=>t.namespace?`${t.namespace}Camera`:"camera");function f(){return t.mode==="local"&&o.value?r.value.resetCamera():i.value.resetCamera()}function h(){return r.value.getCamera()}function d(C){return r.value.setCamera(C)}async function v(C="image/png",S={}){r.value.captureImage(C,S),i.value.captureImage()}function m(){r.value.resize(),i.value.resize()}se.watch(()=>t.viewId,C=>r.value.setSynchronizedViewId(C));function x(C,S=[],T={}){return a.trigger(C,S,T)}function y(C){n.value=C}const{pickingModes:g}=se.toRefs(t);return{computedLocalRenderingReady:o,onReady:y,localViewRef:r,remoteViewRef:i,trigger:x,getCamera:h,setCamera:d,resize:m,resetCamera:f,cameraKey:u,localStyle:l,remoteStyle:p,emit:e,captureImage:v,pickingModes:g}},template:` + `},Rd={position:"absolute !important",left:"-20000px"},Ld={position:"absolute !important",left:0},Tb={components:{VtkRemoteView:hg,VtkSyncView:eu},emits:["resetCamera","beforeSceneLoaded","afterSceneLoaded","viewStateChange","onReady","resize","onLocalImageCapture","onRemoteImageCapture","BoxSelection","click","hover","select","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],props:{mode:{type:String,default:"local"},disableAutoSwitch:{type:Boolean,default:!1},namespace:{type:String,default:""},refPrefix:{type:String,default:"refName"},viewId:{type:String,default:"-1"},wsClient:{type:Object},interactiveRatio:{type:[Number,String]},interactiveQuality:{type:[Number,String]},stillRatio:{type:[Number,String]},stillQuality:{type:[Number,String]},camera:{type:Object,default:null},interactorEvents:{type:Array,default:()=>["EndAnimation"]},interactorSettings:{type:Array,default:()=>[{button:1,action:"Rotate"},{button:2,action:"Pan"},{button:3,action:"Zoom",scrollEnabled:!0},{button:1,action:"Pan",shift:!0},{button:1,action:"Zoom",alt:!0},{button:1,action:"Zoom",control:!0},{button:1,action:"Roll",alt:!0,shift:!0}]},contextName:{type:String,default:"LocalRenderingContext"},enablePicking:{type:Boolean,default:!1},boxSelection:{type:Boolean,default:!1},viewState:{type:Object},pickingModes:{type:Array,default:()=>[]}},setup(t,{emit:e}){const a=se.inject("trame"),n=se.ref(!1),r=se.ref(null),i=se.ref(null),o=se.computed(()=>t.disableAutoSwitch||n.value),s=se.computed(()=>t.mode==="local"&&o.value),u=se.computed(()=>t.mode==="remote"||!o.value),c=se.computed(()=>s.value?Ld:Rd),p=se.computed(()=>u.value?Ld:Rd),l=se.computed(()=>t.namespace?`${t.namespace}Camera`:"camera");function f(){return t.mode==="local"&&o.value?r.value.resetCamera():i.value.resetCamera()}function h(){return r.value.getCamera()}function v(C){return r.value.setCamera(C)}async function m(C="image/png",S={}){r.value.captureImage(C,S),i.value.captureImage()}function x(){r.value.resize(),i.value.resize()}se.watch(()=>t.viewId,C=>r.value.setSynchronizedViewId(C));function y(C,S=[],T={}){return a.trigger(C,S,T)}function d(C){n.value=C}const{pickingModes:g}=se.toRefs(t);return{computedLocalRenderingReady:o,onReady:d,localViewRef:r,remoteViewRef:i,trigger:y,getCamera:h,setCamera:v,resize:x,resetCamera:f,cameraKey:l,localStyle:c,remoteStyle:p,emit:e,captureImage:m,pickingModes:g}},template:`
- `},bO={props:{background:{type:Array,default:()=>[.2,.3,.4]},camera:{type:Object,default:null},interactorEvents:{type:Array,default:()=>["EndAnimation"]},interactorSettings:{type:Array,default:()=>[{button:1,action:"Rotate"},{button:2,action:"Pan"},{button:3,action:"Zoom",scrollEnabled:!0},{button:1,action:"Pan",alt:!0},{button:1,action:"Zoom",control:!0},{button:1,action:"Select",shift:!0},{button:1,action:"Roll",alt:!0,shift:!0}]},pickingModes:{type:Array,default:()=>[]},showCubeAxes:{type:Boolean,default:!1},cubeAxesStyle:{type:Object,default:()=>({})}},emits:["resize","resetCamera","BoxSelection","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],setup(t,{emit:e}){const a=se.ref(null),n=new DO(t.background,t.pickingModes,t.interactorSettings,t.interactorEvents,{emit:e,nextTick:se.nextTick});n.setCubeAxesVisibility(t.showCubeAxes);const{onEnter:r,onLeave:i,onKeyUp:o}=yd(n),s=new ResizeObserver(()=>n.resize());se.onMounted(()=>{const d=a.value;n.setContainer(d),s.observe(d),document.addEventListener("keyup",o)}),se.onBeforeUnmount(()=>{n.beforeDelete(),document.removeEventListener("keyup",o),s.disconnect()}),se.watch(()=>t.interactorSettings,()=>n.updateStyle(t.interactorSettings)),se.watch(()=>t.pickingModes,()=>n.pickingModes=t.pickingModes),se.watch(()=>t.showCubeAxes,()=>n.setCubeAxesVisibility(t.showCubeAxes)),se.provide("view",n);const{onClick:c,onMouseMove:l}=n;return{vtkContainer:a,onEnter:r,onLeave:i,onClick:c,onMouseMove:l,resetCamera:()=>n.resetCamera(),getCamera:()=>n.getCamera(),setCamera:d=>n.setCamera(d),setCubeAxesVisibility:d=>{t.showCubeAxes=d}}},template:` + `},wb={props:{background:{type:Array,default:()=>[.2,.3,.4]},camera:{type:Object,default:null},interactorEvents:{type:Array,default:()=>["EndAnimation"]},interactorSettings:{type:Array,default:()=>[{button:1,action:"Rotate"},{button:2,action:"Pan"},{button:3,action:"Zoom",scrollEnabled:!0},{button:1,action:"Pan",alt:!0},{button:1,action:"Zoom",control:!0},{button:1,action:"Select",shift:!0},{button:1,action:"Roll",alt:!0,shift:!0}]},pickingModes:{type:Array,default:()=>[]},showCubeAxes:{type:Boolean,default:!1},cubeAxesStyle:{type:Object,default:()=>({})}},emits:["resize","resetCamera","BoxSelection","StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"],setup(t,{emit:e}){const a=se.ref(null),n=new Sb(t.background,t.pickingModes,t.interactorSettings,t.interactorEvents,{emit:e,nextTick:se.nextTick});n.setCubeAxesVisibility(t.showCubeAxes);const{onEnter:r,onLeave:i,onKeyUp:o}=Nd(n),s=new ResizeObserver(()=>n.resize());se.onMounted(()=>{const v=a.value;n.setContainer(v),s.observe(v),document.addEventListener("keyup",o)}),se.onBeforeUnmount(()=>{n.beforeDelete(),document.removeEventListener("keyup",o),s.disconnect()}),se.watch(()=>t.interactorSettings,()=>n.updateStyle(t.interactorSettings)),se.watch(()=>t.pickingModes,()=>n.pickingModes=t.pickingModes),se.watch(()=>t.showCubeAxes,()=>n.setCubeAxesVisibility(t.showCubeAxes)),se.provide("view",n);const{onClick:u,onMouseMove:c}=n;return{vtkContainer:a,onEnter:r,onLeave:i,onClick:u,onMouseMove:c,resetCamera:()=>n.resetCamera(),getCamera:()=>n.getCamera(),setCamera:v=>n.setCamera(v),setCubeAxesVisibility:v=>{t.showCubeAxes=v}}},template:`
- `},gi=[];function MO(t){return new Promise((e,a)=>{if(gi.indexOf(t)===-1){gi.push(t);const n=document.createElement("script");n.type="text/javascript",n.src=t,n.onload=e,n.onerror=a,document.body.appendChild(n)}else e(!1)})}function NO(t){return new Promise((e,a)=>{if(gi.indexOf(t)===-1){gi.push(t);const n=document.createElement("link");n.rel="stylesheet",n.href=t,n.onload=e,n.onerror=a,document.head.appendChild(n)}else e(!1)})}var RO={loadScript:MO,loadCSS:NO,LOADED_URLS:gi},Cd={XrSessionTypes:{HmdVR:0,MobileAR:1,LookingGlassVR:2,HmdAR:3}};const{XrSessionTypes:kn}=Cd,Sd={rescaleFactor:.25,translateZ:-1.5};function LO(){const t=A7.newInstance(),e=gn.newInstance();e.setInputConnection(t.getOutputPort());const a=pn.newInstance();return a.getProperty().setColor(1,0,0),a.getProperty().setLineWidth(5),a.setMapper(e),a.setPickable(!1),{lineSource:t,mapper:e,actor:a,visible:!1}}function FO(t,e){e.classHierarchy.push("vtkWebXRRenderWindowHelper"),t.initialize=a=>{e.initialized||(e.renderWindow=a,e.initialized=!0)},t.getXrSupported=()=>navigator.xr!==void 0,t.startXR=a=>{if(navigator.xr===void 0)throw new Error("WebXR is not available");e.xrSessionType=a!==void 0?a:kn.HmdVR;const n=[kn.HmdAR,kn.MobileAR].includes(e.xrSessionType),r=n?"immersive-ar":"immersive-vr";if(!navigator.xr.isSessionSupported(r))throw n?new Error("Device does not support AR session"):new Error("VR display is not available");if(e.xrSession===null)navigator.xr.requestSession(r).then(t.enterXR,()=>{throw new Error("Failed to create XR session!")});else throw new Error("XR Session already exists!")},t.enterXR=async a=>{if(e.xrSession=a,e.initCanvasSize=e.renderWindow.getSize(),e.xrSession!==null){const n=e.renderWindow.get3DContext();await n.makeXRCompatible();const{XRWebGLLayer:r}=window,i=new r(e.xrSession,n[Qg]());if(e.renderWindow.setSize(i.framebufferWidth,i.framebufferHeight),e.xrSession.updateRenderState({baseLayer:i}),e.xrSession.requestReferenceSpace("local").then(s=>{e.xrReferenceSpace=s}),[kn.HmdAR,kn.MobileAR].includes(e.xrSessionType)){const s=e.renderWindow.getRenderable().getRenderers()[0];e.initBackground=s.getBackground(),s.setBackground([0,0,0,0])}t.resetXRScene(),e.renderWindow.getRenderable().getInteractor().switchToXRAnimation(),e.xrSceneFrame=e.xrSession.requestAnimationFrame(e.xrRender),t.modified()}else throw new Error("Failed to enter XR with a null xrSession.")},t.resetXRScene=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sd.rescaleFactor,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sd.translateZ;const r=e.renderWindow.getRenderable().getRenderers()[0];r.resetCamera();const i=r.getActiveCamera();let o=i.getPhysicalScale();const s=i.getPhysicalTranslation(),c=n*o;o/=a,s[2]+=c,i.setPhysicalScale(o),i.setPhysicalTranslation(s),i.setClippingRange(.1*o,100*o)},t.stopXR=async()=>{if(navigator.xr===void 0)return;if(e.xrSession!==null){e.xrSession.cancelAnimationFrame(e.xrSceneFrame),e.renderWindow.getRenderable().getInteractor().returnFromXRAnimation();const n=e.renderWindow.get3DContext();n.bindFramebuffer(n.FRAMEBUFFER,null);const r=e.renderWindow.getRenderable().getRenderers()[0];e.xrSession.inputSources.forEach(i=>{e.inputSourceToRay[i.handedness]&&(r.removeActor(e.inputSourceToRay[i.handedness].actor),e.inputSourceToRay[i.handedness].visible=!1)}),await e.xrSession.end().catch(i=>{if(!(i instanceof DOMException))throw i}),e.xrSession=null}e.initCanvasSize!==null&&e.renderWindow.setSize(...e.initCanvasSize);const a=e.renderWindow.getRenderable().getRenderers()[0];e.initBackground!=null&&(a.setBackground(e.initBackground),e.initBackground=null),a.getActiveCamera().setProjectionMatrix(null),a.resetCamera(),a.setViewport(0,0,1,1),e.renderWindow.traverseAllPasses(),t.modified()},e.xrRender=async(a,n)=>{const r=n.session,i=[kn.HmdVR,kn.HmdAR].includes(e.xrSessionType);if(i&&e.drawControllersRay&&e.xrReferenceSpace){const s=e.renderWindow.getRenderable().getRenderers()[0],c=s.getActiveCamera(),l=[];c.getPhysicalToWorldMatrix(l),r.inputSources.forEach(p=>{if(p.targetRaySpace==null||p.gripSpace==null||p.targetRayMode!=="tracked-pointer")return;e.inputSourceToRay[p.handedness]==null&&(e.inputSourceToRay[p.handedness]=LO());const u=e.inputSourceToRay[p.handedness],f=n.getPose(p.targetRaySpace,e.xrReferenceSpace);if(f==null)return;const h=Ci(f.transform.position.x,f.transform.position.y,f.transform.position.z),d=c.physicalOrientationToWorldDirection([f.transform.orientation.x,f.transform.orientation.y,f.transform.orientation.z,f.transform.orientation.w]),v=_e([],h,l),m=s.getActiveCamera().getClippingRange()[1];u.visible||(s.addActor(u.actor),u.visible=!0),u.lineSource.setPoint1(v[0]-d[0]*m,v[1]-d[1]*m,v[2]-d[2]*m),u.lineSource.setPoint2(...v)}),e.renderWindow.render()}e.renderWindow.getRenderable().getInteractor().updateXRGamepads(r,n,e.xrReferenceSpace),e.xrSceneFrame=e.xrSession.requestAnimationFrame(e.xrRender);const o=n.getViewerPose(e.xrReferenceSpace);if(o){const s=e.renderWindow.get3DContext();e.xrSessionType===kn.MobileAR&&e.initCanvasSize!==null&&(s.canvas.width=e.initCanvasSize[0],s.canvas.height=e.initCanvasSize[1]);const c=r.renderState.baseLayer;s.bindFramebuffer(s.FRAMEBUFFER,c.framebuffer),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT),e.renderWindow.setSize(c.framebufferWidth,c.framebufferHeight);const l=e.renderWindow.getRenderable().getRenderers()[0];o.views.forEach((p,u)=>{const f=c.getViewport(p);if(i)if(p.eye==="left")l.setViewport(0,0,.5,1);else if(p.eye==="right")l.setViewport(.5,0,1,1);else return;else if(e.xrSessionType===kn.LookingGlassVR){const h=f.x/c.framebufferWidth,d=f.y/c.framebufferHeight,v=(f.x+f.width)/c.framebufferWidth,m=(f.y+f.height)/c.framebufferHeight;l.setViewport(h,d,v,m)}else l.setViewport(0,0,1,1);l.getActiveCamera().computeViewParametersFromPhysicalMatrix(p.transform.inverse.matrix),l.getActiveCamera().setProjectionMatrix(p.projectionMatrix),e.renderWindow.traverseAllPasses()}),s.scissor(0,0,c.framebufferWidth,c.framebufferHeight),s.disable(s.SCISSOR_TEST)}},t.delete=V.chain(t.delete)}function kO(){return{initialized:!1,drawControllersRay:!1,inputSourceToRay:{},initCanvasSize:null,initBackground:null,renderWindow:null,xrSession:null,xrSessionType:0,xrReferenceSpace:null}}function Td(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,kO(),a),V.obj(t,e),V.event(t,e,"event"),V.get(t,e,["xrSession"]),V.setGet(t,e,["renderWindow","drawControllersRay"]),FO(t,e)}var VO={newInstance:V.newInstance(Td,"vtkWebXRRenderWindowHelper"),extend:Td,...Cd};function AO(t,e){e.classHierarchy.push("vtkCompositeVRManipulator"),t.onButton3D=(a,n,r,i)=>{},t.onMove3D=(a,n,r,i)=>{}}const BO={};function UO(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,BO,a),V.setGet(t,e,["device","input"]),AO(t,e)}var GO={extend:UO,Device:jo,Input:Wo};function IO(t,e){e.classHierarchy.push("vtkAbstractPicker"),t.initialize=()=>{e.renderer=null,e.selectionPoint[0]=0,e.selectionPoint[1]=0,e.selectionPoint[2]=0,e.pickPosition[0]=0,e.pickPosition[1]=0,e.pickPosition[2]=0},t.initializePickList=()=>{e.pickList=[]},t.addPickList=a=>{e.pickList.push(a)},t.deletePickList=a=>{const n=e.pickList.indexOf(a);n!==-1&&e.pickList.splice(n,1)}}const PO={renderer:null,selectionPoint:[0,0,0],pickPosition:[0,0,0],pickFromList:!1,pickList:[]};function wd(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,PO,a),V.obj(t,e),V.get(t,e,["renderer"]),V.getArray(t,e,["selectionPoint","pickPosition"]),V.setGet(t,e,["pickFromList","pickList"]),IO(t,e)}var zO={newInstance:V.newInstance(wd,"vtkAbstractPicker"),extend:wd};const{vtkErrorMacro:jO}=V,{vtkWarningMacro:ls}=V;function WO(t,e){e.classHierarchy.push("vtkPicker");const a={...t};function n(){a.initialize(),e.actors=[],e.pickedPositions=[],e.mapperPosition[0]=0,e.mapperPosition[1]=0,e.mapperPosition[2]=0,e.mapper=null,e.dataSet=null,e.globalTMin=Number.MAX_VALUE}function r(o,s,c){let l=0;const p=c.getRenderWindow().getViews()[0],u=c.getViewport(),f=p.getSize();let h=f[0]*u[0],d=f[1]*u[1];const v=p.displayToNormalizedDisplay(h,d,o),m=c.normalizedDisplayToWorld(v[0],v[1],v[2],s);h=f[0]*u[2],d=f[1]*u[3];const x=p.displayToNormalizedDisplay(h,d,o),y=c.normalizedDisplayToWorld(x[0],x[1],x[2],s);for(let g=0;g<3;g++)l+=(y[g]-m[g])*(y[g]-m[g]);return Math.sqrt(l)}function i(o,s,c,l){const p=new Float64Array(4),u=new Float64Array(4),f=[],h=[],d=e.pickFromList?e.pickList:o.getActors(),v=new Float64Array(3),m=new Float64Array(3);d.forEach(y=>{var w,_,E;const g=y.getMapper(),C=((E=(w=y.getProperty)==null?void 0:(_=w.call(y)).getOpacity)==null?void 0:E.call(_))===0;if(!(y.getNestedPickable()&&y.getNestedVisibility()&&!C))return;e.transformMatrix=y.getMatrix().slice(0),We(e.transformMatrix,e.transformMatrix),Et(e.transformMatrix,e.transformMatrix),er(p,c,e.transformMatrix),er(u,l,e.transformMatrix),Kt(p,p,1/p[3]),Kt(u,u,1/u[3]),He(u,p,f);const T=g?we.inflate(g.getBounds(),s):[...we.INIT_BOUNDS];if(we.intersectBox(T,p,f,h,[])){mi(v,e.transformMatrix);const D=e.intersectWithLine(p,u,s*.333*(v[0]+v[1]+v[2]),y,g);if(D{const C=y.distance2,S=g.distance2;return CS?1:0}),e.pickedPositions=[],e.actors=[],x.forEach(y=>{e.pickedPositions.push(y.pickedPosition),e.actors.push(y.actor)})}e.intersectWithLine=(o,s,c,l,p)=>{if(!p)return Number.MAX_VALUE;const u=p.getCenter(),f=sn(new Float64Array(3),s,o),h=xe(f,f);return h===0?2:(f[0]*(u[0]-o[0])+f[1]*(u[1]-o[1])+f[2]*(u[2]-o[2]))/h},t.pick=(o,s)=>{if(o.length!==3&&ls("vtkPicker.pick - selection needs three components"),!s)throw jO("vtkPicker.pick - renderer cannot be null"),new Error("renderer cannot be null");n();const c=o[0],l=o[1];let p=o[2];e.renderer=s,e.selectionPoint[0]=c,e.selectionPoint[1]=l,e.selectionPoint[2]=p;const u=new Float64Array(4),f=new Float64Array(4),h=s.getActiveCamera(),d=h.getPosition(),v=h.getFocalPoint(),m=s.getRenderWindow().getViews()[0],x=m.getViewportSize(s);if(x[1]===0){ls("vtkPicker.pick - viewport area is 0");return}const y=x[0]/x[1];let g=[];g=s.worldToNormalizedDisplay(v[0],v[1],v[2],y),g=m.normalizedDisplayToDisplay(g[0],g[1],g[2]),p=g[2];const C=m.displayToNormalizedDisplay(c,l,p),S=s.normalizedDisplayToWorld(C[0],C[1],C[2],y);for(let N=0;N<3;N++)e.pickPosition[N]=S[N];const T=[];for(let N=0;N<3;N++)T[N]=e.pickPosition[N]-d[N];const w=[];for(let N=0;N<3;N++)w[N]=v[N]-d[N];Ke(w);const _=xe(w,T);if(_===0){ls("Picker::Pick Cannot process points");return}const E=h.getClippingRange();let D,O;if(h.getParallelProjection()){D=E[0]-_,O=E[1]-_;for(let N=0;N<3;N++)u[N]=e.pickPosition[N]+D*w[N],f[N]=e.pickPosition[N]+O*w[N]}else{D=E[0]/_,O=E[1]/_;for(let N=0;N<3;N++)u[N]=d[N]+D*T[N],f[N]=d[N]+O*T[N]}u[3]=1,f[3]=1;const M=r(p,y,s)*e.tolerance;i(e.renderer,M,u,f)},t.pick3DPoint=(o,s,c)=>{if(!c)throw new Error("renderer cannot be null");n(),e.renderer=c,Si(e.selectionPoint,o);const p=c.getRenderWindow().getViews()[0].getViewportSize(c);if(p[1]===0){ls("vtkPicker.pick3DPoint - viewport area is 0");return}const u=p[0]/p[1],f=r(e.selectionPoint[2],u,c)*e.tolerance;i(c,f,o,s)}}const $O={tolerance:.025,mapperPosition:[0,0,0],mapper:null,dataSet:null,actors:[],pickedPositions:[],transformMatrix:null,globalTMin:Number.MAX_VALUE};function _d(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,$O,a),zO.extend(t,e,a),V.setGet(t,e,["tolerance"]),V.setGetArray(t,e,["mapperPosition"],3),V.get(t,e,["mapper","dataSet","actors","pickedPositions"]),V.event(t,e,"pickChange"),WO(t,e)}var HO={newInstance:V.newInstance(_d,"vtkPicker"),extend:_d};function KO(t,e){e.classHierarchy.push("vtk3DControllerModelSelectorManipulator");const a=HO.newInstance();let n;const r=new Float64Array(16),i=new Float64Array(3),o=new Float64Array(4),s=new Float64Array(4),c=new Float64Array(3),l=new Float64Array(16),p=new Float64Array(4),u=new Float64Array(16),f=new Float64Array(4),h=new Float64Array(4),d=new Float64Array(3),v=new Float64Array(3),m=new Float64Array(4);function x(S,T,w){sn(i,T,e.lastWorldPosition),ps(s,e.lastOrientation),Oi(o,w,s),Mi(o,o);const _=fu(c,o);Te(l),Ye(l,l,T),mt(l,l,_,c),Ye(l,l,cu(new Float64Array(3),T)),Ye(l,l,i),We(u,S.getMatrix()),Ee(l,l,u),xi(p,l),S.getOrientationQuaternion(f),ps(h,f),Oi(m,h,p),Mi(m,m),Zc(d,l),mi(v,l),S.setPosition(...d),S.setScale(...v),S.rotateQuaternion(m)}function y(){e.lastOrientation=null,e.lastWorldPosition=null,n&&n.setDragable(!0),n=null}t.onButton3D=(S,T,w,_)=>{if(!_.pressed)return y(),V.VOID;const E=T.getActiveCamera();E.getPhysicalToWorldMatrix(r);const{targetPosition:D,targetOrientation:O}=_,M=_e([],[D.x,D.y,D.z],r),N=E.physicalOrientationToWorldDirection([O.x,O.y,O.z,O.w]),R=T.getActiveCamera().getClippingRange()[1],B=[...M,1],I=[B[0]-N[0]*R,B[1]-N[1]*R,B[2]-N[2]*R,1];a.pick3DPoint(B,I,T);const P=a.getActors();return P.length>0&&P[0].getNestedDragable()?(n=P[0],n.setDragable(!1)):y(),V.EVENT_ABORT};const g=new Float64Array(3),C=new Float64Array(4);t.onMove3D=(S,T,w,_)=>{if(w!==W1.IS_CAMERA_POSE||n==null)return V.VOID;T.getActiveCamera().getPhysicalToWorldMatrix(r);const{targetPosition:D}=_;return _e(g,[D.x,D.y,D.z],r),A2(C,_.targetOrientation.x,_.targetOrientation.y,_.targetOrientation.z,_.targetOrientation.w),e.lastWorldPosition&&e.lastOrientation?x(n,g,C):(e.lastWorldPosition=new Float64Array(3),e.lastOrientation=new Float64Array(4)),Si(e.lastWorldPosition,g),V2(e.lastOrientation,C),V.EVENT_ABORT}}const XO={};function Ed(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,XO,a),V.get(t,e,["lastWorldPosition","lastOrientation"]),V.obj(t,e),GO.extend(t,e,a),KO(t,e)}var Dd={newInstance:V.newInstance(Ed,"vtk3DControllerModelSelectorManipulator"),extend:Ed};function qO(t,e){e.classHierarchy.push("vtkInteractorStyleHMDXR");const a=Dd.newInstance({device:jo.LeftController,input:Wo.A}),n=Dd.newInstance({device:jo.RightController,input:Wo.A});t.addVRManipulator(a),t.addVRManipulator(n)}const YO={};function Od(t,e){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.assign(e,YO,a),Vr.extend(t,e,a),qO(t,e)}var JO={newInstance:V.newInstance(Od,"vtkInteractorStyleHMDXR"),extend:Od};const bd={VtkAlgorithm:Sw,VtkCalculator:Ew,VtkCellData:w1,VtkDataArray:E1,VtkFieldData:Ow,VtkGeometryRepresentation:Gw,VtkGlyphRepresentation:jw,VtkMesh:$w,VtkPointData:B1,VtkPolydata:A1,VtkReader:Hw,VtkRemoteLocalView:OO,VtkRemoteView:Q1,VtkSyncView:Hc,VtkLocalView:Hc,VtkView:bO,VtkWebXRHelper:{props:{drawControllersRay:{type:Boolean,default:!1}},emits:["enterXR","exitXR"],setup(t,{attrs:e,emit:a}){navigator.xr===void 0&&RO.loadScript("https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js").then(()=>{new WebXRPolyfill});const n=VO.newInstance(),r=se.inject("view");return{startXR:()=>{if(!r||!r.openglRenderWindow){console.error("WebXR is not supported by VtkRemoteView");return}n.setRenderWindow(r.openglRenderWindow),n.setDrawControllersRay(t.drawControllersRay),e.oldInteractorStyle=r.renderWindow.getInteractor().getInteractorStyle(),r.renderWindow.getInteractor().setInteractorStyle(JO.newInstance()),n.startXR(),a("enterXR")},stopXR:()=>{if(!r||!r.openglRenderWindow){console.error("WebXR is not supported by VtkRemoteView");return}r.renderWindow.getInteractor().setInteractorStyle(e.oldInteractorStyle),n.stopXR(),a("exitXR")}}}}};function ZO(){return vc.rgbPresetNames}function Md(t){return t.split("_").map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" ")}function Nd(t){return t.map(e=>({text:Md(e),value:e}))}function QO(){return Nd(vc.rgbPresetNames)}const ga={vtkColorPresetNames:ZO,vtkLabel:Md,ListToItem:Nd,vtkColorPresetItems:QO};function eb(t){var e,a;Object.keys(bd).forEach(n=>{t.component(n,bd[n])}),(a=(e=window==null?void 0:window.trame)==null?void 0:e.utils)!=null&&a.vtk&&Object.keys(ga).forEach(n=>{window.trame.utils.vtk[n]=ga[n]})}const tb=ga.vtkColorPresetNames,nb=ga.vtkLabel,rb=ga.ListToItem,ab=ga.vtkColorPresetItems;Ht.ListToItem=rb,Ht.install=eb,Ht.vtkColorPresetItems=ab,Ht.vtkColorPresetNames=tb,Ht.vtkLabel=nb,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})}); + `};var mi=[];function _b(t){return new Promise((e,a)=>{if(mi.indexOf(t)===-1){mi.push(t);const n=document.createElement("script");n.type="text/javascript",n.src=t,n.onload=e,n.onerror=a,document.body.appendChild(n)}else e(!1)})}function Eb(t){return new Promise((e,a)=>{if(mi.indexOf(t)===-1){mi.push(t);const n=document.createElement("link");n.rel="stylesheet",n.href=t,n.onload=e,n.onerror=a,document.head.appendChild(n)}else e(!1)})}var Db={loadScript:_b,loadCSS:Eb,LOADED_URLS:mi},Ob={HmdVR:0,MobileAR:1,LookingGlassVR:2,HmdAR:3},Fd={XrSessionTypes:Ob},{XrSessionTypes:Un}=Fd,kd={rescaleFactor:.25,translateZ:-1.5};function bb(){const t=ES.newInstance(),e=dn.newInstance();e.setInputConnection(t.getOutputPort());const a=hn.newInstance();return a.getProperty().setColor(1,0,0),a.getProperty().setLineWidth(5),a.setMapper(e),a.setPickable(!1),{lineSource:t,mapper:e,actor:a,visible:!1}}function Mb(t,e){e.classHierarchy.push("vtkWebXRRenderWindowHelper"),t.initialize=a=>{e.initialized||(e.renderWindow=a,e.initialized=!0)},t.getXrSupported=()=>navigator.xr!==void 0,t.startXR=a=>{if(navigator.xr===void 0)throw new Error("WebXR is not available");e.xrSessionType=a!==void 0?a:Un.HmdVR;const n=[Un.HmdAR,Un.MobileAR].includes(e.xrSessionType),r=n?"immersive-ar":"immersive-vr";if(!navigator.xr.isSessionSupported(r))throw n?new Error("Device does not support AR session"):new Error("VR display is not available");if(e.xrSession===null)navigator.xr.requestSession(r).then(t.enterXR,()=>{throw new Error("Failed to create XR session!")});else throw new Error("XR Session already exists!")},t.enterXR=async a=>{if(e.xrSession=a,e.initCanvasSize=e.renderWindow.getSize(),e.xrSession!==null){const n=e.renderWindow.get3DContext();await n.makeXRCompatible();const{XRWebGLLayer:r}=window,i=new r(e.xrSession,n[MO]());if(e.renderWindow.setSize(i.framebufferWidth,i.framebufferHeight),e.xrSession.updateRenderState({baseLayer:i}),e.xrSession.requestReferenceSpace("local").then(o=>{e.xrReferenceSpace=o}),[Un.HmdAR,Un.MobileAR].includes(e.xrSessionType)){const o=e.renderWindow.getRenderable().getRenderers()[0];e.initBackground=o.getBackground(),o.setBackground([0,0,0,0])}t.resetXRScene(),e.renderWindow.getRenderable().getInteractor().switchToXRAnimation(),e.xrSceneFrame=e.xrSession.requestAnimationFrame(e.xrRender),t.modified()}else throw new Error("Failed to enter XR with a null xrSession.")},t.resetXRScene=(a=kd.rescaleFactor,n=kd.translateZ)=>{const r=e.renderWindow.getRenderable().getRenderers()[0];r.resetCamera();const i=r.getActiveCamera();let o=i.getPhysicalScale();const s=i.getPhysicalTranslation(),u=n*o;o/=a,s[2]+=u,i.setPhysicalScale(o),i.setPhysicalTranslation(s),i.setClippingRange(.1*o,100*o)},t.stopXR=async()=>{if(navigator.xr===void 0)return;if(e.xrSession!==null){e.xrSession.cancelAnimationFrame(e.xrSceneFrame),e.renderWindow.getRenderable().getInteractor().returnFromXRAnimation();const n=e.renderWindow.get3DContext();n.bindFramebuffer(n.FRAMEBUFFER,null);const r=e.renderWindow.getRenderable().getRenderers()[0];e.xrSession.inputSources.forEach(i=>{e.inputSourceToRay[i.handedness]&&(r.removeActor(e.inputSourceToRay[i.handedness].actor),e.inputSourceToRay[i.handedness].visible=!1)}),await e.xrSession.end().catch(i=>{if(!(i instanceof DOMException))throw i}),e.xrSession=null}e.initCanvasSize!==null&&e.renderWindow.setSize(...e.initCanvasSize);const a=e.renderWindow.getRenderable().getRenderers()[0];e.initBackground!=null&&(a.setBackground(e.initBackground),e.initBackground=null),a.getActiveCamera().setProjectionMatrix(null),a.resetCamera(),a.setViewport(0,0,1,1),e.renderWindow.traverseAllPasses(),t.modified()},e.xrRender=async(a,n)=>{const r=n.session,i=[Un.HmdVR,Un.HmdAR].includes(e.xrSessionType);if(i&&e.drawControllersRay&&e.xrReferenceSpace){const s=e.renderWindow.getRenderable().getRenderers()[0],u=s.getActiveCamera(),c=[];u.getPhysicalToWorldMatrix(c),r.inputSources.forEach(p=>{if(p.targetRaySpace==null||p.gripSpace==null||p.targetRayMode!=="tracked-pointer")return;e.inputSourceToRay[p.handedness]==null&&(e.inputSourceToRay[p.handedness]=bb());const l=e.inputSourceToRay[p.handedness],f=n.getPose(p.targetRaySpace,e.xrReferenceSpace);if(f==null)return;const h=ji(f.transform.position.x,f.transform.position.y,f.transform.position.z),v=u.physicalOrientationToWorldDirection([f.transform.orientation.x,f.transform.orientation.y,f.transform.orientation.z,f.transform.orientation.w]),m=_e([],h,c),x=s.getActiveCamera().getClippingRange()[1];l.visible||(s.addActor(l.actor),l.visible=!0),l.lineSource.setPoint1(m[0]-v[0]*x,m[1]-v[1]*x,m[2]-v[2]*x),l.lineSource.setPoint2(...m)}),e.renderWindow.render()}e.renderWindow.getRenderable().getInteractor().updateXRGamepads(r,n,e.xrReferenceSpace),e.xrSceneFrame=e.xrSession.requestAnimationFrame(e.xrRender);const o=n.getViewerPose(e.xrReferenceSpace);if(o){const s=e.renderWindow.get3DContext();e.xrSessionType===Un.MobileAR&&e.initCanvasSize!==null&&(s.canvas.width=e.initCanvasSize[0],s.canvas.height=e.initCanvasSize[1]);const u=r.renderState.baseLayer;s.bindFramebuffer(s.FRAMEBUFFER,u.framebuffer),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT),e.renderWindow.setSize(u.framebufferWidth,u.framebufferHeight);const c=e.renderWindow.getRenderable().getRenderers()[0];o.views.forEach((p,l)=>{const f=u.getViewport(p);if(i)if(p.eye==="left")c.setViewport(0,0,.5,1);else if(p.eye==="right")c.setViewport(.5,0,1,1);else return;else if(e.xrSessionType===Un.LookingGlassVR){const h=f.x/u.framebufferWidth,v=f.y/u.framebufferHeight,m=(f.x+f.width)/u.framebufferWidth,x=(f.y+f.height)/u.framebufferHeight;c.setViewport(h,v,m,x)}else c.setViewport(0,0,1,1);c.getActiveCamera().computeViewParametersFromPhysicalMatrix(p.transform.inverse.matrix),c.getActiveCamera().setProjectionMatrix(p.projectionMatrix),e.renderWindow.traverseAllPasses()}),s.scissor(0,0,u.framebufferWidth,u.framebufferHeight),s.disable(s.SCISSOR_TEST)}},t.delete=A.chain(t.delete)}function Nb(){return{initialized:!1,drawControllersRay:!1,inputSourceToRay:{},initCanvasSize:null,initBackground:null,renderWindow:null,xrSession:null,xrSessionType:0,xrReferenceSpace:null}}function Ad(t,e,a={}){Object.assign(e,Nb(),a),A.obj(t,e),A.event(t,e,"event"),A.get(t,e,["xrSession"]),A.setGet(t,e,["renderWindow","drawControllersRay"]),Mb(t,e)}var Rb=A.newInstance(Ad,"vtkWebXRRenderWindowHelper"),Lb={newInstance:Rb,extend:Ad,...Fd};function Fb(t,e){e.classHierarchy.push("vtkCompositeVRManipulator"),t.onButton3D=(a,n,r,i)=>{},t.onMove3D=(a,n,r,i)=>{}}var kb={};function Ab(t,e,a={}){Object.assign(e,kb,a),A.setGet(t,e,["device","input"]),Fb(t,e)}var Vb={extend:Ab,Device:Yo,Input:Jo};function Bb(t,e){e.classHierarchy.push("vtkAbstractPicker"),t.initialize=()=>{e.renderer=null,e.selectionPoint[0]=0,e.selectionPoint[1]=0,e.selectionPoint[2]=0,e.pickPosition[0]=0,e.pickPosition[1]=0,e.pickPosition[2]=0},t.initializePickList=()=>{e.pickList=[]},t.addPickList=a=>{e.pickList.push(a)},t.deletePickList=a=>{const n=e.pickList.indexOf(a);n!==-1&&e.pickList.splice(n,1)}}var Ub={renderer:null,selectionPoint:[0,0,0],pickPosition:[0,0,0],pickFromList:!1,pickList:[]};function Vd(t,e,a={}){Object.assign(e,Ub,a),A.obj(t,e),A.get(t,e,["renderer"]),A.getArray(t,e,["selectionPoint","pickPosition"]),A.setGet(t,e,["pickFromList","pickList"]),Bb(t,e)}var Gb=A.newInstance(Vd,"vtkAbstractPicker"),Ib={newInstance:Gb,extend:Vd},{vtkErrorMacro:Pb}=A,{vtkWarningMacro:ys}=A;function zb(t,e){e.classHierarchy.push("vtkPicker");const a={...t};function n(){a.initialize(),e.actors=[],e.pickedPositions=[],e.mapperPosition[0]=0,e.mapperPosition[1]=0,e.mapperPosition[2]=0,e.mapper=null,e.dataSet=null,e.globalTMin=Number.MAX_VALUE}function r(o,s,u){let c=0;const p=u.getRenderWindow().getViews()[0],l=u.getViewport(),f=p.getSize();let h=f[0]*l[0],v=f[1]*l[1];const m=p.displayToNormalizedDisplay(h,v,o),x=u.normalizedDisplayToWorld(m[0],m[1],m[2],s);h=f[0]*l[2],v=f[1]*l[3];const y=p.displayToNormalizedDisplay(h,v,o),d=u.normalizedDisplayToWorld(y[0],y[1],y[2],s);for(let g=0;g<3;g++)c+=(d[g]-x[g])*(d[g]-x[g]);return Math.sqrt(c)}function i(o,s,u,c){const p=new Float64Array(4),l=new Float64Array(4),f=[],h=[],v=e.pickFromList?e.pickList:o.getActors(),m=new Float64Array(3),x=new Float64Array(3);v.forEach(d=>{var T,w,_;const g=d.getMapper(),C=((_=(T=d.getProperty)==null?void 0:(w=T.call(d)).getOpacity)==null?void 0:_.call(w))===0;if(!(d.getNestedPickable()&&d.getNestedVisibility()&&!C))return;e.transformMatrix=d.getMatrix().slice(0),We(e.transformMatrix,e.transformMatrix),Et(e.transformMatrix,e.transformMatrix),On(p,u,e.transformMatrix),On(l,c,e.transformMatrix),Yt(p,p,1/p[3]),Yt(l,l,1/l[3]),$e(l,p,f);const S=g?de.inflate(g.getBounds(),s):[...de.INIT_BOUNDS];if(de.intersectBox(S,p,f,h,[])){Pi(m,e.transformMatrix);const E=e.intersectWithLine(p,l,s*.333*(m[0]+m[1]+m[2]),d,g);if(E{const C=d.distance2,S=g.distance2;return CS?1:0}),e.pickedPositions=[],e.actors=[],y.forEach(d=>{e.pickedPositions.push(d.pickedPosition),e.actors.push(d.actor)})}e.intersectWithLine=(o,s,u,c,p)=>{if(!p)return Number.MAX_VALUE;const l=p.getCenter(),f=ln(new Float64Array(3),s,o),h=xe(f,f);return h===0?2:(f[0]*(l[0]-o[0])+f[1]*(l[1]-o[1])+f[2]*(l[2]-o[2]))/h},t.pick=(o,s)=>{if(o.length!==3&&ys("vtkPicker.pick - selection needs three components"),!s)throw Pb("vtkPicker.pick - renderer cannot be null"),new Error("renderer cannot be null");n();const u=o[0],c=o[1];let p=o[2];e.renderer=s,e.selectionPoint[0]=u,e.selectionPoint[1]=c,e.selectionPoint[2]=p;const l=new Float64Array(4),f=new Float64Array(4),h=s.getActiveCamera(),v=h.getPosition(),m=h.getFocalPoint(),x=s.getRenderWindow().getViews()[0],y=x.getViewportSize(s);if(y[1]===0){ys("vtkPicker.pick - viewport area is 0");return}const d=y[0]/y[1];let g=[];g=s.worldToNormalizedDisplay(m[0],m[1],m[2],d),g=x.normalizedDisplayToDisplay(g[0],g[1],g[2]),p=g[2];const C=x.displayToNormalizedDisplay(u,c,p),S=s.normalizedDisplayToWorld(C[0],C[1],C[2],d);for(let R=0;R<3;R++)e.pickPosition[R]=S[R];const T=[];for(let R=0;R<3;R++)T[R]=e.pickPosition[R]-v[R];const w=[];for(let R=0;R<3;R++)w[R]=m[R]-v[R];He(w);const _=xe(w,T);if(_===0){ys("Picker::Pick Cannot process points");return}const E=h.getClippingRange();let D,O;if(h.getParallelProjection()){D=E[0]-_,O=E[1]-_;for(let R=0;R<3;R++)l[R]=e.pickPosition[R]+D*w[R],f[R]=e.pickPosition[R]+O*w[R]}else{D=E[0]/_,O=E[1]/_;for(let R=0;R<3;R++)l[R]=v[R]+D*T[R],f[R]=v[R]+O*T[R]}l[3]=1,f[3]=1;const b=r(p,d,s)*e.tolerance;i(e.renderer,b,l,f)},t.pick3DPoint=(o,s,u)=>{if(!u)throw new Error("renderer cannot be null");n(),e.renderer=u,$i(e.selectionPoint,o);const c=u.getRenderWindow().getViews()[0].getViewportSize(u);if(c[1]===0){ys("vtkPicker.pick3DPoint - viewport area is 0");return}const p=c[0]/c[1];i(u,r(e.selectionPoint[2],p,u)*e.tolerance,o,s)}}var Wb={tolerance:.025,mapperPosition:[0,0,0],mapper:null,dataSet:null,actors:[],pickedPositions:[],transformMatrix:null,globalTMin:Number.MAX_VALUE};function Bd(t,e,a={}){Object.assign(e,Wb,a),Ib.extend(t,e,a),A.setGet(t,e,["tolerance"]),A.setGetArray(t,e,["mapperPosition"],3),A.get(t,e,["mapper","dataSet","actors","pickedPositions"]),A.event(t,e,"pickChange"),zb(t,e)}var jb=A.newInstance(Bd,"vtkPicker"),$b={newInstance:jb,extend:Bd};function Hb(t,e){e.classHierarchy.push("vtk3DControllerModelSelectorManipulator");const a=$b.newInstance();let n;const r=new Float64Array(16),i=new Float64Array(3),o=new Float64Array(4),s=new Float64Array(4),u=new Float64Array(3),c=new Float64Array(16),p=new Float64Array(4),l=new Float64Array(16),f=new Float64Array(4),h=new Float64Array(4),v=new Float64Array(3),m=new Float64Array(3),x=new Float64Array(4);function y(S,T,w){ln(i,T,e.lastWorldPosition),c0(s,e.lastOrientation),Yi(o,w,s),Zi(o,o);const _=Pl(u,o);we(c),Ye(c,c,T),Tt(c,c,_,u),Ye(c,c,Ul(new Float64Array(3),T)),Ye(c,c,i),We(l,S.getMatrix()),Ee(c,c,l),zi(p,c),S.getOrientationQuaternion(f),c0(h,f),Yi(x,h,p),Zi(x,x),Ml(v,c),Pi(m,c),S.setPosition(...v),S.setScale(...m),S.rotateQuaternion(x)}function d(){e.lastOrientation=null,e.lastWorldPosition=null,n&&n.setDragable(!0),n=null}t.onButton3D=(S,T,w,_)=>{if(!_.pressed)return d(),A.VOID;const E=T.getActiveCamera();E.getPhysicalToWorldMatrix(r);const{targetPosition:D,targetOrientation:O}=_,b=_e([],[D.x,D.y,D.z],r),R=E.physicalOrientationToWorldDirection([O.x,O.y,O.z,O.w]),N=T.getActiveCamera().getClippingRange()[1],L=[...b,1],B=[L[0]-R[0]*N,L[1]-R[1]*N,L[2]-R[2]*N,1];a.pick3DPoint(L,B,T);const P=a.getActors();return P.length>0&&P[0].getNestedDragable()?(n=P[0],n.setDragable(!1)):d(),A.EVENT_ABORT};const g=new Float64Array(3),C=new Float64Array(4);t.onMove3D=(S,T,w,_)=>{if(w!==tg.IS_CAMERA_POSE||n==null)return A.VOID;T.getActiveCamera().getPhysicalToWorldMatrix(r);const{targetPosition:E}=_;return _e(g,[E.x,E.y,E.z],r),U9(C,_.targetOrientation.x,_.targetOrientation.y,_.targetOrientation.z,_.targetOrientation.w),e.lastWorldPosition&&e.lastOrientation?y(n,g,C):(e.lastWorldPosition=new Float64Array(3),e.lastOrientation=new Float64Array(4)),$i(e.lastWorldPosition,g),B9(e.lastOrientation,C),A.EVENT_ABORT}}var Kb={};function Ud(t,e,a={}){Object.assign(e,Kb,a),A.get(t,e,["lastWorldPosition","lastOrientation"]),A.obj(t,e),Vb.extend(t,e,a),Hb(t,e)}var Xb=A.newInstance(Ud,"vtk3DControllerModelSelectorManipulator"),Gd={newInstance:Xb,extend:Ud};function qb(t,e){e.classHierarchy.push("vtkInteractorStyleHMDXR");const a=Gd.newInstance({device:Yo.LeftController,input:Jo.A}),n=Gd.newInstance({device:Yo.RightController,input:Jo.A});t.addVRManipulator(a),t.addVRManipulator(n)}var Yb={};function Id(t,e,a={}){Object.assign(e,Yb,a),Br.extend(t,e,a),qb(t,e)}var Jb=A.newInstance(Id,"vtkInteractorStyleHMDXR"),Zb={newInstance:Jb,extend:Id};const Pd={VtkAlgorithm:Sw,VtkCalculator:Dw,VtkCellData:Bh,VtkDataArray:Gh,VtkFieldData:bw,VtkGeometryRepresentation:Ww,VtkGlyphRepresentation:Yw,VtkMesh:Zw,VtkPointData:Jh,VtkPolydata:Yh,VtkReader:Qw,VtkRemoteLocalView:Tb,VtkRemoteView:hg,VtkSyncView:eu,VtkLocalView:eu,VtkView:wb,VtkWebXRHelper:{props:{drawControllersRay:{type:Boolean,default:!1}},emits:["enterXR","exitXR"],setup(t,{attrs:e,emit:a}){navigator.xr===void 0&&Db.loadScript("https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js").then(()=>{new WebXRPolyfill});const n=Lb.newInstance(),r=se.inject("view");return{startXR:()=>{if(!r||!r.openglRenderWindow){console.error("WebXR is not supported by VtkRemoteView");return}n.setRenderWindow(r.openglRenderWindow),n.setDrawControllersRay(t.drawControllersRay),e.oldInteractorStyle=r.renderWindow.getInteractor().getInteractorStyle(),r.renderWindow.getInteractor().setInteractorStyle(Zb.newInstance()),n.startXR(),a("enterXR")},stopXR:()=>{if(!r||!r.openglRenderWindow){console.error("WebXR is not supported by VtkRemoteView");return}r.renderWindow.getInteractor().setInteractorStyle(e.oldInteractorStyle),n.stopXR(),a("exitXR")}}}}};function Qb(){return Ec.rgbPresetNames}function zd(t){return t.split("_").map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" ")}function Wd(t){return t.map(e=>({text:zd(e),value:e}))}function eM(){return Wd(Ec.rgbPresetNames)}const da={vtkColorPresetNames:Qb,vtkLabel:zd,ListToItem:Wd,vtkColorPresetItems:eM};function tM(t){var e,a;Object.keys(Pd).forEach(n=>{t.component(n,Pd[n])}),(a=(e=window==null?void 0:window.trame)==null?void 0:e.utils)!=null&&a.vtk&&Object.keys(da).forEach(n=>{window.trame.utils.vtk[n]=da[n]})}const nM=da.vtkColorPresetNames,rM=da.vtkLabel,aM=da.ListToItem,iM=da.vtkColorPresetItems;Kt.ListToItem=aM,Kt.install=tM,Kt.vtkColorPresetItems=iM,Kt.vtkColorPresetNames=nM,Kt.vtkLabel=rM,Object.defineProperty(Kt,Symbol.toStringTag,{value:"Module"})});