ocearo-ui
Version:
Ocean Robot UI: 3D visualization dashboard for signalk
81 lines (72 loc) • 109 kB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71753,e=>{"use strict";var t=e.i(40859);e.s(["useFrame",()=>t.D])},43257,58013,e=>{"use strict";let t;var r=e.i(31067),a=e.i(71645),n=e.i(15080),i=e.i(71753),o=e.i(40859),o=o,s=o,l=o;e.s(["extend",()=>l.e],58013);var l=o,h=e.i(90072),u=h,c=e.i(31497);class p extends u.Mesh{constructor(e,t){var r,a;const n=(e=>e&&e.isCubeTexture)(e),i=Math.floor(Math.log2((null!=(a=n?null==(r=e.image[0])?void 0:r.width:e.image.width)?a:1024)/4)),o=Math.pow(2,i),s=3*Math.max(o,112),l=`
varying vec3 vWorldPosition;
void main()
{
vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );
vWorldPosition = worldPosition.xyz;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
`,h=[n?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/s}`,`#define CUBEUV_TEXEL_HEIGHT ${1/(4*o)}`,`#define CUBEUV_MAX_MIP ${i}.0`].join("\n")+`
#define ENVMAP_TYPE_CUBE_UV
varying vec3 vWorldPosition;
uniform float radius;
uniform float height;
uniform float angle;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube map;
#else
uniform sampler2D map;
#endif
// From: https://www.shadertoy.com/view/4tsBD7
float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r )
{
float d = dot ( rd, n );
if( d > 0.0 ) { return 1e6; }
vec3 o = ro - c;
float t = - dot( n, o ) / d;
vec3 q = o + rd * t;
return ( dot( q, q ) < r * r ) ? t : 1e6;
}
// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm
float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra )
{
vec3 oc = ro - ce;
float b = dot( oc, rd );
float c = dot( oc, oc ) - ra * ra;
float h = b * b - c;
if( h < 0.0 ) { return -1.0; }
h = sqrt( h );
return - b + h;
}
vec3 project()
{
vec3 p = normalize( vWorldPosition );
vec3 camPos = cameraPosition;
camPos.y -= height;
float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );
if( intersection > 0.0 ) {
vec3 h = vec3( 0.0, - height, 0.0 );
float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );
p = ( camPos + min( intersection, intersection2 ) * p ) / radius;
} else {
p = vec3( 0.0, 1.0, 0.0 );
}
return p;
}
#include <common>
#include <cube_uv_reflection_fragment>
void main()
{
vec3 projectedWorldPosition = project();
#ifdef ENVMAP_TYPE_CUBE
vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;
#else
vec3 direction = normalize( projectedWorldPosition );
vec2 uv = equirectUv( direction );
vec3 outcolor = texture2D( map, uv ).rgb;
#endif
gl_FragColor = vec4( outcolor, 1.0 );
#include <tonemapping_fragment>
#include <${c.version>=154?"colorspace_fragment":"encodings_fragment"}>
}
`,p={map:{value:e},height:{value:(null==t?void 0:t.height)||15},radius:{value:(null==t?void 0:t.radius)||100}};super(new u.IcosahedronGeometry(1,16),new u.ShaderMaterial({uniforms:p,fragmentShader:h,vertexShader:l,side:u.DoubleSide}))}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}var d=e.i(99143),f=h;class m extends f.DataTextureLoader{constructor(e){super(e),this.type=f.HalfFloatType}parse(e){let t,r,a,n=function(e,t){switch(e){case 1:throw Error("THREE.RGBELoader: Read Error: "+(t||""));case 2:throw Error("THREE.RGBELoader: Write Error: "+(t||""));case 3:throw Error("THREE.RGBELoader: Bad File Format: "+(t||""));default:throw Error("THREE.RGBELoader: Memory Error: "+(t||""))}},i=function(e,t,r){t=t||1024;let a=e.pos,n=-1,i=0,o="",s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(a,a+128)));for(;0>(n=s.indexOf("\n"))&&i<t&&a<e.byteLength;)o+=s,i+=s.length,a+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(a,a+128)));return -1<n&&(!1!==r&&(e.pos+=i+n+1),o+s.slice(0,n))},o=new Uint8Array(e);o.pos=0;let s=function(e){let t,r,a=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,l=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,h={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};for(!(e.pos>=e.byteLength)&&(t=i(e))||n(1,"no header found"),(r=t.match(/^#\?(\S+)/))||n(3,"bad initial token"),h.valid|=1,h.programtype=r[1],h.string+=t+"\n";!1!==(t=i(e));){if(h.string+=t+"\n","#"===t.charAt(0)){h.comments+=t+"\n";continue}if((r=t.match(a))&&(h.gamma=parseFloat(r[1])),(r=t.match(o))&&(h.exposure=parseFloat(r[1])),(r=t.match(s))&&(h.valid|=2,h.format=r[1]),(r=t.match(l))&&(h.valid|=4,h.height=parseInt(r[1],10),h.width=parseInt(r[2],10)),2&h.valid&&4&h.valid)break}return 2&h.valid||n(3,"missing format specifier"),4&h.valid||n(3,"missing image size specifier"),h}(o),l=s.width,h=s.height,u=function(e,t,r){if(t<8||t>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);t!==(e[2]<<8|e[3])&&n(3,"wrong scanline width");let a=new Uint8Array(4*t*r);a.length||n(4,"unable to allocate buffer space");let i=0,o=0,s=4*t,l=new Uint8Array(4),h=new Uint8Array(s),u=r;for(;u>0&&o<e.byteLength;){o+4>e.byteLength&&n(1),l[0]=e[o++],l[1]=e[o++],l[2]=e[o++],l[3]=e[o++],(2!=l[0]||2!=l[1]||(l[2]<<8|l[3])!=t)&&n(3,"bad rgbe scanline format");let r=0,c;for(;r<s&&o<e.byteLength;){let t=(c=e[o++])>128;if(t&&(c-=128),(0===c||r+c>s)&&n(3,"bad scanline data"),t){let t=e[o++];for(let e=0;e<c;e++)h[r++]=t}else h.set(e.subarray(o,o+c),r),r+=c,o+=c}for(let e=0;e<t;e++){let r=0;a[i]=h[e+r],r+=t,a[i+1]=h[e+r],r+=t,a[i+2]=h[e+r],r+=t,a[i+3]=h[e+r],i+=4}u--}return a}(o.subarray(o.pos),l,h);switch(this.type){case f.FloatType:let c=new Float32Array(4*(a=u.length/4));for(let e=0;e<a;e++)!function(e,t,r,a){let n=Math.pow(2,e[t+3]-128)/255;r[a+0]=e[t+0]*n,r[a+1]=e[t+1]*n,r[a+2]=e[t+2]*n,r[a+3]=1}(u,4*e,c,4*e);t=c,r=f.FloatType;break;case f.HalfFloatType:let p=new Uint16Array(4*(a=u.length/4));for(let e=0;e<a;e++)!function(e,t,r,a){let n=Math.pow(2,e[t+3]-128)/255;r[a+0]=f.DataUtils.toHalfFloat(Math.min(e[t+0]*n,65504)),r[a+1]=f.DataUtils.toHalfFloat(Math.min(e[t+1]*n,65504)),r[a+2]=f.DataUtils.toHalfFloat(Math.min(e[t+2]*n,65504)),r[a+3]=f.DataUtils.toHalfFloat(1)}(u,4*e,p,4*e);t=p,r=f.HalfFloatType;break;default:throw Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:l,height:h,data:t,header:s.string,gamma:s.gamma,exposure:s.exposure,type:r}}setDataType(e){return this.type=e,this}load(e,t,r,a){return super.load(e,function(e,r){switch(e.type){case f.FloatType:case f.HalfFloatType:"colorSpace"in e?e.colorSpace="srgb-linear":e.encoding=3e3,e.minFilter=f.LinearFilter,e.magFilter=f.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,r)},r,a)}}var g=h,v={},y=function(e,t,r,a,n){var i=new Worker(v[t]||(v[t]=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))));return i.onerror=function(e){return n(e.error,null)},i.onmessage=function(e){return n(null,e.data)},i.postMessage(r,a),i},w=Uint8Array,b=Uint16Array,M=Uint32Array,x=new w([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]),_=new w([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]),E=new w([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),T=function(e,t){for(var r=new b(31),a=0;a<31;++a)r[a]=t+=1<<e[a-1];for(var n=new M(r[30]),a=1;a<30;++a)for(var i=r[a];i<r[a+1];++i)n[i]=i-r[a]<<5|a;return[r,n]},S=T(x,2),P=S[0],A=S[1];P[28]=258,A[258]=28;for(var I=T(_,0),C=I[0],R=I[1],O=new b(32768),j=0;j<32768;++j){var F=(43690&j)>>>1|(21845&j)<<1;F=(61680&(F=(52428&F)>>>2|(13107&F)<<2))>>>4|(3855&F)<<4,O[j]=((65280&F)>>>8|(255&F)<<8)>>>1}for(var k=function(e,t,r){for(var a,n=e.length,i=0,o=new b(t);i<n;++i)++o[e[i]-1];var s=new b(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(r){a=new b(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var h=i<<4|e[i],u=t-e[i],c=s[e[i]-1]++<<u,p=c|(1<<u)-1;c<=p;++c)a[O[c]>>>l]=h}else for(i=0,a=new b(n);i<n;++i)e[i]&&(a[i]=O[s[e[i]-1]++]>>>15-e[i]);return a},L=new w(288),j=0;j<144;++j)L[j]=8;for(var j=144;j<256;++j)L[j]=9;for(var j=256;j<280;++j)L[j]=7;for(var j=280;j<288;++j)L[j]=8;for(var U=new w(32),j=0;j<32;++j)U[j]=5;var D=k(L,9,0),z=k(L,9,1),B=k(U,5,0),N=k(U,5,1),H=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},W=function(e,t,r){var a=t/8|0;return(e[a]|e[a+1]<<8)>>(7&t)&r},V=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},G=function(e){return(e/8|0)+(7&e&&1)},Y=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var a=new(e instanceof b?b:e instanceof M?M:w)(r-t);return a.set(e.subarray(t,r)),a},X=function(e,t,r){var a=e.length;if(!a||r&&!r.l&&a<5)return t||new w(0);var n=!t||r,i=!r||r.i;r||(r={}),t||(t=new w(3*a));var o=function(e){var r=t.length;if(e>r){var a=new w(Math.max(2*r,e));a.set(t),t=a}},s=r.f||0,l=r.p||0,h=r.b||0,u=r.l,c=r.d,p=r.m,d=r.n,f=8*a;do{if(!u){r.f=s=W(e,l,1);var m=W(e,l+1,3);if(l+=3,m)if(1==m)u=z,c=N,p=9,d=5;else if(2==m){var g=W(e,l,31)+257,v=W(e,l+10,15)+4,y=g+W(e,l+5,31)+1;l+=14;for(var b=new w(y),M=new w(19),T=0;T<v;++T)M[E[T]]=W(e,l+3*T,7);l+=3*v;for(var S=H(M),A=(1<<S)-1,I=k(M,S,1),T=0;T<y;){var R=I[W(e,l,A)];l+=15&R;var O=R>>>4;if(O<16)b[T++]=O;else{var j=0,F=0;for(16==O?(F=3+W(e,l,3),l+=2,j=b[T-1]):17==O?(F=3+W(e,l,7),l+=3):18==O&&(F=11+W(e,l,127),l+=7);F--;)b[T++]=j}}var L=b.subarray(0,g),U=b.subarray(g);p=H(L),d=H(U),u=k(L,p,1),c=k(U,d,1)}else throw"invalid block type";else{var O=G(l)+4,D=e[O-4]|e[O-3]<<8,B=O+D;if(B>a){if(i)throw"unexpected EOF";break}n&&o(h+D),t.set(e.subarray(O,B),h),r.b=h+=D,r.p=l=8*B;continue}if(l>f){if(i)throw"unexpected EOF";break}}n&&o(h+131072);for(var X=(1<<p)-1,$=(1<<d)-1,Z=l;;Z=l){var j=u[V(e,l)&X],K=j>>>4;if((l+=15&j)>f){if(i)throw"unexpected EOF";break}if(!j)throw"invalid length/literal";if(K<256)t[h++]=K;else if(256==K){Z=l,u=null;break}else{var q=K-254;if(K>264){var T=K-257,Q=x[T];q=W(e,l,(1<<Q)-1)+P[T],l+=Q}var J=c[V(e,l)&$],ee=J>>>4;if(!J)throw"invalid distance";l+=15&J;var U=C[ee];if(ee>3){var Q=_[ee];U+=V(e,l)&(1<<Q)-1,l+=Q}if(l>f){if(i)throw"unexpected EOF";break}n&&o(h+131072);for(var et=h+q;h<et;h+=4)t[h]=t[h-U],t[h+1]=t[h+1-U],t[h+2]=t[h+2-U],t[h+3]=t[h+3-U];h=et}}r.l=u,r.p=Z,r.b=h,u&&(s=1,r.m=p,r.d=c,r.n=d)}while(!s)return h==t.length?t:Y(t,0,h)},$=function(e,t,r){r<<=7&t;var a=t/8|0;e[a]|=r,e[a+1]|=r>>>8},Z=function(e,t,r){r<<=7&t;var a=t/8|0;e[a]|=r,e[a+1]|=r>>>8,e[a+2]|=r>>>16},K=function(e,t){for(var r=[],a=0;a<e.length;++a)e[a]&&r.push({s:a,f:e[a]});var n=r.length,i=r.slice();if(!n)return[ea,0];if(1==n){var o=new w(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var s=r[0],l=r[1],h=0,u=1,c=2;for(r[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=n-1;)s=r[r[h].f<r[c].f?h++:c++],l=r[h!=u&&r[h].f<r[c].f?h++:c++],r[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=i[0].s,a=1;a<n;++a)i[a].s>p&&(p=i[a].s);var d=new b(p+1),f=q(r[u-1],d,0);if(f>t){var a=0,m=0,g=f-t,v=1<<g;for(i.sort(function(e,t){return d[t.s]-d[e.s]||e.f-t.f});a<n;++a){var y=i[a].s;if(d[y]>t)m+=v-(1<<f-d[y]),d[y]=t;else break}for(m>>>=g;m>0;){var M=i[a].s;d[M]<t?m-=1<<t-d[M]++-1:++a}for(;a>=0&&m;--a){var x=i[a].s;d[x]==t&&(--d[x],++m)}f=t}return[new w(d),f]},q=function(e,t,r){return -1==e.s?Math.max(q(e.l,t,r+1),q(e.r,t,r+1)):t[e.s]=r},Q=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new b(++t),a=0,n=e[0],i=1,o=function(e){r[a++]=e},s=1;s<=t;++s)if(e[s]==n&&s!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=e[s]}return[r.subarray(0,a),t]},J=function(e,t){for(var r=0,a=0;a<t.length;++a)r+=e[a]*t[a];return r},ee=function(e,t,r){var a=r.length,n=G(t+2);e[n]=255&a,e[n+1]=a>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var i=0;i<a;++i)e[n+i+4]=r[i];return(n+4+a)*8},et=function(e,t,r,a,n,i,o,s,l,h,u){$(t,u++,r),++n[256];for(var c,p,d,f,m=K(n,15),g=m[0],v=m[1],y=K(i,15),w=y[0],M=y[1],T=Q(g),S=T[0],P=T[1],A=Q(w),I=A[0],C=A[1],R=new b(19),O=0;O<S.length;++O)R[31&S[O]]++;for(var O=0;O<I.length;++O)R[31&I[O]]++;for(var j=K(R,7),F=j[0],z=j[1],N=19;N>4&&!F[E[N-1]];--N);var H=h+5<<3,W=J(n,L)+J(i,U)+o,V=J(n,g)+J(i,w)+o+14+3*N+J(R,F)+(2*R[16]+3*R[17]+7*R[18]);if(H<=W&&H<=V)return ee(t,u,e.subarray(l,l+h));if($(t,u,1+(V<W)),u+=2,V<W){c=k(g,v,0),p=g,d=k(w,M,0),f=w;var G=k(F,z,0);$(t,u,P-257),$(t,u+5,C-1),$(t,u+10,N-4),u+=14;for(var O=0;O<N;++O)$(t,u+3*O,F[E[O]]);u+=3*N;for(var Y=[S,I],X=0;X<2;++X)for(var q=Y[X],O=0;O<q.length;++O){var et=31&q[O];$(t,u,G[et]),u+=F[et],et>15&&($(t,u,q[O]>>>5&127),u+=q[O]>>>12)}}else c=D,p=L,d=B,f=U;for(var O=0;O<s;++O)if(a[O]>255){var et=a[O]>>>18&31;Z(t,u,c[et+257]),u+=p[et+257],et>7&&($(t,u,a[O]>>>23&31),u+=x[et]);var er=31&a[O];Z(t,u,d[er]),u+=f[er],er>3&&(Z(t,u,a[O]>>>5&8191),u+=_[er])}else Z(t,u,c[a[O]]),u+=p[a[O]];return Z(t,u,c[256]),u+p[256]},er=new M([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ea=new w(0),en=function(e,t,r,a,n,i){var o=e.length,s=new w(a+o+5*(1+Math.ceil(o/7e3))+n),l=s.subarray(a,s.length-n),h=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var c=u+65535;c<o?h=ee(l,h,e.subarray(u,c)):(l[u]=i,h=ee(l,h,e.subarray(u,o)))}else{for(var p=er[t-1],d=p>>>13,f=8191&p,m=(1<<r)-1,g=new b(32768),v=new b(m+1),y=Math.ceil(r/3),E=2*y,T=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<E)&m},S=new M(25e3),P=new b(288),I=new b(32),C=0,O=0,u=0,j=0,F=0,k=0;u<o;++u){var L=T(u),U=32767&u,D=v[L];if(g[U]=D,v[L]=U,F<=u){var z=o-u;if((C>7e3||j>24576)&&z>423){h=et(e,l,0,S,P,I,O,j,k,u-k,h),j=C=O=0,k=u;for(var B=0;B<286;++B)P[B]=0;for(var B=0;B<30;++B)I[B]=0}var N=2,H=0,W=f,V=U-D&32767;if(z>2&&L==T(u-V))for(var X=Math.min(d,z)-1,$=Math.min(32767,u),Z=Math.min(258,z);V<=$&&--W&&U!=D;){if(e[u+N]==e[u+N-V]){for(var K=0;K<Z&&e[u+K]==e[u+K-V];++K);if(K>N){if(N=K,H=V,K>X)break;for(var q=Math.min(V,K-2),Q=0,B=0;B<q;++B){var J=u-V+B+32768&32767,en=g[J],ei=J-en+32768&32767;ei>Q&&(Q=ei,D=J)}}}D=g[U=D],V+=U-D+32768&32767}if(H){S[j++]=0x10000000|A[N]<<18|R[H];var eo=31&A[N],es=31&R[H];O+=x[eo]+_[es],++P[257+eo],++I[es],F=u+N,++C}else S[j++]=e[u],++P[e[u]]}}h=et(e,l,i,S,P,I,O,j,k,u-k,h),!i&&7&h&&(h=ee(l,h+1,ea))}return Y(s,0,a+G(h)+n)},ei=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,a=9;--a;)r=(1&r&&-0x12477ce0)^r>>>1;e[t]=r}return e}(),eo=function(){var e=-1;return{p:function(t){for(var r=e,a=0;a<t.length;++a)r=ei[255&r^t[a]]^r>>>8;e=r},d:function(){return~e}}},es=function(){var e=1,t=0;return{p:function(r){for(var a=e,n=t,i=r.length,o=0;o!=i;){for(var s=Math.min(o+2655,i);o<s;++o)n+=a+=r[o];a=(65535&a)+15*(a>>16),n=(65535&n)+15*(n>>16)}e=a,t=n},d:function(){return e%=65521,t%=65521,(255&e)<<24|e>>>8<<16|(255&t)<<8|t>>>8}}},el=function(e,t,r,a,n){return en(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,a,!n)},eh=function(e,t){var r={};for(var a in e)r[a]=e[a];for(var a in t)r[a]=t[a];return r},eu=function(e,t,r){for(var a=e(),n=e.toString(),i=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/ /g,"").split(","),o=0;o<a.length;++o){var s=a[o],l=i[o];if("function"==typeof s){t+=";"+l+"=";var h=s.toString();if(s.prototype)if(-1!=h.indexOf("[native code]")){var u=h.indexOf(" ",8)+1;t+=h.slice(u,h.indexOf("(",u))}else for(var c in t+=h,s.prototype)t+=";"+l+".prototype."+c+"="+s.prototype[c].toString();else t+=h}else r[l]=s}return[t,r]},ec=[],ep=function(e){var t=[];for(var r in e)(e[r]instanceof w||e[r]instanceof b||e[r]instanceof M)&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},ed=function(e,t,r,a){if(!ec[r]){for(var n,i="",o={},s=e.length-1,l=0;l<s;++l)i=(n=eu(e[l],i,o))[0],o=n[1];ec[r]=eu(e[s],i,o)}var h=eh({},ec[r][1]);return y(ec[r][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,h,ep(h),a)},ef=function(){return[w,b,M,x,_,E,P,C,z,N,O,k,H,W,V,G,Y,X,eD,ey,ew]},em=function(){return[w,b,M,x,_,E,A,R,D,L,B,U,O,er,ea,k,$,Z,K,q,Q,J,ee,et,G,Y,en,el,ek,ey]},eg=function(){return[eP,eA]},ev=function(){return[eR]},ey=function(e){return postMessage(e,[e.buffer])},ew=function(e){return e&&e.size&&new w(e.size)},eb=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},eM=function(e,t,r,a,n){var i,o=ed(e,a,n,function(e,r){e?(o.terminate(),t.ondata.call(t,e)):(r[1]&&o.terminate(),t.ondata.call(t,e,r[0],r[1]))});o.postMessage(r),t.push=function(e,r){if(i)throw"stream finished";if(!t.ondata)throw"no stream handler";o.postMessage([e,i=r],[e.buffer])},t.terminate=function(){o.terminate()}},ex=function(e,t){return e[t]|e[t+1]<<8},e_=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},eE=function(e,t){return e_(e,t)+0x100000000*e_(e,t+4)},eT=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},eS=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&eT(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var a=0;a<=r.length;++a)e[a+10]=r.charCodeAt(a)}},eP=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],r=10;4&t&&(r+=e[10]|(e[11]<<8)+2);for(var a=(t>>3&1)+(t>>4&1);a>0;a-=!e[r++]);return r+(2&t)},eA=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},eI=function(e){return 10+(e.filename&&e.filename.length+1||0)},eC=function(e,t){var r=t.level,a=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},eR=function(e){if((15&e[0])!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function eO(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var ej=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(el(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}(),eF=function(e,t){eM([em,function(){return[eb,ej]}],this,eO.call(this,e,t),function(e){onmessage=eb(new ej(e.data))},6)};function ek(e,t){return el(e,t||{},0,0)}var eL=function(){function e(e){this.s={},this.p=new w(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,r=new w(t+e.length);r.set(this.p),r.set(e,t),this.p=r},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,r=X(this.p,this.o,this.s);this.ondata(Y(r,t,this.s.b),this.d),this.o=Y(r,this.s.b-32768),this.s.b=this.o.length,this.p=Y(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),eU=function(e){this.ondata=e,eM([ef,function(){return[eb,eL]}],this,0,function(){onmessage=eb(new eL)},7)};function eD(e,t){return X(e,t)}(function(){function e(e,t){this.c=eo(),this.l=0,this.v=1,ej.call(this,e,t)}e.prototype.push=function(e,t){ej.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var r=el(e,this.o,this.v&&eI(this.o),t&&8,!t);this.v&&(eS(r,this.o),this.v=0),t&&(eT(r,r.length-8,this.c.d()),eT(r,r.length-4,this.l)),this.ondata(r,t)}})();var ez=function(){function e(e){this.v=1,eL.call(this,e)}return e.prototype.push=function(e,t){if(eL.prototype.e.call(this,e),this.v){var r=this.p.length>3?eP(this.p):4;if(r>=this.p.length&&!t)return;this.p=this.p.subarray(r),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}eL.prototype.c.call(this,t)},e}(),eB=function(e){this.ondata=e,eM([ef,eg,function(){return[eb,eL,ez]}],this,0,function(){onmessage=eb(new ez)},9)},eN=(function(){function e(e,t){this.c=es(),this.v=1,ej.call(this,e,t)}e.prototype.push=function(e,t){ej.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var r=el(e,this.o,this.v&&2,t&&4,!t);this.v&&(eC(r,this.o),this.v=0),t&&eT(r,r.length-4,this.c.d()),this.ondata(r,t)}}(),function(){function e(e){this.v=1,eL.call(this,e)}return e.prototype.push=function(e,t){if(eL.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}eL.prototype.c.call(this,t)},e}()),eH=function(e){this.ondata=e,eM([ef,ev,function(){return[eb,eL,eN]}],this,0,function(){onmessage=eb(new eN)},11)};function eW(e,t){return X((eR(e),e.subarray(2,-4)),t)}var eV=function(){function e(e){this.G=ez,this.I=eL,this.Z=eN,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var r=new w(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var a=this,n=function(){a.ondata.apply(a,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(n):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(n):new this.Z(n),this.s.push(this.p,t),this.p=null}}},e}();(function(e){this.G=eB,this.I=eU,this.Z=eH,this.ondata=e}).prototype.push=function(e,t){eV.prototype.push.call(this,e,t)};var eG="u">typeof TextEncoder&&new TextEncoder,eY="u">typeof TextDecoder&&new TextDecoder,eX=0;try{eY.decode(ea,{stream:!0}),eX=1}catch(e){}var e$=function(e){for(var t="",r=0;;){var a=e[r++],n=(a>127)+(a>223)+(a>239);if(r+n>e.length)return[t,Y(e,r-1)];n?3==n?t+=String.fromCharCode(55296|(a=((15&a)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&a):1&n?t+=String.fromCharCode((31&a)<<6|63&e[r++]):t+=String.fromCharCode((15&a)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(a)}};function eZ(e,t){if(t){for(var r=new w(e.length),a=0;a<e.length;++a)r[a]=e.charCodeAt(a);return r}if(eG)return eG.encode(e);for(var n=e.length,i=new w(e.length+(e.length>>1)),o=0,s=function(e){i[o++]=e},a=0;a<n;++a){if(o+5>i.length){var l=new w(o+8+(n-a<<1));l.set(i),i=l}var h=e.charCodeAt(a);h<128||t?s(h):(h<2048?s(192|h>>6):(h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++a))>>18),s(128|h>>12&63)):s(224|h>>12),s(128|h>>6&63)),s(128|63&h))}return Y(i,0,o)}(function(e){this.ondata=e,eX?this.t=new TextDecoder:this.p=ea}).prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}return}if(!this.p)throw"stream finished";var r=new w(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length);var a=e$(r),n=a[0],i=a[1];if(t){if(i.length)throw"invalid utf-8 data";this.p=null}else this.p=i;this.ondata(n,t)},(function(e){this.ondata=e}).prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(eZ(e),this.d=t||!1)};var eK=function(e){return 1==e?3:e<6?2:+(9==e)},eq=function(e,t){for(;1!=ex(e,t);t+=4+ex(e,t+2));return[eE(e,t+12),eE(e,t+4),eE(e,t+20)]},eQ=function(e){var t=0;if(e)for(var r in e){var a=e[r].length;if(a>65535)throw"extra field too long";t+=a+4}return t},eJ=function(e,t,r,a,n,i,o,s){var l=a.length,h=r.extra,u=s&&s.length,c=eQ(h);eT(e,t,null!=o?0x2014b50:0x4034b50),t+=4,null!=o&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(null==i&&8),e[t++]=n&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var p=new Date(null==r.mtime?Date.now():r.mtime),d=p.getFullYear()-1980;if(d<0||d>119)throw"date not in range 1980-2099";if(eT(e,t,d<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),t+=4,null!=i&&(eT(e,t,r.crc),eT(e,t+4,i),eT(e,t+8,r.size)),eT(e,t+12,l),eT(e,t+14,c),t+=16,null!=o&&(eT(e,t,u),eT(e,t+6,r.attrs),eT(e,t+10,o),t+=14),e.set(a,t),t+=l,c)for(var f in h){var m=h[f],g=m.length;eT(e,t,+f),eT(e,t+2,g),e.set(m,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},e0=function(e,t,r,a,n){eT(e,t,0x6054b50),eT(e,t+8,r),eT(e,t+10,r),eT(e,t+12,a),eT(e,t+16,n)},e1=function(){function e(e){this.filename=e,this.c=eo(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();function e2(e,t){var r=this;t||(t={}),e1.call(this,e),this.d=new ej(t,function(e,t){r.ondata(null,e,t)}),this.compression=8,this.flag=eK(t.level)}function e3(e,t){var r=this;t||(t={}),e1.call(this,e),this.d=new eF(t,function(e,t,a){r.ondata(e,t,a)}),this.compression=8,this.flag=eK(t.level),this.terminate=this.d.terminate}function e5(e){this.ondata=e,this.u=[],this.d=1}e2.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e2.prototype.push=function(e,t){e1.prototype.push.call(this,e,t)},e3.prototype.process=function(e,t){this.d.push(e,t)},e3.prototype.push=function(e,t){e1.prototype.push.call(this,e,t)},e5.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var r=eZ(e.filename),a=r.length,n=e.comment,i=n&&eZ(n),o=a!=e.filename.length||i&&n.length!=i.length,s=a+eQ(e.extra)+30;if(a>65535)throw"filename too long";var l=new w(s);eJ(l,0,e,r,o);var h=[l],u=function(){for(var e=0,r=h;e<r.length;e++){var a=r[e];t.ondata(null,a,!1)}h=[]},c=this.d;this.d=0;var p=this.u.length,d=eh(e,{f:r,u:o,o:i,t:function(){e.terminate&&e.terminate()},r:function(){if(u(),c){var e=t.u[p+1];e?e.r():t.d=1}c=1}}),f=0;e.ondata=function(r,a,n){if(r)t.ondata(r,a,n),t.terminate();else if(f+=a.length,h.push(a),n){var i=new w(16);eT(i,0,0x8074b50),eT(i,4,e.crc),eT(i,8,f),eT(i,12,e.size),h.push(i),d.c=f,d.b=s+f+16,d.crc=e.crc,d.size=e.size,c&&d.r(),c=1}else c&&u()},this.u.push(d)},e5.prototype.end=function(){var e=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e5.prototype.e=function(){for(var e=0,t=0,r=0,a=0,n=this.u;a<n.length;a++){var i=n[a];r+=46+i.f.length+eQ(i.extra)+(i.o?i.o.length:0)}for(var o=new w(r+22),s=0,l=this.u;s<l.length;s++){var i=l[s];eJ(o,e,i,i.f,i.u,i.c,t,i.o),e+=46+i.f.length+eQ(i.extra)+(i.o?i.o.length:0),t+=i.b}e0(o,e,this.u.length,r,t),this.ondata(null,o,!0),this.d=2},e5.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++)t[e].t();this.d=2};var e4=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}();function e6(){var e=this;this.i=new eL(function(t,r){e.ondata(null,t,r)})}function e8(e,t){var r=this;t<32e4?this.i=new eL(function(e,t){r.ondata(null,e,t)}):(this.i=new eU(function(e,t,a){r.ondata(e,t,a)}),this.terminate=this.i.terminate)}function e7(e){this.onfile=e,this.k=[],this.o={0:e4},this.p=ea}e6.prototype.push=function(e,t){try{this.i.push(e,t)}catch(r){this.ondata(r,e,t)}},e6.compression=8,e8.prototype.push=function(e,t){this.i.terminate&&(e=Y(e,0)),this.i.push(e,t)},e8.compression=8,e7.prototype.push=function(e,t){var r=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var a=Math.min(this.c,e.length),n=e.subarray(0,a);if(this.c-=a,this.d?this.d.push(n,!this.c):this.k[0].push(n),(e=e.subarray(a)).length)return this.push(e,t)}else{var i=0,o=0,s=void 0,l=void 0;this.p.length?e.length?((l=new w(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var h=l.length,u=this.c,c=u&&this.d,p=this;o<h-4&&"break"!==function(){var e=e_(l,o);if(0x4034b50==e){i=1,s=o,p.d=null,p.c=0;var t=ex(l,o+6),a=ex(l,o+8),n=8&t,c=ex(l,o+26),d=ex(l,o+28);if(h>o+30+c+d){var f,m,g=[];p.k.unshift(g),i=2;var v=e_(l,o+18),y=e_(l,o+22),w=function(e,t){if(t){for(var r="",a=0;a<e.length;a+=16384)r+=String.fromCharCode.apply(null,e.subarray(a,a+16384));return r}if(eY)return eY.decode(e);var n=e$(e),i=n[0];if(n[1].length)throw"invalid utf-8 data";return i}(l.subarray(o+30,o+=30+c),!(2048&t));0xffffffff==v?(v=(f=n?[-2]:eq(l,o))[0],y=f[1]):n&&(v=-1),o+=d,p.c=v;var b={name:w,compression:a,start:function(){if(!b.ondata)throw"no callback";if(v){var e=r.o[a];if(!e)throw"unknown compression type "+a;(m=v<0?new e(w):new e(w,v,y)).ondata=function(e,t,r){b.ondata(e,t,r)};for(var t=0;t<g.length;t++){var n=g[t];m.push(n,!1)}r.k[0]==g&&r.c?r.d=m:m.push(ea,!0)}else b.ondata(null,ea,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};v>=0&&(b.size=v,b.originalSize=y),p.onfile(b)}return"break"}if(u){if(0x8074b50==e)return s=o+=12+(-2==u&&8),i=3,p.c=0,"break";else if(0x2014b50==e)return s=o-=4,i=3,p.c=0,"break"}}();++o);if(this.p=ea,u<0){var d=i?l.subarray(0,s-12-(-2==u&&8)-(0x8074b50==e_(l,s-16)&&4)):l.subarray(0,o);c?c.push(d,!!i):this.k[+(2==i)].push(d)}if(2&i)return this.push(l.subarray(o),t);this.p=l.subarray(o)}if(t){if(this.c)throw"invalid zip file";this.p=null}},e7.prototype.register=function(e){this.o[e.compression]=e};let e9=c.version>=152;class te extends g.DataTextureLoader{constructor(e){super(e),this.type=g.HalfFloatType}parse(e){let t={l:0,c:0,lc:0};function r(e,r,a,n,i){for(;a<e;)r=r<<8|S(n,i),a+=8;t.l=r>>(a-=e)&(1<<e)-1,t.c=r,t.lc=a}let a=Array(59),n={c:0,lc:0};function i(e,t,r,a){e=e<<8|S(r,a),t+=8,n.c=e,n.lc=t}let o={c:0,lc:0};function s(e,t,r,a,s,l,h,u,c,p){if(e==t){a<8&&(i(r,a,s,h),r=n.c,a=n.lc);var d=r>>(a-=8),d=new Uint8Array([d])[0];if(c.value+d>p)return!1;for(var f=u[c.value-1];d-- >0;)u[c.value++]=f}else{if(!(c.value<p))return!1;u[c.value++]=e}o.c=r,o.lc=a}function l(e){var t=65535&e;return t>32767?t-65536:t}let h={a:0,b:0};function u(e,t){var r=l(e),a=l(t),n=r+(1&a)+(a>>1),i=n-a;h.a=n,h.b=i}function c(e,t){var r=65535&t,a=(65535&e)-(r>>1)&65535;h.a=r+a-32768&65535,h.b=a}function p(e,l,h,u,c,p){var d=h.value,f=T(l,h),m=T(l,h);h.value+=4;var g=T(l,h);if(h.value+=4,f<0||f>=65537||m<0||m>=65537)throw"Something wrong with HUF_ENCSIZE";for(var v=Array(65537),y=Array(16384),w=0;w<16384;w++)y[w]={},y[w].len=0,y[w].lit=0,y[w].p=null;var b=u-(h.value-d);if(!function(e,n,i,o,s,l,h){for(var u=0,c=0;s<=l;s++){if(i.value-i.value>o)return!1;r(6,u,c,e,i);var p=t.l;if(u=t.c,c=t.lc,h[s]=p,63==p){if(i.value-i.value>o)throw"Something wrong with hufUnpackEncTable";r(8,u,c,e,i);var d=t.l+6;if(u=t.c,c=t.lc,s+d>l+1)throw"Something wrong with hufUnpackEncTable";for(;d--;)h[s++]=0;s--}else if(p>=59){var d=p-59+2;if(s+d>l+1)throw"Something wrong with hufUnpackEncTable";for(;d--;)h[s++]=0;s--}}!function(e){for(var t=0;t<=58;++t)a[t]=0;for(var t=0;t<65537;++t)a[e[t]]+=1;for(var r=0,t=58;t>0;--t){var n=r+a[t]>>1;a[t]=r,r=n}for(var t=0;t<65537;++t){var i=e[t];i>0&&(e[t]=i|a[i]++<<6)}}(h)}(e,0,h,b,f,m,v),g>8*(u-(h.value-d)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var n=e[t]>>6,i=63&e[t];if(n>>i)throw"Invalid table entry";if(i>14){var o=a[n>>i-14];if(o.len)throw"Invalid table entry";if(o.lit++,o.p){var s=o.p;o.p=Array(o.lit);for(var l=0;l<o.lit-1;++l)o.p[l]=s[l]}else o.p=[,];o.p[o.lit-1]=t}else if(i)for(var h=0,l=1<<14-i;l>0;l--){var o=a[(n<<14-i)+h];if(o.len||o.p)throw"Invalid table entry";o.len=i,o.lit=t,h++}}}(v,f,m,y),function(e,t,r,a,l,h,u,c,p,d){for(var f=0,m=0,g=Math.trunc(l.value+(h+7)/8);l.value<g;)for(i(f,m,r,l),f=n.c,m=n.lc;m>=14;){var v=t[f>>m-14&16383];if(v.len)m-=v.len,s(v.lit,u,f,m,r,a,l,p,d,c),f=o.c,m=o.lc;else{if(!v.p)throw"hufDecode issues";for(y=0;y<v.lit;y++){for(var y,w=63&e[v.p[y]];m<w&&l.value<g;)i(f,m,r,l),f=n.c,m=n.lc;if(m>=w&&e[v.p[y]]>>6==(f>>m-w&(1<<w)-1)){m-=w,s(v.p[y],u,f,m,r,a,l,p,d,c),f=o.c,m=o.lc;break}}if(y==v.lit)throw"hufDecode issues"}}var b=8-h&7;for(f>>=b,m-=b;m>0;){var v=t[f<<14-m&16383];if(v.len)m-=v.len,s(v.lit,u,f,m,r,a,l,p,d,c),f=o.c,m=o.lc;else throw"hufDecode issues"}}(v,y,e,l,h,g,m,p,c,{value:0})}function d(e){for(var t=1;t<e.length;t++){var r=e[t-1]+e[t]-128;e[t]=r}}function f(e,t){for(var r=0,a=Math.floor((e.length+1)/2),n=0,i=e.length-1;!(n>i)&&(t[n++]=e[r++],!(n>i));){;t[n++]=e[a++]}}function m(e){for(var t=e.byteLength,r=[],a=0,n=new DataView(e);t>0;){var i=n.getInt8(a++);if(i<0){var o=-i;t-=o+1;for(var s=0;s<o;s++)r.push(n.getUint8(a++))}else{var o=i;t-=2;for(var l=n.getUint8(a++),s=0;s<o+1;s++)r.push(l)}}return r}function v(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function y(e){var t=new Uint8Array(m(e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size))),r=new Uint8Array(t.length);return d(t),f(t,r),new DataView(r.buffer)}function w(e){var t=eW(e.array.slice(e.offset.value,e.offset.value+e.size)),r=new Uint8Array(t.length);return d(t),f(t,r),new DataView(r.buffer)}function b(e){for(var t=e.viewer,r={value:e.offset.value},a=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),n=new Uint8Array(8192),i=0,o=Array(e.channels),s=0;s<e.channels;s++)o[s]={},o[s].start=i,o[s].end=o[s].start,o[s].nx=e.width,o[s].ny=e.lines,o[s].size=e.type,i+=o[s].nx*o[s].ny*o[s].size;var l=O(t,r),d=O(t,r);if(d>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(l<=d)for(var s=0;s<d-l+1;s++)n[s+l]=P(t,r);var f=new Uint16Array(65536),m=function(e,t){for(var r=0,a=0;a<65536;++a)(0==a||e[a>>3]&1<<(7&a))&&(t[r++]=a);for(var n=r-1;r<65536;)t[r++]=0;return n}(n,f),g=T(t,r);p(e.array,t,r,g,a,i);for(var s=0;s<e.channels;++s)for(var v=o[s],y=0;y<o[s].size;++y)!function(e,t,r,a,n,i,o){for(var s=o<16384,l=r>n?n:r,p=1;p<=l;)p<<=1;for(p>>=1,d=p,p>>=1;p>=1;){for(var d,f,m,g,v,y=0,w=0+i*(n-d),b=i*p,M=i*d,x=a*p,_=a*d;y<=w;y+=M){for(var E=y,T=y+a*(r-d);E<=T;E+=_){var S=E+x,P=E+b,A=P+x;s?(u(e[E+t],e[P+t]),f=h.a,g=h.b,u(e[S+t],e[A+t]),m=h.a,v=h.b,u(f,m),e[E+t]=h.a,e[S+t]=h.b,u(g,v)):(c(e[E+t],e[P+t]),f=h.a,g=h.b,c(e[S+t],e[A+t]),m=h.a,v=h.b,c(f,m),e[E+t]=h.a,e[S+t]=h.b,c(g,v)),e[P+t]=h.a,e[A+t]=h.b}if(r&p){var P=E+b;s?u(e[E+t],e[P+t]):c(e[E+t],e[P+t]),f=h.a,e[P+t]=h.b,e[E+t]=f}}if(n&p)for(var E=y,T=y+a*(r-d);E<=T;E+=_){var S=E+x;s?u(e[E+t],e[S+t]):c(e[E+t],e[S+t]),f=h.a,e[S+t]=h.b,e[E+t]=f}d=p,p>>=1}}(a,v.start+y,v.nx,v.size,v.ny,v.nx*v.size,m);for(var w=i,b=0;b<w;++b)a[b]=f[a[b]];for(var M=0,x=new Uint8Array(a.buffer.byteLength),_=0;_<e.lines;_++)for(var E=0;E<e.channels;E++){var v=o[E],S=v.nx*v.size,A=new Uint8Array(a.buffer,2*v.end,2*S);x.set(A,M),M+=2*S,v.end+=S}return new DataView(x.buffer)}function M(e){var t=eW(e.array.slice(e.offset.value,e.offset.value+e.size));let r=e.lines*e.channels*e.width,a=1==e.type?new Uint16Array(r):new Uint32Array(r),n=0,i=0,o=[,,,,];for(let r=0;r<e.lines;r++)for(let r=0;r<e.channels;r++){let r=0;switch(e.type){case 1:o[0]=n,o[1]=o[0]+e.width,n=o[1]+e.width;for(let n=0;n<e.width;++n)r+=t[o[0]++]<<8|t[o[1]++],a[i]=r,i++;break;case 2:o[0]=n,o[1]=o[0]+e.width,o[2]=o[1]+e.width,n=o[2]+e.width;for(let n=0;n<e.width;++n)r+=t[o[0]++]<<24|t[o[1]++]<<16|t[o[2]++]<<8,a[i]=r,i++}}return new DataView(a.buffer)}function x(e){var t=e.viewer,r={value:e.offset.value},a=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),n={version:A(t,r),unknownUncompressedSize:A(t,r),unknownCompressedSize:A(t,r),acCompressedSize:A(t,r),dcCompressedSize:A(t,r),rleCompressedSize:A(t,r),rleUncompressedSize:A(t,r),rleRawSize:A(t,r),totalAcUncompressedCount:A(t,r),totalDcUncompressedCount:A(t,r),acCompression:A(t,r)};if(n.version<2)throw"EXRLoader.parse: "+U.compression+" version "+n.version+" is unsupported";for(var i=[],o=O(t,r)-2;o>0;){var s=_(t.buffer,r),l=P(t,r),h=l>>2&3,u=new Int8Array([(l>>4)-1])[0],c=P(t,r);i.push({name:s,index:u,type:c,compression:h}),o-=s.length+3}for(var d=U.channels,f=Array(e.channels),v=0;v<e.channels;++v){var y=f[v]={},b=d[v];y.name=b.name,y.compression=0,y.decoded=!1,y.type=b.pixelType,y.pLinear=b.pLinear,y.width=e.width,y.height=e.lines}for(var M={idx:[,,,]},x=0;x<e.channels;++x)for(var y=f[x],v=0;v<i.length;++v){var E=i[v];y.name==E.name&&(y.compression=E.compression,E.index>=0&&(M.idx[E.index]=x),y.offset=x)}if(n.acCompressedSize>0)switch(n.acCompression){case 0:var T=new Uint16Array(n.totalAcUncompressedCount);p(e.array,t,r,n.acCompressedSize,T,n.totalAcUncompressedCount);break;case 1:var S=e.array.slice(r.value,r.value+n.totalAcUncompressedCount),I=eW(S),T=new Uint16Array(I.buffer);r.value+=n.totalAcUncompressedCount}if(n.dcCompressedSize>0){var C=new Uint16Array(w({array:e.array,offset:r,size:n.dcCompressedSize}).buffer);r.value+=n.dcCompressedSize}if(n.rleRawSize>0){var S=e.array.slice(r.value,r.value+n.rleCompressedSize),I=eW(S),j=m(I.buffer);r.value+=n.rleCompressedSize}for(var F=0,k=Array(f.length),v=0;v<k.length;++v)k[v]=[];for(var L=0;L<e.lines;++L)for(var D=0;D<f.length;++D)k[D].push(F),F+=f[D].width*e.type*2;!function(e,t,r,a,n,i){var o=new DataView(i.buffer),s=r[e.idx[0]].width,l=r[e.idx[0]].height,h=Math.floor(s/8),u=Math.ceil(s/8),c=Math.ceil(l/8),p=s-(u-1)*8,d=l-(c-1)*8,f={value:0},m=[,,,],v=[,,,],y=[,,,],w=[,,,],b=[,,,];for(let r=0;r<3;++r)b[r]=t[e.idx[r]],m[r]=r<1?0:m[r-1]+u*c,v[r]=new Float32Array(64),y[r]=new Uint16Array(64),w[r]=new Uint16Array(64*u);for(let t=0;t<c;++t){var M,x,_=8;t==c-1&&(_=d);var E=8;for(let e=0;e<u;++e){e==u-1&&(E=p);for(let e=0;e<3;++e){y[e].fill(0),y[e][0]=n[m[e]++],function(e,t,r){for(var a,n=1;n<64;)65280==(a=t[e.value])?n=64:a>>8==255?n+=255&a:(r[n]=a,n++),e.value++}(f,a,y[e]),M=y[e],(x=v[e])[0]=R(M[0]),x[1]=R(M[1]),x[2]=R(M[5]),x[3]=R(M[6]),x[4]=R(M[14]),x[5]=R(M[15]),x[6]=R(M[27]),x[7]=R(M[28]),x[8]=R(M[2]),x[9]=R(M[4]),x[10]=R(M[7]),x[11]=R(M[13]),x[12]=R(M[16]),x[13]=R(M[26]),x[14]=R(M[29]),x[15]=R(M[42]),x[16]=R(M[3]),x[17]=R(M[8]),x[18]=R(M[12]),x[19]=R(M[17]),x[20]=R(M[25]),x[21]=R(M[30]),x[22]=R(M[41]),x[23]=R(M[43]),x[24]=R(M[9]),x[25]=R(M[11]),x[26]=R(M[18]),x[27]=R(M[24]),x[28]=R(M[31]),x[29]=R(M[40]),x[30]=R(M[44]),x[31]=R(M[53]),x[32]=R(M[10]),x[33]=R(M[19]),x[34]=R(M[23]),x[35]=R(M[32]),x[36]=R(M[39]),x[37]=R(M[45]),x[38]=R(M[52]),x[39]=R(M[54]),x[40]=R(M[20]),x[41]=R(M[22]),x[42]=R(M[33]),x[43]=R(M[38]),x[44]=R(M[46]),x[45]=R(M[51]),x[46]=R(M[55]),x[47]=R(M[60]),x[48]=R(M[21]),x[49]=R(M[34]),x[50]=R(M[37]),x[51]=R(M[47]),x[52]=R(M[50]),x[53]=R(M[56]),x[54]=R(M[59]),x[55]=R(M[61]),x[56]=R(M[35]),x[57]=R(M[36]),x[58]=R(M[48]),x[59]=R(M[49]),x[60]=R(M[57]),x[61]=R(M[58]),x[62]=R(M[62]),x[63]=R(M[63]),function(e){let t=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),a=.5*Math.cos(3*3.14159/16),n=.5*Math.cos(3*3.14159/8);for(var i=[,,,,],o=[,,,,],s=[,,,,],l=[,,,,],h=0;h<8;++h){var u=8*h;i[0]=r*e[u+2],i[1]=n*e[u+2],i[2]=r*e[u+6],i[3]=n*e[u+6],o[0]=t*e[u+1]+a*e[u+3]+.2777854612564676*e[u+5]+.09754573032714427*e[u+7],o[1]=a*e[u+1]-.09754573032714427*e[u+3]-t*e[u+5]-.2777854612564676*e[u+7],o[2]=.2777854612564676*e[u+1]-t*e[u+3]+.09754573032714427*e[u+5]+a*e[u+7],o[3]=.09754573032714427*e[u+1]-.2777854612564676*e[u+3]+a*e[u+5]-t*e[u+7],s[0]=.35355362513961314*(e[u+0]+e[u+4]),s[3]=.35355362513961314*(e[u+0]-e[u+4]),s[1]=i[0]+i[3],s[2]=i[1]-i[2],l[0]=s[0]+s[1],l[1]=s[3]+s[2],l[2]=s[3]-s[2],l[3]=s[0]-s[1],e[u+0]=l[0]+o[0],e[u+1]=l[1]+o[1],e[u+2]=l[2]+o[2],e[u+3]=l[3]+o[3],e[u+4]=l[3]-o[3],e[u+5]=l[2]-o[2],e[u+6]=l[1]-o[1],e[u+7]=l[0]-o[0]}for(var c=0;c<8;++c)i[0]=r*e[16+c],i[1]=n*e[16+c],i[2]=r*e[48+c],i[3]=n*e[48+c],o[0]=t*e[8+c]+a*e[24+c]+.2777854612564676*e[40+c]+.09754573032714427*e[56+c],o[1]=a*e[8+c]-.09754573032714427*e[24+c]-t*e[40+c]-.2777854612564676*e[56+c],o[2]=.2777854612564676*e[8+c]-t*e[24+c]+.09754573032714427*e[40+c]+a*e[56+c],o[3]=.09754573032714427*e[8+c]-.2777854612564676*e[24+c]+a*e[40+c]-t*e[56+c],s[0]=.35355362513961314*(e[c]+e[32+c]),s[3]=.35355362513961314*(e[c]-e[32+c]),s[1]=i[0]+i[3],s[2]=i[1]-i[2],l[0]=s[0]+s[1],l[1]=s[3]+s[2],l[2]=s[3]-s[2],l[3]=s[0]-s[1],e[0+c]=l[0]+o[0],e[8+c]=l[1]+o[1],e[16+c]=l[2]+o[2],e[24+c]=l[3]+o[3],e[32+c]=l[3]-o[3],e[40+c]=l[2]-o[2],e[48+c]=l[1]-o[1],e[56+c]=l[0]-o[0]}(v[e])}for(var T=v,S=0;S<64;++S){var P=T[0][S],A=T[1][S],I=T[2][S];T[0][S]=P+1.5747*I,T[1][S]=P-.1873*A-.4682*I,T[2][S]=P+1.8556*A}for(let t=0;t<3;++t)!function(e,t,r){for(var a,n=0;n<64;++n){t[r+n]=g.DataUtils.toHalfFloat((a=e[n])<=1?Math.sign(a)*Math.pow(Math.abs(a),2.2):Math.sign(a)*Math.pow(9.025013291561939,Math.abs(a)-1))}}(v[t],w[t],64*e)}let i=0;for(let a=0;a<3;++a){let n=r[e.idx[a]].type;for(let e=8*t;e<8*t+_;++e){i=b[a][e];for(let t=0;t<h;++t){let r=64*t+(7&e)*8;o.setUint16(i+0*n,w[a][r+0],!0),o.setUint16(i+2*n,w[a][r+1],!0),o.setUint16(i+4*n,w[a][r+2],!0),o.setUint16(i+6*n,w[a][r+3],!0),o.setUint16(i+8*n,w[a][r+4],!0),o.setUint16(i+10*n,w[a][r+5],!0),o.setUint16(i+12*n,w[a][r+6],!0),o.setUint16(i+14*n,w[a][r+7],!0),i+=16*n}}if(h!=u)for(let e=8*t;e<8*t+_;++e){let t=b[a][e]+8*h*2*n,r=64*h+(7&e)*8;for(let e=0;e<E;++e)o.setUint16(t+2*e*n,w[a][r+e],!0)}}}for(var C=new Uint16Array(s),o=new DataView(i.buffer),O=0;O<3;++O){r[e.idx[O]].decoded=!0;var j=r[e.idx[O]].type;if(2==r[O].type)for(var F=0;F<l;++F){let e=b[O][F];for(var k=0;k<s;++k)C[k]=o.getUint16(e+2*k*j,!0);for(var k=0;k<s;++k)o.setFloat32(e+2*k*j,R(C[k]),!0)}}}(M,k,f,T,C,a);for(var v=0;v<f.length;++v){var y=f[v];if(!y.decoded)if(2===y.compression)for(var z=0,B=0,L=0;L<e.lines;++L){for(var N=k[v][z],H=0;H<y.width;++H){for(var W=0;W<2*y.type;++W)a[N++]=j[B+W*y.width*y.height];B++}z++}else throw"EXRLoader.parse: unsupported channel compression"}return new DataView(a.buffer)}function _(e,t){for(var r=new Uint8Array(e),a=0;0!=r[t.value+a];)a+=1;var n=new TextDecoder().decode(r.slice(t.value,t.value+a));return t.value=t.value+a+1,n}function E(e,t){var r=e.getInt32(t.value,!0);return t.value=t.value+4,r}function T(e,t){var r=e.getUint32(t.value,!0);return t.value=t.value+4,r}function S(e,t){var r=e[t.value];return t.value=t.value+1,r}function P(e,t){var r=e.getUint8(t.value);return t.value=t.value+1,r}let A=function(e,t){let r;return r="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,r};function I(e,t){var r=e.getFloat32(t.value,!0);return t.value+=4,r}function C(e,t){return g.DataUtils.toHalfFloat(I(e,t))}function R(e){var t=(31744&e)>>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function O(e,t){var r=e.getUint16(t.value,!0);return t.value+=2,r}function j(e,t){return R(O(e,t))}let F=new DataView(e),k=new Uint8Array(e),L={value:0},U=function(e,t,r){let a={};if(0x1312f76!=e.getUint32(0,!0))throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";a.version=e.getUint8(4);let n=e.getUint8(5);a.spec={singleTile:!!(2&n),longName:!!(4&n),deepFormat:!!(8&n),multiPart:!!(16&n)},r.value=8;for(var i=!0;i;){var o=_(t,r);if(0==o)i=!1;else{var s=_(t,r),l=T(e,r),h=function(e,t,r,a,n){var i,o,s,l,h,u,c;if("string"===a||"stringvector"===a||"iccProfile"===a)return i=new TextDecoder().decode(new Uint8Array(t).slice(r.value,r.value+n)),r.value=r.value+n,i;if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value<n+a-1;){var o=_(t,r),s=E(e,r),l=P(e,r);r.value+=3;var h=E(e,r),u=E(e,r);i.push({name:o,pixelType:s,pLinear:l,xSampling:h,ySampling:u})}return r.value+=1,i}(e,t,r,n);if("chromaticities"===a)return o=I(e,r),s=I(e,r),l=I(e,r),h=I(e,r),u=I(e,r),{redX:o,redY:s,greenX:l,greenY:h,blueX:u,blueY:I(e,r),whiteX:I(e,r),whiteY:I(e,r)};if("compression"===a)return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][P(e,r)];if("box2i"===a)return c=T(e,r),{xMin:c,yMin:T(e,r),xMax:T(e,r),yMax:T(e,r)};else if("lineOrder"===a)return["INCREASING_Y"][P(e,r)];else if("float"===a)return I(e,r);else if("v2f"===a)return[I(e,r),I(e,r)];else if("v3f"===a)return[I(e,r),I(e,r),I(e,r)];else if("int"===a)return E(e,r);else if("rational"===a)return[E(e,r),T(e,r)];else if("timecode"===a)return[T(e,r),T(e,r)];else return"preview"===a?(r.value+=n,"skipped"):(r.value+=n,void 0)}(e,t,r,s,l);void 0===h?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${s}'.`):a[o]=h}}if((-5&n)!=0)throw console.error("EXRHeader:",a),"THREE.EXRLoader: provided file is currently unsupported.";return a}(F,e,L),D=function(e,t,r,a,n){let i={size:0,viewer:t,array:r,offset:a,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,[e9?"colorSpace":"encoding"]:null};switch(e.compression){case"NO_COMPRESSION":i.lines=1,i.uncompress=v;break;case"RLE_COMPRESSION":i.lines=1,i.uncompress=y;break;case"ZIPS_COMPRESSION":i.lines=1,i.uncompress=w;break;case"ZIP_COMPRESSION":i.lines=16,i.uncompress=w;break;case"PIZ_COMPRESSION":i.lines=32,i.uncompress=b;break;case"PXR24_COMPRESSION":i.lines=16,i.uncompress=M;break;case"DWAA_COMPRESSION":i.lines=32,i.uncompress=x;break;case"DWAB_COMPRESSION":i.lines=256,i.uncompress=x;break;default:throw"EXRLoader.parse: "+e.compression+" is unsupported"}if(i.scanlineBlockSize=i.lines,1==i.type)switch(n){case g.FloatType:i.getter=j,i.inputSize=2;break;case g.HalfFloatType:i.getter=O,i.inputSize=2}else if(2==i.type)switch(n){case g.FloatType:i.getter=I,i.inputSize=4;break;case g.HalfFloatType:i.getter=C,i.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+i.type+" for "+e.compression+".";i.blockCount=(e.dataWindow.yMax+1)/i.scanlineBlockSize;for(var o=0;o<i.blockCount;o++)A(t,a);i.outputChannels=3==i.channels?4:i.channels;let s=i.width*i.height*i.outputChannels;switch(n){case g.FloatType:i.byteArray=new Float32Array(s),i.channels<i.outputChannels&&i.byteArray.fill(1,0,s);break;case g.HalfFloatType:i.byteArray=new Uint16Array(s),i.channels<i.outputChannels&&i.byteArray.fill(15360,0,s);break;default:console.error("THREE.EXRLoader: unsupported type: ",n)}return i.bytesPerLine=i.width*i.inputSize*i.channels,4==i.outputChannels?i.format=g.RGBAFormat:i.format=g.RedFormat,e9?i.colorSpace="srgb-linear":i.encoding=3e3,i}(U,F,k,L,this.type),z={value:0},B={R:0,G:1,B:2,A:3,Y:0};for(let e=0;e<D.height/D.scanlineBlockSize;e++){let t=T(F,L);D.size=T(F,L),D.lines=t+D.scanlineBlockSize>D.height?D.height-t:D.scanlineBlockSize;let r=D.size<D.lines*D.bytesPerLine?D.uncompress(D):v(D);L.value+=D.size;for(let t=0;t<D.scanlineBlockSize;t++){let a=t+e*D.scanlineBlockSize;if(a>=D.height)break;for(let e=0;e<D.channels;e++){let n=B[U.channels[e].name];for(let i=0;i<D.width;i++){z.value=(t*(D.channels*D.width)+e*D.width+i)*D.inputSize;let o=(D.height-1-a)*(D.width*D.outputChannels)+i*D.outputChannels+n;D.byteArray[o]=D.getter(r,z)}}}}return{header:U,width:D.width,height:D.height,data:D.byteArray,format:D.format,[e9?"colorSpace":"encoding"]:D[e9?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,r,a){return super.load(e,function(e,r){e9?e.colorSpace=r.colorSpace:e.encoding=r.encoding,e.minFilter=g.LinearFilter,e.magFilter=g.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,r)},r,a)}}var tt=e.i(8560);let tr=(e,t,r)=>{let a;switch(e){case h.UnsignedByteType:a=new Uint8ClampedArray(t*r*4);break;case h.HalfFloatType:a=new Uint16Array(t*r*4);break;case h.UnsignedIntType:a=new Uint32Array(t*r*4);break;case h.ByteType:a=new Int8Array(t*r*4);break;case h.ShortType:a=new Int16Array(t*r*4);break;case h.IntType:a=new Int32Array(t*r*4);break;case h.FloatType:a=new Float32Array(t*r*4);break;default:throw Error("Unsupported data type")}return a};class ta{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(e){this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const r={format:h.RGBAFormat,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:e.renderTargetOptions?.anisotropy!==void 0?e.renderTargetOptions?.anisotropy:1,generateMipmaps:e.renderTargetOptions?.generateMipmaps!==void 0&&e.renderTargetOptions?.generateMipmaps,magFilter:e.renderTargetOptions?.magFilter!==void 0?e.renderTargetOptions?.magFilter:h.LinearFilter,minFilter:e.renderTargetOptions?.minFilter!==void 0?e.renderTargetOptions?.minFilter:h.LinearFilter,samples:e.renderTargetOptions?.samples!==void 0?e.renderTargetOptions?.samples:void 0,wrapS:e.renderTargetOptions?.wrapS!==void 0?e.renderTargetOptions?.wrapS:h.ClampToEdgeWrapping,wrapT:e.renderTargetOptions?.wrapT!==void 0?e.renderTargetOptions?.wrapT:h.ClampToEdgeWrapping};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=ta.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new h.Scene,this._camera=new h.OrthographicCamera,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((e,r,a,n)=>{if(void 0!==t)return t;let i=new h.WebGLRenderTarget(1,1,n);r.setRenderTarget(i);let o=new h.Mesh(new h.PlaneGeometry,new h.MeshBasicMaterial({color:0xffffff}));r.render(o,a),r.setRenderTarget(null);let s=tr(e,i.width,i.height);return r.readRenderTargetPixels(i,0,0,i.width,i.height,s),i.dispose(),o.geometry.dispose(),o.material.dispose(),t=0!==s[0]})(this._type,this._renderer,this._camera,r)){let e;this._type===h.HalfFloatType&&(e=this._renderer.extensions.has("EXT_color_buffer_float")?h.FloatType:void 0),void 0!==e?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${h.FloatType}`),this._type=e):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods w