@takram/three-geospatial 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.2] - 2025-06-12
4
+
5
+ ### Changed
6
+
7
+ - Removed the use of `forwardRef` and added it in props.
8
+ - Updated dependencies.
9
+
3
10
  ## [0.2.1] - 2025-05-23
4
11
 
5
12
  ### Fixed
package/build/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("three"),Ie=require("./shared.cjs");var wi=process.env.NODE_ENV==="production",Pr="Invariant failed";function en(r,e){if(!r){if(wi)throw new Error(Pr);var i=Pr;throw new Error(i)}}class tn extends S.Loader{load(e,i,o,s){const c=new S.FileLoader(this.manager);c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{en(l instanceof ArrayBuffer);try{i(l)}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function Ai(r){}function Ti(r){var c;const{attributes:e,index:i,boundingBox:o,boundingSphere:s}=r;return[{attributes:e,index:i,boundingBox:o,boundingSphere:s},[...Object.values(r.attributes).map(l=>l.array.buffer),(c=r.index)==null?void 0:c.array.buffer].filter(l=>l!=null)]}function gi(r,e=new S.BufferGeometry){for(const[i,o]of Object.entries(r.attributes))e.setAttribute(i,new S.BufferAttribute(o.array,o.itemSize,o.normalized));if(e.index=r.index!=null?new S.BufferAttribute(r.index.array,r.index.itemSize,r.index.normalized):null,r.boundingBox!=null){const{min:i,max:o}=r.boundingBox;e.boundingBox=new S.Box3(new S.Vector3(i.x,i.y,i.z),new S.Vector3(o.x,o.y,o.z))}if(r.boundingSphere!=null){const{center:i,radius:o}=r.boundingSphere;e.boundingSphere=new S.Sphere(new S.Vector3(i.x,i.y,i.z),o)}return e}const rn=128,nn=128,on=64,Si="9627216cc50057994c98a2118f3c4a23765d43b9",Ei=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Si}/packages/core/assets/stbn.bin`,Ii="This is not an object",_i="This is not a Float16Array object",Dr="This constructor is not a subclass of Float16Array",sn="The constructor property value is not an object",bi="Species constructor didn't return TypedArray object",Ni="Derived constructor created TypedArray object which was too small length",ht="Attempting to access detached ArrayBuffer",ar="Cannot convert undefined or null to object",cr="Cannot mix BigInt and other types, use explicit conversions",Br="@@iterator property is not callable",zr="Reduce of empty array with no initial value",Ui="The comparison function must be either a function or undefined",Kt="Offset is out of bounds";function Z(r){return(e,...i)=>oe(r,e,i)}function Qe(r,e){return Z(Ve(r,e).get)}const{apply:oe,construct:lt,defineProperty:Hr,get:er,getOwnPropertyDescriptor:Ve,getPrototypeOf:dt,has:lr,ownKeys:an,set:kr,setPrototypeOf:cn}=Reflect,Oi=Proxy,{EPSILON:mi,MAX_SAFE_INTEGER:Zr,isFinite:ln,isNaN:qe}=Number,{iterator:_e,species:Ci,toStringTag:dr,for:Ri}=Symbol,Je=Object,{create:Gt,defineProperty:wt,freeze:Li,is:Gr}=Je,ur=Je.prototype,Fi=ur.__lookupGetter__?Z(ur.__lookupGetter__):(r,e)=>{if(r==null)throw Y(ar);let i=Je(r);do{const o=Ve(i,e);if(o!==void 0)return Re(o,"get")?o.get:void 0}while((i=dt(i))!==null)},Re=Je.hasOwn||Z(ur.hasOwnProperty),un=Array,hn=un.isArray,Wt=un.prototype,xi=Z(Wt.join),Mi=Z(Wt.push),Pi=Z(Wt.toLocaleString),wr=Wt[_e],Di=Z(wr),{abs:Bi,trunc:fn}=Math,Xt=ArrayBuffer,zi=Xt.isView,yn=Xt.prototype,Hi=Z(yn.slice),ki=Qe(yn,"byteLength"),hr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,Zi=hr&&Qe(hr.prototype,"byteLength"),Ar=dt(Uint8Array),Gi=Ar.from,j=Ar.prototype,Wi=j[_e],Xi=Z(j.keys),Yi=Z(j.values),Vi=Z(j.entries),qi=Z(j.set),Wr=Z(j.reverse),Ji=Z(j.fill),$i=Z(j.copyWithin),Xr=Z(j.sort),st=Z(j.slice),Qi=Z(j.subarray),Q=Qe(j,"buffer"),Be=Qe(j,"byteOffset"),F=Qe(j,"length"),vn=Qe(j,dr),ji=Uint8Array,le=Uint16Array,Yr=(...r)=>oe(Gi,le,r),Tr=Uint32Array,Ki=Float32Array,ze=dt([][_e]()),Yt=Z(ze.next),eo=Z(function*(){}().next),to=dt(ze),ro=DataView.prototype,no=Z(ro.getUint16),Y=TypeError,tr=RangeError,pn=WeakSet,dn=pn.prototype,io=Z(dn.add),oo=Z(dn.has),Vt=WeakMap,gr=Vt.prototype,Dt=Z(gr.get),so=Z(gr.has),Sr=Z(gr.set),wn=new Vt,ao=Gt(null,{next:{value:function(){const e=Dt(wn,this);return Yt(e)}},[_e]:{value:function(){return this}}});function ut(r){if(r[_e]===wr&&ze.next===Yt)return r;const e=Gt(ao);return Sr(wn,e,Di(r)),e}const An=new Vt,Tn=Gt(to,{next:{value:function(){const e=Dt(An,this);return eo(e)},writable:!0,configurable:!0}});for(const r of an(ze))r!=="next"&&wt(Tn,r,Ve(ze,r));function Vr(r){const e=Gt(Tn);return Sr(An,e,r),e}function Bt(r){return r!==null&&typeof r=="object"||typeof r=="function"}function qr(r){return r!==null&&typeof r=="object"}function zt(r){return vn(r)!==void 0}function fr(r){const e=vn(r);return e==="BigInt64Array"||e==="BigUint64Array"}function co(r){try{return hn(r)?!1:(ki(r),!0)}catch{return!1}}function gn(r){if(hr===null)return!1;try{return Zi(r),!0}catch{return!1}}function lo(r){return co(r)||gn(r)}function Jr(r){return hn(r)?r[_e]===wr&&ze.next===Yt:!1}function uo(r){return zt(r)?r[_e]===Wi&&ze.next===Yt:!1}function Ct(r){if(typeof r!="string")return!1;const e=+r;return r!==e+""||!ln(e)?!1:e===fn(e)}const Ht=Ri("__Float16Array__");function ho(r){if(!qr(r))return!1;const e=dt(r);if(!qr(e))return!1;const i=e.constructor;if(i===void 0)return!1;if(!Bt(i))throw Y(sn);return lr(i,Ht)}const yr=1/mi;function fo(r){return r+yr-yr}const Sn=6103515625e-14,yo=65504,En=.0009765625,$r=En*Sn,vo=En*yr;function po(r){const e=+r;if(!ln(e)||e===0)return e;const i=e>0?1:-1,o=Bi(e);if(o<Sn)return i*fo(o/$r)*$r;const s=(1+vo)*o,c=s-(s-o);return c>yo||qe(c)?i*(1/0):i*c}const In=new Xt(4),_n=new Ki(In),bn=new Tr(In),we=new le(512),Ae=new ji(512);for(let r=0;r<256;++r){const e=r-127;e<-24?(we[r]=0,we[r|256]=32768,Ae[r]=24,Ae[r|256]=24):e<-14?(we[r]=1024>>-e-14,we[r|256]=1024>>-e-14|32768,Ae[r]=-e-1,Ae[r|256]=-e-1):e<=15?(we[r]=e+15<<10,we[r|256]=e+15<<10|32768,Ae[r]=13,Ae[r|256]=13):e<128?(we[r]=31744,we[r|256]=64512,Ae[r]=24,Ae[r|256]=24):(we[r]=31744,we[r|256]=64512,Ae[r]=13,Ae[r|256]=13)}function Ee(r){_n[0]=po(r);const e=bn[0],i=e>>23&511;return we[i]+((e&8388607)>>Ae[i])}const Er=new Tr(2048);for(let r=1;r<1024;++r){let e=r<<13,i=0;for(;(e&8388608)===0;)e<<=1,i-=8388608;e&=-8388609,i+=947912704,Er[r]=e|i}for(let r=1024;r<2048;++r)Er[r]=939524096+(r-1024<<13);const je=new Tr(64);for(let r=1;r<31;++r)je[r]=r<<23;je[31]=1199570944;je[32]=2147483648;for(let r=33;r<63;++r)je[r]=2147483648+(r-32<<23);je[63]=3347054592;const Nn=new le(64);for(let r=1;r<64;++r)r!==32&&(Nn[r]=1024);function M(r){const e=r>>10;return bn[0]=Er[Nn[e]+(r&1023)]+je[e],_n[0]}function Ce(r){const e=+r;return qe(e)||e===0?0:fn(e)}function rr(r){const e=Ce(r);return e<0?0:e<Zr?e:Zr}function Rt(r,e){if(!Bt(r))throw Y(Ii);const i=r.constructor;if(i===void 0)return e;if(!Bt(i))throw Y(sn);const o=i[Ci];return o??e}function ft(r){if(gn(r))return!1;try{return Hi(r,0,0),!1}catch{}return!0}function Qr(r,e){const i=qe(r),o=qe(e);if(i&&o)return 0;if(i)return 1;if(o||r<e)return-1;if(r>e)return 1;if(r===0&&e===0){const s=Gr(r,0),c=Gr(e,0);if(!s&&c)return-1;if(s&&!c)return 1}return 0}const Ir=2,kt=new Vt;function Ye(r){return so(kt,r)||!zi(r)&&ho(r)}function L(r){if(!Ye(r))throw Y(_i)}function Lt(r,e){const i=Ye(r),o=zt(r);if(!i&&!o)throw Y(bi);if(typeof e=="number"){let s;if(i){const c=O(r);s=F(c)}else s=F(r);if(s<e)throw Y(Ni)}if(fr(r))throw Y(cr)}function O(r){const e=Dt(kt,r);if(e!==void 0){const s=Q(e);if(ft(s))throw Y(ht);return e}const i=r.buffer;if(ft(i))throw Y(ht);const o=lt(P,[i,r.byteOffset,r.length],r.constructor);return Dt(kt,o)}function jr(r){const e=F(r),i=[];for(let o=0;o<e;++o)i[o]=M(r[o]);return i}const Un=new pn;for(const r of an(j)){if(r===dr)continue;const e=Ve(j,r);Re(e,"get")&&typeof e.get=="function"&&io(Un,e.get)}const wo=Li({get(r,e,i){return Ct(e)&&Re(r,e)?M(er(r,e)):oo(Un,Fi(r,e))?er(r,e):er(r,e,i)},set(r,e,i,o){return Ct(e)&&Re(r,e)?kr(r,e,Ee(i)):kr(r,e,i,o)},getOwnPropertyDescriptor(r,e){if(Ct(e)&&Re(r,e)){const i=Ve(r,e);return i.value=M(i.value),i}return Ve(r,e)},defineProperty(r,e,i){return Ct(e)&&Re(r,e)&&Re(i,"value")&&(i.value=Ee(i.value)),Hr(r,e,i)}});class P{constructor(e,i,o){let s;if(Ye(e))s=lt(le,[O(e)],new.target);else if(Bt(e)&&!lo(e)){let l,y;if(zt(e)){l=e,y=F(e);const v=Q(e);if(ft(v))throw Y(ht);if(fr(e))throw Y(cr);const I=new Xt(y*Ir);s=lt(le,[I],new.target)}else{const v=e[_e];if(v!=null&&typeof v!="function")throw Y(Br);v!=null?Jr(e)?(l=e,y=e.length):(l=[...e],y=l.length):(l=e,y=rr(l.length)),s=lt(le,[y],new.target)}for(let v=0;v<y;++v)s[v]=Ee(l[v])}else s=lt(le,arguments,new.target);const c=new Oi(s,wo);return Sr(kt,c,s),c}static from(e,...i){const o=this;if(!lr(o,Ht))throw Y(Dr);if(o===P){if(Ye(e)&&i.length===0){const N=O(e),C=new le(Q(N),Be(N),F(N));return new P(Q(st(C)))}if(i.length===0)return new P(Q(Yr(e,Ee)));const v=i[0],I=i[1];return new P(Q(Yr(e,function(N,...C){return Ee(oe(v,this,[N,...ut(C)]))},I)))}let s,c;const l=e[_e];if(l!=null&&typeof l!="function")throw Y(Br);if(l!=null)Jr(e)?(s=e,c=e.length):uo(e)?(s=e,c=F(e)):(s=[...e],c=s.length);else{if(e==null)throw Y(ar);s=Je(e),c=rr(s.length)}const y=new o(c);if(i.length===0)for(let v=0;v<c;++v)y[v]=s[v];else{const v=i[0],I=i[1];for(let N=0;N<c;++N)y[N]=oe(v,I,[s[N],N])}return y}static of(...e){const i=this;if(!lr(i,Ht))throw Y(Dr);const o=e.length;if(i===P){const c=new P(o),l=O(c);for(let y=0;y<o;++y)l[y]=Ee(e[y]);return c}const s=new i(o);for(let c=0;c<o;++c)s[c]=e[c];return s}keys(){L(this);const e=O(this);return Xi(e)}values(){L(this);const e=O(this);return Vr(function*(){for(const i of Yi(e))yield M(i)}())}entries(){L(this);const e=O(this);return Vr(function*(){for(const[i,o]of Vi(e))yield[i,M(o)]}())}at(e){L(this);const i=O(this),o=F(i),s=Ce(e),c=s>=0?s:o+s;if(!(c<0||c>=o))return M(i[c])}with(e,i){L(this);const o=O(this),s=F(o),c=Ce(e),l=c>=0?c:s+c,y=+i;if(l<0||l>=s)throw tr(Kt);const v=new le(Q(o),Be(o),F(o)),I=new P(Q(st(v))),N=O(I);return N[l]=Ee(y),I}map(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=Rt(o,P);if(l===P){const v=new P(s),I=O(v);for(let N=0;N<s;++N){const C=M(o[N]);I[N]=Ee(oe(e,c,[C,N,this]))}return v}const y=new l(s);Lt(y,s);for(let v=0;v<s;++v){const I=M(o[v]);y[v]=oe(e,c,[I,v,this])}return y}filter(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=[];for(let I=0;I<s;++I){const N=M(o[I]);oe(e,c,[N,I,this])&&Mi(l,N)}const y=Rt(o,P),v=new y(l);return Lt(v),v}reduce(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(zr);let c,l;i.length===0?(c=M(o[0]),l=1):(c=i[0],l=0);for(let y=l;y<s;++y)c=e(c,M(o[y]),y,this);return c}reduceRight(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(zr);let c,l;i.length===0?(c=M(o[s-1]),l=s-2):(c=i[0],l=s-1);for(let y=l;y>=0;--y)c=e(c,M(o[y]),y,this);return c}forEach(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)oe(e,c,[M(o[l]),l,this])}find(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}findLast(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findLastIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}every(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(!oe(e,c,[M(o[l]),l,this]))return!1;return!0}some(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(oe(e,c,[M(o[l]),l,this]))return!0;return!1}set(e,...i){L(this);const o=O(this),s=Ce(i[0]);if(s<0)throw tr(Kt);if(e==null)throw Y(ar);if(fr(e))throw Y(cr);if(Ye(e))return qi(O(this),O(e),s);if(zt(e)){const v=Q(e);if(ft(v))throw Y(ht)}const c=F(o),l=Je(e),y=rr(l.length);if(s===1/0||y+s>c)throw tr(Kt);for(let v=0;v<y;++v)o[v+s]=Ee(l[v])}reverse(){L(this);const e=O(this);return Wr(e),this}toReversed(){L(this);const e=O(this),i=new le(Q(e),Be(e),F(e)),o=new P(Q(st(i))),s=O(o);return Wr(s),o}fill(e,...i){L(this);const o=O(this);return Ji(o,Ee(e),...ut(i)),this}copyWithin(e,i,...o){L(this);const s=O(this);return $i(s,e,i,...ut(o)),this}sort(e){L(this);const i=O(this),o=e!==void 0?e:Qr;return Xr(i,(s,c)=>o(M(s),M(c))),this}toSorted(e){L(this);const i=O(this);if(e!==void 0&&typeof e!="function")throw new Y(Ui);const o=e!==void 0?e:Qr,s=new le(Q(i),Be(i),F(i)),c=new P(Q(st(s))),l=O(c);return Xr(l,(y,v)=>o(M(y),M(v))),c}slice(e,i){L(this);const o=O(this),s=Rt(o,P);if(s===P){const Ze=new le(Q(o),Be(o),F(o));return new P(Q(st(Ze,e,i)))}const c=F(o),l=Ce(e),y=i===void 0?c:Ce(i);let v;l===-1/0?v=0:l<0?v=c+l>0?c+l:0:v=c<l?c:l;let I;y===-1/0?I=0:y<0?I=c+y>0?c+y:0:I=c<y?c:y;const N=I-v>0?I-v:0,C=new s(N);if(Lt(C,N),N===0)return C;const q=Q(o);if(ft(q))throw Y(ht);let se=0;for(;v<I;)C[se]=M(o[v]),++v,++se;return C}subarray(e,i){L(this);const o=O(this),s=Rt(o,P),c=new le(Q(o),Be(o),F(o)),l=Qi(c,e,i),y=new s(Q(l),Be(l),F(l));return Lt(y),y}indexOf(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return-1;c<0&&(c+=s,c<0&&(c=0));for(let l=c;l<s;++l)if(Re(o,l)&&M(o[l])===e)return l;return-1}lastIndexOf(e,...i){L(this);const o=O(this),s=F(o);let c=i.length>=1?Ce(i[0]):s-1;if(c===-1/0)return-1;c>=0?c=c<s-1?c:s-1:c+=s;for(let l=c;l>=0;--l)if(Re(o,l)&&M(o[l])===e)return l;return-1}includes(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return!1;c<0&&(c+=s,c<0&&(c=0));const l=qe(e);for(let y=c;y<s;++y){const v=M(o[y]);if(l&&qe(v)||v===e)return!0}return!1}join(e){L(this);const i=O(this),o=jr(i);return xi(o,e)}toLocaleString(...e){L(this);const i=O(this),o=jr(i);return Pi(o,...ut(e))}get[dr](){if(Ye(this))return"Float16Array"}}wt(P,"BYTES_PER_ELEMENT",{value:Ir});wt(P,Ht,{});cn(P,Ar);const Zt=P.prototype;wt(Zt,"BYTES_PER_ELEMENT",{value:Ir});wt(Zt,_e,{value:Zt.values,writable:!0,configurable:!0});cn(Zt,j);function Ao(r,e,...i){return M(no(r,e,...ut(i)))}function To(r){return r instanceof Int8Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof P||r instanceof Float32Array||r instanceof Float64Array}class On extends S.Loader{load(e,i,o,s){const c=new tn(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{try{i(this.parseTypedArray(l))}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function _r(r){return class extends On{constructor(){super(...arguments),this.parseTypedArray=r}}}function go(r){return new(_r(r))}function So(r){const e=r instanceof Int8Array?S.ByteType:r instanceof Uint8Array||r instanceof Uint8ClampedArray?S.UnsignedByteType:r instanceof Int16Array?S.ShortType:r instanceof Uint16Array?S.UnsignedShortType:r instanceof Int32Array?S.IntType:r instanceof Uint32Array?S.UnsignedIntType:r instanceof P?S.HalfFloatType:r instanceof Float32Array||r instanceof Float64Array?S.FloatType:null;return en(e!=null),e}const Eo={format:S.RGBAFormat,minFilter:S.LinearFilter,magFilter:S.LinearFilter};class mn extends S.Loader{constructor(){super(...arguments),this.parameters={}}load(e,i,o,s){const c=new this.Texture,l=new this.TypedArrayLoader(this.manager);l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),l.load(e,y=>{c.image.data=y instanceof P?new Uint16Array(y.buffer):y;const{width:v,height:I,depth:N,...C}=this.parameters;v!=null&&(c.image.width=v),I!=null&&(c.image.height=I),"depth"in c.image&&N!=null&&(c.image.depth=N),c.type=So(y),Object.assign(c,C),c.needsUpdate=!0,i(c)},o,s)}}function Cn(r,e,i){return class extends mn{constructor(){super(...arguments),this.Texture=r,this.TypedArrayLoader=_r(e),this.parameters={...Eo,...i}}}}function br(r,e){return Cn(S.Data3DTexture,r,e)}function Rn(r,e){return Cn(S.DataTexture,r,e)}function Io(r,e){return new(br(r,e))}function _o(r,e){return new(Rn(r,e))}const He=S.MathUtils.clamp,bo=S.MathUtils.euclideanModulo,No=S.MathUtils.inverseLerp,Uo=S.MathUtils.lerp,Oo=S.MathUtils.degToRad,mo=S.MathUtils.radToDeg,Co=S.MathUtils.isPowerOfTwo,Ro=S.MathUtils.ceilPowerOfTwo,Lo=S.MathUtils.floorPowerOfTwo,Fo=S.MathUtils.normalize;function xo(r,e,i,o=0,s=1){return S.MathUtils.mapLinear(r,e,i,o,s)}function Mo(r,e,i,o=0,s=1){return He(S.MathUtils.mapLinear(r,e,i,o,s),o,s)}function Po(r,e,i){return i<=r?0:i>=e?1:(i=(i-r)/(e-r),i*i*(3-2*i))}function Do(r){return Math.min(Math.max(r,0),1)}function Bo(r,e,i,o=i){const s=Math.abs(r-e);return s<=o||s<=i*Math.max(Math.abs(r),Math.abs(e))}function zo(r){return(e,i)=>{e instanceof S.Material?Object.defineProperty(e,i,{enumerable:!0,get(){var o;return((o=this.defines)==null?void 0:o[r])!=null},set(o){var s;o!==this[i]&&(o?(this.defines??(this.defines={}),this.defines[r]="1"):(s=this.defines)==null||delete s[r],this.needsUpdate=!0)}}):Object.defineProperty(e,i,{enumerable:!0,get(){return this.defines.has(r)},set(o){o!==this[i]&&(o?this.defines.set(r,"1"):this.defines.delete(r),this.setChanged())}})}}function Ho(r,{min:e=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER}={}){return(o,s)=>{o instanceof S.Material?Object.defineProperty(o,s,{enumerable:!0,get(){var l;const c=(l=this.defines)==null?void 0:l[r];return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines??(this.defines={}),this.defines[r]=He(c,e,i).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(o,s,{enumerable:!0,get(){const c=this.defines.get(r);return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines.set(r,He(c,e,i).toFixed(0)),this.setChanged())}})}}function ko(r,{min:e=-1/0,max:i=1/0,precision:o=7}={}){return(s,c)=>{s instanceof S.Material?Object.defineProperty(s,c,{enumerable:!0,get(){var y;const l=(y=this.defines)==null?void 0:y[r];return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines??(this.defines={}),this.defines[r]=He(l,e,i).toFixed(o),this.needsUpdate=!0)}}):Object.defineProperty(s,c,{enumerable:!0,get(){const l=this.defines.get(r);return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines.set(r,He(l,e,i).toFixed(o)),this.setChanged())}})}}function Zo(r,{validate:e}={}){return(i,o)=>{i instanceof S.Material?Object.defineProperty(i,o,{enumerable:!0,get(){var s;return((s=this.defines)==null?void 0:s[r])??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines??(this.defines={}),this.defines[r]=s,this.needsUpdate=!0}}}):Object.defineProperty(i,o,{enumerable:!0,get(){return this.defines.get(r)??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines.set(r,s),this.setChanged()}}})}}function Go(r,...e){const i={};for(let o=0;o<e.length;o+=2){const s=e[o],c=e[o+1];for(const l of c)i[l]={enumerable:!0,get:()=>s[l],set:y=>{s[l]=y}}}return Object.defineProperties(r,i),r}function Wo(r,e,i){const o={};for(const s of i)o[s]={enumerable:!0,get:()=>e.uniforms[s].value,set:c=>{e.uniforms[s].value=c}};return Object.defineProperties(r,o),r}const Xo=parseInt(S.REVISION.replace(/\D+/g,""));var ve=Uint8Array,xe=Uint16Array,vr=Uint32Array,Ln=new ve([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]),Fn=new ve([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]),Yo=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=function(r,e){for(var i=new xe(31),o=0;o<31;++o)i[o]=e+=1<<r[o-1];for(var s=new vr(i[30]),o=1;o<30;++o)for(var c=i[o];c<i[o+1];++c)s[c]=c-i[o]<<5|o;return[i,s]},Mn=xn(Ln,2),Pn=Mn[0],Vo=Mn[1];Pn[28]=258,Vo[258]=28;var qo=xn(Fn,0),Jo=qo[0],pr=new xe(32768);for(var W=0;W<32768;++W){var Fe=(W&43690)>>>1|(W&21845)<<1;Fe=(Fe&52428)>>>2|(Fe&13107)<<2,Fe=(Fe&61680)>>>4|(Fe&3855)<<4,pr[W]=((Fe&65280)>>>8|(Fe&255)<<8)>>>1}var yt=function(r,e,i){for(var o=r.length,s=0,c=new xe(e);s<o;++s)++c[r[s]-1];var l=new xe(e);for(s=0;s<e;++s)l[s]=l[s-1]+c[s-1]<<1;var y;if(i){y=new xe(1<<e);var v=15-e;for(s=0;s<o;++s)if(r[s])for(var I=s<<4|r[s],N=e-r[s],C=l[r[s]-1]++<<N,q=C|(1<<N)-1;C<=q;++C)y[pr[C]>>>v]=I}else for(y=new xe(o),s=0;s<o;++s)r[s]&&(y[s]=pr[l[r[s]-1]++]>>>15-r[s]);return y},At=new ve(288);for(var W=0;W<144;++W)At[W]=8;for(var W=144;W<256;++W)At[W]=9;for(var W=256;W<280;++W)At[W]=7;for(var W=280;W<288;++W)At[W]=8;var Dn=new ve(32);for(var W=0;W<32;++W)Dn[W]=5;var $o=yt(At,9,1),Qo=yt(Dn,5,1),nr=function(r){for(var e=r[0],i=1;i<r.length;++i)r[i]>e&&(e=r[i]);return e},de=function(r,e,i){var o=e/8|0;return(r[o]|r[o+1]<<8)>>(e&7)&i},ir=function(r,e){var i=e/8|0;return(r[i]|r[i+1]<<8|r[i+2]<<16)>>(e&7)},jo=function(r){return(r/8|0)+(r&7&&1)},Ko=function(r,e,i){(i==null||i>r.length)&&(i=r.length);var o=new(r instanceof xe?xe:r instanceof vr?vr:ve)(i-e);return o.set(r.subarray(e,i)),o},es=function(r,e,i){var o=r.length;if(!o||i&&!i.l&&o<5)return e||new ve(0);var s=!e||i,c=!i||i.i;i||(i={}),e||(e=new ve(o*3));var l=function(D){var Ne=e.length;if(D>Ne){var Ue=new ve(Math.max(Ne*2,D));Ue.set(e),e=Ue}},y=i.f||0,v=i.p||0,I=i.b||0,N=i.l,C=i.d,q=i.m,se=i.n,Ze=o*8;do{if(!N){i.f=y=de(r,v,1);var Tt=de(r,v+1,3);if(v+=3,Tt)if(Tt==1)N=$o,C=Qo,q=9,se=5;else if(Tt==2){var Et=de(r,v,31)+257,qt=de(r,v+10,15)+4,Jt=Et+de(r,v+5,31)+1;v+=14;for(var Ge=new ve(Jt),It=new ve(19),ae=0;ae<qt;++ae)It[Yo[ae]]=de(r,v+ae*3,7);v+=qt*3;for(var _t=nr(It),$t=(1<<_t)-1,Qt=yt(It,_t,1),ae=0;ae<Jt;){var ue=Qt[de(r,v,$t)];v+=ue&15;var pe=ue>>>4;if(pe<16)Ge[ae++]=pe;else{var be=0,Te=0;for(pe==16?(Te=3+de(r,v,3),v+=2,be=Ge[ae-1]):pe==17?(Te=3+de(r,v,7),v+=3):pe==18&&(Te=11+de(r,v,127),v+=7);Te--;)Ge[ae++]=be}}var bt=Ge.subarray(0,Et),ge=Ge.subarray(Et);q=nr(bt),se=nr(ge),N=yt(bt,q,1),C=yt(ge,se,1)}else throw"invalid block type";else{var pe=jo(v)+4,gt=r[pe-4]|r[pe-3]<<8,St=pe+gt;if(St>o){if(c)throw"unexpected EOF";break}s&&l(I+gt),e.set(r.subarray(pe,St),I),i.b=I+=gt,i.p=v=St*8;continue}if(v>Ze){if(c)throw"unexpected EOF";break}}s&&l(I+131072);for(var Nt=(1<<q)-1,Ut=(1<<se)-1,Ke=v;;Ke=v){var be=N[ir(r,v)&Nt],te=be>>>4;if(v+=be&15,v>Ze){if(c)throw"unexpected EOF";break}if(!be)throw"invalid length/literal";if(te<256)e[I++]=te;else if(te==256){Ke=v,N=null;break}else{var We=te-254;if(te>264){var ae=te-257,ne=Ln[ae];We=de(r,v,(1<<ne)-1)+Pn[ae],v+=ne}var Me=C[ir(r,v)&Ut],Pe=Me>>>4;if(!Me)throw"invalid distance";v+=Me&15;var ge=Jo[Pe];if(Pe>3){var ne=Fn[Pe];ge+=ir(r,v)&(1<<ne)-1,v+=ne}if(v>Ze){if(c)throw"unexpected EOF";break}s&&l(I+131072);for(var et=I+We;I<et;I+=4)e[I]=e[I-ge],e[I+1]=e[I+1-ge],e[I+2]=e[I+2-ge],e[I+3]=e[I+3-ge];I=et}}i.l=N,i.p=Ke,i.b=I,N&&(y=1,i.m=q,i.d=C,i.n=se)}while(!y);return I==e.length?e:Ko(e,0,I)},ts=new ve(0),rs=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Ft(r,e){return es((rs(r),r.subarray(2,-4)),e)}var ns=typeof TextDecoder<"u"&&new TextDecoder,is=0;try{ns.decode(ts,{stream:!0}),is=1}catch{}const at=Xo>=152;class os extends S.DataTextureLoader{constructor(e){super(e),this.type=S.HalfFloatType}parse(e){const _t=Math.pow(2.7182818,2.2);function $t(t,n){for(var a=0,u=0;u<65536;++u)(u==0||t[u>>3]&1<<(u&7))&&(n[a++]=u);for(var h=a-1;a<65536;)n[a++]=0;return h}function Qt(t){for(var n=0;n<16384;n++)t[n]={},t[n].len=0,t[n].lit=0,t[n].p=null}const ue={l:0,c:0,lc:0};function be(t,n,a,u,h){for(;a<t;)n=n<<8|xr(u,h),a+=8;a-=t,ue.l=n>>a&(1<<t)-1,ue.c=n,ue.lc=a}const Te=new Array(59);function bt(t){for(var n=0;n<=58;++n)Te[n]=0;for(var n=0;n<65537;++n)Te[t[n]]+=1;for(var a=0,n=58;n>0;--n){var u=a+Te[n]>>1;Te[n]=a,a=u}for(var n=0;n<65537;++n){var h=t[n];h>0&&(t[n]=h|Te[h]++<<6)}}function ge(t,n,a,u,h,f,d){for(var p=a,T=0,A=0;h<=f;h++){if(p.value-a.value>u)return!1;be(6,T,A,t,p);var g=ue.l;if(T=ue.c,A=ue.lc,d[h]=g,g==63){if(p.value-a.value>u)throw"Something wrong with hufUnpackEncTable";be(8,T,A,t,p);var w=ue.l+6;if(T=ue.c,A=ue.lc,h+w>f+1)throw"Something wrong with hufUnpackEncTable";for(;w--;)d[h++]=0;h--}else if(g>=59){var w=g-59+2;if(h+w>f+1)throw"Something wrong with hufUnpackEncTable";for(;w--;)d[h++]=0;h--}}bt(d)}function Nt(t){return t&63}function Ut(t){return t>>6}function Ke(t,n,a,u){for(;n<=a;n++){var h=Ut(t[n]),f=Nt(t[n]);if(h>>f)throw"Invalid table entry";if(f>14){var d=u[h>>f-14];if(d.len)throw"Invalid table entry";if(d.lit++,d.p){var p=d.p;d.p=new Array(d.lit);for(var T=0;T<d.lit-1;++T)d.p[T]=p[T]}else d.p=new Array(1);d.p[d.lit-1]=n}else if(f)for(var A=0,T=1<<14-f;T>0;T--){var d=u[(h<<14-f)+A];if(d.len||d.p)throw"Invalid table entry";d.len=f,d.lit=n,A++}}return!0}const te={c:0,lc:0};function We(t,n,a,u){t=t<<8|xr(a,u),n+=8,te.c=t,te.lc=n}const ne={c:0,lc:0};function Me(t,n,a,u,h,f,d,p,T,A){if(t==n){u<8&&(We(a,u,h,d),a=te.c,u=te.lc),u-=8;var g=a>>u,g=new Uint8Array([g])[0];if(T.value+g>A)return!1;for(var w=p[T.value-1];g-- >0;)p[T.value++]=w}else if(T.value<A)p[T.value++]=t;else return!1;ne.c=a,ne.lc=u}function Pe(t){return t&65535}function et(t){var n=Pe(t);return n>32767?n-65536:n}const D={a:0,b:0};function Ne(t,n){var a=et(t),u=et(n),h=u,f=a+(h&1)+(h>>1),d=f,p=f-h;D.a=d,D.b=p}function Ue(t,n){var a=Pe(t),u=Pe(n),h=a-(u>>1)&65535,f=u+h-32768&65535;D.a=f,D.b=h}function kn(t,n,a,u,h,f,d){for(var p=d<16384,T=a>h?h:a,A=1,g;A<=T;)A<<=1;for(A>>=1,g=A,A>>=1;A>=1;){for(var w=0,V=w+f*(h-g),_=f*A,b=f*g,U=u*A,m=u*g,B,H,J,re;w<=V;w+=b){for(var k=w,Se=w+u*(a-g);k<=Se;k+=m){var G=k+U,$=k+_,Oe=$+U;p?(Ne(t[k+n],t[$+n]),B=D.a,J=D.b,Ne(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ne(B,H),t[k+n]=D.a,t[G+n]=D.b,Ne(J,re),t[$+n]=D.a,t[Oe+n]=D.b):(Ue(t[k+n],t[$+n]),B=D.a,J=D.b,Ue(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ue(B,H),t[k+n]=D.a,t[G+n]=D.b,Ue(J,re),t[$+n]=D.a,t[Oe+n]=D.b)}if(a&A){var $=k+_;p?Ne(t[k+n],t[$+n]):Ue(t[k+n],t[$+n]),B=D.a,t[$+n]=D.b,t[k+n]=B}}if(h&A)for(var k=w,Se=w+u*(a-g);k<=Se;k+=m){var G=k+U;p?Ne(t[k+n],t[G+n]):Ue(t[k+n],t[G+n]),B=D.a,t[G+n]=D.b,t[k+n]=B}g=A,A>>=1}return w}function Zn(t,n,a,u,h,f,d,p,T,A){for(var g=0,w=0,V=p,_=Math.trunc(h.value+(f+7)/8);h.value<_;)for(We(g,w,a,h),g=te.c,w=te.lc;w>=14;){var b=g>>w-14&16383,U=n[b];if(U.len)w-=U.len,Me(U.lit,d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;else{if(!U.p)throw"hufDecode issues";var m;for(m=0;m<U.lit;m++){for(var B=Nt(t[U.p[m]]);w<B&&h.value<_;)We(g,w,a,h),g=te.c,w=te.lc;if(w>=B&&Ut(t[U.p[m]])==(g>>w-B&(1<<B)-1)){w-=B,Me(U.p[m],d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;break}}if(m==U.lit)throw"hufDecode issues"}}var H=8-f&7;for(g>>=H,w-=H;w>0;){var U=n[g<<14-w&16383];if(U.len)w-=U.len,Me(U.lit,d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;else throw"hufDecode issues"}return!0}function Or(t,n,a,u,h,f){var d={value:0},p=a.value,T=ie(n,a),A=ie(n,a);a.value+=4;var g=ie(n,a);if(a.value+=4,T<0||T>=65537||A<0||A>=65537)throw"Something wrong with HUF_ENCSIZE";var w=new Array(65537),V=new Array(16384);Qt(V);var _=u-(a.value-p);if(ge(t,n,a,_,T,A,w),g>8*(u-(a.value-p)))throw"Something wrong with hufUncompress";Ke(w,T,A,V),Zn(w,V,t,n,a,g,A,f,h,d)}function Gn(t,n,a){for(var u=0;u<a;++u)n[u]=t[n[u]]}function mr(t){for(var n=1;n<t.length;n++){var a=t[n-1]+t[n]-128;t[n]=a}}function Cr(t,n){for(var a=0,u=Math.floor((t.length+1)/2),h=0,f=t.length-1;!(h>f||(n[h++]=t[a++],h>f));)n[h++]=t[u++]}function Rr(t){for(var n=t.byteLength,a=new Array,u=0,h=new DataView(t);n>0;){var f=h.getInt8(u++);if(f<0){var d=-f;n-=d+1;for(var p=0;p<d;p++)a.push(h.getUint8(u++))}else{var d=f;n-=2;for(var T=h.getUint8(u++),p=0;p<d+1;p++)a.push(T)}}return a}function Wn(t,n,a,u,h,f){var G=new DataView(f.buffer),d=a[t.idx[0]].width,p=a[t.idx[0]].height,T=3,A=Math.floor(d/8),g=Math.ceil(d/8),w=Math.ceil(p/8),V=d-(g-1)*8,_=p-(w-1)*8,b={value:0},U=new Array(T),m=new Array(T),B=new Array(T),H=new Array(T),J=new Array(T);for(let z=0;z<T;++z)J[z]=n[t.idx[z]],U[z]=z<1?0:U[z-1]+g*w,m[z]=new Float32Array(64),B[z]=new Uint16Array(64),H[z]=new Uint16Array(g*64);for(let z=0;z<w;++z){var re=8;z==w-1&&(re=_);var k=8;for(let X=0;X<g;++X){X==g-1&&(k=V);for(let x=0;x<T;++x)B[x].fill(0),B[x][0]=h[U[x]++],Xn(b,u,B[x]),Yn(B[x],m[x]),Vn(m[x]);qn(m);for(let x=0;x<T;++x)Jn(m[x],H[x],X*64)}let ee=0;for(let X=0;X<T;++X){const x=a[t.idx[X]].type;for(let ye=8*z;ye<8*z+re;++ye){ee=J[X][ye];for(let De=0;De<A;++De){const ce=De*64+(ye&7)*8;G.setUint16(ee+0*2*x,H[X][ce+0],!0),G.setUint16(ee+1*2*x,H[X][ce+1],!0),G.setUint16(ee+2*2*x,H[X][ce+2],!0),G.setUint16(ee+3*2*x,H[X][ce+3],!0),G.setUint16(ee+4*2*x,H[X][ce+4],!0),G.setUint16(ee+5*2*x,H[X][ce+5],!0),G.setUint16(ee+6*2*x,H[X][ce+6],!0),G.setUint16(ee+7*2*x,H[X][ce+7],!0),ee+=8*2*x}}if(A!=g)for(let ye=8*z;ye<8*z+re;++ye){const De=J[X][ye]+8*A*2*x,ce=A*64+(ye&7)*8;for(let Le=0;Le<k;++Le)G.setUint16(De+Le*2*x,H[X][ce+Le],!0)}}}for(var Se=new Uint16Array(d),G=new DataView(f.buffer),$=0;$<T;++$){a[t.idx[$]].decoded=!0;var Oe=a[t.idx[$]].type;if(a[$].type==2)for(var ot=0;ot<p;++ot){const z=J[$][ot];for(var fe=0;fe<d;++fe)Se[fe]=G.getUint16(z+fe*2*Oe,!0);for(var fe=0;fe<d;++fe)G.setFloat32(z+fe*2*Oe,E(Se[fe]),!0)}}}function Xn(t,n,a){for(var u,h=1;h<64;)u=n[t.value],u==65280?h=64:u>>8==255?h+=u&255:(a[h]=u,h++),t.value++}function Yn(t,n){n[0]=E(t[0]),n[1]=E(t[1]),n[2]=E(t[5]),n[3]=E(t[6]),n[4]=E(t[14]),n[5]=E(t[15]),n[6]=E(t[27]),n[7]=E(t[28]),n[8]=E(t[2]),n[9]=E(t[4]),n[10]=E(t[7]),n[11]=E(t[13]),n[12]=E(t[16]),n[13]=E(t[26]),n[14]=E(t[29]),n[15]=E(t[42]),n[16]=E(t[3]),n[17]=E(t[8]),n[18]=E(t[12]),n[19]=E(t[17]),n[20]=E(t[25]),n[21]=E(t[30]),n[22]=E(t[41]),n[23]=E(t[43]),n[24]=E(t[9]),n[25]=E(t[11]),n[26]=E(t[18]),n[27]=E(t[24]),n[28]=E(t[31]),n[29]=E(t[40]),n[30]=E(t[44]),n[31]=E(t[53]),n[32]=E(t[10]),n[33]=E(t[19]),n[34]=E(t[23]),n[35]=E(t[32]),n[36]=E(t[39]),n[37]=E(t[45]),n[38]=E(t[52]),n[39]=E(t[54]),n[40]=E(t[20]),n[41]=E(t[22]),n[42]=E(t[33]),n[43]=E(t[38]),n[44]=E(t[46]),n[45]=E(t[51]),n[46]=E(t[55]),n[47]=E(t[60]),n[48]=E(t[21]),n[49]=E(t[34]),n[50]=E(t[37]),n[51]=E(t[47]),n[52]=E(t[50]),n[53]=E(t[56]),n[54]=E(t[59]),n[55]=E(t[61]),n[56]=E(t[35]),n[57]=E(t[36]),n[58]=E(t[48]),n[59]=E(t[49]),n[60]=E(t[57]),n[61]=E(t[58]),n[62]=E(t[62]),n[63]=E(t[63])}function Vn(t){const n=.5*Math.cos(.7853975),a=.5*Math.cos(3.14159/16),u=.5*Math.cos(3.14159/8),h=.5*Math.cos(3*3.14159/16),f=.5*Math.cos(5*3.14159/16),d=.5*Math.cos(3*3.14159/8),p=.5*Math.cos(7*3.14159/16);for(var T=new Array(4),A=new Array(4),g=new Array(4),w=new Array(4),V=0;V<8;++V){var _=V*8;T[0]=u*t[_+2],T[1]=d*t[_+2],T[2]=u*t[_+6],T[3]=d*t[_+6],A[0]=a*t[_+1]+h*t[_+3]+f*t[_+5]+p*t[_+7],A[1]=h*t[_+1]-p*t[_+3]-a*t[_+5]-f*t[_+7],A[2]=f*t[_+1]-a*t[_+3]+p*t[_+5]+h*t[_+7],A[3]=p*t[_+1]-f*t[_+3]+h*t[_+5]-a*t[_+7],g[0]=n*(t[_+0]+t[_+4]),g[3]=n*(t[_+0]-t[_+4]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],w[0]=g[0]+g[1],w[1]=g[3]+g[2],w[2]=g[3]-g[2],w[3]=g[0]-g[1],t[_+0]=w[0]+A[0],t[_+1]=w[1]+A[1],t[_+2]=w[2]+A[2],t[_+3]=w[3]+A[3],t[_+4]=w[3]-A[3],t[_+5]=w[2]-A[2],t[_+6]=w[1]-A[1],t[_+7]=w[0]-A[0]}for(var b=0;b<8;++b)T[0]=u*t[16+b],T[1]=d*t[16+b],T[2]=u*t[48+b],T[3]=d*t[48+b],A[0]=a*t[8+b]+h*t[24+b]+f*t[40+b]+p*t[56+b],A[1]=h*t[8+b]-p*t[24+b]-a*t[40+b]-f*t[56+b],A[2]=f*t[8+b]-a*t[24+b]+p*t[40+b]+h*t[56+b],A[3]=p*t[8+b]-f*t[24+b]+h*t[40+b]-a*t[56+b],g[0]=n*(t[b]+t[32+b]),g[3]=n*(t[b]-t[32+b]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],w[0]=g[0]+g[1],w[1]=g[3]+g[2],w[2]=g[3]-g[2],w[3]=g[0]-g[1],t[0+b]=w[0]+A[0],t[8+b]=w[1]+A[1],t[16+b]=w[2]+A[2],t[24+b]=w[3]+A[3],t[32+b]=w[3]-A[3],t[40+b]=w[2]-A[2],t[48+b]=w[1]-A[1],t[56+b]=w[0]-A[0]}function qn(t){for(var n=0;n<64;++n){var a=t[0][n],u=t[1][n],h=t[2][n];t[0][n]=a+1.5747*h,t[1][n]=a-.1873*u-.4682*h,t[2][n]=a+1.8556*u}}function Jn(t,n,a){for(var u=0;u<64;++u)n[a+u]=S.DataUtils.toHalfFloat($n(t[u]))}function $n(t){return t<=1?Math.sign(t)*Math.pow(Math.abs(t),2.2):Math.sign(t)*Math.pow(_t,Math.abs(t)-1)}function Lr(t){return new DataView(t.array.buffer,t.offset.value,t.size)}function Qn(t){var n=t.viewer.buffer.slice(t.offset.value,t.offset.value+t.size),a=new Uint8Array(Rr(n)),u=new Uint8Array(a.length);return mr(a),Cr(a,u),new DataView(u.buffer)}function jt(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Ft(n),u=new Uint8Array(a.length);return mr(a),Cr(a,u),new DataView(u.buffer)}function jn(t){for(var n=t.viewer,a={value:t.offset.value},u=new Uint16Array(t.width*t.scanlineBlockSize*(t.channels*t.type)),h=new Uint8Array(8192),f=0,d=new Array(t.channels),p=0;p<t.channels;p++)d[p]={},d[p].start=f,d[p].end=d[p].start,d[p].nx=t.width,d[p].ny=t.lines,d[p].size=t.type,f+=d[p].nx*d[p].ny*d[p].size;var T=rt(n,a),A=rt(n,a);if(A>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(T<=A)for(var p=0;p<A-T+1;p++)h[p+T]=Xe(n,a);var g=new Uint16Array(65536),w=$t(h,g),V=ie(n,a);Or(t.array,n,a,V,u,f);for(var p=0;p<t.channels;++p)for(var _=d[p],b=0;b<d[p].size;++b)kn(u,_.start+b,_.nx,_.size,_.ny,_.nx*_.size,w);Gn(g,u,f);for(var U=0,m=new Uint8Array(u.buffer.byteLength),B=0;B<t.lines;B++)for(var H=0;H<t.channels;H++){var _=d[H],J=_.nx*_.size,re=new Uint8Array(u.buffer,_.end*2,J*2);m.set(re,U),U+=J*2,_.end+=J}return new DataView(m.buffer)}function Kn(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Ft(n);const u=t.lines*t.channels*t.width,h=t.type==1?new Uint16Array(u):new Uint32Array(u);let f=0,d=0;const p=new Array(4);for(let T=0;T<t.lines;T++)for(let A=0;A<t.channels;A++){let g=0;switch(t.type){case 1:p[0]=f,p[1]=p[0]+t.width,f=p[1]+t.width;for(let w=0;w<t.width;++w){const V=a[p[0]++]<<8|a[p[1]++];g+=V,h[d]=g,d++}break;case 2:p[0]=f,p[1]=p[0]+t.width,p[2]=p[1]+t.width,f=p[2]+t.width;for(let w=0;w<t.width;++w){const V=a[p[0]++]<<24|a[p[1]++]<<16|a[p[2]++]<<8;g+=V,h[d]=g,d++}break}}return new DataView(h.buffer)}function Fr(t){var n=t.viewer,a={value:t.offset.value},u=new Uint8Array(t.width*t.lines*(t.channels*t.type*2)),h={version:he(n,a),unknownUncompressedSize:he(n,a),unknownCompressedSize:he(n,a),acCompressedSize:he(n,a),dcCompressedSize:he(n,a),rleCompressedSize:he(n,a),rleUncompressedSize:he(n,a),rleRawSize:he(n,a),totalAcUncompressedCount:he(n,a),totalDcUncompressedCount:he(n,a),acCompression:he(n,a)};if(h.version<2)throw"EXRLoader.parse: "+it.compression+" version "+h.version+" is unsupported";for(var f=new Array,d=rt(n,a)-2;d>0;){var p=Ot(n.buffer,a),T=Xe(n,a),A=T>>2&3,g=(T>>4)-1,w=new Int8Array([g])[0],V=Xe(n,a);f.push({name:p,index:w,type:V,compression:A}),d-=p.length+3}for(var _=it.channels,b=new Array(t.channels),U=0;U<t.channels;++U){var m=b[U]={},B=_[U];m.name=B.name,m.compression=0,m.decoded=!1,m.type=B.pixelType,m.pLinear=B.pLinear,m.width=t.width,m.height=t.lines}for(var H={idx:new Array(3)},J=0;J<t.channels;++J)for(var m=b[J],U=0;U<f.length;++U){var re=f[U];m.name==re.name&&(m.compression=re.compression,re.index>=0&&(H.idx[re.index]=J),m.offset=J)}if(h.acCompressedSize>0)switch(h.acCompression){case 0:var G=new Uint16Array(h.totalAcUncompressedCount);Or(t.array,n,a,h.acCompressedSize,G,h.totalAcUncompressedCount);break;case 1:var k=t.array.slice(a.value,a.value+h.totalAcUncompressedCount),Se=Ft(k),G=new Uint16Array(Se.buffer);a.value+=h.totalAcUncompressedCount;break}if(h.dcCompressedSize>0){var $={array:t.array,offset:a,size:h.dcCompressedSize},Oe=new Uint16Array(jt($).buffer);a.value+=h.dcCompressedSize}if(h.rleRawSize>0){var k=t.array.slice(a.value,a.value+h.rleCompressedSize),Se=Ft(k),ot=Rr(Se.buffer);a.value+=h.rleCompressedSize}for(var fe=0,z=new Array(b.length),U=0;U<z.length;++U)z[U]=new Array;for(var ee=0;ee<t.lines;++ee)for(var X=0;X<b.length;++X)z[X].push(fe),fe+=b[X].width*t.type*2;Wn(H,z,b,G,Oe,u);for(var U=0;U<b.length;++U){var m=b[U];if(!m.decoded)switch(m.compression){case 2:for(var x=0,ye=0,ee=0;ee<t.lines;++ee){for(var De=z[U][x],ce=0;ce<m.width;++ce){for(var Le=0;Le<2*m.type;++Le)u[De++]=ot[ye+Le*m.width*m.height];ye++}x++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(u.buffer)}function Ot(t,n){for(var a=new Uint8Array(t),u=0;a[n.value+u]!=0;)u+=1;var h=new TextDecoder().decode(a.slice(n.value,n.value+u));return n.value=n.value+u+1,h}function ei(t,n,a){var u=new TextDecoder().decode(new Uint8Array(t).slice(n.value,n.value+a));return n.value=n.value+a,u}function ti(t,n){var a=tt(t,n),u=ie(t,n);return[a,u]}function ri(t,n){var a=ie(t,n),u=ie(t,n);return[a,u]}function tt(t,n){var a=t.getInt32(n.value,!0);return n.value=n.value+4,a}function ie(t,n){var a=t.getUint32(n.value,!0);return n.value=n.value+4,a}function xr(t,n){var a=t[n.value];return n.value=n.value+1,a}function Xe(t,n){var a=t.getUint8(n.value);return n.value=n.value+1,a}const he=function(t,n){let a;return"getBigInt64"in DataView.prototype?a=Number(t.getBigInt64(n.value,!0)):a=t.getUint32(n.value+4,!0)+Number(t.getUint32(n.value,!0)<<32),n.value+=8,a};function K(t,n){var a=t.getFloat32(n.value,!0);return n.value+=4,a}function ni(t,n){return S.DataUtils.toHalfFloat(K(t,n))}function E(t){var n=(t&31744)>>10,a=t&1023;return(t>>15?-1:1)*(n?n===31?a?NaN:1/0:Math.pow(2,n-15)*(1+a/1024):6103515625e-14*(a/1024))}function rt(t,n){var a=t.getUint16(n.value,!0);return n.value+=2,a}function ii(t,n){return E(rt(t,n))}function oi(t,n,a,u){for(var h=a.value,f=[];a.value<h+u-1;){var d=Ot(n,a),p=tt(t,a),T=Xe(t,a);a.value+=3;var A=tt(t,a),g=tt(t,a);f.push({name:d,pixelType:p,pLinear:T,xSampling:A,ySampling:g})}return a.value+=1,f}function si(t,n){var a=K(t,n),u=K(t,n),h=K(t,n),f=K(t,n),d=K(t,n),p=K(t,n),T=K(t,n),A=K(t,n);return{redX:a,redY:u,greenX:h,greenY:f,blueX:d,blueY:p,whiteX:T,whiteY:A}}function ai(t,n){var a=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],u=Xe(t,n);return a[u]}function ci(t,n){var a=ie(t,n),u=ie(t,n),h=ie(t,n),f=ie(t,n);return{xMin:a,yMin:u,xMax:h,yMax:f}}function li(t,n){var a=["INCREASING_Y"],u=Xe(t,n);return a[u]}function ui(t,n){var a=K(t,n),u=K(t,n);return[a,u]}function hi(t,n){var a=K(t,n),u=K(t,n),h=K(t,n);return[a,u,h]}function fi(t,n,a,u,h){if(u==="string"||u==="stringvector"||u==="iccProfile")return ei(n,a,h);if(u==="chlist")return oi(t,n,a,h);if(u==="chromaticities")return si(t,a);if(u==="compression")return ai(t,a);if(u==="box2i")return ci(t,a);if(u==="lineOrder")return li(t,a);if(u==="float")return K(t,a);if(u==="v2f")return ui(t,a);if(u==="v3f")return hi(t,a);if(u==="int")return tt(t,a);if(u==="rational")return ti(t,a);if(u==="timecode")return ri(t,a);if(u==="preview")return a.value+=h,"skipped";a.value+=h}function yi(t,n,a){const u={};if(t.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";u.version=t.getUint8(4);const h=t.getUint8(5);u.spec={singleTile:!!(h&2),longName:!!(h&4),deepFormat:!!(h&8),multiPart:!!(h&16)},a.value=8;for(var f=!0;f;){var d=Ot(n,a);if(d==0)f=!1;else{var p=Ot(n,a),T=ie(t,a),A=fi(t,n,a,p,T);A===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${p}'.`):u[d]=A}}if((h&-5)!=0)throw console.error("EXRHeader:",u),"THREE.EXRLoader: provided file is currently unsupported.";return u}function vi(t,n,a,u,h){const f={size:0,viewer:n,array:a,offset:u,width:t.dataWindow.xMax-t.dataWindow.xMin+1,height:t.dataWindow.yMax-t.dataWindow.yMin+1,channels:t.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:t.channels[0].pixelType,uncompress:null,getter:null,format:null,[at?"colorSpace":"encoding"]:null};switch(t.compression){case"NO_COMPRESSION":f.lines=1,f.uncompress=Lr;break;case"RLE_COMPRESSION":f.lines=1,f.uncompress=Qn;break;case"ZIPS_COMPRESSION":f.lines=1,f.uncompress=jt;break;case"ZIP_COMPRESSION":f.lines=16,f.uncompress=jt;break;case"PIZ_COMPRESSION":f.lines=32,f.uncompress=jn;break;case"PXR24_COMPRESSION":f.lines=16,f.uncompress=Kn;break;case"DWAA_COMPRESSION":f.lines=32,f.uncompress=Fr;break;case"DWAB_COMPRESSION":f.lines=256,f.uncompress=Fr;break;default:throw"EXRLoader.parse: "+t.compression+" is unsupported"}if(f.scanlineBlockSize=f.lines,f.type==1)switch(h){case S.FloatType:f.getter=ii,f.inputSize=2;break;case S.HalfFloatType:f.getter=rt,f.inputSize=2;break}else if(f.type==2)switch(h){case S.FloatType:f.getter=K,f.inputSize=4;break;case S.HalfFloatType:f.getter=ni,f.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+f.type+" for "+t.compression+".";f.blockCount=(t.dataWindow.yMax+1)/f.scanlineBlockSize;for(var d=0;d<f.blockCount;d++)he(n,u);f.outputChannels=f.channels==3?4:f.channels;const p=f.width*f.height*f.outputChannels;switch(h){case S.FloatType:f.byteArray=new Float32Array(p),f.channels<f.outputChannels&&f.byteArray.fill(1,0,p);break;case S.HalfFloatType:f.byteArray=new Uint16Array(p),f.channels<f.outputChannels&&f.byteArray.fill(15360,0,p);break;default:console.error("THREE.EXRLoader: unsupported type: ",h);break}return f.bytesPerLine=f.width*f.inputSize*f.channels,f.outputChannels==4?f.format=S.RGBAFormat:f.format=S.RedFormat,at?f.colorSpace="srgb-linear":f.encoding=3e3,f}const mt=new DataView(e),pi=new Uint8Array(e),nt={value:0},it=yi(mt,e,nt),R=vi(it,mt,pi,nt,this.type),Mr={value:0},di={R:0,G:1,B:2,A:3,Y:0};for(let t=0;t<R.height/R.scanlineBlockSize;t++){const n=ie(mt,nt);R.size=ie(mt,nt),R.lines=n+R.scanlineBlockSize>R.height?R.height-n:R.scanlineBlockSize;const u=R.size<R.lines*R.bytesPerLine?R.uncompress(R):Lr(R);nt.value+=R.size;for(let h=0;h<R.scanlineBlockSize;h++){const f=h+t*R.scanlineBlockSize;if(f>=R.height)break;for(let d=0;d<R.channels;d++){const p=di[it.channels[d].name];for(let T=0;T<R.width;T++){Mr.value=(h*(R.channels*R.width)+d*R.width+T)*R.inputSize;const A=(R.height-1-f)*(R.width*R.outputChannels)+T*R.outputChannels+p;R.byteArray[A]=R.getter(u,Mr)}}}}return{header:it,width:R.width,height:R.height,data:R.byteArray,format:R.format,[at?"colorSpace":"encoding"]:R[at?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,i,o,s){function c(l,y){at?l.colorSpace=y.colorSpace:l.encoding=y.encoding,l.minFilter=S.LinearFilter,l.magFilter=S.LinearFilter,l.generateMipmaps=!1,l.flipY=!1,i&&i(l,y)}return super.load(e,c,o,s)}}class ss extends S.Loader{setDepth(e){return this.depth=e,this}load(e,i,o,s){const c=new os(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{const{data:y,width:v,height:I}=l.image,N=this.depth??Math.sqrt(I),C=new S.Data3DTexture(y,v,I/N,N);C.type=l.type,C.format=l.format,C.colorSpace=l.colorSpace,C.needsUpdate=!0;try{i(C)}catch(q){s!=null?s(q):console.error(q),this.manager.itemError(e)}},o,s)}}const or=1e-6,xt=new S.Vector3,Mt=new S.Vector3,me=new S.Vector3,ct=new S.Vector3,sr=new S.Vector3,as=new S.Vector3,cs=new S.Matrix4,ls=new S.Quaternion,us=new S.Ray;class Nr{constructor(e=0,i=0,o=0,s=0){this.distance=e,this.heading=i,this.pitch=o,this.roll=s}get distance(){return this._distance}set distance(e){this._distance=Math.max(e,or)}get pitch(){return this._pitch}set pitch(e){this._pitch=He(e,-Math.PI/2+or,Math.PI/2-or)}set(e,i,o,s){return this.distance=e,this.heading=i,this.pitch=o,s!=null&&(this.roll=s),this}clone(){return new Nr(this.distance,this.heading,this.pitch,this.roll)}copy(e){return this.distance=e.distance,this.heading=e.heading,this.pitch=e.pitch,this.roll=e.roll,this}equals(e){return e.distance===this.distance&&e.heading===this.heading&&e.pitch===this.pitch&&e.roll===this.roll}decompose(e,i,o,s,c=Ie.Ellipsoid.WGS84){c.getEastNorthUpVectors(e,xt,Mt,me),s==null||s.copy(me);const l=ct.copy(xt).multiplyScalar(Math.cos(this.heading)).add(sr.copy(Mt).multiplyScalar(Math.sin(this.heading))).multiplyScalar(Math.cos(this.pitch)).add(sr.copy(me).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);if(i.copy(e).sub(l),this.roll!==0){const y=ct.copy(e).sub(i).normalize();me.applyQuaternion(ls.setFromAxisAngle(y,this.roll))}o.setFromRotationMatrix(cs.lookAt(i,e,me))}setFromCamera(e,i=Ie.Ellipsoid.WGS84){const o=ct.setFromMatrixPosition(e.matrixWorld),s=sr.set(0,0,.5).unproject(e).sub(o).normalize(),c=i.getIntersection(us.set(o,s));if(c==null)return;this.distance=o.distanceTo(c),i.getEastNorthUpVectors(c,xt,Mt,me),this.heading=Math.atan2(Mt.dot(s),xt.dot(s)),this.pitch=Math.asin(me.dot(s));const l=ct.copy(e.up).applyQuaternion(e.quaternion),y=as.copy(s).multiplyScalar(-l.dot(s)).add(l).normalize(),v=ct.copy(s).multiplyScalar(-me.dot(s)).add(me).normalize(),I=v.dot(y),N=s.dot(v.cross(y));return this.roll=Math.atan2(N,I),this}}const vt=class vt{constructor(e=0,i=0,o=0,s=0){this.west=e,this.south=i,this.east=o,this.north=s}get width(){let e=this.east;return e<this.west&&(e+=Math.PI*2),e-this.west}get height(){return this.north-this.south}set(e,i,o,s){return this.west=e,this.south=i,this.east=o,this.north=s,this}clone(){return new vt(this.west,this.south,this.east,this.north)}copy(e){return this.west=e.west,this.south=e.south,this.east=e.east,this.north=e.north,this}equals(e){return e.west===this.west&&e.south===this.south&&e.east===this.east&&e.north===this.north}at(e,i,o=new Ie.Geodetic){return o.set(this.west+(this.east-this.west)*e,this.north+(this.south-this.north)*i)}fromArray(e,i=0){return this.west=e[i],this.south=e[i+1],this.east=e[i+2],this.north=e[i+3],this}toArray(e=[],i=0){return e[i]=this.west,e[i+1]=this.south,e[i+2]=this.east,e[i+3]=this.north,e}*[Symbol.iterator](){yield this.west,yield this.south,yield this.east,yield this.north}};vt.MAX=new vt(Ie.Geodetic.MIN_LONGITUDE,Ie.Geodetic.MIN_LATITUDE,Ie.Geodetic.MAX_LONGITUDE,Ie.Geodetic.MAX_LATITUDE);let pt=vt;const hs=/^[ \t]*#include +"([\w\d./]+)"/gm;function Bn(r,e){return r.replace(hs,(i,o)=>{const c=o.split("/").reduce((l,y)=>typeof l!="string"&&l!=null?l[y]:void 0,e);if(typeof c!="string")throw new Error(`Could not find include for ${o}.`);return Bn(c,e)})}let Pt;function fs(){if(Pt!=null)return Pt;const r=new Uint32Array([268435456]);return Pt=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)[0]===0,Pt}function ke(r,e,i,o=!0){if(o===fs())return new e(r);const s=Object.assign(new DataView(r),{getFloat16(l,y){return Ao(this,l,y)}}),c=new e(s.byteLength/e.BYTES_PER_ELEMENT);for(let l=0,y=0;l<c.length;++l,y+=e.BYTES_PER_ELEMENT)c[l]=s[i](y,o);return c}const zn=r=>new Uint8Array(r),ys=r=>new Int8Array(r),vs=(r,e)=>ke(r,Uint16Array,"getUint16",e),ps=(r,e)=>ke(r,Int16Array,"getInt16",e),ds=(r,e)=>ke(r,Int32Array,"getInt32",e),ws=(r,e)=>ke(r,Uint32Array,"getUint32",e),As=(r,e)=>ke(r,P,"getFloat16",e),Ts=(r,e)=>ke(r,Float32Array,"getFloat32",e),gs=(r,e)=>ke(r,Float64Array,"getFloat64",e),Ss=br(zn,{format:S.RedFormat,minFilter:S.NearestFilter,magFilter:S.NearestFilter,wrapS:S.RepeatWrapping,wrapT:S.RepeatWrapping,wrapR:S.RepeatWrapping,width:rn,height:nn,depth:on});function*Hn(r,e,i,o,s){if(i>=o)return;const c=2**i,l=i+1,y=2**l,v=Math.floor(r/c*y),I=Math.floor(e/c*y),N=[[v,I,l],[v+1,I,l],[v,I+1,l],[v+1,I+1,l]];if(l<o)for(const C of N)for(const q of Hn(...C,o,s))yield q;else for(const C of N)yield(s??new $e).set(...C)}class $e{constructor(e=0,i=0,o=0){this.x=e,this.y=i,this.z=o}set(e,i,o){return this.x=e,this.y=i,o!=null&&(this.z=o),this}clone(){return new $e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}getParent(e=new $e){const i=2**this.z,o=this.x/i,s=this.y/i,c=this.z-1,l=2**c;return e.set(Math.floor(o*l),Math.floor(s*l),c)}*traverseChildren(e,i){const{x:o,y:s,z:c}=this;for(const l of Hn(o,s,c,c+e,i))yield l}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Kr=new S.Vector2;class Ur{constructor(e=2,i=1,o=pt.MAX){this.width=e,this.height=i,this.rectangle=o}clone(){return new Ur(this.width,this.height,this.rectangle.clone())}copy(e){return this.width=e.width,this.height=e.height,this.rectangle.copy(e.rectangle),this}getSize(e,i=new S.Vector2){return i.set(this.width<<e,this.height<<e)}getTile(e,i,o=new $e){const s=this.getSize(i,Kr),{rectangle:c}=this,l=c.width/s.x,y=c.height/s.y,{west:v,south:I,east:N}=c;let C=e.longitude;N<v&&(C+=Math.PI*2);let q=Math.floor((C-v)/l);q>=s.x&&(q=s.x-1);let se=Math.floor((e.latitude-I)/y);return se>=s.y&&(se=s.y-1),o.x=q,o.y=se,o.z=i,o}getRectangle(e,i=new pt){const o=this.getSize(e.z,Kr),{rectangle:s}=this,c=s.width/o.x,l=s.height/o.y,{west:y,north:v}=s;return i.west=e.x*c+y,i.east=(e.x+1)*c+y,i.north=v-(o.y-e.y-1)*l,i.south=v-(o.y-e.y)*l,i}}const Es=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Is(r,e,i,o){let s="";for(let c=parseInt(e);c<parseInt(i);++c)s+=o.replace(/\[\s*i\s*\]/g,"["+c+"]").replace(/UNROLLED_LOOP_INDEX/g,`${c}`);return s}function _s(r){return r.replace(Es,Is)}exports.Ellipsoid=Ie.Ellipsoid;exports.EllipsoidGeometry=Ie.EllipsoidGeometry;exports.Geodetic=Ie.Geodetic;exports.ArrayBufferLoader=tn;exports.DEFAULT_STBN_URL=Ei;exports.DataLoader=mn;exports.EXR3DLoader=ss;exports.Float16Array=P;exports.PointOfView=Nr;exports.Rectangle=pt;exports.STBNLoader=Ss;exports.STBN_TEXTURE_DEPTH=on;exports.STBN_TEXTURE_HEIGHT=nn;exports.STBN_TEXTURE_WIDTH=rn;exports.TileCoordinate=$e;exports.TilingScheme=Ur;exports.TypedArrayLoader=On;exports.assertType=Ai;exports.ceilPowerOfTwo=Ro;exports.clamp=He;exports.closeTo=Bo;exports.createData3DTextureLoader=Io;exports.createData3DTextureLoaderClass=br;exports.createDataTextureLoader=_o;exports.createDataTextureLoaderClass=Rn;exports.createTypedArrayLoader=go;exports.createTypedArrayLoaderClass=_r;exports.define=zo;exports.defineExpression=Zo;exports.defineFloat=ko;exports.defineInt=Ho;exports.definePropertyShorthand=Go;exports.defineUniformShorthand=Wo;exports.degrees=mo;exports.euclideanModulo=bo;exports.floorPowerOfTwo=Lo;exports.fromBufferGeometryLike=gi;exports.inverseLerp=No;exports.isPowerOfTwo=Co;exports.isTypedArray=To;exports.lerp=Uo;exports.normalize=Fo;exports.parseFloat16Array=As;exports.parseFloat32Array=Ts;exports.parseFloat64Array=gs;exports.parseInt16Array=ps;exports.parseInt32Array=ds;exports.parseInt8Array=ys;exports.parseUint16Array=vs;exports.parseUint32Array=ws;exports.parseUint8Array=zn;exports.radians=Oo;exports.remap=xo;exports.remapClamped=Mo;exports.resolveIncludes=Bn;exports.saturate=Do;exports.smoothstep=Po;exports.toBufferGeometryLike=Ti;exports.unrollLoops=_s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("three"),ve=require("./shared.cjs");class Kr extends S.Loader{load(e,i,o,s){const c=new S.FileLoader(this.manager);c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{ve.invariant(l instanceof ArrayBuffer);try{i(l)}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function pi(r){}function di(r){var c;const{attributes:e,index:i,boundingBox:o,boundingSphere:s}=r;return[{attributes:e,index:i,boundingBox:o,boundingSphere:s},[...Object.values(r.attributes).map(l=>l.array.buffer),(c=r.index)==null?void 0:c.array.buffer].filter(l=>l!=null)]}function wi(r,e=new S.BufferGeometry){for(const[i,o]of Object.entries(r.attributes))e.setAttribute(i,new S.BufferAttribute(o.array,o.itemSize,o.normalized));if(e.index=r.index!=null?new S.BufferAttribute(r.index.array,r.index.itemSize,r.index.normalized):null,r.boundingBox!=null){const{min:i,max:o}=r.boundingBox;e.boundingBox=new S.Box3(new S.Vector3(i.x,i.y,i.z),new S.Vector3(o.x,o.y,o.z))}if(r.boundingSphere!=null){const{center:i,radius:o}=r.boundingSphere;e.boundingSphere=new S.Sphere(new S.Vector3(i.x,i.y,i.z),o)}return e}const en=128,tn=128,rn=64,Ai="9627216cc50057994c98a2118f3c4a23765d43b9",Ti=`https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${Ai}/packages/core/assets/stbn.bin`,gi="This is not an object",Si="This is not a Float16Array object",Pr="This constructor is not a subclass of Float16Array",nn="The constructor property value is not an object",Ei="Species constructor didn't return TypedArray object",Ii="Derived constructor created TypedArray object which was too small length",ht="Attempting to access detached ArrayBuffer",ar="Cannot convert undefined or null to object",cr="Cannot mix BigInt and other types, use explicit conversions",Dr="@@iterator property is not callable",Br="Reduce of empty array with no initial value",_i="The comparison function must be either a function or undefined",Kt="Offset is out of bounds";function Z(r){return(e,...i)=>oe(r,e,i)}function Qe(r,e){return Z(Ve(r,e).get)}const{apply:oe,construct:lt,defineProperty:zr,get:er,getOwnPropertyDescriptor:Ve,getPrototypeOf:dt,has:lr,ownKeys:on,set:Hr,setPrototypeOf:sn}=Reflect,bi=Proxy,{EPSILON:Ni,MAX_SAFE_INTEGER:kr,isFinite:an,isNaN:qe}=Number,{iterator:_e,species:Ui,toStringTag:dr,for:Oi}=Symbol,Je=Object,{create:Gt,defineProperty:wt,freeze:mi,is:Zr}=Je,ur=Je.prototype,Ci=ur.__lookupGetter__?Z(ur.__lookupGetter__):(r,e)=>{if(r==null)throw Y(ar);let i=Je(r);do{const o=Ve(i,e);if(o!==void 0)return Re(o,"get")?o.get:void 0}while((i=dt(i))!==null)},Re=Je.hasOwn||Z(ur.hasOwnProperty),cn=Array,ln=cn.isArray,Wt=cn.prototype,Ri=Z(Wt.join),Li=Z(Wt.push),Fi=Z(Wt.toLocaleString),wr=Wt[_e],xi=Z(wr),{abs:Mi,trunc:un}=Math,Xt=ArrayBuffer,Pi=Xt.isView,hn=Xt.prototype,Di=Z(hn.slice),Bi=Qe(hn,"byteLength"),hr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null,zi=hr&&Qe(hr.prototype,"byteLength"),Ar=dt(Uint8Array),Hi=Ar.from,j=Ar.prototype,ki=j[_e],Zi=Z(j.keys),Gi=Z(j.values),Wi=Z(j.entries),Xi=Z(j.set),Gr=Z(j.reverse),Yi=Z(j.fill),Vi=Z(j.copyWithin),Wr=Z(j.sort),st=Z(j.slice),qi=Z(j.subarray),Q=Qe(j,"buffer"),Be=Qe(j,"byteOffset"),F=Qe(j,"length"),fn=Qe(j,dr),Ji=Uint8Array,le=Uint16Array,Xr=(...r)=>oe(Hi,le,r),Tr=Uint32Array,$i=Float32Array,ze=dt([][_e]()),Yt=Z(ze.next),Qi=Z(function*(){}().next),ji=dt(ze),Ki=DataView.prototype,eo=Z(Ki.getUint16),Y=TypeError,tr=RangeError,yn=WeakSet,vn=yn.prototype,to=Z(vn.add),ro=Z(vn.has),Vt=WeakMap,gr=Vt.prototype,Dt=Z(gr.get),no=Z(gr.has),Sr=Z(gr.set),pn=new Vt,io=Gt(null,{next:{value:function(){const e=Dt(pn,this);return Yt(e)}},[_e]:{value:function(){return this}}});function ut(r){if(r[_e]===wr&&ze.next===Yt)return r;const e=Gt(io);return Sr(pn,e,xi(r)),e}const dn=new Vt,wn=Gt(ji,{next:{value:function(){const e=Dt(dn,this);return Qi(e)},writable:!0,configurable:!0}});for(const r of on(ze))r!=="next"&&wt(wn,r,Ve(ze,r));function Yr(r){const e=Gt(wn);return Sr(dn,e,r),e}function Bt(r){return r!==null&&typeof r=="object"||typeof r=="function"}function Vr(r){return r!==null&&typeof r=="object"}function zt(r){return fn(r)!==void 0}function fr(r){const e=fn(r);return e==="BigInt64Array"||e==="BigUint64Array"}function oo(r){try{return ln(r)?!1:(Bi(r),!0)}catch{return!1}}function An(r){if(hr===null)return!1;try{return zi(r),!0}catch{return!1}}function so(r){return oo(r)||An(r)}function qr(r){return ln(r)?r[_e]===wr&&ze.next===Yt:!1}function ao(r){return zt(r)?r[_e]===ki&&ze.next===Yt:!1}function Ct(r){if(typeof r!="string")return!1;const e=+r;return r!==e+""||!an(e)?!1:e===un(e)}const Ht=Oi("__Float16Array__");function co(r){if(!Vr(r))return!1;const e=dt(r);if(!Vr(e))return!1;const i=e.constructor;if(i===void 0)return!1;if(!Bt(i))throw Y(nn);return lr(i,Ht)}const yr=1/Ni;function lo(r){return r+yr-yr}const Tn=6103515625e-14,uo=65504,gn=.0009765625,Jr=gn*Tn,ho=gn*yr;function fo(r){const e=+r;if(!an(e)||e===0)return e;const i=e>0?1:-1,o=Mi(e);if(o<Tn)return i*lo(o/Jr)*Jr;const s=(1+ho)*o,c=s-(s-o);return c>uo||qe(c)?i*(1/0):i*c}const Sn=new Xt(4),En=new $i(Sn),In=new Tr(Sn),Ae=new le(512),Te=new Ji(512);for(let r=0;r<256;++r){const e=r-127;e<-24?(Ae[r]=0,Ae[r|256]=32768,Te[r]=24,Te[r|256]=24):e<-14?(Ae[r]=1024>>-e-14,Ae[r|256]=1024>>-e-14|32768,Te[r]=-e-1,Te[r|256]=-e-1):e<=15?(Ae[r]=e+15<<10,Ae[r|256]=e+15<<10|32768,Te[r]=13,Te[r|256]=13):e<128?(Ae[r]=31744,Ae[r|256]=64512,Te[r]=24,Te[r|256]=24):(Ae[r]=31744,Ae[r|256]=64512,Te[r]=13,Te[r|256]=13)}function Ie(r){En[0]=fo(r);const e=In[0],i=e>>23&511;return Ae[i]+((e&8388607)>>Te[i])}const Er=new Tr(2048);for(let r=1;r<1024;++r){let e=r<<13,i=0;for(;(e&8388608)===0;)e<<=1,i-=8388608;e&=-8388609,i+=947912704,Er[r]=e|i}for(let r=1024;r<2048;++r)Er[r]=939524096+(r-1024<<13);const je=new Tr(64);for(let r=1;r<31;++r)je[r]=r<<23;je[31]=1199570944;je[32]=2147483648;for(let r=33;r<63;++r)je[r]=2147483648+(r-32<<23);je[63]=3347054592;const _n=new le(64);for(let r=1;r<64;++r)r!==32&&(_n[r]=1024);function M(r){const e=r>>10;return In[0]=Er[_n[e]+(r&1023)]+je[e],En[0]}function Ce(r){const e=+r;return qe(e)||e===0?0:un(e)}function rr(r){const e=Ce(r);return e<0?0:e<kr?e:kr}function Rt(r,e){if(!Bt(r))throw Y(gi);const i=r.constructor;if(i===void 0)return e;if(!Bt(i))throw Y(nn);const o=i[Ui];return o??e}function ft(r){if(An(r))return!1;try{return Di(r,0,0),!1}catch{}return!0}function $r(r,e){const i=qe(r),o=qe(e);if(i&&o)return 0;if(i)return 1;if(o||r<e)return-1;if(r>e)return 1;if(r===0&&e===0){const s=Zr(r,0),c=Zr(e,0);if(!s&&c)return-1;if(s&&!c)return 1}return 0}const Ir=2,kt=new Vt;function Ye(r){return no(kt,r)||!Pi(r)&&co(r)}function L(r){if(!Ye(r))throw Y(Si)}function Lt(r,e){const i=Ye(r),o=zt(r);if(!i&&!o)throw Y(Ei);if(typeof e=="number"){let s;if(i){const c=O(r);s=F(c)}else s=F(r);if(s<e)throw Y(Ii)}if(fr(r))throw Y(cr)}function O(r){const e=Dt(kt,r);if(e!==void 0){const s=Q(e);if(ft(s))throw Y(ht);return e}const i=r.buffer;if(ft(i))throw Y(ht);const o=lt(P,[i,r.byteOffset,r.length],r.constructor);return Dt(kt,o)}function Qr(r){const e=F(r),i=[];for(let o=0;o<e;++o)i[o]=M(r[o]);return i}const bn=new yn;for(const r of on(j)){if(r===dr)continue;const e=Ve(j,r);Re(e,"get")&&typeof e.get=="function"&&to(bn,e.get)}const yo=mi({get(r,e,i){return Ct(e)&&Re(r,e)?M(er(r,e)):ro(bn,Ci(r,e))?er(r,e):er(r,e,i)},set(r,e,i,o){return Ct(e)&&Re(r,e)?Hr(r,e,Ie(i)):Hr(r,e,i,o)},getOwnPropertyDescriptor(r,e){if(Ct(e)&&Re(r,e)){const i=Ve(r,e);return i.value=M(i.value),i}return Ve(r,e)},defineProperty(r,e,i){return Ct(e)&&Re(r,e)&&Re(i,"value")&&(i.value=Ie(i.value)),zr(r,e,i)}});class P{constructor(e,i,o){let s;if(Ye(e))s=lt(le,[O(e)],new.target);else if(Bt(e)&&!so(e)){let l,y;if(zt(e)){l=e,y=F(e);const v=Q(e);if(ft(v))throw Y(ht);if(fr(e))throw Y(cr);const I=new Xt(y*Ir);s=lt(le,[I],new.target)}else{const v=e[_e];if(v!=null&&typeof v!="function")throw Y(Dr);v!=null?qr(e)?(l=e,y=e.length):(l=[...e],y=l.length):(l=e,y=rr(l.length)),s=lt(le,[y],new.target)}for(let v=0;v<y;++v)s[v]=Ie(l[v])}else s=lt(le,arguments,new.target);const c=new bi(s,yo);return Sr(kt,c,s),c}static from(e,...i){const o=this;if(!lr(o,Ht))throw Y(Pr);if(o===P){if(Ye(e)&&i.length===0){const N=O(e),C=new le(Q(N),Be(N),F(N));return new P(Q(st(C)))}if(i.length===0)return new P(Q(Xr(e,Ie)));const v=i[0],I=i[1];return new P(Q(Xr(e,function(N,...C){return Ie(oe(v,this,[N,...ut(C)]))},I)))}let s,c;const l=e[_e];if(l!=null&&typeof l!="function")throw Y(Dr);if(l!=null)qr(e)?(s=e,c=e.length):ao(e)?(s=e,c=F(e)):(s=[...e],c=s.length);else{if(e==null)throw Y(ar);s=Je(e),c=rr(s.length)}const y=new o(c);if(i.length===0)for(let v=0;v<c;++v)y[v]=s[v];else{const v=i[0],I=i[1];for(let N=0;N<c;++N)y[N]=oe(v,I,[s[N],N])}return y}static of(...e){const i=this;if(!lr(i,Ht))throw Y(Pr);const o=e.length;if(i===P){const c=new P(o),l=O(c);for(let y=0;y<o;++y)l[y]=Ie(e[y]);return c}const s=new i(o);for(let c=0;c<o;++c)s[c]=e[c];return s}keys(){L(this);const e=O(this);return Zi(e)}values(){L(this);const e=O(this);return Yr(function*(){for(const i of Gi(e))yield M(i)}())}entries(){L(this);const e=O(this);return Yr(function*(){for(const[i,o]of Wi(e))yield[i,M(o)]}())}at(e){L(this);const i=O(this),o=F(i),s=Ce(e),c=s>=0?s:o+s;if(!(c<0||c>=o))return M(i[c])}with(e,i){L(this);const o=O(this),s=F(o),c=Ce(e),l=c>=0?c:s+c,y=+i;if(l<0||l>=s)throw tr(Kt);const v=new le(Q(o),Be(o),F(o)),I=new P(Q(st(v))),N=O(I);return N[l]=Ie(y),I}map(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=Rt(o,P);if(l===P){const v=new P(s),I=O(v);for(let N=0;N<s;++N){const C=M(o[N]);I[N]=Ie(oe(e,c,[C,N,this]))}return v}const y=new l(s);Lt(y,s);for(let v=0;v<s;++v){const I=M(o[v]);y[v]=oe(e,c,[I,v,this])}return y}filter(e,...i){L(this);const o=O(this),s=F(o),c=i[0],l=[];for(let I=0;I<s;++I){const N=M(o[I]);oe(e,c,[N,I,this])&&Li(l,N)}const y=Rt(o,P),v=new y(l);return Lt(v),v}reduce(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(Br);let c,l;i.length===0?(c=M(o[0]),l=1):(c=i[0],l=0);for(let y=l;y<s;++y)c=e(c,M(o[y]),y,this);return c}reduceRight(e,...i){L(this);const o=O(this),s=F(o);if(s===0&&i.length===0)throw Y(Br);let c,l;i.length===0?(c=M(o[s-1]),l=s-2):(c=i[0],l=s-1);for(let y=l;y>=0;--y)c=e(c,M(o[y]),y,this);return c}forEach(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)oe(e,c,[M(o[l]),l,this])}find(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}findLast(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return y}}findLastIndex(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=s-1;l>=0;--l){const y=M(o[l]);if(oe(e,c,[y,l,this]))return l}return-1}every(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(!oe(e,c,[M(o[l]),l,this]))return!1;return!0}some(e,...i){L(this);const o=O(this),s=F(o),c=i[0];for(let l=0;l<s;++l)if(oe(e,c,[M(o[l]),l,this]))return!0;return!1}set(e,...i){L(this);const o=O(this),s=Ce(i[0]);if(s<0)throw tr(Kt);if(e==null)throw Y(ar);if(fr(e))throw Y(cr);if(Ye(e))return Xi(O(this),O(e),s);if(zt(e)){const v=Q(e);if(ft(v))throw Y(ht)}const c=F(o),l=Je(e),y=rr(l.length);if(s===1/0||y+s>c)throw tr(Kt);for(let v=0;v<y;++v)o[v+s]=Ie(l[v])}reverse(){L(this);const e=O(this);return Gr(e),this}toReversed(){L(this);const e=O(this),i=new le(Q(e),Be(e),F(e)),o=new P(Q(st(i))),s=O(o);return Gr(s),o}fill(e,...i){L(this);const o=O(this);return Yi(o,Ie(e),...ut(i)),this}copyWithin(e,i,...o){L(this);const s=O(this);return Vi(s,e,i,...ut(o)),this}sort(e){L(this);const i=O(this),o=e!==void 0?e:$r;return Wr(i,(s,c)=>o(M(s),M(c))),this}toSorted(e){L(this);const i=O(this);if(e!==void 0&&typeof e!="function")throw new Y(_i);const o=e!==void 0?e:$r,s=new le(Q(i),Be(i),F(i)),c=new P(Q(st(s))),l=O(c);return Wr(l,(y,v)=>o(M(y),M(v))),c}slice(e,i){L(this);const o=O(this),s=Rt(o,P);if(s===P){const Ze=new le(Q(o),Be(o),F(o));return new P(Q(st(Ze,e,i)))}const c=F(o),l=Ce(e),y=i===void 0?c:Ce(i);let v;l===-1/0?v=0:l<0?v=c+l>0?c+l:0:v=c<l?c:l;let I;y===-1/0?I=0:y<0?I=c+y>0?c+y:0:I=c<y?c:y;const N=I-v>0?I-v:0,C=new s(N);if(Lt(C,N),N===0)return C;const q=Q(o);if(ft(q))throw Y(ht);let se=0;for(;v<I;)C[se]=M(o[v]),++v,++se;return C}subarray(e,i){L(this);const o=O(this),s=Rt(o,P),c=new le(Q(o),Be(o),F(o)),l=qi(c,e,i),y=new s(Q(l),Be(l),F(l));return Lt(y),y}indexOf(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return-1;c<0&&(c+=s,c<0&&(c=0));for(let l=c;l<s;++l)if(Re(o,l)&&M(o[l])===e)return l;return-1}lastIndexOf(e,...i){L(this);const o=O(this),s=F(o);let c=i.length>=1?Ce(i[0]):s-1;if(c===-1/0)return-1;c>=0?c=c<s-1?c:s-1:c+=s;for(let l=c;l>=0;--l)if(Re(o,l)&&M(o[l])===e)return l;return-1}includes(e,...i){L(this);const o=O(this),s=F(o);let c=Ce(i[0]);if(c===1/0)return!1;c<0&&(c+=s,c<0&&(c=0));const l=qe(e);for(let y=c;y<s;++y){const v=M(o[y]);if(l&&qe(v)||v===e)return!0}return!1}join(e){L(this);const i=O(this),o=Qr(i);return Ri(o,e)}toLocaleString(...e){L(this);const i=O(this),o=Qr(i);return Fi(o,...ut(e))}get[dr](){if(Ye(this))return"Float16Array"}}wt(P,"BYTES_PER_ELEMENT",{value:Ir});wt(P,Ht,{});sn(P,Ar);const Zt=P.prototype;wt(Zt,"BYTES_PER_ELEMENT",{value:Ir});wt(Zt,_e,{value:Zt.values,writable:!0,configurable:!0});sn(Zt,j);function vo(r,e,...i){return M(eo(r,e,...ut(i)))}function po(r){return r instanceof Int8Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof P||r instanceof Float32Array||r instanceof Float64Array}class Nn extends S.Loader{load(e,i,o,s){const c=new Kr(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{try{i(this.parseTypedArray(l))}catch(y){s!=null?s(y):console.error(y),this.manager.itemError(e)}},o,s)}}function _r(r){return class extends Nn{constructor(){super(...arguments),this.parseTypedArray=r}}}function wo(r){return new(_r(r))}function Ao(r){const e=r instanceof Int8Array?S.ByteType:r instanceof Uint8Array||r instanceof Uint8ClampedArray?S.UnsignedByteType:r instanceof Int16Array?S.ShortType:r instanceof Uint16Array?S.UnsignedShortType:r instanceof Int32Array?S.IntType:r instanceof Uint32Array?S.UnsignedIntType:r instanceof P?S.HalfFloatType:r instanceof Float32Array||r instanceof Float64Array?S.FloatType:null;return ve.invariant(e!=null),e}const To={format:S.RGBAFormat,minFilter:S.LinearFilter,magFilter:S.LinearFilter};class Un extends S.Loader{constructor(){super(...arguments),this.parameters={}}load(e,i,o,s){const c=new this.Texture,l=new this.TypedArrayLoader(this.manager);l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),l.load(e,y=>{c.image.data=y instanceof P?new Uint16Array(y.buffer):y;const{width:v,height:I,depth:N,...C}=this.parameters;v!=null&&(c.image.width=v),I!=null&&(c.image.height=I),"depth"in c.image&&N!=null&&(c.image.depth=N),c.type=Ao(y),Object.assign(c,C),c.needsUpdate=!0,i(c)},o,s)}}function On(r,e,i){return class extends Un{constructor(){super(...arguments),this.Texture=r,this.TypedArrayLoader=_r(e),this.parameters={...To,...i}}}}function br(r,e){return On(S.Data3DTexture,r,e)}function mn(r,e){return On(S.DataTexture,r,e)}function go(r,e){return new(br(r,e))}function So(r,e){return new(mn(r,e))}const He=S.MathUtils.clamp,Eo=S.MathUtils.euclideanModulo,Io=S.MathUtils.inverseLerp,_o=S.MathUtils.lerp,bo=S.MathUtils.degToRad,No=S.MathUtils.radToDeg,Uo=S.MathUtils.isPowerOfTwo,Oo=S.MathUtils.ceilPowerOfTwo,mo=S.MathUtils.floorPowerOfTwo,Co=S.MathUtils.normalize;function Ro(r,e,i,o=0,s=1){return S.MathUtils.mapLinear(r,e,i,o,s)}function Lo(r,e,i,o=0,s=1){return He(S.MathUtils.mapLinear(r,e,i,o,s),o,s)}function Fo(r,e,i){return i<=r?0:i>=e?1:(i=(i-r)/(e-r),i*i*(3-2*i))}function xo(r){return Math.min(Math.max(r,0),1)}function Mo(r,e,i,o=i){const s=Math.abs(r-e);return s<=o||s<=i*Math.max(Math.abs(r),Math.abs(e))}function Po(r){return(e,i)=>{e instanceof S.Material?Object.defineProperty(e,i,{enumerable:!0,get(){var o;return((o=this.defines)==null?void 0:o[r])!=null},set(o){var s;o!==this[i]&&(o?(this.defines??(this.defines={}),this.defines[r]="1"):(s=this.defines)==null||delete s[r],this.needsUpdate=!0)}}):Object.defineProperty(e,i,{enumerable:!0,get(){return this.defines.has(r)},set(o){o!==this[i]&&(o?this.defines.set(r,"1"):this.defines.delete(r),this.setChanged())}})}}function Do(r,{min:e=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER}={}){return(o,s)=>{o instanceof S.Material?Object.defineProperty(o,s,{enumerable:!0,get(){var l;const c=(l=this.defines)==null?void 0:l[r];return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines??(this.defines={}),this.defines[r]=He(c,e,i).toFixed(0),this.needsUpdate=!0)}}):Object.defineProperty(o,s,{enumerable:!0,get(){const c=this.defines.get(r);return c!=null?parseInt(c):0},set(c){const l=this[s];c!==l&&(this.defines.set(r,He(c,e,i).toFixed(0)),this.setChanged())}})}}function Bo(r,{min:e=-1/0,max:i=1/0,precision:o=7}={}){return(s,c)=>{s instanceof S.Material?Object.defineProperty(s,c,{enumerable:!0,get(){var y;const l=(y=this.defines)==null?void 0:y[r];return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines??(this.defines={}),this.defines[r]=He(l,e,i).toFixed(o),this.needsUpdate=!0)}}):Object.defineProperty(s,c,{enumerable:!0,get(){const l=this.defines.get(r);return l!=null?parseFloat(l):0},set(l){const y=this[c];l!==y&&(this.defines.set(r,He(l,e,i).toFixed(o)),this.setChanged())}})}}function zo(r,{validate:e}={}){return(i,o)=>{i instanceof S.Material?Object.defineProperty(i,o,{enumerable:!0,get(){var s;return((s=this.defines)==null?void 0:s[r])??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines??(this.defines={}),this.defines[r]=s,this.needsUpdate=!0}}}):Object.defineProperty(i,o,{enumerable:!0,get(){return this.defines.get(r)??""},set(s){if(s!==this[o]){if((e==null?void 0:e(s))===!1){console.error(`Expression validation failed: ${s}`);return}this.defines.set(r,s),this.setChanged()}}})}}function Ho(r,...e){const i={};for(let o=0;o<e.length;o+=2){const s=e[o],c=e[o+1];for(const l of c)i[l]={enumerable:!0,get:()=>s[l],set:y=>{s[l]=y}}}return Object.defineProperties(r,i),r}function ko(r,e,i){const o={};for(const s of i)o[s]={enumerable:!0,get:()=>e.uniforms[s].value,set:c=>{e.uniforms[s].value=c}};return Object.defineProperties(r,o),r}const Zo=parseInt(S.REVISION.replace(/\D+/g,""));var pe=Uint8Array,xe=Uint16Array,vr=Uint32Array,Cn=new pe([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]),Rn=new pe([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]),Go=new pe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ln=function(r,e){for(var i=new xe(31),o=0;o<31;++o)i[o]=e+=1<<r[o-1];for(var s=new vr(i[30]),o=1;o<30;++o)for(var c=i[o];c<i[o+1];++c)s[c]=c-i[o]<<5|o;return[i,s]},Fn=Ln(Cn,2),xn=Fn[0],Wo=Fn[1];xn[28]=258,Wo[258]=28;var Xo=Ln(Rn,0),Yo=Xo[0],pr=new xe(32768);for(var W=0;W<32768;++W){var Fe=(W&43690)>>>1|(W&21845)<<1;Fe=(Fe&52428)>>>2|(Fe&13107)<<2,Fe=(Fe&61680)>>>4|(Fe&3855)<<4,pr[W]=((Fe&65280)>>>8|(Fe&255)<<8)>>>1}var yt=function(r,e,i){for(var o=r.length,s=0,c=new xe(e);s<o;++s)++c[r[s]-1];var l=new xe(e);for(s=0;s<e;++s)l[s]=l[s-1]+c[s-1]<<1;var y;if(i){y=new xe(1<<e);var v=15-e;for(s=0;s<o;++s)if(r[s])for(var I=s<<4|r[s],N=e-r[s],C=l[r[s]-1]++<<N,q=C|(1<<N)-1;C<=q;++C)y[pr[C]>>>v]=I}else for(y=new xe(o),s=0;s<o;++s)r[s]&&(y[s]=pr[l[r[s]-1]++]>>>15-r[s]);return y},At=new pe(288);for(var W=0;W<144;++W)At[W]=8;for(var W=144;W<256;++W)At[W]=9;for(var W=256;W<280;++W)At[W]=7;for(var W=280;W<288;++W)At[W]=8;var Mn=new pe(32);for(var W=0;W<32;++W)Mn[W]=5;var Vo=yt(At,9,1),qo=yt(Mn,5,1),nr=function(r){for(var e=r[0],i=1;i<r.length;++i)r[i]>e&&(e=r[i]);return e},we=function(r,e,i){var o=e/8|0;return(r[o]|r[o+1]<<8)>>(e&7)&i},ir=function(r,e){var i=e/8|0;return(r[i]|r[i+1]<<8|r[i+2]<<16)>>(e&7)},Jo=function(r){return(r/8|0)+(r&7&&1)},$o=function(r,e,i){(i==null||i>r.length)&&(i=r.length);var o=new(r instanceof xe?xe:r instanceof vr?vr:pe)(i-e);return o.set(r.subarray(e,i)),o},Qo=function(r,e,i){var o=r.length;if(!o||i&&!i.l&&o<5)return e||new pe(0);var s=!e||i,c=!i||i.i;i||(i={}),e||(e=new pe(o*3));var l=function(D){var Ne=e.length;if(D>Ne){var Ue=new pe(Math.max(Ne*2,D));Ue.set(e),e=Ue}},y=i.f||0,v=i.p||0,I=i.b||0,N=i.l,C=i.d,q=i.m,se=i.n,Ze=o*8;do{if(!N){i.f=y=we(r,v,1);var Tt=we(r,v+1,3);if(v+=3,Tt)if(Tt==1)N=Vo,C=qo,q=9,se=5;else if(Tt==2){var Et=we(r,v,31)+257,qt=we(r,v+10,15)+4,Jt=Et+we(r,v+5,31)+1;v+=14;for(var Ge=new pe(Jt),It=new pe(19),ae=0;ae<qt;++ae)It[Go[ae]]=we(r,v+ae*3,7);v+=qt*3;for(var _t=nr(It),$t=(1<<_t)-1,Qt=yt(It,_t,1),ae=0;ae<Jt;){var ue=Qt[we(r,v,$t)];v+=ue&15;var de=ue>>>4;if(de<16)Ge[ae++]=de;else{var be=0,ge=0;for(de==16?(ge=3+we(r,v,3),v+=2,be=Ge[ae-1]):de==17?(ge=3+we(r,v,7),v+=3):de==18&&(ge=11+we(r,v,127),v+=7);ge--;)Ge[ae++]=be}}var bt=Ge.subarray(0,Et),Se=Ge.subarray(Et);q=nr(bt),se=nr(Se),N=yt(bt,q,1),C=yt(Se,se,1)}else throw"invalid block type";else{var de=Jo(v)+4,gt=r[de-4]|r[de-3]<<8,St=de+gt;if(St>o){if(c)throw"unexpected EOF";break}s&&l(I+gt),e.set(r.subarray(de,St),I),i.b=I+=gt,i.p=v=St*8;continue}if(v>Ze){if(c)throw"unexpected EOF";break}}s&&l(I+131072);for(var Nt=(1<<q)-1,Ut=(1<<se)-1,Ke=v;;Ke=v){var be=N[ir(r,v)&Nt],te=be>>>4;if(v+=be&15,v>Ze){if(c)throw"unexpected EOF";break}if(!be)throw"invalid length/literal";if(te<256)e[I++]=te;else if(te==256){Ke=v,N=null;break}else{var We=te-254;if(te>264){var ae=te-257,ne=Cn[ae];We=we(r,v,(1<<ne)-1)+xn[ae],v+=ne}var Me=C[ir(r,v)&Ut],Pe=Me>>>4;if(!Me)throw"invalid distance";v+=Me&15;var Se=Yo[Pe];if(Pe>3){var ne=Rn[Pe];Se+=ir(r,v)&(1<<ne)-1,v+=ne}if(v>Ze){if(c)throw"unexpected EOF";break}s&&l(I+131072);for(var et=I+We;I<et;I+=4)e[I]=e[I-Se],e[I+1]=e[I+1-Se],e[I+2]=e[I+2-Se],e[I+3]=e[I+3-Se];I=et}}i.l=N,i.p=Ke,i.b=I,N&&(y=1,i.m=q,i.d=C,i.n=se)}while(!y);return I==e.length?e:$o(e,0,I)},jo=new pe(0),Ko=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Ft(r,e){return Qo((Ko(r),r.subarray(2,-4)),e)}var es=typeof TextDecoder<"u"&&new TextDecoder,ts=0;try{es.decode(jo,{stream:!0}),ts=1}catch{}const at=Zo>=152;class rs extends S.DataTextureLoader{constructor(e){super(e),this.type=S.HalfFloatType}parse(e){const _t=Math.pow(2.7182818,2.2);function $t(t,n){for(var a=0,u=0;u<65536;++u)(u==0||t[u>>3]&1<<(u&7))&&(n[a++]=u);for(var h=a-1;a<65536;)n[a++]=0;return h}function Qt(t){for(var n=0;n<16384;n++)t[n]={},t[n].len=0,t[n].lit=0,t[n].p=null}const ue={l:0,c:0,lc:0};function be(t,n,a,u,h){for(;a<t;)n=n<<8|xr(u,h),a+=8;a-=t,ue.l=n>>a&(1<<t)-1,ue.c=n,ue.lc=a}const ge=new Array(59);function bt(t){for(var n=0;n<=58;++n)ge[n]=0;for(var n=0;n<65537;++n)ge[t[n]]+=1;for(var a=0,n=58;n>0;--n){var u=a+ge[n]>>1;ge[n]=a,a=u}for(var n=0;n<65537;++n){var h=t[n];h>0&&(t[n]=h|ge[h]++<<6)}}function Se(t,n,a,u,h,f,d){for(var p=a,T=0,A=0;h<=f;h++){if(p.value-a.value>u)return!1;be(6,T,A,t,p);var g=ue.l;if(T=ue.c,A=ue.lc,d[h]=g,g==63){if(p.value-a.value>u)throw"Something wrong with hufUnpackEncTable";be(8,T,A,t,p);var w=ue.l+6;if(T=ue.c,A=ue.lc,h+w>f+1)throw"Something wrong with hufUnpackEncTable";for(;w--;)d[h++]=0;h--}else if(g>=59){var w=g-59+2;if(h+w>f+1)throw"Something wrong with hufUnpackEncTable";for(;w--;)d[h++]=0;h--}}bt(d)}function Nt(t){return t&63}function Ut(t){return t>>6}function Ke(t,n,a,u){for(;n<=a;n++){var h=Ut(t[n]),f=Nt(t[n]);if(h>>f)throw"Invalid table entry";if(f>14){var d=u[h>>f-14];if(d.len)throw"Invalid table entry";if(d.lit++,d.p){var p=d.p;d.p=new Array(d.lit);for(var T=0;T<d.lit-1;++T)d.p[T]=p[T]}else d.p=new Array(1);d.p[d.lit-1]=n}else if(f)for(var A=0,T=1<<14-f;T>0;T--){var d=u[(h<<14-f)+A];if(d.len||d.p)throw"Invalid table entry";d.len=f,d.lit=n,A++}}return!0}const te={c:0,lc:0};function We(t,n,a,u){t=t<<8|xr(a,u),n+=8,te.c=t,te.lc=n}const ne={c:0,lc:0};function Me(t,n,a,u,h,f,d,p,T,A){if(t==n){u<8&&(We(a,u,h,d),a=te.c,u=te.lc),u-=8;var g=a>>u,g=new Uint8Array([g])[0];if(T.value+g>A)return!1;for(var w=p[T.value-1];g-- >0;)p[T.value++]=w}else if(T.value<A)p[T.value++]=t;else return!1;ne.c=a,ne.lc=u}function Pe(t){return t&65535}function et(t){var n=Pe(t);return n>32767?n-65536:n}const D={a:0,b:0};function Ne(t,n){var a=et(t),u=et(n),h=u,f=a+(h&1)+(h>>1),d=f,p=f-h;D.a=d,D.b=p}function Ue(t,n){var a=Pe(t),u=Pe(n),h=a-(u>>1)&65535,f=u+h-32768&65535;D.a=f,D.b=h}function zn(t,n,a,u,h,f,d){for(var p=d<16384,T=a>h?h:a,A=1,g;A<=T;)A<<=1;for(A>>=1,g=A,A>>=1;A>=1;){for(var w=0,V=w+f*(h-g),_=f*A,b=f*g,U=u*A,m=u*g,B,H,J,re;w<=V;w+=b){for(var k=w,Ee=w+u*(a-g);k<=Ee;k+=m){var G=k+U,$=k+_,Oe=$+U;p?(Ne(t[k+n],t[$+n]),B=D.a,J=D.b,Ne(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ne(B,H),t[k+n]=D.a,t[G+n]=D.b,Ne(J,re),t[$+n]=D.a,t[Oe+n]=D.b):(Ue(t[k+n],t[$+n]),B=D.a,J=D.b,Ue(t[G+n],t[Oe+n]),H=D.a,re=D.b,Ue(B,H),t[k+n]=D.a,t[G+n]=D.b,Ue(J,re),t[$+n]=D.a,t[Oe+n]=D.b)}if(a&A){var $=k+_;p?Ne(t[k+n],t[$+n]):Ue(t[k+n],t[$+n]),B=D.a,t[$+n]=D.b,t[k+n]=B}}if(h&A)for(var k=w,Ee=w+u*(a-g);k<=Ee;k+=m){var G=k+U;p?Ne(t[k+n],t[G+n]):Ue(t[k+n],t[G+n]),B=D.a,t[G+n]=D.b,t[k+n]=B}g=A,A>>=1}return w}function Hn(t,n,a,u,h,f,d,p,T,A){for(var g=0,w=0,V=p,_=Math.trunc(h.value+(f+7)/8);h.value<_;)for(We(g,w,a,h),g=te.c,w=te.lc;w>=14;){var b=g>>w-14&16383,U=n[b];if(U.len)w-=U.len,Me(U.lit,d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;else{if(!U.p)throw"hufDecode issues";var m;for(m=0;m<U.lit;m++){for(var B=Nt(t[U.p[m]]);w<B&&h.value<_;)We(g,w,a,h),g=te.c,w=te.lc;if(w>=B&&Ut(t[U.p[m]])==(g>>w-B&(1<<B)-1)){w-=B,Me(U.p[m],d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;break}}if(m==U.lit)throw"hufDecode issues"}}var H=8-f&7;for(g>>=H,w-=H;w>0;){var U=n[g<<14-w&16383];if(U.len)w-=U.len,Me(U.lit,d,g,w,a,u,h,T,A,V),g=ne.c,w=ne.lc;else throw"hufDecode issues"}return!0}function Or(t,n,a,u,h,f){var d={value:0},p=a.value,T=ie(n,a),A=ie(n,a);a.value+=4;var g=ie(n,a);if(a.value+=4,T<0||T>=65537||A<0||A>=65537)throw"Something wrong with HUF_ENCSIZE";var w=new Array(65537),V=new Array(16384);Qt(V);var _=u-(a.value-p);if(Se(t,n,a,_,T,A,w),g>8*(u-(a.value-p)))throw"Something wrong with hufUncompress";Ke(w,T,A,V),Hn(w,V,t,n,a,g,A,f,h,d)}function kn(t,n,a){for(var u=0;u<a;++u)n[u]=t[n[u]]}function mr(t){for(var n=1;n<t.length;n++){var a=t[n-1]+t[n]-128;t[n]=a}}function Cr(t,n){for(var a=0,u=Math.floor((t.length+1)/2),h=0,f=t.length-1;!(h>f||(n[h++]=t[a++],h>f));)n[h++]=t[u++]}function Rr(t){for(var n=t.byteLength,a=new Array,u=0,h=new DataView(t);n>0;){var f=h.getInt8(u++);if(f<0){var d=-f;n-=d+1;for(var p=0;p<d;p++)a.push(h.getUint8(u++))}else{var d=f;n-=2;for(var T=h.getUint8(u++),p=0;p<d+1;p++)a.push(T)}}return a}function Zn(t,n,a,u,h,f){var G=new DataView(f.buffer),d=a[t.idx[0]].width,p=a[t.idx[0]].height,T=3,A=Math.floor(d/8),g=Math.ceil(d/8),w=Math.ceil(p/8),V=d-(g-1)*8,_=p-(w-1)*8,b={value:0},U=new Array(T),m=new Array(T),B=new Array(T),H=new Array(T),J=new Array(T);for(let z=0;z<T;++z)J[z]=n[t.idx[z]],U[z]=z<1?0:U[z-1]+g*w,m[z]=new Float32Array(64),B[z]=new Uint16Array(64),H[z]=new Uint16Array(g*64);for(let z=0;z<w;++z){var re=8;z==w-1&&(re=_);var k=8;for(let X=0;X<g;++X){X==g-1&&(k=V);for(let x=0;x<T;++x)B[x].fill(0),B[x][0]=h[U[x]++],Gn(b,u,B[x]),Wn(B[x],m[x]),Xn(m[x]);Yn(m);for(let x=0;x<T;++x)Vn(m[x],H[x],X*64)}let ee=0;for(let X=0;X<T;++X){const x=a[t.idx[X]].type;for(let ye=8*z;ye<8*z+re;++ye){ee=J[X][ye];for(let De=0;De<A;++De){const ce=De*64+(ye&7)*8;G.setUint16(ee+0*2*x,H[X][ce+0],!0),G.setUint16(ee+1*2*x,H[X][ce+1],!0),G.setUint16(ee+2*2*x,H[X][ce+2],!0),G.setUint16(ee+3*2*x,H[X][ce+3],!0),G.setUint16(ee+4*2*x,H[X][ce+4],!0),G.setUint16(ee+5*2*x,H[X][ce+5],!0),G.setUint16(ee+6*2*x,H[X][ce+6],!0),G.setUint16(ee+7*2*x,H[X][ce+7],!0),ee+=8*2*x}}if(A!=g)for(let ye=8*z;ye<8*z+re;++ye){const De=J[X][ye]+8*A*2*x,ce=A*64+(ye&7)*8;for(let Le=0;Le<k;++Le)G.setUint16(De+Le*2*x,H[X][ce+Le],!0)}}}for(var Ee=new Uint16Array(d),G=new DataView(f.buffer),$=0;$<T;++$){a[t.idx[$]].decoded=!0;var Oe=a[t.idx[$]].type;if(a[$].type==2)for(var ot=0;ot<p;++ot){const z=J[$][ot];for(var fe=0;fe<d;++fe)Ee[fe]=G.getUint16(z+fe*2*Oe,!0);for(var fe=0;fe<d;++fe)G.setFloat32(z+fe*2*Oe,E(Ee[fe]),!0)}}}function Gn(t,n,a){for(var u,h=1;h<64;)u=n[t.value],u==65280?h=64:u>>8==255?h+=u&255:(a[h]=u,h++),t.value++}function Wn(t,n){n[0]=E(t[0]),n[1]=E(t[1]),n[2]=E(t[5]),n[3]=E(t[6]),n[4]=E(t[14]),n[5]=E(t[15]),n[6]=E(t[27]),n[7]=E(t[28]),n[8]=E(t[2]),n[9]=E(t[4]),n[10]=E(t[7]),n[11]=E(t[13]),n[12]=E(t[16]),n[13]=E(t[26]),n[14]=E(t[29]),n[15]=E(t[42]),n[16]=E(t[3]),n[17]=E(t[8]),n[18]=E(t[12]),n[19]=E(t[17]),n[20]=E(t[25]),n[21]=E(t[30]),n[22]=E(t[41]),n[23]=E(t[43]),n[24]=E(t[9]),n[25]=E(t[11]),n[26]=E(t[18]),n[27]=E(t[24]),n[28]=E(t[31]),n[29]=E(t[40]),n[30]=E(t[44]),n[31]=E(t[53]),n[32]=E(t[10]),n[33]=E(t[19]),n[34]=E(t[23]),n[35]=E(t[32]),n[36]=E(t[39]),n[37]=E(t[45]),n[38]=E(t[52]),n[39]=E(t[54]),n[40]=E(t[20]),n[41]=E(t[22]),n[42]=E(t[33]),n[43]=E(t[38]),n[44]=E(t[46]),n[45]=E(t[51]),n[46]=E(t[55]),n[47]=E(t[60]),n[48]=E(t[21]),n[49]=E(t[34]),n[50]=E(t[37]),n[51]=E(t[47]),n[52]=E(t[50]),n[53]=E(t[56]),n[54]=E(t[59]),n[55]=E(t[61]),n[56]=E(t[35]),n[57]=E(t[36]),n[58]=E(t[48]),n[59]=E(t[49]),n[60]=E(t[57]),n[61]=E(t[58]),n[62]=E(t[62]),n[63]=E(t[63])}function Xn(t){const n=.5*Math.cos(.7853975),a=.5*Math.cos(3.14159/16),u=.5*Math.cos(3.14159/8),h=.5*Math.cos(3*3.14159/16),f=.5*Math.cos(5*3.14159/16),d=.5*Math.cos(3*3.14159/8),p=.5*Math.cos(7*3.14159/16);for(var T=new Array(4),A=new Array(4),g=new Array(4),w=new Array(4),V=0;V<8;++V){var _=V*8;T[0]=u*t[_+2],T[1]=d*t[_+2],T[2]=u*t[_+6],T[3]=d*t[_+6],A[0]=a*t[_+1]+h*t[_+3]+f*t[_+5]+p*t[_+7],A[1]=h*t[_+1]-p*t[_+3]-a*t[_+5]-f*t[_+7],A[2]=f*t[_+1]-a*t[_+3]+p*t[_+5]+h*t[_+7],A[3]=p*t[_+1]-f*t[_+3]+h*t[_+5]-a*t[_+7],g[0]=n*(t[_+0]+t[_+4]),g[3]=n*(t[_+0]-t[_+4]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],w[0]=g[0]+g[1],w[1]=g[3]+g[2],w[2]=g[3]-g[2],w[3]=g[0]-g[1],t[_+0]=w[0]+A[0],t[_+1]=w[1]+A[1],t[_+2]=w[2]+A[2],t[_+3]=w[3]+A[3],t[_+4]=w[3]-A[3],t[_+5]=w[2]-A[2],t[_+6]=w[1]-A[1],t[_+7]=w[0]-A[0]}for(var b=0;b<8;++b)T[0]=u*t[16+b],T[1]=d*t[16+b],T[2]=u*t[48+b],T[3]=d*t[48+b],A[0]=a*t[8+b]+h*t[24+b]+f*t[40+b]+p*t[56+b],A[1]=h*t[8+b]-p*t[24+b]-a*t[40+b]-f*t[56+b],A[2]=f*t[8+b]-a*t[24+b]+p*t[40+b]+h*t[56+b],A[3]=p*t[8+b]-f*t[24+b]+h*t[40+b]-a*t[56+b],g[0]=n*(t[b]+t[32+b]),g[3]=n*(t[b]-t[32+b]),g[1]=T[0]+T[3],g[2]=T[1]-T[2],w[0]=g[0]+g[1],w[1]=g[3]+g[2],w[2]=g[3]-g[2],w[3]=g[0]-g[1],t[0+b]=w[0]+A[0],t[8+b]=w[1]+A[1],t[16+b]=w[2]+A[2],t[24+b]=w[3]+A[3],t[32+b]=w[3]-A[3],t[40+b]=w[2]-A[2],t[48+b]=w[1]-A[1],t[56+b]=w[0]-A[0]}function Yn(t){for(var n=0;n<64;++n){var a=t[0][n],u=t[1][n],h=t[2][n];t[0][n]=a+1.5747*h,t[1][n]=a-.1873*u-.4682*h,t[2][n]=a+1.8556*u}}function Vn(t,n,a){for(var u=0;u<64;++u)n[a+u]=S.DataUtils.toHalfFloat(qn(t[u]))}function qn(t){return t<=1?Math.sign(t)*Math.pow(Math.abs(t),2.2):Math.sign(t)*Math.pow(_t,Math.abs(t)-1)}function Lr(t){return new DataView(t.array.buffer,t.offset.value,t.size)}function Jn(t){var n=t.viewer.buffer.slice(t.offset.value,t.offset.value+t.size),a=new Uint8Array(Rr(n)),u=new Uint8Array(a.length);return mr(a),Cr(a,u),new DataView(u.buffer)}function jt(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Ft(n),u=new Uint8Array(a.length);return mr(a),Cr(a,u),new DataView(u.buffer)}function $n(t){for(var n=t.viewer,a={value:t.offset.value},u=new Uint16Array(t.width*t.scanlineBlockSize*(t.channels*t.type)),h=new Uint8Array(8192),f=0,d=new Array(t.channels),p=0;p<t.channels;p++)d[p]={},d[p].start=f,d[p].end=d[p].start,d[p].nx=t.width,d[p].ny=t.lines,d[p].size=t.type,f+=d[p].nx*d[p].ny*d[p].size;var T=rt(n,a),A=rt(n,a);if(A>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(T<=A)for(var p=0;p<A-T+1;p++)h[p+T]=Xe(n,a);var g=new Uint16Array(65536),w=$t(h,g),V=ie(n,a);Or(t.array,n,a,V,u,f);for(var p=0;p<t.channels;++p)for(var _=d[p],b=0;b<d[p].size;++b)zn(u,_.start+b,_.nx,_.size,_.ny,_.nx*_.size,w);kn(g,u,f);for(var U=0,m=new Uint8Array(u.buffer.byteLength),B=0;B<t.lines;B++)for(var H=0;H<t.channels;H++){var _=d[H],J=_.nx*_.size,re=new Uint8Array(u.buffer,_.end*2,J*2);m.set(re,U),U+=J*2,_.end+=J}return new DataView(m.buffer)}function Qn(t){var n=t.array.slice(t.offset.value,t.offset.value+t.size),a=Ft(n);const u=t.lines*t.channels*t.width,h=t.type==1?new Uint16Array(u):new Uint32Array(u);let f=0,d=0;const p=new Array(4);for(let T=0;T<t.lines;T++)for(let A=0;A<t.channels;A++){let g=0;switch(t.type){case 1:p[0]=f,p[1]=p[0]+t.width,f=p[1]+t.width;for(let w=0;w<t.width;++w){const V=a[p[0]++]<<8|a[p[1]++];g+=V,h[d]=g,d++}break;case 2:p[0]=f,p[1]=p[0]+t.width,p[2]=p[1]+t.width,f=p[2]+t.width;for(let w=0;w<t.width;++w){const V=a[p[0]++]<<24|a[p[1]++]<<16|a[p[2]++]<<8;g+=V,h[d]=g,d++}break}}return new DataView(h.buffer)}function Fr(t){var n=t.viewer,a={value:t.offset.value},u=new Uint8Array(t.width*t.lines*(t.channels*t.type*2)),h={version:he(n,a),unknownUncompressedSize:he(n,a),unknownCompressedSize:he(n,a),acCompressedSize:he(n,a),dcCompressedSize:he(n,a),rleCompressedSize:he(n,a),rleUncompressedSize:he(n,a),rleRawSize:he(n,a),totalAcUncompressedCount:he(n,a),totalDcUncompressedCount:he(n,a),acCompression:he(n,a)};if(h.version<2)throw"EXRLoader.parse: "+it.compression+" version "+h.version+" is unsupported";for(var f=new Array,d=rt(n,a)-2;d>0;){var p=Ot(n.buffer,a),T=Xe(n,a),A=T>>2&3,g=(T>>4)-1,w=new Int8Array([g])[0],V=Xe(n,a);f.push({name:p,index:w,type:V,compression:A}),d-=p.length+3}for(var _=it.channels,b=new Array(t.channels),U=0;U<t.channels;++U){var m=b[U]={},B=_[U];m.name=B.name,m.compression=0,m.decoded=!1,m.type=B.pixelType,m.pLinear=B.pLinear,m.width=t.width,m.height=t.lines}for(var H={idx:new Array(3)},J=0;J<t.channels;++J)for(var m=b[J],U=0;U<f.length;++U){var re=f[U];m.name==re.name&&(m.compression=re.compression,re.index>=0&&(H.idx[re.index]=J),m.offset=J)}if(h.acCompressedSize>0)switch(h.acCompression){case 0:var G=new Uint16Array(h.totalAcUncompressedCount);Or(t.array,n,a,h.acCompressedSize,G,h.totalAcUncompressedCount);break;case 1:var k=t.array.slice(a.value,a.value+h.totalAcUncompressedCount),Ee=Ft(k),G=new Uint16Array(Ee.buffer);a.value+=h.totalAcUncompressedCount;break}if(h.dcCompressedSize>0){var $={array:t.array,offset:a,size:h.dcCompressedSize},Oe=new Uint16Array(jt($).buffer);a.value+=h.dcCompressedSize}if(h.rleRawSize>0){var k=t.array.slice(a.value,a.value+h.rleCompressedSize),Ee=Ft(k),ot=Rr(Ee.buffer);a.value+=h.rleCompressedSize}for(var fe=0,z=new Array(b.length),U=0;U<z.length;++U)z[U]=new Array;for(var ee=0;ee<t.lines;++ee)for(var X=0;X<b.length;++X)z[X].push(fe),fe+=b[X].width*t.type*2;Zn(H,z,b,G,Oe,u);for(var U=0;U<b.length;++U){var m=b[U];if(!m.decoded)switch(m.compression){case 2:for(var x=0,ye=0,ee=0;ee<t.lines;++ee){for(var De=z[U][x],ce=0;ce<m.width;++ce){for(var Le=0;Le<2*m.type;++Le)u[De++]=ot[ye+Le*m.width*m.height];ye++}x++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(u.buffer)}function Ot(t,n){for(var a=new Uint8Array(t),u=0;a[n.value+u]!=0;)u+=1;var h=new TextDecoder().decode(a.slice(n.value,n.value+u));return n.value=n.value+u+1,h}function jn(t,n,a){var u=new TextDecoder().decode(new Uint8Array(t).slice(n.value,n.value+a));return n.value=n.value+a,u}function Kn(t,n){var a=tt(t,n),u=ie(t,n);return[a,u]}function ei(t,n){var a=ie(t,n),u=ie(t,n);return[a,u]}function tt(t,n){var a=t.getInt32(n.value,!0);return n.value=n.value+4,a}function ie(t,n){var a=t.getUint32(n.value,!0);return n.value=n.value+4,a}function xr(t,n){var a=t[n.value];return n.value=n.value+1,a}function Xe(t,n){var a=t.getUint8(n.value);return n.value=n.value+1,a}const he=function(t,n){let a;return"getBigInt64"in DataView.prototype?a=Number(t.getBigInt64(n.value,!0)):a=t.getUint32(n.value+4,!0)+Number(t.getUint32(n.value,!0)<<32),n.value+=8,a};function K(t,n){var a=t.getFloat32(n.value,!0);return n.value+=4,a}function ti(t,n){return S.DataUtils.toHalfFloat(K(t,n))}function E(t){var n=(t&31744)>>10,a=t&1023;return(t>>15?-1:1)*(n?n===31?a?NaN:1/0:Math.pow(2,n-15)*(1+a/1024):6103515625e-14*(a/1024))}function rt(t,n){var a=t.getUint16(n.value,!0);return n.value+=2,a}function ri(t,n){return E(rt(t,n))}function ni(t,n,a,u){for(var h=a.value,f=[];a.value<h+u-1;){var d=Ot(n,a),p=tt(t,a),T=Xe(t,a);a.value+=3;var A=tt(t,a),g=tt(t,a);f.push({name:d,pixelType:p,pLinear:T,xSampling:A,ySampling:g})}return a.value+=1,f}function ii(t,n){var a=K(t,n),u=K(t,n),h=K(t,n),f=K(t,n),d=K(t,n),p=K(t,n),T=K(t,n),A=K(t,n);return{redX:a,redY:u,greenX:h,greenY:f,blueX:d,blueY:p,whiteX:T,whiteY:A}}function oi(t,n){var a=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],u=Xe(t,n);return a[u]}function si(t,n){var a=ie(t,n),u=ie(t,n),h=ie(t,n),f=ie(t,n);return{xMin:a,yMin:u,xMax:h,yMax:f}}function ai(t,n){var a=["INCREASING_Y"],u=Xe(t,n);return a[u]}function ci(t,n){var a=K(t,n),u=K(t,n);return[a,u]}function li(t,n){var a=K(t,n),u=K(t,n),h=K(t,n);return[a,u,h]}function ui(t,n,a,u,h){if(u==="string"||u==="stringvector"||u==="iccProfile")return jn(n,a,h);if(u==="chlist")return ni(t,n,a,h);if(u==="chromaticities")return ii(t,a);if(u==="compression")return oi(t,a);if(u==="box2i")return si(t,a);if(u==="lineOrder")return ai(t,a);if(u==="float")return K(t,a);if(u==="v2f")return ci(t,a);if(u==="v3f")return li(t,a);if(u==="int")return tt(t,a);if(u==="rational")return Kn(t,a);if(u==="timecode")return ei(t,a);if(u==="preview")return a.value+=h,"skipped";a.value+=h}function hi(t,n,a){const u={};if(t.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";u.version=t.getUint8(4);const h=t.getUint8(5);u.spec={singleTile:!!(h&2),longName:!!(h&4),deepFormat:!!(h&8),multiPart:!!(h&16)},a.value=8;for(var f=!0;f;){var d=Ot(n,a);if(d==0)f=!1;else{var p=Ot(n,a),T=ie(t,a),A=ui(t,n,a,p,T);A===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${p}'.`):u[d]=A}}if((h&-5)!=0)throw console.error("EXRHeader:",u),"THREE.EXRLoader: provided file is currently unsupported.";return u}function fi(t,n,a,u,h){const f={size:0,viewer:n,array:a,offset:u,width:t.dataWindow.xMax-t.dataWindow.xMin+1,height:t.dataWindow.yMax-t.dataWindow.yMin+1,channels:t.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:t.channels[0].pixelType,uncompress:null,getter:null,format:null,[at?"colorSpace":"encoding"]:null};switch(t.compression){case"NO_COMPRESSION":f.lines=1,f.uncompress=Lr;break;case"RLE_COMPRESSION":f.lines=1,f.uncompress=Jn;break;case"ZIPS_COMPRESSION":f.lines=1,f.uncompress=jt;break;case"ZIP_COMPRESSION":f.lines=16,f.uncompress=jt;break;case"PIZ_COMPRESSION":f.lines=32,f.uncompress=$n;break;case"PXR24_COMPRESSION":f.lines=16,f.uncompress=Qn;break;case"DWAA_COMPRESSION":f.lines=32,f.uncompress=Fr;break;case"DWAB_COMPRESSION":f.lines=256,f.uncompress=Fr;break;default:throw"EXRLoader.parse: "+t.compression+" is unsupported"}if(f.scanlineBlockSize=f.lines,f.type==1)switch(h){case S.FloatType:f.getter=ri,f.inputSize=2;break;case S.HalfFloatType:f.getter=rt,f.inputSize=2;break}else if(f.type==2)switch(h){case S.FloatType:f.getter=K,f.inputSize=4;break;case S.HalfFloatType:f.getter=ti,f.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+f.type+" for "+t.compression+".";f.blockCount=(t.dataWindow.yMax+1)/f.scanlineBlockSize;for(var d=0;d<f.blockCount;d++)he(n,u);f.outputChannels=f.channels==3?4:f.channels;const p=f.width*f.height*f.outputChannels;switch(h){case S.FloatType:f.byteArray=new Float32Array(p),f.channels<f.outputChannels&&f.byteArray.fill(1,0,p);break;case S.HalfFloatType:f.byteArray=new Uint16Array(p),f.channels<f.outputChannels&&f.byteArray.fill(15360,0,p);break;default:console.error("THREE.EXRLoader: unsupported type: ",h);break}return f.bytesPerLine=f.width*f.inputSize*f.channels,f.outputChannels==4?f.format=S.RGBAFormat:f.format=S.RedFormat,at?f.colorSpace="srgb-linear":f.encoding=3e3,f}const mt=new DataView(e),yi=new Uint8Array(e),nt={value:0},it=hi(mt,e,nt),R=fi(it,mt,yi,nt,this.type),Mr={value:0},vi={R:0,G:1,B:2,A:3,Y:0};for(let t=0;t<R.height/R.scanlineBlockSize;t++){const n=ie(mt,nt);R.size=ie(mt,nt),R.lines=n+R.scanlineBlockSize>R.height?R.height-n:R.scanlineBlockSize;const u=R.size<R.lines*R.bytesPerLine?R.uncompress(R):Lr(R);nt.value+=R.size;for(let h=0;h<R.scanlineBlockSize;h++){const f=h+t*R.scanlineBlockSize;if(f>=R.height)break;for(let d=0;d<R.channels;d++){const p=vi[it.channels[d].name];for(let T=0;T<R.width;T++){Mr.value=(h*(R.channels*R.width)+d*R.width+T)*R.inputSize;const A=(R.height-1-f)*(R.width*R.outputChannels)+T*R.outputChannels+p;R.byteArray[A]=R.getter(u,Mr)}}}}return{header:it,width:R.width,height:R.height,data:R.byteArray,format:R.format,[at?"colorSpace":"encoding"]:R[at?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,i,o,s){function c(l,y){at?l.colorSpace=y.colorSpace:l.encoding=y.encoding,l.minFilter=S.LinearFilter,l.magFilter=S.LinearFilter,l.generateMipmaps=!1,l.flipY=!1,i&&i(l,y)}return super.load(e,c,o,s)}}class ns extends S.Loader{setDepth(e){return this.depth=e,this}load(e,i,o,s){const c=new rs(this.manager);c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),c.load(e,l=>{const{data:y,width:v,height:I}=l.image,N=this.depth??Math.sqrt(I),C=new S.Data3DTexture(y,v,I/N,N);C.type=l.type,C.format=l.format,C.colorSpace=l.colorSpace,C.needsUpdate=!0;try{i(C)}catch(q){s!=null?s(q):console.error(q),this.manager.itemError(e)}},o,s)}}const or=1e-6,xt=new S.Vector3,Mt=new S.Vector3,me=new S.Vector3,ct=new S.Vector3,sr=new S.Vector3,is=new S.Vector3,os=new S.Matrix4,ss=new S.Quaternion,as=new S.Ray;class Nr{constructor(e=0,i=0,o=0,s=0){this.distance=e,this.heading=i,this.pitch=o,this.roll=s}get distance(){return this._distance}set distance(e){this._distance=Math.max(e,or)}get pitch(){return this._pitch}set pitch(e){this._pitch=He(e,-Math.PI/2+or,Math.PI/2-or)}set(e,i,o,s){return this.distance=e,this.heading=i,this.pitch=o,s!=null&&(this.roll=s),this}clone(){return new Nr(this.distance,this.heading,this.pitch,this.roll)}copy(e){return this.distance=e.distance,this.heading=e.heading,this.pitch=e.pitch,this.roll=e.roll,this}equals(e){return e.distance===this.distance&&e.heading===this.heading&&e.pitch===this.pitch&&e.roll===this.roll}decompose(e,i,o,s,c=ve.Ellipsoid.WGS84){c.getEastNorthUpVectors(e,xt,Mt,me),s==null||s.copy(me);const l=ct.copy(xt).multiplyScalar(Math.cos(this.heading)).add(sr.copy(Mt).multiplyScalar(Math.sin(this.heading))).multiplyScalar(Math.cos(this.pitch)).add(sr.copy(me).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);if(i.copy(e).sub(l),this.roll!==0){const y=ct.copy(e).sub(i).normalize();me.applyQuaternion(ss.setFromAxisAngle(y,this.roll))}o.setFromRotationMatrix(os.lookAt(i,e,me))}setFromCamera(e,i=ve.Ellipsoid.WGS84){const o=ct.setFromMatrixPosition(e.matrixWorld),s=sr.set(0,0,.5).unproject(e).sub(o).normalize(),c=i.getIntersection(as.set(o,s));if(c==null)return;this.distance=o.distanceTo(c),i.getEastNorthUpVectors(c,xt,Mt,me),this.heading=Math.atan2(Mt.dot(s),xt.dot(s)),this.pitch=Math.asin(me.dot(s));const l=ct.copy(e.up).applyQuaternion(e.quaternion),y=is.copy(s).multiplyScalar(-l.dot(s)).add(l).normalize(),v=ct.copy(s).multiplyScalar(-me.dot(s)).add(me).normalize(),I=v.dot(y),N=s.dot(v.cross(y));return this.roll=Math.atan2(N,I),this}}const vt=class vt{constructor(e=0,i=0,o=0,s=0){this.west=e,this.south=i,this.east=o,this.north=s}get width(){let e=this.east;return e<this.west&&(e+=Math.PI*2),e-this.west}get height(){return this.north-this.south}set(e,i,o,s){return this.west=e,this.south=i,this.east=o,this.north=s,this}clone(){return new vt(this.west,this.south,this.east,this.north)}copy(e){return this.west=e.west,this.south=e.south,this.east=e.east,this.north=e.north,this}equals(e){return e.west===this.west&&e.south===this.south&&e.east===this.east&&e.north===this.north}at(e,i,o=new ve.Geodetic){return o.set(this.west+(this.east-this.west)*e,this.north+(this.south-this.north)*i)}fromArray(e,i=0){return this.west=e[i],this.south=e[i+1],this.east=e[i+2],this.north=e[i+3],this}toArray(e=[],i=0){return e[i]=this.west,e[i+1]=this.south,e[i+2]=this.east,e[i+3]=this.north,e}*[Symbol.iterator](){yield this.west,yield this.south,yield this.east,yield this.north}};vt.MAX=new vt(ve.Geodetic.MIN_LONGITUDE,ve.Geodetic.MIN_LATITUDE,ve.Geodetic.MAX_LONGITUDE,ve.Geodetic.MAX_LATITUDE);let pt=vt;const cs=/^[ \t]*#include +"([\w\d./]+)"/gm;function Pn(r,e){return r.replace(cs,(i,o)=>{const c=o.split("/").reduce((l,y)=>typeof l!="string"&&l!=null?l[y]:void 0,e);if(typeof c!="string")throw new Error(`Could not find include for ${o}.`);return Pn(c,e)})}let Pt;function ls(){if(Pt!=null)return Pt;const r=new Uint32Array([268435456]);return Pt=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)[0]===0,Pt}function ke(r,e,i,o=!0){if(o===ls())return new e(r);const s=Object.assign(new DataView(r),{getFloat16(l,y){return vo(this,l,y)}}),c=new e(s.byteLength/e.BYTES_PER_ELEMENT);for(let l=0,y=0;l<c.length;++l,y+=e.BYTES_PER_ELEMENT)c[l]=s[i](y,o);return c}const Dn=r=>new Uint8Array(r),us=r=>new Int8Array(r),hs=(r,e)=>ke(r,Uint16Array,"getUint16",e),fs=(r,e)=>ke(r,Int16Array,"getInt16",e),ys=(r,e)=>ke(r,Int32Array,"getInt32",e),vs=(r,e)=>ke(r,Uint32Array,"getUint32",e),ps=(r,e)=>ke(r,P,"getFloat16",e),ds=(r,e)=>ke(r,Float32Array,"getFloat32",e),ws=(r,e)=>ke(r,Float64Array,"getFloat64",e),As=br(Dn,{format:S.RedFormat,minFilter:S.NearestFilter,magFilter:S.NearestFilter,wrapS:S.RepeatWrapping,wrapT:S.RepeatWrapping,wrapR:S.RepeatWrapping,width:en,height:tn,depth:rn});function*Bn(r,e,i,o,s){if(i>=o)return;const c=2**i,l=i+1,y=2**l,v=Math.floor(r/c*y),I=Math.floor(e/c*y),N=[[v,I,l],[v+1,I,l],[v,I+1,l],[v+1,I+1,l]];if(l<o)for(const C of N)for(const q of Bn(...C,o,s))yield q;else for(const C of N)yield(s??new $e).set(...C)}class $e{constructor(e=0,i=0,o=0){this.x=e,this.y=i,this.z=o}set(e,i,o){return this.x=e,this.y=i,o!=null&&(this.z=o),this}clone(){return new $e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}getParent(e=new $e){const i=2**this.z,o=this.x/i,s=this.y/i,c=this.z-1,l=2**c;return e.set(Math.floor(o*l),Math.floor(s*l),c)}*traverseChildren(e,i){const{x:o,y:s,z:c}=this;for(const l of Bn(o,s,c,c+e,i))yield l}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const jr=new S.Vector2;class Ur{constructor(e=2,i=1,o=pt.MAX){this.width=e,this.height=i,this.rectangle=o}clone(){return new Ur(this.width,this.height,this.rectangle.clone())}copy(e){return this.width=e.width,this.height=e.height,this.rectangle.copy(e.rectangle),this}getSize(e,i=new S.Vector2){return i.set(this.width<<e,this.height<<e)}getTile(e,i,o=new $e){const s=this.getSize(i,jr),{rectangle:c}=this,l=c.width/s.x,y=c.height/s.y,{west:v,south:I,east:N}=c;let C=e.longitude;N<v&&(C+=Math.PI*2);let q=Math.floor((C-v)/l);q>=s.x&&(q=s.x-1);let se=Math.floor((e.latitude-I)/y);return se>=s.y&&(se=s.y-1),o.x=q,o.y=se,o.z=i,o}getRectangle(e,i=new pt){const o=this.getSize(e.z,jr),{rectangle:s}=this,c=s.width/o.x,l=s.height/o.y,{west:y,north:v}=s;return i.west=e.x*c+y,i.east=(e.x+1)*c+y,i.north=v-(o.y-e.y-1)*l,i.south=v-(o.y-e.y)*l,i}}const Ts=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function gs(r,e,i,o){let s="";for(let c=parseInt(e);c<parseInt(i);++c)s+=o.replace(/\[\s*i\s*\]/g,"["+c+"]").replace(/UNROLLED_LOOP_INDEX/g,`${c}`);return s}function Ss(r){return r.replace(Ts,gs)}exports.Ellipsoid=ve.Ellipsoid;exports.EllipsoidGeometry=ve.EllipsoidGeometry;exports.Geodetic=ve.Geodetic;exports.ArrayBufferLoader=Kr;exports.DEFAULT_STBN_URL=Ti;exports.DataLoader=Un;exports.EXR3DLoader=ns;exports.Float16Array=P;exports.PointOfView=Nr;exports.Rectangle=pt;exports.STBNLoader=As;exports.STBN_TEXTURE_DEPTH=rn;exports.STBN_TEXTURE_HEIGHT=tn;exports.STBN_TEXTURE_WIDTH=en;exports.TileCoordinate=$e;exports.TilingScheme=Ur;exports.TypedArrayLoader=Nn;exports.assertType=pi;exports.ceilPowerOfTwo=Oo;exports.clamp=He;exports.closeTo=Mo;exports.createData3DTextureLoader=go;exports.createData3DTextureLoaderClass=br;exports.createDataTextureLoader=So;exports.createDataTextureLoaderClass=mn;exports.createTypedArrayLoader=wo;exports.createTypedArrayLoaderClass=_r;exports.define=Po;exports.defineExpression=zo;exports.defineFloat=Bo;exports.defineInt=Do;exports.definePropertyShorthand=Ho;exports.defineUniformShorthand=ko;exports.degrees=No;exports.euclideanModulo=Eo;exports.floorPowerOfTwo=mo;exports.fromBufferGeometryLike=wi;exports.inverseLerp=Io;exports.isPowerOfTwo=Uo;exports.isTypedArray=po;exports.lerp=_o;exports.normalize=Co;exports.parseFloat16Array=ps;exports.parseFloat32Array=ds;exports.parseFloat64Array=ws;exports.parseInt16Array=fs;exports.parseInt32Array=ys;exports.parseInt8Array=us;exports.parseUint16Array=hs;exports.parseUint32Array=vs;exports.parseUint8Array=Dn;exports.radians=bo;exports.remap=Ro;exports.remapClamped=Lo;exports.resolveIncludes=Pn;exports.saturate=xo;exports.smoothstep=Fo;exports.toBufferGeometryLike=di;exports.unrollLoops=Ss;
2
2
  //# sourceMappingURL=index.cjs.map