@loaders.gl/i3s 4.4.0-alpha.2 → 4.4.0-alpha.9
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/README.md +1 -1
- package/dist/arcgis-webscene-loader.js +2 -1
- package/dist/arcgis-webscene-loader.js.map +1 -0
- package/dist/dist.dev.js +402 -298
- package/dist/dist.min.js +1 -1
- package/dist/i3s-attribute-loader.js +2 -1
- package/dist/i3s-attribute-loader.js.map +1 -0
- package/dist/i3s-building-scene-layer-loader.js +2 -1
- package/dist/i3s-building-scene-layer-loader.js.map +1 -0
- package/dist/i3s-content-loader.js +2 -1
- package/dist/i3s-content-loader.js.map +1 -0
- package/dist/i3s-content-worker-node.js +45 -45
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +396 -159
- package/dist/i3s-loader.d.ts +13 -8
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +8 -7
- package/dist/i3s-loader.js.map +1 -0
- package/dist/i3s-node-page-loader.js +2 -1
- package/dist/i3s-node-page-loader.js.map +1 -0
- package/dist/i3s-slpk-loader.d.ts +6 -1
- package/dist/i3s-slpk-loader.d.ts.map +1 -1
- package/dist/i3s-slpk-loader.js +10 -4
- package/dist/i3s-slpk-loader.js.map +1 -0
- package/dist/index.cjs +35 -27
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/helpers/i3s-nodepages-tiles.js +5 -4
- package/dist/lib/helpers/i3s-nodepages-tiles.js.map +1 -0
- package/dist/lib/parsers/constants.js +1 -0
- package/dist/lib/parsers/constants.js.map +1 -0
- package/dist/lib/parsers/parse-arcgis-webscene.js +1 -0
- package/dist/lib/parsers/parse-arcgis-webscene.js.map +1 -0
- package/dist/lib/parsers/parse-i3s-attribute.js +1 -0
- package/dist/lib/parsers/parse-i3s-attribute.js.map +1 -0
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js +1 -0
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -0
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts +2 -2
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +1 -0
- package/dist/lib/parsers/parse-i3s-tile-content.js.map +1 -0
- package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s.js +6 -4
- package/dist/lib/parsers/parse-i3s.js.map +1 -0
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts +3 -3
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.js +4 -3
- package/dist/lib/parsers/parse-slpk/parse-slpk.js.map +1 -0
- package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts +3 -3
- package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +1 -1
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js +5 -4
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -0
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js +1 -0
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -0
- package/dist/lib/utils/customize-colors.js +5 -2
- package/dist/lib/utils/customize-colors.js.map +1 -0
- package/dist/lib/utils/url-utils.js +1 -0
- package/dist/lib/utils/url-utils.js.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/workers/i3s-content-worker-node.js +1 -0
- package/dist/workers/i3s-content-worker-node.js.map +1 -0
- package/dist/workers/i3s-content-worker.js +1 -0
- package/dist/workers/i3s-content-worker.js.map +1 -0
- package/package.json +18 -12
- package/src/i3s-loader.ts +15 -10
- package/src/i3s-slpk-loader.ts +8 -3
- package/src/lib/helpers/i3s-nodepages-tiles.ts +4 -4
- package/src/lib/parsers/parse-i3s-tile-content.ts +2 -2
- package/src/lib/parsers/parse-i3s.ts +7 -4
- package/src/lib/parsers/parse-slpk/parse-slpk.ts +7 -5
- package/src/lib/parsers/parse-slpk/slpk-archieve.ts +7 -10
- package/src/lib/utils/customize-colors.ts +4 -2
package/dist/dist.min.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var zl=Object.create;var nn=Object.defineProperty;var Kl=Object.getOwnPropertyDescriptor;var Hl=Object.getOwnPropertyNames;var Vl=Object.getPrototypeOf,Xl=Object.prototype.hasOwnProperty;var J=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),on=(t,e)=>{for(var r in e)nn(t,r,{get:e[r],enumerable:!0})},rn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hl(e))!Xl.call(t,o)&&o!==r&&nn(t,o,{get:()=>e[o],enumerable:!(n=Kl(e,o))||n.enumerable});return t},sn=(t,e,r)=>(rn(t,e,"default"),r&&rn(r,e,"default")),Ct=(t,e,r)=>(r=t!=null?zl(Vl(t)):{},rn(e||!t||!t.__esModule?nn(r,"default",{value:t,enumerable:!0}):r,t)),Wl=t=>rn(nn({},"__esModule",{value:!0}),t);var Ht=J((dm,ii)=>{ii.exports=globalThis.loaders});var Zt=J(at=>{"use strict";var Kd=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Hd(t,e){return Object.prototype.hasOwnProperty.call(t,e)}at.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Hd(r,n)&&(t[n]=r[n])}}return t};at.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var Vd={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){var e,r,n,o,s,i;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(i=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)s=t[e],i.set(s,o),o+=s.length;return i}},Xd={arraySet:function(t,e,r,n,o){for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};at.setTyped=function(t){t?(at.Buf8=Uint8Array,at.Buf16=Uint16Array,at.Buf32=Int32Array,at.assign(at,Vd)):(at.Buf8=Array,at.Buf16=Array,at.Buf32=Array,at.assign(at,Xd))};at.setTyped(Kd)});var nf=J(Ze=>{"use strict";var Wd=Zt(),qd=4,Nc=0,Pc=1,Zd=2;function qe(t){for(var e=t.length;--e>=0;)t[e]=0}var Qd=0,Kc=1,Yd=2,jd=3,$d=258,ys=29,kr=256,Nr=kr+1+ys,We=30,ws=19,Hc=2*Nr+1,ge=15,gs=16,Jd=7,Os=256,Vc=16,Xc=17,Wc=18,Ts=[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],Xn=[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],tu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],qc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],eu=512,Qt=new Array((Nr+2)*2);qe(Qt);var Lr=new Array(We*2);qe(Lr);var Pr=new Array(eu);qe(Pr);var Fr=new Array($d-jd+1);qe(Fr);var bs=new Array(ys);qe(bs);var Wn=new Array(We);qe(Wn);function Es(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var Zc,Qc,Yc;function Ss(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function jc(t){return t<256?Pr[t]:Pr[256+(t>>>7)]}function Ur(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function ht(t,e,r){t.bi_valid>gs-r?(t.bi_buf|=e<<t.bi_valid&65535,Ur(t,t.bi_buf),t.bi_buf=e>>gs-t.bi_valid,t.bi_valid+=r-gs):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function Ut(t,e,r){ht(t,r[e*2],r[e*2+1])}function $c(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function ru(t){t.bi_valid===16?(Ur(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function nu(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,d,_,h,u,A=0;for(_=0;_<=ge;_++)t.bl_count[_]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Hc;c++)l=t.heap[c],_=r[r[l*2+1]*2+1]+1,_>f&&(_=f,A++),r[l*2+1]=_,!(l>n)&&(t.bl_count[_]++,h=0,l>=a&&(h=i[l-a]),u=r[l*2],t.opt_len+=u*(_+h),s&&(t.static_len+=u*(o[l*2+1]+h)));if(A!==0){do{for(_=f-1;t.bl_count[_]===0;)_--;t.bl_count[_]--,t.bl_count[_+1]+=2,t.bl_count[f]--,A-=2}while(A>0);for(_=f;_!==0;_--)for(l=t.bl_count[_];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==_&&(t.opt_len+=(_-r[d*2+1])*r[d*2],r[d*2+1]=_),l--)}}function Jc(t,e,r){var n=new Array(ge+1),o=0,s,i;for(s=1;s<=ge;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=e;i++){var a=t[i*2+1];a!==0&&(t[i*2]=$c(n[a]++,a))}}function ou(){var t,e,r,n,o,s=new Array(ge+1);for(r=0,n=0;n<ys-1;n++)for(bs[n]=r,t=0;t<1<<Ts[n];t++)Fr[r++]=n;for(Fr[r-1]=n,o=0,n=0;n<16;n++)for(Wn[n]=o,t=0;t<1<<Xn[n];t++)Pr[o++]=n;for(o>>=7;n<We;n++)for(Wn[n]=o<<7,t=0;t<1<<Xn[n]-7;t++)Pr[256+o++]=n;for(e=0;e<=ge;e++)s[e]=0;for(t=0;t<=143;)Qt[t*2+1]=8,t++,s[8]++;for(;t<=255;)Qt[t*2+1]=9,t++,s[9]++;for(;t<=279;)Qt[t*2+1]=7,t++,s[7]++;for(;t<=287;)Qt[t*2+1]=8,t++,s[8]++;for(Jc(Qt,Nr+1,s),t=0;t<We;t++)Lr[t*2+1]=5,Lr[t*2]=$c(t,5);Zc=new Es(Qt,Ts,kr+1,Nr,ge),Qc=new Es(Lr,Xn,0,We,ge),Yc=new Es(new Array(0),tu,0,ws,Jd)}function tf(t){var e;for(e=0;e<Nr;e++)t.dyn_ltree[e*2]=0;for(e=0;e<We;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ws;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Os*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function ef(t){t.bi_valid>8?Ur(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function su(t,e,r,n){ef(t),n&&(Ur(t,r),Ur(t,~r)),Wd.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function Fc(t,e,r,n){var o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]}function Rs(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&Fc(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!Fc(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function Uc(t,e,r){var n,o,s=0,i,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],o=t.pending_buf[t.l_buf+s],s++,n===0?Ut(t,o,e):(i=Fr[o],Ut(t,i+kr+1,e),a=Ts[i],a!==0&&(o-=bs[i],ht(t,o,a)),n--,i=jc(n),Ut(t,i,r),a=Xn[i],a!==0&&(n-=Wn[i],ht(t,n,a)));while(s<t.last_lit);Ut(t,Os,e)}function Ms(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,a,f=-1,c;for(t.heap_len=0,t.heap_max=Hc,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=f=i,t.depth[i]=0):r[i*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,o&&(t.static_len-=n[c*2+1]);for(e.max_code=f,i=t.heap_len>>1;i>=1;i--)Rs(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Rs(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=a,r[c*2]=r[i*2]+r[a*2],t.depth[c]=(t.depth[i]>=t.depth[a]?t.depth[i]:t.depth[a])+1,r[i*2+1]=r[a*2+1]=c,t.heap[1]=c++,Rs(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],nu(t,e),Jc(r,f,t.bl_count)}function kc(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)&&(a<c?t.bl_tree[s*2]+=a:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[Vc*2]++):a<=10?t.bl_tree[Xc*2]++:t.bl_tree[Wc*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function Gc(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)){if(a<c)do Ut(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&(Ut(t,s,t.bl_tree),a--),Ut(t,Vc,t.bl_tree),ht(t,a-3,2)):a<=10?(Ut(t,Xc,t.bl_tree),ht(t,a-3,3)):(Ut(t,Wc,t.bl_tree),ht(t,a-11,7));a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4)}}function iu(t){var e;for(kc(t,t.dyn_ltree,t.l_desc.max_code),kc(t,t.dyn_dtree,t.d_desc.max_code),Ms(t,t.bl_desc),e=ws-1;e>=3&&t.bl_tree[qc[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function au(t,e,r,n){var o;for(ht(t,e-257,5),ht(t,r-1,5),ht(t,n-4,4),o=0;o<n;o++)ht(t,t.bl_tree[qc[o]*2+1],3);Gc(t,t.dyn_ltree,e-1),Gc(t,t.dyn_dtree,r-1)}function cu(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Nc;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Pc;for(r=32;r<kr;r++)if(t.dyn_ltree[r*2]!==0)return Pc;return Nc}var zc=!1;function fu(t){zc||(ou(),zc=!0),t.l_desc=new Ss(t.dyn_ltree,Zc),t.d_desc=new Ss(t.dyn_dtree,Qc),t.bl_desc=new Ss(t.bl_tree,Yc),t.bi_buf=0,t.bi_valid=0,tf(t)}function rf(t,e,r,n){ht(t,(Qd<<1)+(n?1:0),3),su(t,e,r,!0)}function lu(t){ht(t,Kc<<1,3),Ut(t,Os,Qt),ru(t)}function hu(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===Zd&&(t.strm.data_type=cu(t)),Ms(t,t.l_desc),Ms(t,t.d_desc),i=iu(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?rf(t,e,r,n):t.strategy===qd||s===o?(ht(t,(Kc<<1)+(n?1:0),3),Uc(t,Qt,Lr)):(ht(t,(Yd<<1)+(n?1:0),3),au(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),Uc(t,t.dyn_ltree,t.dyn_dtree)),tf(t),n&&ef(t)}function _u(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Fr[r]+kr+1)*2]++,t.dyn_dtree[jc(e)*2]++),t.last_lit===t.lit_bufsize-1}Ze._tr_init=fu;Ze._tr_stored_block=rf;Ze._tr_flush_block=hu;Ze._tr_tally=_u;Ze._tr_align=lu});var Cs=J((LR,of)=>{"use strict";function du(t,e,r,n){for(var o=t&65535|0,s=t>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}of.exports=du});var Bs=J((NR,sf)=>{"use strict";function uu(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var pu=uu();function mu(t,e,r,n){var o=pu,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}sf.exports=mu});var qn=J((PR,af)=>{"use strict";af.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var mf=J(zt=>{"use strict";var ct=Zt(),St=nf(),hf=Cs(),se=Bs(),Au=qn(),Te=0,xu=1,gu=3,le=4,cf=5,Gt=0,ff=1,Rt=-2,Eu=-3,Ds=-5,Su=-1,Ru=1,Zn=2,Tu=3,Mu=4,yu=0,wu=2,$n=8,Ou=9,bu=15,Cu=8,Bu=29,Du=256,vs=Du+1+Bu,Iu=30,vu=19,Lu=2*vs+1,Nu=15,G=3,ce=258,yt=ce+G+1,Pu=32,Jn=42,Ls=69,Qn=73,Yn=91,jn=103,Ee=113,zr=666,$=1,Kr=2,Se=3,je=4,Fu=3;function fe(t,e){return t.msg=Au[e],e}function lf(t){return(t<<1)-(t>4?9:0)}function ae(t){for(var e=t.length;--e>=0;)t[e]=0}function ie(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(ct.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function rt(t,e){St._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ie(t.strm)}function K(t,e){t.pending_buf[t.pending++]=e}function Gr(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function Uu(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,ct.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=hf(t.adler,e,o,r):t.state.wrap===2&&(t.adler=se(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function _f(t,e){var r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-yt?t.strstart-(t.w_size-yt):0,c=t.window,l=t.w_mask,d=t.prev,_=t.strstart+ce,h=c[n+i-1],u=c[n+i];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+i]!==u||c[o+i-1]!==h||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<_);if(s=ce-(_-n),n=_-ce,s>i){if(t.match_start=e,i=s,s>=a)break;h=c[n+i-1],u=c[n+i]}}while((e=d[e&l])>f&&--r!==0);return i<=t.lookahead?i:t.lookahead}function Re(t){var e=t.w_size,r,n,o,s,i;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-yt)){ct.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);s+=e}if(t.strm.avail_in===0)break;if(n=Uu(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=G)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+G-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<G)););}while(t.lookahead<yt&&t.strm.avail_in!==0)}function ku(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Re(t),t.lookahead===0&&e===Te)return $;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,rt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-yt&&(rt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(rt(t,!0),t.strm.avail_out===0?Se:je):(t.strstart>t.block_start&&(rt(t,!1),t.strm.avail_out===0),$)}function Is(t,e){for(var r,n;;){if(t.lookahead<yt){if(Re(t),t.lookahead<yt&&e===Te)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=G&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-yt&&(t.match_length=_f(t,r)),t.match_length>=G)if(n=St._tr_tally(t,t.strstart-t.match_start,t.match_length-G),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=G){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=St._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(rt(t,!1),t.strm.avail_out===0))return $}return t.insert=t.strstart<G-1?t.strstart:G-1,e===le?(rt(t,!0),t.strm.avail_out===0?Se:je):t.last_lit&&(rt(t,!1),t.strm.avail_out===0)?$:Kr}function Qe(t,e){for(var r,n,o;;){if(t.lookahead<yt){if(Re(t),t.lookahead<yt&&e===Te)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=G&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=G-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-yt&&(t.match_length=_f(t,r),t.match_length<=5&&(t.strategy===Ru||t.match_length===G&&t.strstart-t.match_start>4096)&&(t.match_length=G-1)),t.prev_length>=G&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-G,n=St._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-G),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=G-1,t.strstart++,n&&(rt(t,!1),t.strm.avail_out===0))return $}else if(t.match_available){if(n=St._tr_tally(t,0,t.window[t.strstart-1]),n&&rt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return $}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=St._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<G-1?t.strstart:G-1,e===le?(rt(t,!0),t.strm.avail_out===0?Se:je):t.last_lit&&(rt(t,!1),t.strm.avail_out===0)?$:Kr}function Gu(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=ce){if(Re(t),t.lookahead<=ce&&e===Te)return $;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=G&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+ce;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=ce-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=G?(r=St._tr_tally(t,1,t.match_length-G),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=St._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(rt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(rt(t,!0),t.strm.avail_out===0?Se:je):t.last_lit&&(rt(t,!1),t.strm.avail_out===0)?$:Kr}function zu(t,e){for(var r;;){if(t.lookahead===0&&(Re(t),t.lookahead===0)){if(e===Te)return $;break}if(t.match_length=0,r=St._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(rt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(rt(t,!0),t.strm.avail_out===0?Se:je):t.last_lit&&(rt(t,!1),t.strm.avail_out===0)?$:Kr}function kt(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var Ye;Ye=[new kt(0,0,0,0,ku),new kt(4,4,8,4,Is),new kt(4,5,16,8,Is),new kt(4,6,32,32,Is),new kt(4,4,16,16,Qe),new kt(8,16,32,32,Qe),new kt(8,16,128,128,Qe),new kt(8,32,128,256,Qe),new kt(32,128,258,1024,Qe),new kt(32,258,258,4096,Qe)];function Ku(t){t.window_size=2*t.w_size,ae(t.head),t.max_lazy_match=Ye[t.level].max_lazy,t.good_match=Ye[t.level].good_length,t.nice_match=Ye[t.level].nice_length,t.max_chain_length=Ye[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=G-1,t.match_available=0,t.ins_h=0}function Hu(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$n,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ct.Buf16(Lu*2),this.dyn_dtree=new ct.Buf16((2*Iu+1)*2),this.bl_tree=new ct.Buf16((2*vu+1)*2),ae(this.dyn_ltree),ae(this.dyn_dtree),ae(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ct.Buf16(Nu+1),this.heap=new ct.Buf16(2*vs+1),ae(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ct.Buf16(2*vs+1),ae(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function df(t){var e;return!t||!t.state?fe(t,Rt):(t.total_in=t.total_out=0,t.data_type=wu,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Jn:Ee,t.adler=e.wrap===2?0:1,e.last_flush=Te,St._tr_init(e),Gt)}function uf(t){var e=df(t);return e===Gt&&Ku(t.state),e}function Vu(t,e){return!t||!t.state||t.state.wrap!==2?Rt:(t.state.gzhead=e,Gt)}function pf(t,e,r,n,o,s){if(!t)return Rt;var i=1;if(e===Su&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>Ou||r!==$n||n<8||n>15||e<0||e>9||s<0||s>Mu)return fe(t,Rt);n===8&&(n=9);var a=new Hu;return t.state=a,a.strm=t,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+G-1)/G),a.window=new ct.Buf8(a.w_size*2),a.head=new ct.Buf16(a.hash_size),a.prev=new ct.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new ct.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=s,a.method=r,uf(t)}function Xu(t,e){return pf(t,e,$n,bu,Cu,yu)}function Wu(t,e){var r,n,o,s;if(!t||!t.state||e>cf||e<0)return t?fe(t,Rt):Rt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===zr&&e!==le)return fe(t,t.avail_out===0?Ds:Rt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===Jn)if(n.wrap===2)t.adler=0,K(n,31),K(n,139),K(n,8),n.gzhead?(K(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),K(n,n.gzhead.time&255),K(n,n.gzhead.time>>8&255),K(n,n.gzhead.time>>16&255),K(n,n.gzhead.time>>24&255),K(n,n.level===9?2:n.strategy>=Zn||n.level<2?4:0),K(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(K(n,n.gzhead.extra.length&255),K(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=se(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Ls):(K(n,0),K(n,0),K(n,0),K(n,0),K(n,0),K(n,n.level===9?2:n.strategy>=Zn||n.level<2?4:0),K(n,Fu),n.status=Ee);else{var i=$n+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Zn||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=Pu),i+=31-i%31,n.status=Ee,Gr(n,i),n.strstart!==0&&(Gr(n,t.adler>>>16),Gr(n,t.adler&65535)),t.adler=1}if(n.status===Ls)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=se(t.adler,n.pending_buf,n.pending-o,o)),ie(t),o=n.pending,n.pending===n.pending_buf_size));)K(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=se(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Qn)}else n.status=Qn;if(n.status===Qn)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=se(t.adler,n.pending_buf,n.pending-o,o)),ie(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,K(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=se(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=Yn)}else n.status=Yn;if(n.status===Yn)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=se(t.adler,n.pending_buf,n.pending-o,o)),ie(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,K(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=se(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=jn)}else n.status=jn;if(n.status===jn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ie(t),n.pending+2<=n.pending_buf_size&&(K(n,t.adler&255),K(n,t.adler>>8&255),t.adler=0,n.status=Ee)):n.status=Ee),n.pending!==0){if(ie(t),t.avail_out===0)return n.last_flush=-1,Gt}else if(t.avail_in===0&&lf(e)<=lf(r)&&e!==le)return fe(t,Ds);if(n.status===zr&&t.avail_in!==0)return fe(t,Ds);if(t.avail_in!==0||n.lookahead!==0||e!==Te&&n.status!==zr){var f=n.strategy===Zn?zu(n,e):n.strategy===Tu?Gu(n,e):Ye[n.level].func(n,e);if((f===Se||f===je)&&(n.status=zr),f===$||f===Se)return t.avail_out===0&&(n.last_flush=-1),Gt;if(f===Kr&&(e===xu?St._tr_align(n):e!==cf&&(St._tr_stored_block(n,0,0,!1),e===gu&&(ae(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),ie(t),t.avail_out===0))return n.last_flush=-1,Gt}return e!==le?Gt:n.wrap<=0?ff:(n.wrap===2?(K(n,t.adler&255),K(n,t.adler>>8&255),K(n,t.adler>>16&255),K(n,t.adler>>24&255),K(n,t.total_in&255),K(n,t.total_in>>8&255),K(n,t.total_in>>16&255),K(n,t.total_in>>24&255)):(Gr(n,t.adler>>>16),Gr(n,t.adler&65535)),ie(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Gt:ff)}function qu(t){var e;return!t||!t.state?Rt:(e=t.state.status,e!==Jn&&e!==Ls&&e!==Qn&&e!==Yn&&e!==jn&&e!==Ee&&e!==zr?fe(t,Rt):(t.state=null,e===Ee?fe(t,Eu):Gt))}function Zu(t,e){var r=e.length,n,o,s,i,a,f,c,l;if(!t||!t.state||(n=t.state,i=n.wrap,i===2||i===1&&n.status!==Jn||n.lookahead))return Rt;for(i===1&&(t.adler=hf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(ae(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new ct.Buf8(n.w_size),ct.arraySet(l,e,r-n.w_size,n.w_size,0),e=l,r=n.w_size),a=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Re(n);n.lookahead>=G;){o=n.strstart,s=n.lookahead-(G-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+G-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=G-1,Re(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=G-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=i,Gt}zt.deflateInit=Xu;zt.deflateInit2=pf;zt.deflateReset=uf;zt.deflateResetKeep=df;zt.deflateSetHeader=Vu;zt.deflate=Wu;zt.deflateEnd=qu;zt.deflateSetDictionary=Zu;zt.deflateInfo="pako deflate (from Nodeca project)"});var Ns=J($e=>{"use strict";var to=Zt(),Af=!0,xf=!0;try{String.fromCharCode.apply(null,[0])}catch{Af=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{xf=!1}var Hr=new to.Buf8(256);for(Yt=0;Yt<256;Yt++)Hr[Yt]=Yt>=252?6:Yt>=248?5:Yt>=240?4:Yt>=224?3:Yt>=192?2:1;var Yt;Hr[254]=Hr[254]=1;$e.string2buf=function(t){var e,r,n,o,s,i=t.length,a=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new to.Buf8(a),s=0,o=0;s<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function gf(t,e){if(e<65534&&(t.subarray&&xf||!t.subarray&&Af))return String.fromCharCode.apply(null,to.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}$e.buf2binstring=function(t){return gf(t,t.length)};$e.binstring2buf=function(t){for(var e=new to.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};$e.buf2string=function(t,e){var r,n,o,s,i=e||t.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=t[r++],o<128){a[n++]=o;continue}if(s=Hr[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|t[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return gf(a,n)};$e.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Hr[t[r]]>e?r:e}});var Ps=J((kR,Ef)=>{"use strict";function Qu(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Ef.exports=Qu});var Mf=J(Wr=>{"use strict";var Vr=mf(),Xr=Zt(),Us=Ns(),ks=qn(),Yu=Ps(),Tf=Object.prototype.toString,ju=0,Fs=4,Je=0,Sf=1,Rf=2,$u=-1,Ju=0,tp=8;function Me(t){if(!(this instanceof Me))return new Me(t);this.options=Xr.assign({level:$u,method:tp,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ju,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yu,this.strm.avail_out=0;var r=Vr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Je)throw new Error(ks[r]);if(e.header&&Vr.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=Us.string2buf(e.dictionary):Tf.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Vr.deflateSetDictionary(this.strm,n),r!==Je)throw new Error(ks[r]);this._dict_set=!0}}Me.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Fs:ju,typeof t=="string"?r.input=Us.string2buf(t):Tf.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Xr.Buf8(n),r.next_out=0,r.avail_out=n),o=Vr.deflate(r,s),o!==Sf&&o!==Je)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Fs||s===Rf))&&(this.options.to==="string"?this.onData(Us.buf2binstring(Xr.shrinkBuf(r.output,r.next_out))):this.onData(Xr.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==Sf);return s===Fs?(o=Vr.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Je):(s===Rf&&(this.onEnd(Je),r.avail_out=0),!0)};Me.prototype.onData=function(t){this.chunks.push(t)};Me.prototype.onEnd=function(t){t===Je&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Xr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Gs(t,e){var r=new Me(e);if(r.push(t,!0),r.err)throw r.msg||ks[r.err];return r.result}function ep(t,e){return e=e||{},e.raw=!0,Gs(t,e)}function rp(t,e){return e=e||{},e.gzip=!0,Gs(t,e)}Wr.Deflate=Me;Wr.deflate=Gs;Wr.deflateRaw=ep;Wr.gzip=rp});var wf=J((zR,yf)=>{"use strict";var eo=30,np=12;yf.exports=function(e,r){var n,o,s,i,a,f,c,l,d,_,h,u,A,p,S,y,B,T,R,D,I,L,x,m,g;n=e.state,o=e.next_in,m=e.input,s=o+(e.avail_in-5),i=e.next_out,g=e.output,a=i-(r-e.avail_out),f=i+(e.avail_out-257),c=n.dmax,l=n.wsize,d=n.whave,_=n.wnext,h=n.window,u=n.hold,A=n.bits,p=n.lencode,S=n.distcode,y=(1<<n.lenbits)-1,B=(1<<n.distbits)-1;t:do{A<15&&(u+=m[o++]<<A,A+=8,u+=m[o++]<<A,A+=8),T=p[u&y];e:for(;;){if(R=T>>>24,u>>>=R,A-=R,R=T>>>16&255,R===0)g[i++]=T&65535;else if(R&16){D=T&65535,R&=15,R&&(A<R&&(u+=m[o++]<<A,A+=8),D+=u&(1<<R)-1,u>>>=R,A-=R),A<15&&(u+=m[o++]<<A,A+=8,u+=m[o++]<<A,A+=8),T=S[u&B];r:for(;;){if(R=T>>>24,u>>>=R,A-=R,R=T>>>16&255,R&16){if(I=T&65535,R&=15,A<R&&(u+=m[o++]<<A,A+=8,A<R&&(u+=m[o++]<<A,A+=8)),I+=u&(1<<R)-1,I>c){e.msg="invalid distance too far back",n.mode=eo;break t}if(u>>>=R,A-=R,R=i-a,I>R){if(R=I-R,R>d&&n.sane){e.msg="invalid distance too far back",n.mode=eo;break t}if(L=0,x=h,_===0){if(L+=l-R,R<D){D-=R;do g[i++]=h[L++];while(--R);L=i-I,x=g}}else if(_<R){if(L+=l+_-R,R-=_,R<D){D-=R;do g[i++]=h[L++];while(--R);if(L=0,_<D){R=_,D-=R;do g[i++]=h[L++];while(--R);L=i-I,x=g}}}else if(L+=_-R,R<D){D-=R;do g[i++]=h[L++];while(--R);L=i-I,x=g}for(;D>2;)g[i++]=x[L++],g[i++]=x[L++],g[i++]=x[L++],D-=3;D&&(g[i++]=x[L++],D>1&&(g[i++]=x[L++]))}else{L=i-I;do g[i++]=g[L++],g[i++]=g[L++],g[i++]=g[L++],D-=3;while(D>2);D&&(g[i++]=g[L++],D>1&&(g[i++]=g[L++]))}}else if(R&64){e.msg="invalid distance code",n.mode=eo;break t}else{T=S[(T&65535)+(u&(1<<R)-1)];continue r}break}}else if(R&64)if(R&32){n.mode=np;break t}else{e.msg="invalid literal/length code",n.mode=eo;break t}else{T=p[(T&65535)+(u&(1<<R)-1)];continue e}break}}while(o<s&&i<f);D=A>>3,o-=D,A-=D<<3,u&=(1<<A)-1,e.next_in=o,e.next_out=i,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=i<f?257+(f-i):257-(i-f),n.hold=u,n.bits=A}});var vf=J((KR,If)=>{"use strict";var Of=Zt(),tr=15,bf=852,Cf=592,Bf=0,zs=1,Df=2,op=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],sp=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],ip=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],ap=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];If.exports=function(e,r,n,o,s,i,a,f){var c=f.bits,l=0,d=0,_=0,h=0,u=0,A=0,p=0,S=0,y=0,B=0,T,R,D,I,L,x=null,m=0,g,E=new Of.Buf16(tr+1),U=new Of.Buf16(tr+1),F=null,k=0,N,j,nt;for(l=0;l<=tr;l++)E[l]=0;for(d=0;d<o;d++)E[r[n+d]]++;for(u=c,h=tr;h>=1&&E[h]===0;h--);if(u>h&&(u=h),h===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,f.bits=1,0;for(_=1;_<h&&E[_]===0;_++);for(u<_&&(u=_),S=1,l=1;l<=tr;l++)if(S<<=1,S-=E[l],S<0)return-1;if(S>0&&(e===Bf||h!==1))return-1;for(U[1]=0,l=1;l<tr;l++)U[l+1]=U[l]+E[l];for(d=0;d<o;d++)r[n+d]!==0&&(a[U[r[n+d]]++]=d);if(e===Bf?(x=F=a,g=19):e===zs?(x=op,m-=257,F=sp,k-=257,g=256):(x=ip,F=ap,g=-1),B=0,d=0,l=_,L=i,A=u,p=0,D=-1,y=1<<u,I=y-1,e===zs&&y>bf||e===Df&&y>Cf)return 1;for(;;){N=l-p,a[d]<g?(j=0,nt=a[d]):a[d]>g?(j=F[k+a[d]],nt=x[m+a[d]]):(j=32+64,nt=0),T=1<<l-p,R=1<<A,_=R;do R-=T,s[L+(B>>p)+R]=N<<24|j<<16|nt|0;while(R!==0);for(T=1<<l-1;B&T;)T>>=1;if(T!==0?(B&=T-1,B+=T):B=0,d++,--E[l]===0){if(l===h)break;l=r[n+a[d]]}if(l>u&&(B&I)!==D){for(p===0&&(p=u),L+=_,A=l-p,S=1<<A;A+p<h&&(S-=E[A+p],!(S<=0));)A++,S<<=1;if(y+=1<<A,e===zs&&y>bf||e===Df&&y>Cf)return 1;D=B&I,s[D]=u<<24|A<<16|L-i|0}}return B!==0&&(s[L+B]=l-p<<24|64<<16|0),f.bits=u,0}});var ul=J(wt=>{"use strict";var mt=Zt(),qs=Cs(),Kt=Bs(),cp=wf(),qr=vf(),fp=0,sl=1,il=2,Lf=4,lp=5,ro=6,ye=0,hp=1,_p=2,Tt=-2,al=-3,Zs=-4,dp=-5,Nf=8,cl=1,Pf=2,Ff=3,Uf=4,kf=5,Gf=6,zf=7,Kf=8,Hf=9,Vf=10,so=11,jt=12,Ks=13,Xf=14,Hs=15,Wf=16,qf=17,Zf=18,Qf=19,no=20,oo=21,Yf=22,jf=23,$f=24,Jf=25,tl=26,Vs=27,el=28,rl=29,q=30,Qs=31,up=32,pp=852,mp=592,Ap=15,xp=Ap;function nl(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function gp(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new mt.Buf16(320),this.work=new mt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fl(t){var e;return!t||!t.state?Tt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=cl,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new mt.Buf32(pp),e.distcode=e.distdyn=new mt.Buf32(mp),e.sane=1,e.back=-1,ye)}function ll(t){var e;return!t||!t.state?Tt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,fl(t))}function hl(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Tt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ll(t))}function _l(t,e){var r,n;return t?(n=new gp,t.state=n,n.window=null,r=hl(t,e),r!==ye&&(t.state=null),r):Tt}function Ep(t){return _l(t,xp)}var ol=!0,Xs,Ws;function Sp(t){if(ol){var e;for(Xs=new mt.Buf32(512),Ws=new mt.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(qr(sl,t.lens,0,288,Xs,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;qr(il,t.lens,0,32,Ws,0,t.work,{bits:5}),ol=!1}t.lencode=Xs,t.lenbits=9,t.distcode=Ws,t.distbits=5}function dl(t,e,r,n){var o,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new mt.Buf8(s.wsize)),n>=s.wsize?(mt.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),mt.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(mt.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function Rp(t,e){var r,n,o,s,i,a,f,c,l,d,_,h,u,A,p=0,S,y,B,T,R,D,I,L,x=new mt.Buf8(4),m,g,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Tt;r=t.state,r.mode===jt&&(r.mode=Ks),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,d=a,_=f,L=ye;t:for(;;)switch(r.mode){case cl:if(r.wrap===0){r.mode=Ks;break}for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=Kt(r.check,x,2,0),c=0,l=0,r.mode=Pf;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=q;break}if((c&15)!==Nf){t.msg="unknown compression method",r.mode=q;break}if(c>>>=4,l-=4,I=(c&15)+8,r.wbits===0)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=q;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?Vf:jt,c=0,l=0;break;case Pf:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Nf){t.msg="unknown compression method",r.mode=q;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=q;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Kt(r.check,x,2,0)),c=0,l=0,r.mode=Ff;case Ff:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=Kt(r.check,x,4,0)),c=0,l=0,r.mode=Uf;case Uf:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Kt(r.check,x,2,0)),c=0,l=0,r.mode=kf;case kf:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Kt(r.check,x,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Gf;case Gf:if(r.flags&1024&&(h=r.length,h>a&&(h=a),h&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),mt.arraySet(r.head.extra,n,s,h,I)),r.flags&512&&(r.check=Kt(r.check,n,h,s)),a-=h,s+=h,r.length-=h),r.length))break t;r.length=0,r.mode=zf;case zf:if(r.flags&2048){if(a===0)break t;h=0;do I=n[s+h++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Kt(r.check,n,h,s)),a-=h,s+=h,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=Kf;case Kf:if(r.flags&4096){if(a===0)break t;h=0;do I=n[s+h++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Kt(r.check,n,h,s)),a-=h,s+=h,I)break t}else r.head&&(r.head.comment=null);r.mode=Hf;case Hf:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=q;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=jt;break;case Vf:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=nl(c),c=0,l=0,r.mode=so;case so:if(r.havedict===0)return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,_p;t.adler=r.check=1,r.mode=jt;case jt:if(e===lp||e===ro)break t;case Ks:if(r.last){c>>>=l&7,l-=l&7,r.mode=Vs;break}for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Xf;break;case 1:if(Sp(r),r.mode=no,e===ro){c>>>=2,l-=2;break t}break;case 2:r.mode=qf;break;case 3:t.msg="invalid block type",r.mode=q}c>>>=2,l-=2;break;case Xf:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=q;break}if(r.length=c&65535,c=0,l=0,r.mode=Hs,e===ro)break t;case Hs:r.mode=Wf;case Wf:if(h=r.length,h){if(h>a&&(h=a),h>f&&(h=f),h===0)break t;mt.arraySet(o,n,s,h,i),a-=h,s+=h,f-=h,i+=h,r.length-=h;break}r.mode=jt;break;case qf:for(;l<14;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=q;break}r.have=0,r.mode=Zf;case Zf:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[E[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,m={bits:r.lenbits},L=qr(fp,r.lens,0,19,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid code lengths set",r.mode=q;break}r.have=0,r.mode=Qf;case Qf:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(B<16)c>>>=S,l-=S,r.lens[r.have++]=B;else{if(B===16){for(g=S+2;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=q;break}I=r.lens[r.have-1],h=3+(c&3),c>>>=2,l-=2}else if(B===17){for(g=S+3;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=S,l-=S,I=0,h=3+(c&7),c>>>=3,l-=3}else{for(g=S+7;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=S,l-=S,I=0,h=11+(c&127),c>>>=7,l-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=q;break}for(;h--;)r.lens[r.have++]=I}}if(r.mode===q)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=q;break}if(r.lenbits=9,m={bits:r.lenbits},L=qr(sl,r.lens,0,r.nlen,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid literal/lengths set",r.mode=q;break}if(r.distbits=6,r.distcode=r.distdyn,m={bits:r.distbits},L=qr(il,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,m),r.distbits=m.bits,L){t.msg="invalid distances set",r.mode=q;break}if(r.mode=no,e===ro)break t;case no:r.mode=oo;case oo:if(a>=6&&f>=258){t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,cp(t,_),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===jt&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(T=S,R=y,D=B;p=r.lencode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,r.length=B,y===0){r.mode=tl;break}if(y&32){r.back=-1,r.mode=jt;break}if(y&64){t.msg="invalid literal/length code",r.mode=q;break}r.extra=y&15,r.mode=Yf;case Yf:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=jf;case jf:for(;p=r.distcode[c&(1<<r.distbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(T=S,R=y,D=B;p=r.distcode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,y&64){t.msg="invalid distance code",r.mode=q;break}r.offset=B,r.extra=y&15,r.mode=$f;case $f:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=q;break}r.mode=Jf;case Jf:if(f===0)break t;if(h=_-f,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=q;break}h>r.wnext?(h-=r.wnext,u=r.wsize-h):u=r.wnext-h,h>r.length&&(h=r.length),A=r.window}else A=o,u=i-r.offset,h=r.length;h>f&&(h=f),f-=h,r.length-=h;do o[i++]=A[u++];while(--h);r.length===0&&(r.mode=oo);break;case tl:if(f===0)break t;o[i++]=r.length,f--,r.mode=oo;break;case Vs:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[s++]<<l,l+=8}if(_-=f,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?Kt(r.check,o,_,i-_):qs(r.check,o,_,i-_)),_=f,(r.flags?c:nl(c))!==r.check){t.msg="incorrect data check",r.mode=q;break}c=0,l=0}r.mode=el;case el:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=q;break}c=0,l=0}r.mode=rl;case rl:L=hp;break t;case q:L=al;break t;case Qs:return Zs;case up:default:return Tt}return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||_!==t.avail_out&&r.mode<q&&(r.mode<Vs||e!==Lf))&&dl(t,t.output,t.next_out,_-t.avail_out)?(r.mode=Qs,Zs):(d-=t.avail_in,_-=t.avail_out,t.total_in+=d,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?Kt(r.check,o,_,t.next_out-_):qs(r.check,o,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(r.mode===jt?128:0)+(r.mode===no||r.mode===Hs?256:0),(d===0&&_===0||e===Lf)&&L===ye&&(L=dp),L)}function Tp(t){if(!t||!t.state)return Tt;var e=t.state;return e.window&&(e.window=null),t.state=null,ye}function Mp(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Tt:(r.head=e,e.done=!1,ye)}function yp(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==so)?Tt:n.mode===so&&(o=1,o=qs(o,e,r,0),o!==n.check)?al:(s=dl(t,e,r,r),s?(n.mode=Qs,Zs):(n.havedict=1,ye))}wt.inflateReset=ll;wt.inflateReset2=hl;wt.inflateResetKeep=fl;wt.inflateInit=Ep;wt.inflateInit2=_l;wt.inflate=Rp;wt.inflateEnd=Tp;wt.inflateGetHeader=Mp;wt.inflateSetDictionary=yp;wt.inflateInfo="pako inflate (from Nodeca project)"});var Ys=J((VR,pl)=>{"use strict";pl.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Al=J((XR,ml)=>{"use strict";function wp(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}ml.exports=wp});var gl=J(Qr=>{"use strict";var er=ul(),Zr=Zt(),io=Ns(),Q=Ys(),js=qn(),Op=Ps(),bp=Al(),xl=Object.prototype.toString;function we(t){if(!(this instanceof we))return new we(t);this.options=Zr.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Op,this.strm.avail_out=0;var r=er.inflateInit2(this.strm,e.windowBits);if(r!==Q.Z_OK)throw new Error(js[r]);if(this.header=new bp,er.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=io.string2buf(e.dictionary):xl.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=er.inflateSetDictionary(this.strm,e.dictionary),r!==Q.Z_OK)))throw new Error(js[r])}we.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,f,c,l=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?Q.Z_FINISH:Q.Z_NO_FLUSH,typeof t=="string"?r.input=io.binstring2buf(t):xl.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Zr.Buf8(n),r.next_out=0,r.avail_out=n),s=er.inflate(r,Q.Z_NO_FLUSH),s===Q.Z_NEED_DICT&&o&&(s=er.inflateSetDictionary(this.strm,o)),s===Q.Z_BUF_ERROR&&l===!0&&(s=Q.Z_OK,l=!1),s!==Q.Z_STREAM_END&&s!==Q.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===Q.Z_STREAM_END||r.avail_in===0&&(i===Q.Z_FINISH||i===Q.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=io.utf8border(r.output,r.next_out),f=r.next_out-a,c=io.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&Zr.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(Zr.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==Q.Z_STREAM_END);return s===Q.Z_STREAM_END&&(i=Q.Z_FINISH),i===Q.Z_FINISH?(s=er.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Q.Z_OK):(i===Q.Z_SYNC_FLUSH&&(this.onEnd(Q.Z_OK),r.avail_out=0),!0)};we.prototype.onData=function(t){this.chunks.push(t)};we.prototype.onEnd=function(t){t===Q.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Zr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function $s(t,e){var r=new we(e);if(r.push(t,!0),r.err)throw r.msg||js[r.err];return r.result}function Cp(t,e){return e=e||{},e.raw=!0,$s(t,e)}Qr.Inflate=we;Qr.inflate=$s;Qr.inflateRaw=Cp;Qr.ungzip=$s});var Rl=J((qR,Sl)=>{"use strict";var Bp=Zt().assign,Dp=Mf(),Ip=gl(),vp=Ys(),El={};Bp(El,Dp,Ip,vp);Sl.exports=El});var Tl=J(()=>{});var Jr={};on(Jr,{ArcGISWebSceneLoader:()=>Pl,COORDINATE_SYSTEM:()=>Dt,I3SAttributeLoader:()=>jr,I3SBuildingSceneLayerLoader:()=>Il,I3SContentLoader:()=>Pn,I3SLoader:()=>Br,I3SNodePageLoader:()=>Gn,LayerError:()=>$r,SLPKArchive:()=>rr,SLPKLoader:()=>Ml,customizeColors:()=>kl,loadFeatureAttributes:()=>Cl,parseSLPKArchive:()=>co});sn(Jr,Ct(Ht(),1));var ql={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Zl={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},he={...ql,...Zl};var Ql=1/Math.PI*180,Yl=1/180*Math.PI,jl={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...jl}};var X=globalThis.mathgl.config;function ho(t,{precision:e=X.precision}={}){return t=$l(t),`${parseFloat(t.toPrecision(e))}`}function Bt(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function _o(t){return ai(t)}function uo(t){return ci(t)}function ai(t,e){return fi(t,r=>r*Yl,e)}function ci(t,e){return fi(t,r=>r*Ql,e)}function _t(t,e,r){let n=X.EPSILON;r&&(X.EPSILON=r);try{if(t===e)return!0;if(Bt(t)&&Bt(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!_t(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=X.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{X.EPSILON=n}}function $l(t){return Math.round(t/X.EPSILON)*X.EPSILON}function Jl(t){return t.clone?t.clone():new Array(t.length)}function fi(t,e,r){if(Bt(t)){let n=t;r=r||Jl(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof t=="number"?t:t[o];r[o]=e(s,o,r)}return r}return e(t)}var Jt=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Bt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(X)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+ho(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!_t(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let o=0;o<this.ELEMENTS;++o){let s=e[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(X.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function t0(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function z(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function te(t,e,r=""){if(X.debug&&!t0(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}function tt(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var De=class extends Jt{get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-e[n];r+=o*o}return z(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return z(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return tt(e>=0&&e<this.ELEMENTS,"index is out of range"),z(this[e])}setComponent(e,r){return tt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,or=Math.random;function Ie(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var ym=Math.PI/180;function e0(){let t=new W(2);return W!=Float32Array&&(t[0]=0,t[1]=0),t}function li(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function hi(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}var wm=function(){let t=e0();return function(e,r,n,o,s,i){let a,f;for(r||(r=2),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],s(t,t,i),e[a]=t[0],e[a+1]=t[1];return e}}();function _i(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function an(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function di(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t}function ui(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t[3]=e[3],t}function cn(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*s,t[1]=r[1]*n+r[4]*o+r[7]*s,t[2]=r[2]*n+r[5]*o+r[8]*s,t[3]=e[3],t}var ue={};on(ue,{add:()=>s0,angle:()=>go,bezier:()=>x0,ceil:()=>i0,clone:()=>r0,copy:()=>n0,create:()=>fn,cross:()=>_e,dist:()=>O0,distance:()=>gi,div:()=>w0,divide:()=>xi,dot:()=>sr,equals:()=>T0,exactEquals:()=>R0,floor:()=>a0,forEach:()=>B0,fromValues:()=>ln,hermite:()=>A0,inverse:()=>u0,len:()=>Eo,length:()=>pi,lerp:()=>p0,max:()=>f0,min:()=>c0,mul:()=>y0,multiply:()=>Ai,negate:()=>d0,normalize:()=>po,random:()=>g0,rotateX:()=>mo,rotateY:()=>Ao,rotateZ:()=>xo,round:()=>l0,scale:()=>h0,scaleAndAdd:()=>_0,set:()=>o0,slerp:()=>m0,sqrDist:()=>b0,sqrLen:()=>C0,squaredDistance:()=>Ei,squaredLength:()=>Si,str:()=>S0,sub:()=>M0,subtract:()=>mi,transformMat3:()=>ir,transformMat4:()=>de,transformQuat:()=>ar,zero:()=>E0});function fn(){let t=new W(3);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function r0(t){let e=new W(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function pi(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function ln(t,e,r){let n=new W(3);return n[0]=t,n[1]=e,n[2]=r,n}function n0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function o0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function s0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function mi(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Ai(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function xi(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function i0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function a0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function c0(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function f0(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function l0(t,e){return t[0]=Ie(e[0]),t[1]=Ie(e[1]),t[2]=Ie(e[2]),t}function h0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function _0(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function gi(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(r*r+n*n+o*o)}function Ei(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}function Si(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function d0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function u0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function po(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function sr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _e(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2];return t[0]=o*f-s*a,t[1]=s*i-n*f,t[2]=n*a-o*i,t}function p0(t,e,r,n){let o=e[0],s=e[1],i=e[2];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t}function m0(t,e,r,n){let o=Math.acos(Math.min(Math.max(sr(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function A0(t,e,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,f=i*(s-2)+s,c=i*(s-1),l=i*(3-2*s);return t[0]=e[0]*a+r[0]*f+n[0]*c+o[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+o[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+o[2]*l,t}function x0(t,e,r,n,o,s){let i=1-s,a=i*i,f=s*s,c=a*i,l=3*s*a,d=3*f*i,_=f*s;return t[0]=e[0]*c+r[0]*l+n[0]*d+o[0]*_,t[1]=e[1]*c+r[1]*l+n[1]*d+o[1]*_,t[2]=e[2]*c+r[2]*l+n[2]*d+o[2]*_,t}function g0(t,e){e=e===void 0?1:e;let r=or()*2*Math.PI,n=or()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function de(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,t[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,t[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,t[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,t}function ir(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=n*r[0]+o*r[3]+s*r[6],t[1]=n*r[1]+o*r[4]+s*r[7],t[2]=n*r[2]+o*r[5]+s*r[8],t}function ar(t,e,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=e[0],f=e[1],c=e[2],l=o*c-s*f,d=s*a-n*c,_=n*f-o*a,h=o*_-s*d,u=s*l-n*_,A=n*d-o*l,p=i*2;return l*=p,d*=p,_*=p,h*=2,u*=2,A*=2,t[0]=a+l+h,t[1]=f+d+u,t[2]=c+_+A,t}function mo(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ao(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xo(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function go(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&sr(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function E0(t){return t[0]=0,t[1]=0,t[2]=0,t}function S0(t){return`vec3(${t[0]}, ${t[1]}, ${t[2]})`}function R0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function T0(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var M0=mi,y0=Ai,w0=xi,O0=gi,b0=Ei,Eo=pi,C0=Si,B0=function(){let t=fn();return function(e,r,n,o,s,i){let a,f;for(r||(r=3),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var So=[0,0,0],hn,v=class extends De{static get ZERO(){return hn||(hn=new v(0,0,0),Object.freeze(hn)),hn}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Bt(e)?this.copy(e):(X.debug&&(z(e),z(r),z(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return X.debug&&(z(e.x),z(e.y),z(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=z(e)}angle(e){return go(this,e)}cross(e){return _e(this,this,e),this.check()}rotateX({radians:e,origin:r=So}){return mo(this,this,r,e),this.check()}rotateY({radians:e,origin:r=So}){return Ao(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=So}){return xo(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return de(this,this,e),this.check()}transformAsVector(e){return an(this,this,e),this.check()}transformByMatrix3(e){return ir(this,this,e),this.check()}transformByMatrix2(e){return di(this,this,e),this.check()}transformByQuaternion(e){return ar(this,this,e),this.check()}};var _n,Le=class extends De{static get ZERO(){return _n||(_n=new Le(0,0,0,0),Object.freeze(_n)),_n}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),Bt(e)&&arguments.length===1?this.copy(e):(X.debug&&(z(e),z(r),z(n),z(o)),this[0]=e,this[1]=r,this[2]=n,this[3]=o)}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return X.debug&&(z(e.x),z(e.y),z(e.z),z(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}transform(e){return de(this,this,e),this.check()}transformByMatrix3(e){return cn(this,this,e),this.check()}transformByMatrix2(e){return ui(this,this,e),this.check()}transformByQuaternion(e){return ar(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Ne=class extends Jt{toString(){let e="[";if(X.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${this[r]}`}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=z(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(e,r){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function Ri(){let t=new W(9);return W!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Ti(t,e){if(t===e){let r=e[1],n=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Mi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=l*i-a*c,_=-l*s+a*f,h=c*s-i*f,u=r*d+n*_+o*h;return u?(u=1/u,t[0]=d*u,t[1]=(-l*n+o*c)*u,t[2]=(a*n-o*i)*u,t[3]=_*u,t[4]=(l*r-o*f)*u,t[5]=(-a*r+o*s)*u,t[6]=h*u,t[7]=(-c*r+n*f)*u,t[8]=(i*r-n*s)*u,t):null}function yi(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8];return e*(c*s-i*f)+r*(-c*o+i*a)+n*(f*o-s*a)}function Ro(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1],u=r[2],A=r[3],p=r[4],S=r[5],y=r[6],B=r[7],T=r[8];return t[0]=_*n+h*i+u*c,t[1]=_*o+h*a+u*l,t[2]=_*s+h*f+u*d,t[3]=A*n+p*i+S*c,t[4]=A*o+p*a+S*l,t[5]=A*s+p*f+S*d,t[6]=y*n+B*i+T*c,t[7]=y*o+B*a+T*l,t[8]=y*s+B*f+T*d,t}function wi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1];return t[0]=n,t[1]=o,t[2]=s,t[3]=i,t[4]=a,t[5]=f,t[6]=_*n+h*i+c,t[7]=_*o+h*a+l,t[8]=_*s+h*f+d,t}function Oi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=Math.sin(r),h=Math.cos(r);return t[0]=h*n+_*i,t[1]=h*o+_*a,t[2]=h*s+_*f,t[3]=h*i-_*n,t[4]=h*a-_*o,t[5]=h*f-_*s,t[6]=c,t[7]=l,t[8]=d,t}function To(t,e,r){let n=r[0],o=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function bi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,d=n*a,_=o*i,h=o*a,u=o*f,A=s*i,p=s*a,S=s*f;return t[0]=1-d-u,t[3]=l-S,t[6]=_+p,t[1]=l+S,t[4]=1-c-u,t[7]=h-A,t[2]=_-p,t[5]=h+A,t[8]=1-c-d,t}var Mo;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(Mo||(Mo={}));var I0=Object.freeze([1,0,0,0,1,0,0,0,1]),Y=class extends Ne{static get IDENTITY(){return L0()}static get ZERO(){return v0()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Mo}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(I0)}fromObject(e){return this.check()}fromQuaternion(e){return bi(this,e),this.check()}set(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return yi(this)}transpose(){return Ti(this,this),this.check()}invert(){return Mi(this,this),this.check()}multiplyLeft(e){return Ro(this,e,this),this.check()}multiplyRight(e){return Ro(this,this,e),this.check()}rotate(e){return Oi(this,this,e),this.check()}scale(e){return Array.isArray(e)?To(this,this,e):To(this,this,[e,e]),this.check()}translate(e){return wi(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=li(r||[-0,-0],e,this);break;case 3:n=ir(r||[-0,-0,-0],e,this);break;case 4:n=cn(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return te(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},dn,un=null;function v0(){return dn||(dn=new Y([0,0,0,0,0,0,0,0,0]),Object.freeze(dn)),dn}function L0(){return un||(un=new Y,Object.freeze(un)),un}var fr={};on(fr,{add:()=>sh,adjoint:()=>G0,clone:()=>P0,copy:()=>F0,create:()=>N0,decompose:()=>Y0,determinant:()=>Oo,equals:()=>fh,exactEquals:()=>ch,frob:()=>oh,fromQuat:()=>Lo,fromQuat2:()=>q0,fromRotation:()=>H0,fromRotationTranslation:()=>Bi,fromRotationTranslationScale:()=>j0,fromRotationTranslationScaleOrigin:()=>$0,fromScaling:()=>K0,fromTranslation:()=>z0,fromValues:()=>U0,fromXRotation:()=>V0,fromYRotation:()=>X0,fromZRotation:()=>W0,frustum:()=>No,getRotation:()=>Q0,getScaling:()=>Di,getTranslation:()=>Z0,identity:()=>Ci,invert:()=>wo,lookAt:()=>Uo,mul:()=>lh,multiply:()=>cr,multiplyScalar:()=>ih,multiplyScalarAndAdd:()=>ah,ortho:()=>Fo,orthoNO:()=>vi,orthoZO:()=>eh,perspective:()=>Po,perspectiveFromFieldOfView:()=>th,perspectiveNO:()=>Ii,perspectiveZO:()=>J0,rotate:()=>Bo,rotateX:()=>Do,rotateY:()=>Io,rotateZ:()=>vo,scale:()=>Co,set:()=>k0,str:()=>nh,sub:()=>hh,subtract:()=>Li,targetTo:()=>rh,translate:()=>bo,transpose:()=>yo});function N0(){let t=new W(16);return W!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function P0(t){let e=new W(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function F0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function U0(t,e,r,n,o,s,i,a,f,c,l,d,_,h,u,A){let p=new W(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=d,p[12]=_,p[13]=h,p[14]=u,p[15]=A,p}function k0(t,e,r,n,o,s,i,a,f,c,l,d,_,h,u,A,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=s,t[5]=i,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=d,t[11]=_,t[12]=h,t[13]=u,t[14]=A,t[15]=p,t}function Ci(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yo(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],s=e[6],i=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=o,t[13]=i,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function wo(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],A=e[13],p=e[14],S=e[15],y=r*a-n*i,B=r*f-o*i,T=r*c-s*i,R=n*f-o*a,D=n*c-s*a,I=o*c-s*f,L=l*A-d*u,x=l*p-_*u,m=l*S-h*u,g=d*p-_*A,E=d*S-h*A,U=_*S-h*p,F=y*U-B*E+T*g+R*m-D*x+I*L;return F?(F=1/F,t[0]=(a*U-f*E+c*g)*F,t[1]=(o*E-n*U-s*g)*F,t[2]=(A*I-p*D+S*R)*F,t[3]=(_*D-d*I-h*R)*F,t[4]=(f*m-i*U-c*x)*F,t[5]=(r*U-o*m+s*x)*F,t[6]=(p*T-u*I-S*B)*F,t[7]=(l*I-_*T+h*B)*F,t[8]=(i*E-a*m+c*L)*F,t[9]=(n*m-r*E-s*L)*F,t[10]=(u*D-A*T+S*y)*F,t[11]=(d*T-l*D-h*y)*F,t[12]=(a*x-i*g-f*L)*F,t[13]=(r*g-n*x+o*L)*F,t[14]=(A*B-u*R-p*y)*F,t[15]=(l*R-d*B+_*y)*F,t):null}function G0(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],A=e[13],p=e[14],S=e[15],y=r*a-n*i,B=r*f-o*i,T=r*c-s*i,R=n*f-o*a,D=n*c-s*a,I=o*c-s*f,L=l*A-d*u,x=l*p-_*u,m=l*S-h*u,g=d*p-_*A,E=d*S-h*A,U=_*S-h*p;return t[0]=a*U-f*E+c*g,t[1]=o*E-n*U-s*g,t[2]=A*I-p*D+S*R,t[3]=_*D-d*I-h*R,t[4]=f*m-i*U-c*x,t[5]=r*U-o*m+s*x,t[6]=p*T-u*I-S*B,t[7]=l*I-_*T+h*B,t[8]=i*E-a*m+c*L,t[9]=n*m-r*E-s*L,t[10]=u*D-A*T+S*y,t[11]=d*T-l*D-h*y,t[12]=a*x-i*g-f*L,t[13]=r*g-n*x+o*L,t[14]=A*B-u*R-p*y,t[15]=l*R-d*B+_*y,t}function Oo(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8],l=t[9],d=t[10],_=t[11],h=t[12],u=t[13],A=t[14],p=t[15],S=e*i-r*s,y=e*a-n*s,B=r*a-n*i,T=c*u-l*h,R=c*A-d*h,D=l*A-d*u,I=e*D-r*R+n*T,L=s*D-i*R+a*T,x=c*B-l*y+d*S,m=h*B-u*y+A*S;return f*I-o*L+p*x-_*m}function cr(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=e[9],h=e[10],u=e[11],A=e[12],p=e[13],S=e[14],y=e[15],B=r[0],T=r[1],R=r[2],D=r[3];return t[0]=B*n+T*a+R*d+D*A,t[1]=B*o+T*f+R*_+D*p,t[2]=B*s+T*c+R*h+D*S,t[3]=B*i+T*l+R*u+D*y,B=r[4],T=r[5],R=r[6],D=r[7],t[4]=B*n+T*a+R*d+D*A,t[5]=B*o+T*f+R*_+D*p,t[6]=B*s+T*c+R*h+D*S,t[7]=B*i+T*l+R*u+D*y,B=r[8],T=r[9],R=r[10],D=r[11],t[8]=B*n+T*a+R*d+D*A,t[9]=B*o+T*f+R*_+D*p,t[10]=B*s+T*c+R*h+D*S,t[11]=B*i+T*l+R*u+D*y,B=r[12],T=r[13],R=r[14],D=r[15],t[12]=B*n+T*a+R*d+D*A,t[13]=B*o+T*f+R*_+D*p,t[14]=B*s+T*c+R*h+D*S,t[15]=B*i+T*l+R*u+D*y,t}function bo(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,d,_,h,u,A,p,S;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*s+e[12],t[13]=e[1]*n+e[5]*o+e[9]*s+e[13],t[14]=e[2]*n+e[6]*o+e[10]*s+e[14],t[15]=e[3]*n+e[7]*o+e[11]*s+e[15]):(i=e[0],a=e[1],f=e[2],c=e[3],l=e[4],d=e[5],_=e[6],h=e[7],u=e[8],A=e[9],p=e[10],S=e[11],t[0]=i,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=d,t[6]=_,t[7]=h,t[8]=u,t[9]=A,t[10]=p,t[11]=S,t[12]=i*n+l*o+u*s+e[12],t[13]=a*n+d*o+A*s+e[13],t[14]=f*n+_*o+p*s+e[14],t[15]=c*n+h*o+S*s+e[15]),t}function Co(t,e,r){let n=r[0],o=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Bo(t,e,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),f,c,l,d,_,h,u,A,p,S,y,B,T,R,D,I,L,x,m,g,E,U,F,k;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,d=e[0],_=e[1],h=e[2],u=e[3],A=e[4],p=e[5],S=e[6],y=e[7],B=e[8],T=e[9],R=e[10],D=e[11],I=o*o*l+f,L=s*o*l+i*c,x=i*o*l-s*c,m=o*s*l-i*c,g=s*s*l+f,E=i*s*l+o*c,U=o*i*l+s*c,F=s*i*l-o*c,k=i*i*l+f,t[0]=d*I+A*L+B*x,t[1]=_*I+p*L+T*x,t[2]=h*I+S*L+R*x,t[3]=u*I+y*L+D*x,t[4]=d*m+A*g+B*E,t[5]=_*m+p*g+T*E,t[6]=h*m+S*g+R*E,t[7]=u*m+y*g+D*E,t[8]=d*U+A*F+B*k,t[9]=_*U+p*F+T*k,t[10]=h*U+S*F+R*k,t[11]=u*U+y*F+D*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function Do(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[4],i=e[5],a=e[6],f=e[7],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*o+c*n,t[5]=i*o+l*n,t[6]=a*o+d*n,t[7]=f*o+_*n,t[8]=c*o-s*n,t[9]=l*o-i*n,t[10]=d*o-a*n,t[11]=_*o-f*n,t}function Io(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o-c*n,t[1]=i*o-l*n,t[2]=a*o-d*n,t[3]=f*o-_*n,t[8]=s*n+c*o,t[9]=i*n+l*o,t[10]=a*n+d*o,t[11]=f*n+_*o,t}function vo(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[4],l=e[5],d=e[6],_=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o+c*n,t[1]=i*o+l*n,t[2]=a*o+d*n,t[3]=f*o+_*n,t[4]=c*o-s*n,t[5]=l*o-i*n,t[6]=d*o-a*n,t[7]=_*o-f*n,t}function z0(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function K0(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function H0(t,e,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,f,c;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+s*f,t[2]=s*n*c-o*f,t[3]=0,t[4]=n*o*c-s*f,t[5]=o*o*c+a,t[6]=s*o*c+n*f,t[7]=0,t[8]=n*s*c+o*f,t[9]=o*s*c-n*f,t[10]=s*s*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function V0(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function X0(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function W0(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=n+n,f=o+o,c=s+s,l=n*a,d=n*f,_=n*c,h=o*f,u=o*c,A=s*c,p=i*a,S=i*f,y=i*c;return t[0]=1-(h+A),t[1]=d+y,t[2]=_-S,t[3]=0,t[4]=d-y,t[5]=1-(l+A),t[6]=u+p,t[7]=0,t[8]=_+S,t[9]=u-p,t[10]=1-(l+h),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function q0(t,e){let r=new W(3),n=-e[0],o=-e[1],s=-e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=n*n+o*o+s*s+i*i;return d>0?(r[0]=(a*i+l*n+f*s-c*o)*2/d,r[1]=(f*i+l*o+c*n-a*s)*2/d,r[2]=(c*i+l*s+a*o-f*n)*2/d):(r[0]=(a*i+l*n+f*s-c*o)*2,r[1]=(f*i+l*o+c*n-a*s)*2,r[2]=(c*i+l*s+a*o-f*n)*2),Bi(t,e,r),t}function Z0(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Di(t,e){let r=e[0],n=e[1],o=e[2],s=e[4],i=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+o*o),t[1]=Math.sqrt(s*s+i*i+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function Q0(t,e){let r=new W(3);Di(r,e);let n=1/r[0],o=1/r[1],s=1/r[2],i=e[0]*n,a=e[1]*o,f=e[2]*s,c=e[4]*n,l=e[5]*o,d=e[6]*s,_=e[8]*n,h=e[9]*o,u=e[10]*s,A=i+l+u,p=0;return A>0?(p=Math.sqrt(A+1)*2,t[3]=.25*p,t[0]=(d-h)/p,t[1]=(_-f)/p,t[2]=(a-c)/p):i>l&&i>u?(p=Math.sqrt(1+i-l-u)*2,t[3]=(d-h)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(_+f)/p):l>u?(p=Math.sqrt(1+l-i-u)*2,t[3]=(_-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(d+h)/p):(p=Math.sqrt(1+u-i-l)*2,t[3]=(a-c)/p,t[0]=(_+f)/p,t[1]=(d+h)/p,t[2]=.25*p),t}function Y0(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],f=n[5],c=n[6],l=n[8],d=n[9],_=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+d*d+_*_);let h=1/r[0],u=1/r[1],A=1/r[2],p=o*h,S=s*u,y=i*A,B=a*h,T=f*u,R=c*A,D=l*h,I=d*u,L=_*A,x=p+T+L,m=0;return x>0?(m=Math.sqrt(x+1)*2,t[3]=.25*m,t[0]=(R-I)/m,t[1]=(D-y)/m,t[2]=(S-B)/m):p>T&&p>L?(m=Math.sqrt(1+p-T-L)*2,t[3]=(R-I)/m,t[0]=.25*m,t[1]=(S+B)/m,t[2]=(D+y)/m):T>L?(m=Math.sqrt(1+T-p-L)*2,t[3]=(D-y)/m,t[0]=(S+B)/m,t[1]=.25*m,t[2]=(R+I)/m):(m=Math.sqrt(1+L-p-T)*2,t[3]=(S-B)/m,t[0]=(D+y)/m,t[1]=(R+I)/m,t[2]=.25*m),t}function j0(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=o+o,c=s+s,l=i+i,d=o*f,_=o*c,h=o*l,u=s*c,A=s*l,p=i*l,S=a*f,y=a*c,B=a*l,T=n[0],R=n[1],D=n[2];return t[0]=(1-(u+p))*T,t[1]=(_+B)*T,t[2]=(h-y)*T,t[3]=0,t[4]=(_-B)*R,t[5]=(1-(d+p))*R,t[6]=(A+S)*R,t[7]=0,t[8]=(h+y)*D,t[9]=(A-S)*D,t[10]=(1-(d+u))*D,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function $0(t,e,r,n,o){let s=e[0],i=e[1],a=e[2],f=e[3],c=s+s,l=i+i,d=a+a,_=s*c,h=s*l,u=s*d,A=i*l,p=i*d,S=a*d,y=f*c,B=f*l,T=f*d,R=n[0],D=n[1],I=n[2],L=o[0],x=o[1],m=o[2],g=(1-(A+S))*R,E=(h+T)*R,U=(u-B)*R,F=(h-T)*D,k=(1-(_+S))*D,N=(p+y)*D,j=(u+B)*I,nt=(p-y)*I,V=(1-(_+A))*I;return t[0]=g,t[1]=E,t[2]=U,t[3]=0,t[4]=F,t[5]=k,t[6]=N,t[7]=0,t[8]=j,t[9]=nt,t[10]=V,t[11]=0,t[12]=r[0]+L-(g*L+F*x+j*m),t[13]=r[1]+x-(E*L+k*x+nt*m),t[14]=r[2]+m-(U*L+N*x+V*m),t[15]=1,t}function Lo(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,d=n*a,_=o*i,h=o*a,u=o*f,A=s*i,p=s*a,S=s*f;return t[0]=1-d-u,t[1]=l+S,t[2]=_-p,t[3]=0,t[4]=l-S,t[5]=1-c-u,t[6]=h+A,t[7]=0,t[8]=_+p,t[9]=h-A,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function No(t,e,r,n,o,s,i){let a=1/(r-e),f=1/(o-n),c=1/(s-i);return t[0]=s*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(i+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*c,t[15]=0,t}function Ii(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=(o+n)*i,t[14]=2*o*n*i}else t[10]=-1,t[14]=-2*n;return t}var Po=Ii;function J0(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=o*i,t[14]=o*n*i}else t[10]=-1,t[14]=-n;return t}function th(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(o+s);return t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((i-a)*f*.5),t[9]=(o-s)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function vi(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=(i+s)*c,t[15]=1,t}var Fo=vi;function eh(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=s*c,t[15]=1,t}function Uo(t,e,r,n){let o,s,i,a,f,c,l,d,_,h,u=e[0],A=e[1],p=e[2],S=n[0],y=n[1],B=n[2],T=r[0],R=r[1],D=r[2];return Math.abs(u-T)<1e-6&&Math.abs(A-R)<1e-6&&Math.abs(p-D)<1e-6?Ci(t):(d=u-T,_=A-R,h=p-D,o=1/Math.sqrt(d*d+_*_+h*h),d*=o,_*=o,h*=o,s=y*h-B*_,i=B*d-S*h,a=S*_-y*d,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),f=_*a-h*i,c=h*s-d*a,l=d*i-_*s,o=Math.sqrt(f*f+c*c+l*l),o?(o=1/o,f*=o,c*=o,l*=o):(f=0,c=0,l=0),t[0]=s,t[1]=f,t[2]=d,t[3]=0,t[4]=i,t[5]=c,t[6]=_,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(s*u+i*A+a*p),t[13]=-(f*u+c*A+l*p),t[14]=-(d*u+_*A+h*p),t[15]=1,t)}function rh(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],d=s-r[1],_=i-r[2],h=l*l+d*d+_*_;h>0&&(h=1/Math.sqrt(h),l*=h,d*=h,_*=h);let u=f*_-c*d,A=c*l-a*_,p=a*d-f*l;return h=u*u+A*A+p*p,h>0&&(h=1/Math.sqrt(h),u*=h,A*=h,p*=h),t[0]=u,t[1]=A,t[2]=p,t[3]=0,t[4]=d*p-_*A,t[5]=_*u-l*p,t[6]=l*A-d*u,t[7]=0,t[8]=l,t[9]=d,t[10]=_,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t}function nh(t){return`mat4(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}, ${t[4]}, ${t[5]}, ${t[6]}, ${t[7]}, ${t[8]}, ${t[9]}, ${t[10]}, ${t[11]}, ${t[12]}, ${t[13]}, ${t[14]}, ${t[15]})`}function oh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function sh(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Li(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function ih(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function ah(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function ch(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function fh(t,e){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],f=t[6],c=t[7],l=t[8],d=t[9],_=t[10],h=t[11],u=t[12],A=t[13],p=t[14],S=t[15],y=e[0],B=e[1],T=e[2],R=e[3],D=e[4],I=e[5],L=e[6],x=e[7],m=e[8],g=e[9],E=e[10],U=e[11],F=e[12],k=e[13],N=e[14],j=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-B)<=1e-6*Math.max(1,Math.abs(n),Math.abs(B))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(i-D)<=1e-6*Math.max(1,Math.abs(i),Math.abs(D))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(l-m)<=1e-6*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(d-g)<=1e-6*Math.max(1,Math.abs(d),Math.abs(g))&&Math.abs(_-E)<=1e-6*Math.max(1,Math.abs(_),Math.abs(E))&&Math.abs(h-U)<=1e-6*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(u-F)<=1e-6*Math.max(1,Math.abs(u),Math.abs(F))&&Math.abs(A-k)<=1e-6*Math.max(1,Math.abs(A),Math.abs(k))&&Math.abs(p-N)<=1e-6*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(S-j)<=1e-6*Math.max(1,Math.abs(S),Math.abs(j))}var lh=cr,hh=Li;function _h(){let t=new W(4);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Ni(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Pi(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Fi(t){let e=t[0],r=t[1],n=t[2],o=t[3];return Math.sqrt(e*e+r*r+n*n+o*o)}function Ui(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function ki(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=r*i,t[1]=n*i,t[2]=o*i,t[3]=s*i,t}function Gi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function zi(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t[3]=a+n*(r[3]-a),t}function Ki(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,t[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,t[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,t[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,t}function Hi(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*s-f*o,d=c*o+f*n-i*s,_=c*s+i*o-a*n,h=-i*n-a*o-f*s;return t[0]=l*c+h*-i+d*-f-_*-a,t[1]=d*c+h*-a+_*-i-l*-f,t[2]=_*c+h*-f+l*-a-d*-i,t[3]=e[3],t}var $m=function(){let t=_h();return function(e,r,n,o,s,i){let a,f;for(r||(r=4),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var zo;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(zo||(zo={}));var uh=45*Math.PI/180,ph=1,ko=.1,Go=500,mh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),dt=class extends Ne{static get IDENTITY(){return xh()}static get ZERO(){return Ah()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return zo}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,o,s,i,a,f,c,l,d,_,h,u,A,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=d,this[11]=_,this[12]=h,this[13]=u,this[14]=A,this[15]=p,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,d,_,h,u,A,p){return this[0]=e,this[1]=s,this[2]=c,this[3]=h,this[4]=r,this[5]=i,this[6]=l,this[7]=u,this[8]=n,this[9]=a,this[10]=d,this[11]=A,this[12]=o,this[13]=f,this[14]=_,this[15]=p,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(mh)}fromObject(e){return this.check()}fromQuaternion(e){return Lo(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=ko,far:a=Go}=e;return a===1/0?gh(this,r,n,o,s,i):No(this,r,n,o,s,i,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return Uo(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=ko,far:a=Go}=e;return Fo(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=uh,aspect:n=ph,focalDistance:o=1,near:s=ko,far:i=Go}=e;Vi(r);let a=r/2,f=o*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:s,far:i})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=e;return Vi(r),Po(this,r,n,o,s),this.check()}determinant(){return Oo(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*s,e[6]=this[6]*i,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*s,e[10]=this[10]*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=this[4]*o,e[4]=this[5]*s,e[5]=this[6]*i,e[6]=this[8]*o,e[7]=this[9]*s,e[8]=this[10]*i,e}transpose(){return yo(this,this),this.check()}invert(){return wo(this,this),this.check()}multiplyLeft(e){return cr(this,e,this),this.check()}multiplyRight(e){return cr(this,this,e),this.check()}rotateX(e){return Do(this,this,e),this.check()}rotateY(e){return Io(this,this,e),this.check()}rotateZ(e){return vo(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return Bo(this,this,e,r),this.check()}scale(e){return Co(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return bo(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Ki(r||[-0,-0,-0,-0],e,this),te(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=hi(r||[-0,-0],e,this);break;case 3:o=de(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return te(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=_i(r||[-0,-0],e,this);break;case 3:n=an(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return te(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},pn,mn;function Ah(){return pn||(pn=new dt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(pn)),pn}function xh(){return mn||(mn=new dt,Object.freeze(mn)),mn}function Vi(t){if(t>Math.PI*2)throw Error("expected radians")}function gh(t,e,r,n,o,s){let i=2*s/(r-e),a=2*s/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,d=-1,_=-2*s;return t[0]=i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=f,t[9]=c,t[10]=l,t[11]=d,t[12]=0,t[13]=0,t[14]=_,t[15]=0,t}function Xi(){let t=new W(4);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Wi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ko(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Ho(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+i*a+o*c-s*f,t[1]=o*l+i*f+s*a-n*c,t[2]=s*l+i*c+n*f-o*a,t[3]=i*l-n*a-o*f-s*c,t}function qi(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+i*a,t[1]=o*f+s*a,t[2]=s*f-o*a,t[3]=i*f-n*a,t}function Zi(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-s*a,t[1]=o*f+i*a,t[2]=s*f+n*a,t[3]=i*f-o*a,t}function Qi(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+o*a,t[1]=o*f-n*a,t[2]=s*f+i*a,t[3]=i*f-s*a,t}function Yi(t,e){let r=e[0],n=e[1],o=e[2];return t[0]=r,t[1]=n,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t}function lr(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=r[0],c=r[1],l=r[2],d=r[3],_,h,u,A,p;return _=o*f+s*c+i*l+a*d,_<0&&(_=-_,f=-f,c=-c,l=-l,d=-d),1-_>1e-6?(h=Math.acos(_),p=Math.sin(h),u=Math.sin((1-n)*h)/p,A=Math.sin(n*h)/p):(u=1-n,A=n),t[0]=u*o+A*f,t[1]=u*s+A*c,t[2]=u*i+A*l,t[3]=u*a+A*d,t}function ji(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=s*a,t}function $i(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Vo(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[o*3+o]&&(o=2);let s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[s*3+s]-e[i*3+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[s*3+i]-e[i*3+s])*n,t[s]=(e[s*3+o]+e[o*3+s])*n,t[i]=(e[i*3+o]+e[o*3+i])*n}return t}var Ji=Ni;var ta=Pi,ea=Gi,ra=zi,na=Fi;var oa=Ui;var sa=ki;var ia=function(){let t=fn(),e=ln(1,0,0),r=ln(0,1,0);return function(n,o,s){let i=sr(o,s);return i<-.999999?(_e(t,e,o),Eo(t)<1e-6&&_e(t,r,o),po(t,t),Ko(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(_e(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,sa(n,n))}}(),_A=function(){let t=Xi(),e=Xi();return function(r,n,o,s,i,a){return lr(t,n,i,a),lr(e,o,s,a),lr(r,t,e,2*a*(1-a)),r}}(),dA=function(){let t=Ri();return function(e,r,n,o){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],sa(e,Vo(e,t))}}();var Eh=[0,0,0,1],Pe=class extends Jt{constructor(e=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,o)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Vo(this,e),this.check()}fromAxisRotation(e,r){return Ko(this,e,r),this.check()}identity(){return Wi(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}len(){return na(this)}lengthSquared(){return oa(this)}dot(e){return ea(this,e)}rotationTo(e,r){return ia(this,e,r),this.check()}add(e){return Ji(this,this,e),this.check()}calculateW(){return Yi(this,this),this.check()}conjugate(){return $i(this,this),this.check()}invert(){return ji(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(ra(this,e,r,n),this.check())}multiplyRight(e){return Ho(this,this,e),this.check()}multiplyLeft(e){return Ho(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return qi(this,this,e),this.check()}rotateY(e){return Zi(this,this,e),this.check()}rotateZ(e){return Qi(this,this,e),this.check()}scale(e){return ta(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=Eh,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return lr(this,o,s,i),this.check()}transformVector4(e,r=new Le){return Hi(r,e,this),te(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var Vt={};on(Vt,{EPSILON1:()=>Sh,EPSILON10:()=>Bh,EPSILON11:()=>Dh,EPSILON12:()=>Ih,EPSILON13:()=>vh,EPSILON14:()=>Lh,EPSILON15:()=>Nh,EPSILON16:()=>Ph,EPSILON17:()=>Fh,EPSILON18:()=>Uh,EPSILON19:()=>kh,EPSILON2:()=>Rh,EPSILON20:()=>Gh,EPSILON3:()=>Th,EPSILON4:()=>Mh,EPSILON5:()=>yh,EPSILON6:()=>wh,EPSILON7:()=>Oh,EPSILON8:()=>bh,EPSILON9:()=>Ch,PI_OVER_FOUR:()=>Kh,PI_OVER_SIX:()=>Hh,PI_OVER_TWO:()=>zh,TWO_PI:()=>Vh});var Sh=.1,Rh=.01,Th=.001,Mh=1e-4,yh=1e-5,wh=1e-6,Oh=1e-7,bh=1e-8,Ch=1e-9,Bh=1e-10,Dh=1e-11,Ih=1e-12,vh=1e-13,Lh=1e-14,Nh=1e-15,Ph=1e-16,Fh=1e-17,Uh=1e-18,kh=1e-19,Gh=1e-20,zh=Math.PI/2,Kh=Math.PI/4,Hh=Math.PI/6,Vh=Math.PI*2;function Xo(t){switch(t){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${t}`)}}var aa={UInt8:he.UNSIGNED_BYTE,UInt16:he.UNSIGNED_SHORT,Float32:he.FLOAT,UInt32:he.UNSIGNED_INT,UInt64:he.DOUBLE};function Fe(t){switch(t){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${t}`)}}var ca="String",fa="Oid32",la="Float64",ha="Int16",Dt;(function(t){t[t.DEFAULT=-1]="DEFAULT",t[t.LNGLAT=1]="LNGLAT",t[t.METER_OFFSETS=2]="METER_OFFSETS",t[t.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",t[t.CARTESIAN=0]="CARTESIAN"})(Dt||(Dt={}));var Tc=Ct(Ht(),1);var Mr=Ct(Ht(),1);var Xt=6356752314245179e-9,Xh={radii:[6378137,6378137,Xt],radiiSquared:[6378137*6378137,6378137*6378137,Xt*Xt],oneOverRadii:[1/6378137,1/6378137,1/Xt],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Xt*Xt)],maximumRadius:Math.max(6378137,6378137,Xt),centerToleranceSquared:.1};function An(t){return t}var qA=new v;function Wh(t,e=[],r=An){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function _a(t,e=[]){return Wh(t,e,X._cartographicRadians?An:_o)}function qh(t,e,r=An){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function da(t,e){return qh(t,e,X._cartographicRadians?An:uo)}var ua=1e-14,Zh=new v,pa={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Wo={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},hr={east:new v,north:new v,up:new v,west:new v,south:new v,down:new v},Qh=new v,Yh=new v,jh=new v;function qo(t,e,r,n,o,s){let i=pa[e]&&pa[e][r];tt(i&&(!n||n===i));let a,f,c,l=Zh.copy(o);if(_t(l.x,0,ua)&&_t(l.y,0,ua)){let _=Math.sign(l.z);a=Qh.fromArray(Wo[e]),e!=="east"&&e!=="west"&&a.scale(_),f=Yh.fromArray(Wo[r]),r!=="east"&&r!=="west"&&f.scale(_),c=jh.fromArray(Wo[n]),n!=="east"&&n!=="west"&&c.scale(_)}else{let{up:_,east:h,north:u}=hr;h.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,_),u.copy(_).cross(h);let{down:A,west:p,south:S}=hr;A.copy(_).scale(-1),p.copy(h).scale(-1),S.copy(u).scale(-1),a=hr[e],f=hr[r],c=hr[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=c.x,s[9]=c.y,s[10]=c.z,s[11]=0,s[12]=l.x,s[13]=l.y,s[14]=l.z,s[15]=1,s}var Ue=new v,$h=new v,Jh=new v;function ma(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;Ue.from(t);let i=Ue.x,a=Ue.y,f=Ue.z,c=n.x,l=n.y,d=n.z,_=i*i*c*c,h=a*a*l*l,u=f*f*d*d,A=_+h+u,p=Math.sqrt(1/A);if(!Number.isFinite(p))return;let S=$h;if(S.copy(t).scale(p),A<s)return S.to(r);let y=o.x,B=o.y,T=o.z,R=Jh;R.set(S.x*y*2,S.y*B*2,S.z*T*2);let D=(1-p)*Ue.len()/(.5*R.len()),I=0,L,x,m,g;do{D-=I,L=1/(1+D*y),x=1/(1+D*B),m=1/(1+D*T);let E=L*L,U=x*x,F=m*m,k=E*L,N=U*x,j=F*m;g=_*E+h*U+u*F-1;let V=-2*(_*k*y+h*N*B+u*j*T);I=g/V}while(Math.abs(g)>Vt.EPSILON12);return Ue.scale([L,x,m]).to(r)}var xn=new v,Aa=new v,r1=new v,Mt=new v,n1=new v,gn=new v,At=class{constructor(e=0,r=0,n=0){this.centerToleranceSquared=Vt.EPSILON1,tt(e>=0),tt(r>=0),tt(n>=0),this.radii=new v(e,r,n),this.radiiSquared=new v(e*e,r*r,n*n),this.radiiToTheFourth=new v(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new v(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new v(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=Aa,o=r1,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){gn.from(e);let n=this.scaleToGeodeticSurface(gn,Mt);if(!n)return;let o=this.geodeticSurfaceNormal(n,Aa),s=n1;s.copy(gn).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(ue.dot(s,gn))*ue.length(s);return da([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new dt){return qo(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new dt){return qo(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return xn.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=_a(e),o=n[0],s=n[1],i=Math.cos(s);return xn.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),xn.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return xn.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return ma(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Mt.from(e);let n=Mt.x,o=Mt.y,s=Mt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return Mt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return Mt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return Mt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){tt(_t(this.radii.x,this.radii.y,Vt.EPSILON15)),tt(this.radii.z>0),Mt.from(e);let o=Mt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Mt.set(0,0,o).to(n)}};At.WGS84=new At(6378137,6378137,Xt);async function Zo(t,e,r,n){return n._parse(t,e,r,n)}function ee(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var It={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},o1=It.self||It.window||It.global||{},s1=It.window||It.self||It.global||{},i1=It.global||It.self||It.window||{},a1=It.document||{};var xt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var xa=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),c1=xa&&parseFloat(xa[1])||0;function _r(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function Qo(t){return globalThis.loaders?.modules?.[t]||null}function f1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.4.0-alpha.1"),globalThis._loadersgl_.version}var ga=f1();function Ea(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var vt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},px=vt.self||vt.window||vt.global||{},mx=vt.window||vt.self||vt.global||{},Ax=vt.global||vt.self||vt.window||{},xx=vt.document||{};var ke=typeof process!="object"||String(process)!=="[object process]"||process.browser,En=typeof importScripts=="function",gx=typeof window<"u"&&typeof window.orientation<"u",Sa=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ex=Sa&&parseFloat(Sa[1])||0;var Yo={};async function Lt(t,e=null,r={},n=null){return e&&(t=Ra(t,e,r,n)),Yo[t]=Yo[t]||l1(t),await Yo[t]}function Ra(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:ke?r.CDN?(Ea(r.CDN.startsWith("http")),`${r.CDN}/${e}@${ga}/dist/libs/${n}`):En?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function l1(t){if(t.endsWith("wasm"))return await _1(t);if(!ke)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(En)return importScripts(t);let e=await d1(t);return h1(e,t)}function h1(t,e){if(!ke){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(En)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function _1(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return ke||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function d1(t){let{readFileAsText:e}=globalThis.loaders||{};return ke||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function re(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),o=new Uint8Array(e);for(let s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function Ge(...t){return Ta(t)}function Ta(t){let e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=e.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.byteLength;return n.buffer}async function dr(t){let e=[];for await(let r of t)e.push(r);return Ge(...e)}function Ma(t){return t&&typeof t=="object"&&t.isBuffer}function ze(t){if(Ma(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){let e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function Ke(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var ur=new Error("Not implemented"),Sn=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw xt?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(e,r){throw ur}async write(e,r,n){throw ur}async stat(){throw ur}async truncate(e){throw ur}async append(e){throw ur}async close(){}};var jo=t=>t?.getUint8&&t?.slice&&t?.length;var pr=class{file;constructor(e,r=!1){this.file=new Sn(e,r?"a+":"r")}async truncate(e){await this.file.truncate(e)}async append(e){await this.file.append(e)}async destroy(){await this.file.close()}async getUint8(e){let r=await this.file.read(e,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(e){let r=await this.file.read(e,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(e){let r=await this.file.read(e,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(e){let r=await this.file.read(e,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(e,r){let n=r-e;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let o=Number(n);return await this.file.read(e,o)}get length(){return this.file.bigsize}};var He=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},pe=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(He(e))}async getUint16(e){return this.file.getUint16(He(e),!0)}async getUint32(e){return this.file.getUint32(He(e),!0)}async getBigUint64(e){return this.file.getBigUint64(He(e),!0)}async slice(e,r){return this.file.buffer.slice(He(e),He(r))}get length(){return BigInt(this.file.byteLength)}};var ya="4.4.0-alpha.1";var u1=globalThis.loaders?.parseImageNode,$o=typeof Image<"u",Jo=typeof ImageBitmap<"u",p1=Boolean(u1),ts=xt?!0:p1;function wa(t){switch(t){case"auto":return Jo||$o||ts;case"imagebitmap":return Jo;case"image":return $o;case"data":return ts;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Oa(){if(Jo)return"imagebitmap";if($o)return"image";if(ts)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function m1(t){let e=A1(t);if(!e)throw new Error("Not an image");return e}function ba(t){switch(m1(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function A1(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var x1=/^data:image\/svg\+xml/,g1=/\.svg((\?|#).*)?$/;function Rn(t){return t&&(x1.test(t)||g1.test(t))}function Ca(t,e){if(Rn(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return es(t,e)}function es(t,e){if(Rn(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Tn(t,e,r){let n=Ca(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await E1(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function E1(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var S1={},Ba=!0;async function Da(t,e,r){let n;Rn(r)?n=await Tn(t,e,r):n=es(t,r);let o=e&&e.imagebitmap;return await R1(n,o)}async function R1(t,e=null){if((T1(e)||!Ba)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Ba=!1}return await createImageBitmap(t)}function T1(t){for(let e in t||S1)return!1;return!0}function Ia(t){return!O1(t,"ftyp",4)||!(t[8]&96)?null:M1(t)}function M1(t){switch(y1(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function y1(t,e,r){return String.fromCharCode(...t.slice(e,r))}function w1(t){return[...t].map(e=>e.charCodeAt(0))}function O1(t,e,r=0){let n=w1(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var Nt=!1,mr=!0;function Mn(t){let e=Ar(t);return C1(e)||I1(e)||B1(e)||D1(e)||b1(e)}function b1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Ia(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function C1(t){let e=Ar(t);return e.byteLength>=24&&e.getUint32(0,Nt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Nt),height:e.getUint32(20,Nt)}:null}function B1(t){let e=Ar(t);return e.byteLength>=10&&e.getUint32(0,Nt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,mr),height:e.getUint16(8,mr)}:null}function D1(t){let e=Ar(t);return e.byteLength>=14&&e.getUint16(0,Nt)===16973&&e.getUint32(2,mr)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,mr),height:e.getUint32(22,mr)}:null}function I1(t){let e=Ar(t);if(!(e.byteLength>=3&&e.getUint16(0,Nt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=v1(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,Nt);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,Nt),width:e.getUint16(s+7,Nt)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,Nt)}return null}function v1(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Ar(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function va(t,e){let{mimeType:r}=Mn(t)||{},n=globalThis.loaders?.parseImageNode;return ee(n),await n(t,r)}async function La(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=L1(o),a;switch(i){case"imagebitmap":a=await Da(t,e,s);break;case"image":a=await Tn(t,e,s);break;case"data":a=await va(t,e);break;default:ee(!1)}return o==="data"&&(a=ba(a)),a}function L1(t){switch(t){case"auto":case"data":return Oa();default:return wa(t),t}}var N1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],P1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],F1={image:{type:"auto",decode:!0}},yn={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:ya,mimeTypes:P1,extensions:N1,parse:La,tests:[t=>Boolean(Mn(new DataView(t)))],options:F1};var U1="1.5.6",k1="1.4.1",rs=`https://www.gstatic.com/draco/versioned/decoders/${U1}`,lt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},ns={[lt.DECODER]:`${rs}/${lt.DECODER}`,[lt.DECODER_WASM]:`${rs}/${lt.DECODER_WASM}`,[lt.FALLBACK_DECODER]:`${rs}/${lt.FALLBACK_DECODER}`,[lt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${k1}/javascript/${lt.ENCODER}`},os;async function Na(t){let e=t.modules||{};return e.draco3d?os||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):os||=G1(t),await os}async function G1(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await Lt(ns[lt.FALLBACK_DECODER],"draco",t,lt.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await Lt(ns[lt.DECODER],"draco",t,lt.DECODER),await Lt(ns[lt.DECODER_WASM],"draco",t,lt.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await z1(e,r)}function z1(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Pa="4.4.0-alpha.1";function Fa(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function ss(t){let e=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],d=a[c+1],_=a[c+2];e=l<e?l:e,r=d<r?d:r,n=_<n?_:n,o=l>o?l:o,s=d>s?d:s,i=_>i?_:i}return[[e,r,n],[o,s,i]]}function is(t,e,r){let n=Fa(e.value),o=r||Ua(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function Ua(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function Ga(t,e,r){let n=za(e.metadata),o=[],s=K1(e.attributes);for(let i in t){let a=t[i],f=ka(i,a,s[i]);o.push(f)}if(r){let i=ka("indices",r);o.push(i)}return{fields:o,metadata:n}}function K1(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function ka(t,e,r){let n=r?za(r.metadata):void 0;return is(t,e,n)}function za(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Ka={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},H1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},V1=4,xr=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let _=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(_)}let a=this._getDracoLoaderData(s,o,r),f=this._getMeshData(s,a,r),c=ss(f.attributes),l=Ga(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:s}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let s=this.decoder.GetAttribute(e,o),i=this._getAttributeMetadata(e,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(s,r);f&&(n[s.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let o=this._getMeshAttributes(r,e,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,r,n){let o={};for(let s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:f,size:c}=a;o[i]={value:f,size:c,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*V1,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),q1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=H1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=X1(this.draco,n),c,l=this.draco._malloc(a);try{let d=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,d,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,i).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=e.attribute_type;for(let i in Ka)if(this.draco[i]===o)return Ka[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let o=0;o<n;o++){let s=this.metadataQuerier.GetEntryName(e,o);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=W1(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,o=[...r,...n];for(let s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function X1(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function W1(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function q1(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var Ha={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Pa,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}},as={...Ha,parse:Z1};async function Z1(t,e){let{draco:r}=await Na(e),n=new xr(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var wn="4.4.0-alpha.1";var On={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Va;async function fs(t){_r(t.modules);let e=Qo("basis");return e||(Va||=Q1(t),await Va)}async function Q1(t){let e=null,r=null;return[e,r]=await Promise.all([await Lt(On.TRANSCODER,"textures",t),await Lt(On.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await Y1(e,r)}function Y1(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var cs;async function ls(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(cs=cs||j1(t),await cs)}async function j1(t){let e=null,r=null;return[e,r]=await Promise.all([await Lt(On.ENCODER,"textures",t),await Lt(On.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await $1(e,r)}function $1(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:f})})})}var M={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var J1=["","WEBKIT_","MOZ_"],Xa={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},bn=null;function gr(t){if(!bn){t=t||t_()||void 0,bn=new Set;for(let e of J1)for(let r in Xa)if(t&&t.getExtension(`${e}${r}`)){let n=Xa[r];bn.add(n)}}return bn}function t_(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var hs=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},me=class{constructor(e,r,n,o){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=o,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*r;return this._offset+=8,n}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){let n=this._offset,o=0;for(;this._dataView.getUint8(this._offset)!==r&&o<e;)o++,this._offset++;return o<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,o)}};var _g=new Uint8Array([0]),it=[171,75,84,88,32,50,48,187,13,10,26,10];function Wa(t){return new TextDecoder().decode(t)}function qa(t){let e=new Uint8Array(t.buffer,t.byteOffset,it.length);if(e[0]!==it[0]||e[1]!==it[1]||e[2]!==it[2]||e[3]!==it[3]||e[4]!==it[4]||e[5]!==it[5]||e[6]!==it[6]||e[7]!==it[7]||e[8]!==it[8]||e[9]!==it[9]||e[10]!==it[10]||e[11]!==it[11])throw new Error("Missing KTX 2.0 identifier.");let r=new hs,n=17*Uint32Array.BYTES_PER_ELEMENT,o=new me(t,it.length,n,!0);r.vkFormat=o._nextUint32(),r.typeSize=o._nextUint32(),r.pixelWidth=o._nextUint32(),r.pixelHeight=o._nextUint32(),r.pixelDepth=o._nextUint32(),r.layerCount=o._nextUint32(),r.faceCount=o._nextUint32();let s=o._nextUint32();r.supercompressionScheme=o._nextUint32();let i=o._nextUint32(),a=o._nextUint32(),f=o._nextUint32(),c=o._nextUint32(),l=o._nextUint64(),d=o._nextUint64(),_=s*3*8,h=new me(t,it.length+n,_,!0);for(let ot=0;ot<s;ot++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+h._nextUint64(),h._nextUint64()),uncompressedByteLength:h._nextUint64()});let u=new me(t,i,a,!0),A={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},p=6,S=4,y=(A.descriptorBlockSize/4-p)/S;for(let ot=0;ot<y;ot++){let Ot={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};Ot.channelType&64?(Ot.sampleLower=u._nextInt32(),Ot.sampleUpper=u._nextInt32()):(Ot.sampleLower=u._nextUint32(),Ot.sampleUpper=u._nextUint32()),A.samples[ot]=Ot}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(A);let B=new me(t,f,c,!0);for(;B._offset<c;){let ot=B._nextUint32(),Ot=B._scan(ot),Be=Wa(Ot);if(r.keyValue[Be]=B._nextUint8Array(ot-Ot.byteLength-1),Be.match(/^ktx/i)){let w=Wa(r.keyValue[Be]);r.keyValue[Be]=w.substring(0,w.lastIndexOf("\0"))}let O=ot%4?4-ot%4:0;B._skip(O)}if(d<=0)return r;let T=new me(t,l,d,!0),R=T._nextUint16(),D=T._nextUint16(),I=T._nextUint32(),L=T._nextUint32(),x=T._nextUint32(),m=T._nextUint32(),g=[];for(let ot=0;ot<s;ot++)g.push({imageFlags:T._nextUint32(),rgbSliceByteOffset:T._nextUint32(),rgbSliceByteLength:T._nextUint32(),alphaSliceByteOffset:T._nextUint32(),alphaSliceByteLength:T._nextUint32()});let E=l+T._offset,U=E+I,F=U+L,k=F+x,N=new Uint8Array(t.buffer,t.byteOffset+E,I),j=new Uint8Array(t.buffer,t.byteOffset+U,L),nt=new Uint8Array(t.buffer,t.byteOffset+F,x),V=new Uint8Array(t.buffer,t.byteOffset+k,m);return r.globalData={endpointCount:R,selectorCount:D,imageDescs:g,endpointsData:N,selectorsData:j,tablesData:nt,extendedData:V},r}function Ve(t,e){let r=new Array(e.mipMapLevels),n=e.width,o=e.height,s=0;for(let i=0;i<e.mipMapLevels;++i){let a=r_(e,n,o,t,i),f=e_(t,i,s,a);r[i]={compressed:!0,format:e.internalFormat,data:f,width:n,height:o,levelSize:a},n=Math.max(1,n>>1),o=Math.max(1,o>>1),s+=a}return r}function e_(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function r_(t,e,r,n,o){return Array.isArray(n)?t.sizeFunction(n[o]):t.sizeFunction(e,r)}var n_={131:M.COMPRESSED_RGB_S3TC_DXT1_EXT,132:M.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:M.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:M.COMPRESSED_RED_RGTC1_EXT,140:M.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:M.COMPRESSED_RED_GREEN_RGTC2_EXT,142:M.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:M.COMPRESSED_RGB8_ETC2,148:M.COMPRESSED_SRGB8_ETC2,149:M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:M.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:M.COMPRESSED_RGBA8_ETC2_EAC,152:M.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:M.COMPRESSED_R11_EAC,154:M.COMPRESSED_SIGNED_R11_EAC,155:M.COMPRESSED_RG11_EAC,156:M.COMPRESSED_SIGNED_RG11_EAC,157:M.COMPRESSED_RGBA_ASTC_4x4_KHR,158:M.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:M.COMPRESSED_RGBA_ASTC_5x4_KHR,160:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:M.COMPRESSED_RGBA_ASTC_5x5_KHR,162:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:M.COMPRESSED_RGBA_ASTC_6x5_KHR,164:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:M.COMPRESSED_RGBA_ASTC_6x6_KHR,166:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:M.COMPRESSED_RGBA_ASTC_8x5_KHR,168:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:M.COMPRESSED_RGBA_ASTC_8x6_KHR,170:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:M.COMPRESSED_RGBA_ASTC_8x8_KHR,172:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:M.COMPRESSED_RGBA_ASTC_10x5_KHR,174:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:M.COMPRESSED_RGBA_ASTC_10x6_KHR,176:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:M.COMPRESSED_RGBA_ASTC_10x8_KHR,178:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:M.COMPRESSED_RGBA_ASTC_10x10_KHR,180:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:M.COMPRESSED_RGBA_ASTC_12x10_KHR,182:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:M.COMPRESSED_RGBA_ASTC_12x12_KHR,184:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:M.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:M.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:M.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:M.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:M.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:M.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:M.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:M.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:M.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:M.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:M.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:M.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:M.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:M.COMPRESSED_RGBA_ASTC_12x12_KHR};function Za(t){return n_[t]}var ut=[171,75,84,88,32,50,48,187,13,10,26,10];function Cn(t){let e=new Uint8Array(t);return!(e.byteLength<ut.length||e[0]!==ut[0]||e[1]!==ut[1]||e[2]!==ut[2]||e[3]!==ut[3]||e[4]!==ut[4]||e[5]!==ut[5]||e[6]!==ut[6]||e[7]!==ut[7]||e[8]!==ut[8]||e[9]!==ut[9]||e[10]!==ut[10]||e[11]!==ut[11])}function Qa(t){let e=new Uint8Array(t),r=qa(e),n=Math.max(1,r.levels.length),o=r.pixelWidth,s=r.pixelHeight,i=Za(r.vkFormat);return Ve(r.levels,{mipMapLevels:n,width:o,height:s,sizeFunction:a=>a.uncompressedByteLength,internalFormat:i})}var o_={etc1:{basisFormat:0,compressed:!0,format:M.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:M.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:M.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:M.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Bn(t,e){if(e.basis.containerFormat==="auto"){if(Cn(t)){let n=await ls(e);return Ya(n.KTX2File,t,e)}let{BasisFile:r}=await fs(e);return _s(r,t,e)}switch(e.basis.module){case"encoder":let r=await ls(e);switch(e.basis.containerFormat){case"ktx2":return Ya(r.KTX2File,t,e);case"basis":default:return _s(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await fs(e);return _s(n,t,e)}}function _s(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(s_(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function s_(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ja(n,i),l=t.getImageTranscodedSizeInBytes(e,r,c),d=new Uint8Array(l);if(!t.transcodeImage(d,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:d,compressed:a,format:f,hasAlpha:i}}function Ya(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),s=[];for(let i=0;i<o;i++)s.push(i_(n,i,r));return[s]}finally{n.close(),n.delete()}}function i_(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=ja(r,n),c=t.getImageTranscodedSizeInBytes(e,0,0,f),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:s,height:o,data:l,compressed:i,levelSize:c,hasAlpha:n,format:a}}function ja(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Dn()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),o_[r]}function Dn(){let t=gr();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var $a={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:wn,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Er={...$a,parse:Bn};var pt={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},a_={DXT1:M.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":M.COMPRESSED_RGB_ATC_WEBGL,ATCA:M.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:M.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},c_=ec,f_=In,l_=In,h_={DXT1:ec,DXT3:In,DXT5:In,"ATC ":c_,ATCA:f_,ATCI:l_};function Ja(t){return new Uint32Array(t,0,pt.HEADER_LENGTH)[pt.MAGIC_NUMBER_INDEX]===pt.MAGIC_NUMBER}function tc(t){let e=new Int32Array(t,0,pt.HEADER_LENGTH),r=e[pt.HEADER_PF_FOURCC_INDEX];ee(Boolean(e[pt.HEADER_PF_FLAGS_INDEX]&pt.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=__(r),o=a_[n],s=h_[n];ee(o&&s,`DDS: Unknown pixel format ${r}`);let i=1;e[pt.HEADER_FLAGS_INDEX]&pt.DDSD_MIPMAPCOUNT&&(i=Math.max(1,e[pt.MIPMAPCOUNT_INDEX]));let a=e[pt.HEADER_WIDTH_INDEX],f=e[pt.HEADER_HEIGHT_INDEX],c=e[pt.HEADER_SIZE_INDEX]+4,l=new Uint8Array(t,c);return Ve(l,{mipMapLevels:i,width:a,height:f,sizeFunction:s,internalFormat:o})}function ec(t,e){return(t+3>>2)*(e+3>>2)*8}function In(t,e){return(t+3>>2)*(e+3>>2)*16}function __(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var gt={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},d_={0:[M.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[M.COMPRESSED_RGB_ETC1_WEBGL],7:[M.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[M.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[M.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[M.COMPRESSED_RGB8_ETC2],23:[M.COMPRESSED_RGBA8_ETC2_EAC],24:[M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[M.COMPRESSED_R11_EAC],26:[M.COMPRESSED_RG11_EAC],27:[M.COMPRESSED_RGBA_ASTC_4X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[M.COMPRESSED_RGBA_ASTC_5X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[M.COMPRESSED_RGBA_ASTC_5X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[M.COMPRESSED_RGBA_ASTC_6X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[M.COMPRESSED_RGBA_ASTC_6X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[M.COMPRESSED_RGBA_ASTC_8X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[M.COMPRESSED_RGBA_ASTC_8X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[M.COMPRESSED_RGBA_ASTC_8X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[M.COMPRESSED_RGBA_ASTC_10X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[M.COMPRESSED_RGBA_ASTC_10X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[M.COMPRESSED_RGBA_ASTC_10X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[M.COMPRESSED_RGBA_ASTC_10X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[M.COMPRESSED_RGBA_ASTC_12X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[M.COMPRESSED_RGBA_ASTC_12X12_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},u_={0:rc,1:rc,2:nc,3:nc,6:Sr,7:Sr,9:Rr,11:Rr,22:Sr,23:Rr,24:Sr,25:Sr,26:Rr,27:Rr,28:p_,29:m_,30:A_,31:x_,32:g_,33:E_,34:S_,35:R_,36:T_,37:M_,38:y_,39:w_,40:O_};function oc(t){let r=new Uint32Array(t,0,gt.HEADER_LENGTH)[gt.MAGIC_NUMBER_INDEX];return r===gt.MAGIC_NUMBER||r===gt.MAGIC_NUMBER_EXTRA}function sc(t){let e=new Uint32Array(t,0,gt.HEADER_LENGTH),r=e[gt.PIXEL_FORMAT_INDEX],n=e[gt.COLOUR_SPACE_INDEX],o=d_[r]||[],s=o.length>1&&n?o[1]:o[0],i=u_[r],a=e[gt.MIPMAPCOUNT_INDEX],f=e[gt.WIDTH_INDEX],c=e[gt.HEIGHT_INDEX],l=gt.HEADER_SIZE+e[gt.METADATA_SIZE_INDEX],d=new Uint8Array(t,l);return Ve(d,{mipMapLevels:a,width:f,height:c,sizeFunction:i,internalFormat:s})}function rc(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function nc(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function Sr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function Rr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function p_(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function m_(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function A_(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function x_(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function g_(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function E_(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function S_(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function R_(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function T_(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function M_(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function y_(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function w_(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function O_(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}function ic(t){if(Cn(t))return Qa(t);if(Ja(t))return tc(t);if(oc(t))return sc(t);throw new Error("Texture container format not recognized")}var ac={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:wn,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},vn={...ac,parse:async(t,e)=>e?.["compressed-texture"]?.useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},(await Bn(t,e))[0]):ic(t)};var Tr;(function(t){t.vertexCount="vertexCount",t.featureCount="featureCount"})(Tr||(Tr={}));function Ln(t){let e;try{let r=new URL(t);e=`${r.origin}${r.pathname}`,e.startsWith("null")&&(e=null)}catch{e=null}return e||t}function Pt(t,e=null){return e?`${t}?token=${e}`:t}function cc(t,e){let{attributeData:r=[]}=e,n=[];for(let o=0;o<r.length;o++){let s=r[o].href.replace("./","");n.push(`${t}/${s}`)}return n}function fc(t,e,r){let n=[],{attributeStorageInfo:o=[]}=t;for(let s=0;s<o.length;s++){let i=o[s].key;n.push(`${e}/nodes/${r}/attributes/${i}/0`)}return n}var Nn=new v([0,0,0]);function b_(t){switch(t){case"ktx-etc2":case"dds":return vn;case"ktx2":return Er;case"jpg":case"png":default:return yn}}var C_="i3s-attribute-type";async function dc(t,e,r,n,o){let s={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new dt,coordinateSystem:0,byteLength:0,texture:null};if(e.textureUrl){let i=Pt(e.textureUrl,n?.i3s?.token),a=b_(e.textureFormat),l=await(await(o?.fetch||fetch)(i)).arrayBuffer();if(n?.i3s.decodeTextures){if(a===yn){let d={...e.textureLoaderOptions,image:{type:"data"}};try{let _=await Zo(l,[],d,o);s.texture=_}catch{let h=await(0,Mr.parse)(l,a,d,o);s.texture=h}}else if(a===vn||a===Er){let d=await(0,Mr.load)(l,a,e.textureLoaderOptions);a===Er&&(d=d[0]),s.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else s.texture=l}return s.material=U_(e.materialDefinition,s.texture),s.material&&(s.texture=null),await B_(t,s,e,r,n)}async function B_(t,e,r,n,o){let s=t.byteLength,i,a,f=0,c=0,l;if(r.isDracoGeometry){let d=await(0,Mr.parse)(t,as,{draco:{attributeNameEntry:C_}});a=d.header.vertexCount,l=d.indices?.value;let{POSITION:_,NORMAL:h,COLOR_0:u,TEXCOORD_0:A,["feature-index"]:p,["uv-region"]:S}=d.attributes;i={position:_,normal:h,color:u,uv0:A,uvRegion:S,id:p},D_(i,d);let y=K_(p);y&&z_(i,y)}else{let{vertexAttributes:d,ordering:_,featureAttributes:h,featureAttributeOrder:u}=n.store.defaultGeometrySchema,A=v_(t,n);f=A.byteOffset,a=A.vertexCount,c=A.featureCount;let{attributes:p,byteOffset:S}=hc(t,f,d,a,_),{attributes:y}=hc(t,S,h,c,u);G_(y),i=I_(p,y)}if(!o?.i3s?.coordinateSystem||o.i3s.coordinateSystem===Dt.METER_OFFSETS){let d=N_(i.position,r);e.modelMatrix=d.invert(),e.coordinateSystem=Dt.METER_OFFSETS}else e.modelMatrix=F_(i.position),e.coordinateSystem=Dt.LNGLAT_OFFSETS;e.attributes={positions:i.position,normals:i.normal,colors:lc(i.color),texCoords:i.uv0,uvRegions:lc(i.uvRegion||i.region)},e.indices=l||null,i.id&&i.id.value&&(e.featureIds=i.id.value);for(let d in e.attributes)e.attributes[d]||delete e.attributes[d];return e.vertexCount=a,e.byteLength=s,e}function D_(t,e){for(let r in e.loaderData.attributes){let n=e.loaderData.attributes[r];switch(n.name){case"POSITION":t.position.metadata=n.metadata;break;case"feature-index":t.id.metadata=n.metadata;break;default:break}}}function I_(t,e){return{...t,...e}}function lc(t){return t&&(t.normalized=!0,t)}function v_(t,e){let r=0,n=0,o=0;for(let{property:s,type:i}of e.store.defaultGeometrySchema.header){let a=Xo(i);switch(s){case Tr.vertexCount.toString():n=new a(t,0,4)[0],r+=Fe(i);break;case Tr.featureCount.toString():o=new a(t,4,4)[0],r+=Fe(i);break;default:break}}return{vertexCount:n,featureCount:o,byteOffset:r}}function hc(t,e,r,n,o){let s={};for(let i of o)if(r[i]){let{valueType:a,valuesPerElement:f}=r[i];if(e+n*f*Fe(a)<=t.byteLength){let c=t.slice(e),l;if(a==="UInt64")l=L_(c,n*f,Fe(a));else{let d=Xo(a);l=new d(c,0,n*f)}switch(s[i]={value:l,type:aa[a],size:f},i){case"color":s.color.normalized=!0;break;case"position":case"region":case"normal":default:}e=e+n*f*Fe(a)}else if(i!=="uv0")break}return{attributes:s,byteOffset:e}}function L_(t,e,r){let n=[],o=new DataView(t),s=0;for(let i=0;i<e;i++){let a=o.getUint32(s,!0),f=o.getUint32(s+4,!0),c=a+2**32*f;n.push(c),s+=r}return new Uint32Array(n)}function N_(t,e){let r=e.mbs,n=t.value,o=t.metadata,s=new dt,i=new v(r[0],r[1],r[2]),a=new v;return At.WGS84.cartographicToCartesian(i,a),At.WGS84.eastNorthUpToFixedFrame(a,s),t.value=P_(n,o,i),s}function P_(t,e={},r){let n=new Float64Array(t.length),o=e["i3s-scale_x"]&&e["i3s-scale_x"].double||1,s=e["i3s-scale_y"]&&e["i3s-scale_y"].double||1;for(let i=0;i<n.length;i+=3)n[i]=t[i]*o+r.x,n[i+1]=t[i+1]*s+r.y,n[i+2]=t[i+2]+r.z;for(let i=0;i<n.length;i+=3)At.WGS84.cartographicToCartesian(n.subarray(i,i+3),Nn),n[i]=Nn.x,n[i+1]=Nn.y,n[i+2]=Nn.z;return n}function F_(t){let e=t.metadata,r=e?.["i3s-scale_x"]?.double||1,n=e?.["i3s-scale_y"]?.double||1,o=new dt;return o[0]=r,o[5]=n,o}function U_(t,e){let r;return t?r={...t,pbrMetallicRoughness:t.pbrMetallicRoughness?{...t.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},e?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=_c(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=_c(r.pbrMetallicRoughness.baseColorFactor)),e&&k_(r,e),r}function _c(t){let e=[...t];for(let r=0;r<t.length;r++)e[r]=t[r]/255;return e}function k_(t,e){let r={source:{image:e}};t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?t.pbrMetallicRoughness.baseColorTexture={...t.pbrMetallicRoughness.baseColorTexture,texture:r}:t.emissiveTexture?t.emissiveTexture={...t.emissiveTexture,texture:r}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?t.pbrMetallicRoughness.metallicRoughnessTexture={...t.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:t.normalTexture?t.normalTexture={...t.normalTexture,texture:r}:t.occlusionTexture&&(t.occlusionTexture={...t.occlusionTexture,texture:r})}function G_(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,o=r.value,s=o[o.length-1]+1,i=new Uint32Array(s*3),a=0,f=0;for(let c=1;c<o.length;c+=2){let l=Number(n[a]),d=o[c],_=o[c-1],h=d-_+1,u=f+h*3;i.fill(l,f,u),a++,f=u}t.id.value=i}function z_(t,e){let r=t.id.value,n=new Float32Array(r.length);for(let o=0;o<r.length;o++)n[o]=e[r[o]];t.id.value=n}function K_(t){return t?.metadata?.["i3s-feature-ids"]?.intArray}var H_="4.4.0-alpha.1",Pn={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:H_,mimeTypes:["application/octet-stream"],parse:V_,extensions:["bin"],options:{"i3s-content":{}}};async function V_(t,e,r){let{tile:n,_tileOptions:o,tileset:s,_tilesetOptions:i}=e?.i3s||{},a=o||n,f=i||s;return!a||!f?null:await dc(t,a,f,e,r)}var et={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var _E=new v,dE=new v;var yr=new v,uc=new v,ne=class{constructor(e=[0,0,0],r=0){this.radius=-0,this.center=new v,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=yr.from(r),this.center=new v().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new ne(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=yr.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return e.clone();let f=(n+a+s)*.5;return uc.copy(i).scale((-n+f)/a).add(r),this.center.copy(uc),this.radius=f,this}expand(e){let n=yr.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=fr.getScaling(yr,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=yr.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,s=e.normal.dot(r)+e.distance;return s<-n?et.OUTSIDE:s<n?et.INTERSECTING:et.INSIDE}};var X_=new v,W_=new v,Fn=new v,Un=new v,kn=new v,q_=new v,Z_=new v,Wt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},oe=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new v().from(e),this.halfAxes=new Y(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new v(e).len(),new v(r).len(),new v(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new v(e).normalize(),s=new v(r).normalize(),i=new v(n).normalize();return new Pe().fromMatrix3(new Y([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new Pe(n),s=new Y().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new v().from(e),this.halfAxes=s,this}clone(){return new oe(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ne){let r=this.halfAxes,n=r.getColumn(0,Fn),o=r.getColumn(1,Un),s=r.getColumn(2,kn),i=X_.copy(n).add(o).add(s);return e.center.copy(this.center),e.radius=i.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,f=Math.abs(s*o[Wt.COLUMN0ROW0]+i*o[Wt.COLUMN0ROW1]+a*o[Wt.COLUMN0ROW2])+Math.abs(s*o[Wt.COLUMN1ROW0]+i*o[Wt.COLUMN1ROW1]+a*o[Wt.COLUMN1ROW2])+Math.abs(s*o[Wt.COLUMN2ROW0]+i*o[Wt.COLUMN2ROW1]+a*o[Wt.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?et.OUTSIDE:c>=f?et.INSIDE:et.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=W_.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Fn),s=n.getColumn(1,Un),i=n.getColumn(2,kn),a=o.magnitude(),f=s.magnitude(),c=i.magnitude();o.normalize(),s.normalize(),i.normalize();let l=0,d;return d=Math.abs(r.dot(o))-a,d>0&&(l+=d*d),d=Math.abs(r.dot(s))-f,d>0&&(l+=d*d),d=Math.abs(r.dot(i))-c,d>0&&(l+=d*d),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,Fn),c=a.getColumn(1,Un),l=a.getColumn(2,kn),d=q_.copy(f).add(c).add(l).add(i),_=Z_.copy(d).subtract(e),h=r.dot(_);return o=Math.min(h,o),s=Math.max(h,s),d.copy(i).add(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),d.copy(i).add(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),d.copy(i).add(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).add(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),n[0]=o,n[1]=s,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Fn);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Un);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,kn);return o.transformAsPoint(e),this.halfAxes=new Y([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var pc=new v,mc=new v,qt=class{constructor(e=[0,0,1],r=0){this.normal=new v,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return tt(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=pc.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,o){return this.normal.set(e,r,n),tt(_t(this.normal.len(),1)),this.distance=o,this}clone(){return new qt(this.normal,this.distance)}equals(e){return _t(this.distance,e.distance)&&_t(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=mc.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=pc.from(e),o=this.getPointDistance(n),s=mc.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var Ac=[new v([1,0,0]),new v([0,1,0]),new v([0,0,1])],xc=new v,Q_=new v,Et=class{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*Ac.length;let r=e.center,n=e.radius,o=0;for(let s of Ac){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new qt),a||(a=this.planes[o+1]=new qt);let f=xc.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=xc.copy(s).scale(n).add(r),l=Q_.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=et.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case et.OUTSIDE:return et.OUTSIDE;case et.INTERSECTING:r=et.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(tt(Number.isFinite(r),"parentPlaneMask is required."),r===Et.MASK_OUTSIDE||r===Et.MASK_INSIDE)return r;let n=Et.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],f=e.intersectPlane(a);if(f===et.OUTSIDE)return Et.MASK_OUTSIDE;f===et.INTERSECTING&&(n|=i)}return n}};Et.MASK_OUTSIDE=4294967295;Et.MASK_INSIDE=0;Et.MASK_INDETERMINATE=2147483647;var DE=new v,IE=new v,vE=new v,LE=new v,NE=new v;var zE=new v,KE=new v,HE=new v,VE=new v,XE=new v,WE=new v,qE=new v,ZE=new v,QE=new v,YE=new v,jE=new v,$E=new v;var eS=new Y,rS=new Y,nS=new Y,oS=new Y,sS=new Y;var hS=new v,_S=new v,dS=new v,uS=new v,pS=new v,mS=new Y,AS={diagonal:new Y,unitary:new Y};var Ec=Ct(Ht(),1);var wr;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(wr||(wr={}));var Or;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Or||(Or={}));var br;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(br||(br={}));var ds;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(ds||(ds={}));var gc=Ct(Ht(),1);var J_="4.4.0-alpha.1",Gn={dataType:null,batchType:null,name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:J_,mimeTypes:["application/json"],parse:td,extensions:["json"],options:{i3s:{}}};async function td(t,e){return JSON.parse(new TextDecoder().decode(t))}var Cr=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(e,r="",n){this.tileset={...e},this.url=r,this.nodesPerPage=e.nodePages?.nodesPerPage||64,this.lodSelectionMetricType=e.nodePages?.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(e)}async getNodeById(e){let r=Math.floor(e/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let o=Pt(`${this.url}/nodepages/${r}`,this.options.i3s?.token);this.pendingNodePages[r]={status:"Pending",promise:(0,gc.load)(o,Gn,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=e%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(e){let r=await this.getNodeById(e),n=[],o=[];for(let h of r.children||[])o.push(this.getNodeById(h));let s=await Promise.all(o);for(let h of s)n.push({id:h.index.toString(),obb:h.obb});let i,a,f,c="jpg",l=[],d=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:u}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};i=h,d=u;let{textureData:A,materialDefinition:p}=this.getInformationFromMaterial(r.mesh.material);f=p,c=A.format||c,A.name&&(a=`${this.url}/nodes/${r.mesh.material.resource}/textures/${A.name}`),this.tileset.attributeStorageInfo&&(l=fc(this.tileset,this.url,r.mesh.attribute.resource))}let _=this.getLodSelection(r);return us({id:e.toString(),lodSelection:_,obb:r.obb,contentUrl:i,textureUrl:a,attributeUrls:l,materialDefinition:f,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:d})}getContentUrl(e){let r=null,n=this.tileset.geometryDefinitions[e.definition],o=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(o=n.geometryBuffers.findIndex(s=>s.compressedAttributes&&s.compressedAttributes.encoding==="draco")),o===-1&&(o=n.geometryBuffers.findIndex(s=>!s.compressedAttributes)),o!==-1){let s=Boolean(n.geometryBuffers[o].compressedAttributes);r={url:`${this.url}/nodes/${e.resource}/geometries/${o}`,isDracoGeometry:s}}return r}getLodSelection(e){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(e.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:e.lodThreshold}),r}getInformationFromMaterial(e){let r={textureData:{name:null}};if(e){let n=this.tileset.materialDefinitions?.[e.definition];if(n){r.materialDefinition=n;let o=n?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;typeof o=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[o]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=e.textureSetDefinitions||[];for(let o of n){let s=o&&o.formats||[],i=null;for(let a of r){let f=s.find(c=>c.format===a);if(f){i=f;break}}i&&i.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Dn(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(i)}}getSupportedTextureFormats(){let e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=gr();r.has("etc2")&&e.push("ktx-etc2"),r.has("dxt")&&e.push("dds"),e.push("ktx2")}return e.push("jpg"),e.push("png"),e}};function Sc(t,e){let r=e.url||"",n;t.geometryData&&(n=`${r}/${t.geometryData[0].href}`);let o;t.textureData&&(o=`${r}/${t.textureData[0].href}`);let s;t.attributeData&&(s=cc(r,t));let i=t.children||[];return us({...t,children:i,url:r,contentUrl:n,textureUrl:o,textureFormat:"jpg",attributeUrls:s,isDracoGeometry:!1})}function us(t){let e={},r=[0,0,0,1];if(t.mbs)r=t.mbs,e.sphere=[...At.WGS84.cartographicToCartesian(t.mbs.slice(0,3)),t.mbs[3]];else if(t.obb){e.box=[...At.WGS84.cartographicToCartesian(t.obb.center),...t.obb.halfSize,...t.obb.quaternion];let f=new oe().fromCenterHalfSizeQuaternion(e.box.slice(0,3),t.obb.halfSize,t.obb.quaternion).getBoundingSphere();e.sphere=[...f.center,f.radius],r=[...t.obb.center,f.radius]}let n=t.lodSelection?.[0].metricType,o=t.lodSelection?.[0].maxError,s=Or.MESH,i=wr.REPLACE;return{...t,mbs:r,boundingVolume:e,lodMetricType:n,lodMetricValue:o,type:s,refine:i}}async function Rc(t,e,r){let n=Ln(r.url||""),o,s;if(t.nodePages)o=new Cr(t,n,e),s=await o.formTileFromNodePages(0);else{let i=e.i3s,a=Pt(`${n}/nodes/root`,i.token);s=await(0,Ec.load)(a,Br,{...e,i3s:{...e.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...t,loader:Br,url:n,basePath:n,type:br.I3S,nodePagesTile:o,root:s,lodMetricType:s.lodMetricType,lodMetricValue:s.lodMetricValue}}var ed="4.4.0-alpha.1",rd=/layers\/[0-9]+$/,nd=/\.slpk$/,od=/nodes\/([0-9-]+|root)$/,sd="504b0304",id="PointCloud",Br={dataType:null,batchType:null,name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:ed,mimeTypes:["application/octet-stream"],parse:ad,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:Dt.METER_OFFSETS}}};async function ad(t,e={},r){let n=r.url;if(e.i3s=e.i3s||{},hd(t)===sd)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let s=Ln(n),i;e.i3s.isTileset==="auto"?i=rd.test(s)||nd.test(s):i=e.i3s.isTileset;let a;return e.isTileHeader==="auto"?a=od.test(s):a=e.i3s.isTileHeader,i?t=await fd(t,e,r):a?t=await ld(t,r):t=await cd(t,e),t}async function cd(t,e){return await(0,Tc.parse)(t,Pn,e)}async function fd(t,e,r){let n=JSON.parse(new TextDecoder().decode(t));if(n?.layerType===id)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await Rc(n,e,r)}async function ld(t,e){return t=JSON.parse(new TextDecoder().decode(t)),Sc(t,e)}function hd(t){return t instanceof ArrayBuffer?[...new Uint8Array(t,0,4)].map(e=>e.toString(16).padStart(2,"0")).join(""):null}var Dr=async(t,e)=>{let r=[await t.getUint8(t.length-1n),await t.getUint8(t.length-2n),await t.getUint8(t.length-3n),void 0],n=-1,o=t.length-4n;do{let s=o;o-=BigInt(1024),o=o>=0n?o:0n;let i=new Uint8Array(await t.slice(o,s));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var Mc=new Uint8Array([80,75,5,6]),yc=new Uint8Array([80,75,6,7]),wc=new Uint8Array([80,75,6,6]),_d=8n;var dd=12n,ud=16n;var pd=8n,md=24n;var Ad=40n,xd=48n;var Oc=async t=>{let e=await Dr(t,Mc),r=BigInt(await t.getUint16(e+_d)),n=BigInt(await t.getUint32(e+dd)),o=BigInt(await t.getUint32(e+ud)),s=e-20n,i=0n,a=await t.slice(s,s+4n);if(re(a,yc)){i=await t.getBigUint64(s+pd);let f=await t.slice(i,i+4n);if(!re(f,wc.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(i+md),n=await t.getBigUint64(i+Ad),o=await t.getBigUint64(i+xd)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:e}}};var iR=[{offset:0,size:4,default:new DataView(Mc.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var aR=[{offset:0,size:4,default:new DataView(yc.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],cR=[{offset:0,size:4,default:new DataView(wc.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var gd=20,Ed=24,Sd=28,Rd=30,Td=32,Md=42,zn=46n,vr=new Uint8Array([80,75,1,2]),Ir=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+zn)),n=r.buffer.slice(0,4);if(!re(n,vr.buffer))return null;let o=BigInt(r.getUint32(gd,!0)),s=BigInt(r.getUint32(Ed,!0)),i=r.getUint16(Rd,!0),a=BigInt(r.getUint16(Td,!0)),f=r.getUint16(Sd,!0),c=await e.slice(t+zn,t+zn+BigInt(f+i)),l=c.slice(0,f),d=new TextDecoder().decode(l),_=t+zn+BigInt(f),h=r.getUint32(Md,!0),u=BigInt(h),A=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:s,compressedSize:o,localHeaderOffset:u,startDisk:a},S=yd(p,A);return{...p,...S,extraFieldLength:i,fileNameLength:f,fileName:d,extraOffset:_}};async function*Xe(t){let{cdStartOffset:e,cdByteSize:r}=await Oc(t),n=new pe(new DataView(await t.slice(e,e+r))),o=await Ir(0n,n);for(;o;)yield o,o=await Ir(o.extraOffset+BigInt(o.extraFieldLength),n)}var bc=(...t)=>t[0]+t[1]*16,yd=(t,e)=>{let r=wd(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),s=new Uint8Array(e.buffer).findIndex((a,f,c)=>bc(c[f],c[f+1])===1&&bc(c[f+2],c[f+3])===o),i=0;for(let a of r){let f=i;n[a.name]=e.getBigUint64(s+4+f,!0),i=f+a.length}}return n},wd=t=>{let e=[];return t.uncompressedSize===BigInt(4294967295)&&e.push({name:"uncompressedSize",length:8}),t.compressedSize===BigInt(4294967295)&&e.push({name:"compressedSize",length:8}),t.localHeaderOffset===BigInt(4294967295)&&e.push({name:"localHeaderOffset",length:8}),t.startDisk===BigInt(4294967295)&&e.push({name:"startDisk",length:4}),e};var _R=[{offset:0,size:4,default:new DataView(vr.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var Od=8,bd=18,Cd=22,Bd=26,Dd=28,Kn=30n,ps=new Uint8Array([80,75,3,4]),Ae=async(t,e)=>{let r=new DataView(await e.slice(t,t+Kn)),n=r.buffer.slice(0,4);if(!re(n,ps))return null;let o=r.getUint16(Bd,!0),s=r.getUint16(Dd,!0),i=await e.slice(t+Kn,t+Kn+BigInt(o+s)),a=i.slice(0,o),f=new DataView(i.slice(o,i.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+Kn+BigInt(o+s),d=r.getUint16(Od,!0),_=BigInt(r.getUint32(bd,!0)),h=BigInt(r.getUint32(Cd,!0)),u=4;return h===BigInt(4294967295)&&(h=f.getBigUint64(u,!0),u+=8),_===BigInt(4294967295)&&(_=f.getBigUint64(u,!0),u+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(u,!0)),{fileNameLength:o,fileName:c,extraFieldLength:s,fileDataOffset:l,compressedSize:_,compressionMethod:d}};var pR=[{offset:0,size:4,default:new DataView(ps.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var Hn=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let i of e)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(e){return await dr(e)}};function Cc(t){t=`${t}`;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return null;let e="";for(let r=0;r<t.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=t.charCodeAt(r)>>2,n[1]=(t.charCodeAt(r)&3)<<4,t.length>r+1&&(n[1]|=t.charCodeAt(r+1)>>4,n[2]=(t.charCodeAt(r+1)&15)<<2),t.length>r+2&&(n[2]|=t.charCodeAt(r+2)>>6,n[3]=t.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?e+="=":e+=Id(n[o])}return e}function Id(t){if(t<26)return String.fromCharCode(t+"A".charCodeAt(0));if(t<52)return String.fromCharCode(t-26+"a".charCodeAt(0));if(t<62)return String.fromCharCode(t-52+"0".charCodeAt(0));if(t===62)return"+";if(t===63)return"/"}function Bc(t,e){switch(e){case"hex":return t;case"base64":return vd(t);default:throw new Error(e)}}function vd(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Cc(r)||""}var Ic=typeof atob=="function"?atob:typeof Buffer=="function"?Gd:Lc,Ld=Ic("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),ms=WebAssembly&&Ic!==Lc?kd(Ld).buffer:!1,Ft=zd(),As=240*16*16,vc=Math.floor(As*16*1.066666667),Nd=268435456-65536,Dc="Parameter must be Buffer, ArrayBuffer or Uint8Array",Pd="Parameter exceeds max size of 255.9 Mbytes";ms||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function xs(t){var e,r,n,o,s,i,a,f,c,l;let d=Ud(),_=Fd(),h={},u=new Date().getTime();return h.then=function(y){return a=y,p(),h},h.catch=function(y){return f=y,h},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?i=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?i=t.constructor===ArrayBuffer?new Uint8Array(t):t:S(new TypeError(Dc)):S(new TypeError(Dc)),i&&(s=i.length,ms&&s>vc?s>Nd?S(new Error(Pd)):(e=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(ms,n).then(A)):p(d(i))),h;function A(y){p(_(i,y.instance.exports,r))}function p(y){var B=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(B)&&(a(B,l-u),a=f=null):Boolean(y)&&(c=y)}function S(y){typeof f=="function"&&f(y)}}function Fd(){var t,e,r,n,o,s,i,a,f,c,l,d,_,h=function(u){var A,p,S,y,B,T,R,D,I,L,x,m,g,E,U,F,k,N,j,nt,V,ot,Ot=new Date().getTime(),Be=0,O=1732584193,w=-271733879,b=-1732584194,C=271733878,Z=0,nr=u.length*8,tn;for(tn=Gl(u,_),_[nr>>>5]|=128<<nr%32,_[(nr+64>>>9<<4)+14]=nr,tn=(nr+64>>>9<<4)+15,V=_;Z<tn;)tn>Z+vc?(n(O),s(w),a(b),c(C),e(As),Z=Z+As*16,O=r(),w=o(),b=i(),C=f(),Be++):(k=O,N=w,j=b,nt=C,A=V[Z+0]>>>0,p=V[Z+1]>>>0,S=V[Z+2]>>>0,y=V[Z+3]>>>0,B=V[Z+4]>>>0,T=V[Z+5]>>>0,R=V[Z+6]>>>0,D=V[Z+7]>>>0,I=V[Z+8]>>>0,L=V[Z+9]>>>0,x=V[Z+10]>>>0,m=V[Z+11]>>>0,g=V[Z+12]>>>0,E=V[Z+13]>>>0,U=V[Z+14]>>>0,F=V[Z+15]>>>0,O=P(7,25,O+(w&b|~w&C)+A-680876936)+w,C=P(12,20,C+(O&w|~O&b)+p-389564586)+O,b=P(17,15,b+(C&O|~C&w)+S+606105819)+C,w=P(22,10,w+(b&C|~b&O)+y-1044525330)+b,O=P(7,25,O+(w&b|~w&C)+B-176418897)+w,C=P(12,20,C+(O&w|~O&b)+T+1200080426)+O,b=P(17,15,b+(C&O|~C&w)+R-1473231341)+C,w=P(22,10,w+(b&C|~b&O)+D-45705983)+b,O=P(7,25,O+(w&b|~w&C)+I+1770035416)+w,C=P(12,20,C+(O&w|~O&b)+L-1958414417)+O,b=P(17,15,b+(C&O|~C&w)+x-42063)+C,w=P(22,10,w+(b&C|~b&O)+m-1990404162)+b,O=P(7,25,O+(w&b|~w&C)+g+1804603682)+w,C=P(12,20,C+(O&w|~O&b)+E-40341101)+O,b=P(17,15,b+(C&O|~C&w)+U-1502002290)+C,w=P(22,10,w+(b&C|~b&O)+F+1236535329)+b,O=P(5,27,O+(w&C|b&~C)+p-165796510)+w,C=P(9,23,C+(O&b|w&~b)+R-1069501632)+O,b=P(14,18,b+(C&w|O&~w)+m+643717713)+C,w=P(20,12,w+(b&O|C&~O)+A-373897302)+b,O=P(5,27,O+(w&C|b&~C)+T-701558691)+w,C=P(9,23,C+(O&b|w&~b)+x+38016083)+O,b=P(14,18,b+(C&w|O&~w)+F-660478335)+C,w=P(20,12,w+(b&O|C&~O)+B-405537848)+b,O=P(5,27,O+(w&C|b&~C)+L+568446438)+w,C=P(9,23,C+(O&b|w&~b)+U-1019803690)+O,b=P(14,18,b+(C&w|O&~w)+y-187363961)+C,w=P(20,12,w+(b&O|C&~O)+I+1163531501)+b,O=P(5,27,O+(w&C|b&~C)+E-1444681467)+w,C=P(9,23,C+(O&b|w&~b)+S-51403784)+O,b=P(14,18,b+(C&w|O&~w)+D+1735328473)+C,w=P(20,12,w+(b&O|C&~O)+g-1926607734)+b,O=P(4,28,O+(w^b^C)+T-378558)+w,C=P(11,21,C+(O^w^b)+I-2022574463)+O,b=P(16,16,b+(C^O^w)+m+1839030562)+C,w=P(23,9,w+(b^C^O)+U-35309556)+b,O=P(4,28,O+(w^b^C)+p-1530992060)+w,C=P(11,21,C+(O^w^b)+B+1272893353)+O,b=P(16,16,b+(C^O^w)+D-155497632)+C,w=P(23,9,w+(b^C^O)+x-1094730640)+b,O=P(4,28,O+(w^b^C)+E+681279174)+w,C=P(11,21,C+(O^w^b)+A-358537222)+O,b=P(16,16,b+(C^O^w)+y-722521979)+C,w=P(23,9,w+(b^C^O)+R+76029189)+b,O=P(4,28,O+(w^b^C)+L-640364487)+w,C=P(11,21,C+(O^w^b)+g-421815835)+O,b=P(16,16,b+(C^O^w)+F+530742520)+C,w=P(23,9,w+(b^C^O)+S-995338651)+b,O=P(6,26,O+(b^(w|~C))+A-198630844)+w,C=P(10,22,C+(w^(O|~b))+D+1126891415)+O,b=P(15,17,b+(O^(C|~w))+U-1416354905)+C,w=P(21,11,w+(C^(b|~O))+T-57434055)+b,O=P(6,26,O+(b^(w|~C))+g+1700485571)+w,C=P(10,22,C+(w^(O|~b))+y-1894986606)+O,b=P(15,17,b+(O^(C|~w))+x-1051523)+C,w=P(21,11,w+(C^(b|~O))+p-2054922799)+b,O=P(6,26,O+(b^(w|~C))+I+1873313359)+w,C=P(10,22,C+(w^(O|~b))+F-30611744)+O,b=P(15,17,b+(O^(C|~w))+R-1560198380)+C,w=P(21,11,w+(C^(b|~O))+E+1309151649)+b,O=P(6,26,O+(b^(w|~C))+B-145523070)+w,C=P(10,22,C+(w^(O|~b))+m-1120210379)+O,b=P(15,17,b+(O^(C|~w))+S+718787259)+C,w=P(21,11,w+(C^(b|~O))+L-343485551)+b,Z=Z+16,O=O+k>>>0,w=w+N>>>0,b=b+j>>>0,C=C+nt>>>0);return Ft.endian([O,w,b,C]);function P(st,en,bt){return bt<<st|bt>>>en}function Gl(st,en){for(var bt=-1,lo=Math.floor((st.length-1)/4),ft=0,ri,ni,oi,si;lo-8>bt++;)ft=bt<<2,en[bt]=st[ft+0]|st[ft+1]<<8|st[ft+2]<<16|st[ft+3]<<24;for(bt--;lo>bt++;)ft=bt<<2,ri=typeof st[ft+0]>"u"?0:st[ft+0],ni=typeof st[ft+1]>"u"?0:st[ft+1],oi=typeof st[ft+2]>"u"?0:st[ft+2],si=typeof st[ft+3]>"u"?0:st[ft+3],en[bt]=ri|ni<<8|oi<<16|si<<24;return lo+1}};return function(u,A,p,S){var y;return e=A.loops,t=A.loop,r=A.getA,o=A.getB,i=A.getC,f=A.getD,l=A.getX,n=A.setA,s=A.setB,a=A.setC,c=A.setD,d=A.setX,_=p,y=Ft.wordsToBytes(h(u)),S&&S.asBytes?y:Ft.bytesconvertNumberToHex(y)}}function Ud(){var t=function(e,r){var n,o,s,i,a,f,c,l,d,_,h,u,A,p,S,y,B,T,R,D,I,L=new Date().getTime(),x=1732584193,m=-271733879,g=-1732584194,E=271733878,U=e.length*8;I=Ft.bytesToWords(e);for(var F=0;F<I.length;F++)I[F]=(I[F]<<8|I[F]>>>24)&16711935|(I[F]<<24|I[F]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var k=0;k<I.length;k+=16)B=x,T=m,R=g,D=E,n=I[k+0]>>>0,o=I[k+1]>>>0,s=I[k+2]>>>0,i=I[k+3]>>>0,a=I[k+4]>>>0,f=I[k+5]>>>0,c=I[k+6]>>>0,l=I[k+7]>>>0,d=I[k+8]>>>0,_=I[k+9]>>>0,h=I[k+10]>>>0,u=I[k+11]>>>0,A=I[k+12]>>>0,p=I[k+13]>>>0,S=I[k+14]>>>0,y=I[k+15]>>>0,x=N(7,25,x+(m&g|~m&E)+n-680876936)+m,E=N(12,20,E+(x&m|~x&g)+o-389564586)+x,g=N(17,15,g+(E&x|~E&m)+s+606105819)+E,m=N(22,10,m+(g&E|~g&x)+i-1044525330)+g,x=N(7,25,x+(m&g|~m&E)+a-176418897)+m,E=N(12,20,E+(x&m|~x&g)+f+1200080426)+x,g=N(17,15,g+(E&x|~E&m)+c-1473231341)+E,m=N(22,10,m+(g&E|~g&x)+l-45705983)+g,x=N(7,25,x+(m&g|~m&E)+d+1770035416)+m,E=N(12,20,E+(x&m|~x&g)+_-1958414417)+x,g=N(17,15,g+(E&x|~E&m)+h-42063)+E,m=N(22,10,m+(g&E|~g&x)+u-1990404162)+g,x=N(7,25,x+(m&g|~m&E)+A+1804603682)+m,E=N(12,20,E+(x&m|~x&g)+p-40341101)+x,g=N(17,15,g+(E&x|~E&m)+S-1502002290)+E,m=N(22,10,m+(g&E|~g&x)+y+1236535329)+g,x=N(5,27,x+(m&E|g&~E)+o-165796510)+m,E=N(9,23,E+(x&g|m&~g)+c-1069501632)+x,g=N(14,18,g+(E&m|x&~m)+u+643717713)+E,m=N(20,12,m+(g&x|E&~x)+n-373897302)+g,x=N(5,27,x+(m&E|g&~E)+f-701558691)+m,E=N(9,23,E+(x&g|m&~g)+h+38016083)+x,g=N(14,18,g+(E&m|x&~m)+y-660478335)+E,m=N(20,12,m+(g&x|E&~x)+a-405537848)+g,x=N(5,27,x+(m&E|g&~E)+_+568446438)+m,E=N(9,23,E+(x&g|m&~g)+S-1019803690)+x,g=N(14,18,g+(E&m|x&~m)+i-187363961)+E,m=N(20,12,m+(g&x|E&~x)+d+1163531501)+g,x=N(5,27,x+(m&E|g&~E)+p-1444681467)+m,E=N(9,23,E+(x&g|m&~g)+s-51403784)+x,g=N(14,18,g+(E&m|x&~m)+l+1735328473)+E,m=N(20,12,m+(g&x|E&~x)+A-1926607734)+g,x=N(4,28,x+(m^g^E)+f-378558)+m,E=N(11,21,E+(x^m^g)+d-2022574463)+x,g=N(16,16,g+(E^x^m)+u+1839030562)+E,m=N(23,9,m+(g^E^x)+S-35309556)+g,x=N(4,28,x+(m^g^E)+o-1530992060)+m,E=N(11,21,E+(x^m^g)+a+1272893353)+x,g=N(16,16,g+(E^x^m)+l-155497632)+E,m=N(23,9,m+(g^E^x)+h-1094730640)+g,x=N(4,28,x+(m^g^E)+p+681279174)+m,E=N(11,21,E+(x^m^g)+n-358537222)+x,g=N(16,16,g+(E^x^m)+i-722521979)+E,m=N(23,9,m+(g^E^x)+c+76029189)+g,x=N(4,28,x+(m^g^E)+_-640364487)+m,E=N(11,21,E+(x^m^g)+A-421815835)+x,g=N(16,16,g+(E^x^m)+y+530742520)+E,m=N(23,9,m+(g^E^x)+s-995338651)+g,x=N(6,26,x+(g^(m|~E))+n-198630844)+m,E=N(10,22,E+(m^(x|~g))+l+1126891415)+x,g=N(15,17,g+(x^(E|~m))+S-1416354905)+E,m=N(21,11,m+(E^(g|~x))+f-57434055)+g,x=N(6,26,x+(g^(m|~E))+A+1700485571)+m,E=N(10,22,E+(m^(x|~g))+i-1894986606)+x,g=N(15,17,g+(x^(E|~m))+h-1051523)+E,m=N(21,11,m+(E^(g|~x))+o-2054922799)+g,x=N(6,26,x+(g^(m|~E))+d+1873313359)+m,E=N(10,22,E+(m^(x|~g))+y-30611744)+x,g=N(15,17,g+(x^(E|~m))+c-1560198380)+E,m=N(21,11,m+(E^(g|~x))+p+1309151649)+g,x=N(6,26,x+(g^(m|~E))+a-145523070)+m,E=N(10,22,E+(m^(x|~g))+u-1120210379)+x,g=N(15,17,g+(x^(E|~m))+s+718787259)+E,m=N(21,11,m+(E^(g|~x))+_-343485551)+g,x=x+B>>>0,m=m+T>>>0,g=g+R>>>0,E=E+D>>>0;return Ft.endian([x,m,g,E]);function N(j,nt,V){return V<<j|V>>>nt}};return function(e,r){var n=Ft.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:Ft.bytesconvertNumberToHex(n);return o}}function kd(t){var e,r,n,o=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>o++;)n[o]=t.charCodeAt(o);return n}function Gd(t){return Buffer.from(t,"base64").toString("binary")}function Lc(t){return t}function zd(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return Ft.rotl(e,8)&16711935|Ft.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=Ft.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,o=0;n<e.length;n++,o+=8)r[o>>>5]|=e[n]<<24-o%32;return r},wordsToBytes:function(e){for(var r=[],n=0;n<e.length*32;n+=8)r.push(e[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(e){for(var r=[],n=0;n<e.length;n++)r.push((e[n]>>>4).toString(16)),r.push((e[n]&15).toString(16));return r.join("")}}}var xe=class extends Hn{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((s,i)=>xs(e).then(s).catch(i));return Bc(o,r)}};var Vn=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){_r(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}concatenate(e){return dr(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var Oe=Ct(Rl(),1),$t=Ct(Tl(),1),be=class extends Vn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Ke($t.default.gzip)(e):await Ke($t.default.deflate)(e);return ze(r)}return this.compressSync(e)}async decompress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Ke($t.default.gunzip)(e):await Ke($t.default.inflate)(e);return ze(r)}return this.decompressSync(e)}compressSync(e){if(!xt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?$t.default.gzipSync(e):$t.default.deflateSync(e);return ze(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?Oe.default.deflateRaw:Oe.default.deflate)(n,r).buffer}decompressSync(e){if(!xt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?$t.default.gunzipSync(e):$t.default.inflateSync(e);return ze(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?Oe.default.inflateRaw:Oe.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new Oe.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new Oe.default.Inflate(r);yield*this.transformBatches(n,e)}async*transformBatches(e,r){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=e.push(n,!0);yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw new Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[e]}`}};var Yr=class extends be{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}};var Lp={0:async t=>t,8:async t=>await new be({raw:!0}).decompress(t)},ao=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!xt)this.fileProvider=new pr(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof Ce?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):jo(e)&&(this.fileProvider=e)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let e=[],r=Xe(this.fileProvider);for await(let n of r)e.push(n.fileName);return e}async stat(e){let r=await this.getCDFileHeader(e);return{...r,size:Number(r.uncompressedSize)}}async fetch(e){this.fileName&&e.indexOf(this.fileName)===0&&(e=e.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(e,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(e),s=await Ae(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=Lp[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:e?`${this.fileName||""}/${e}`:this.fileName||""}),n}async getCDFileHeader(e){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=Xe(this.fileProvider),n=null;for await(let o of r)if(o.fileName===e){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var Ce=class{fileProvider;fileName;constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new ao(this.fileProvider).fetch(e)).arrayBuffer()}};function Js(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),s=Np(t,n,16);r[s]=o}return r}function Np(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function ti(t){let e=Xe(t);return Pp(e)}async function Pp(t){let e=new xe,r=new TextEncoder,n={};for await(let o of t){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await e.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var Fp=[{test:/^$/,extensions:["3dSceneLayer.json.gz"]},{test:/nodepages\/\d+$/,extensions:[".json.gz"]},{test:/sublayers\/\d+$/,extensions:["/3dSceneLayer.json.gz"]},{test:/nodes\/(\d+|root)$/,extensions:["/3dNodeIndexDocument.json.gz"]},{test:/nodes\/\d+\/textures\/.+$/,extensions:[".jpg",".png",".bin.dds.gz",".ktx",".ktx2"]},{test:/nodes\/\d+\/geometries\/\d+$/,extensions:[".bin.gz",".draco.gz"]},{test:/nodes\/\d+\/attributes\/f_\d+\/\d+$/,extensions:[".bin.gz"]},{test:/statistics\/(f_\d+\/\d+|summary)$/,extensions:[".json.gz"]},{test:/nodes\/\d+\/shared$/,extensions:["/sharedResource.json.gz"]}],rr=class extends Ce{hashTable;_textEncoder=new TextEncoder;_textDecoder=new TextDecoder;_md5Hash=new xe;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e,r="raw"){if(r==="http"){let n=Fp.find(o=>o.test.test(e))?.extensions;if(n){let o;for(let s of n)if(o=await this.getDataByPath(`${e}${s}`),o)break;if(o)return o}}if(r==="raw"){let n=await this.getDataByPath(`${e}.gz`);if(n)return n;let o=await this.getFileBytes(e);if(o)return o}throw new Error(`No such file in the archive: ${e}`)}async getDataByPath(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!!r)return/\.gz$/.test(e)?await new Yr().decompress(r):r}async getFileBytes(e){let r;if(this.hashTable){let n=this._textEncoder.encode(e),o=await this._md5Hash.hash(n.buffer,"hex"),s=this.hashTable[o];if(s===void 0)return;let i=await Ae(s,this.fileProvider);if(!i)return;r=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize)}else try{r=await this.getFileWithoutHash(e)}catch{r=void 0}return r}};async function co(t,e,r){let n=await Dr(t,vr),o=await Ir(n,t),s;if(o?.fileName!=="@specialIndexFileHASH128@")s=await ti(t),e?.("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");else{let i=await Ae(o.localHeaderOffset,t);if(!i)throw new Error("corrupted SLPK");let a=i.fileDataOffset,f=await t.slice(a,a+i.compressedSize);s=Js(f)}return new rr(t,s,r)}var Up="4.4.0-alpha.1",Ml={dataType:null,batchType:null,name:"I3S SLPK (Scene Layer Package)",id:"slpk",module:"i3s",version:Up,mimeTypes:["application/octet-stream"],extensions:["slpk"],options:{},parse:async(t,e={})=>(await co(new pe(new DataView(t)))).getFile(e.slpk?.path??"",e.slpk?.pathMode)};var bl=Ct(Ht(),1);function wl(t,e){let{attributeName:r,attributeType:n}=e;return r?{[r]:n?kp(n,t):null}:{}}function kp(t,e){switch(t){case ca:return Kp(e);case fa:return yl(e);case la:return zp(e);case ha:return Gp(e);default:return yl(e)}}function yl(t){return new Uint32Array(t,4)}function Gp(t){return new Int16Array(t,4)}function zp(t){return new Float64Array(t,8)}function Kp(t){let o=[];try{let s=new DataView(t,0,4).getUint32(0,!0),i=new Uint32Array(t,8,s),a=8+s*4;for(let f of i){let c=new TextDecoder("utf-8"),l=new Uint8Array(t,a,f);o.push(c.decode(l)),a+=f}}catch(s){console.error("Parse string attribute error: ",s.message)}return o}var Hp="4.4.0-alpha.1",Ol="",Vp="rejected",jr={dataType:null,batchType:null,name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:Hp,mimeTypes:["application/binary"],parse:async(t,e)=>wl(t,e),extensions:["bin"],options:{},binary:!0};async function Cl(t,e,r={}){let{attributeStorageInfo:n,attributeUrls:o,tilesetFields:s}=Xp(t);if(!n||!o||e<0)return null;let i=[],a=[];for(let f=0;f<n.length;f++){let c=Pt(o[f],r.i3s?.token),l=n[f].name,d=ei(n[f]),_={...r,attributeName:l,attributeType:d},h=(0,bl.load)(c,jr,_);a.push(h)}try{i=await Promise.allSettled(a)}catch{}return i.length?qp(i,n,e,s):null}function Xp(t){let e=t.tileset?.tileset?.attributeStorageInfo,r=t.header?.attributeUrls,n=t.tileset?.tileset?.fields||[];return{attributeStorageInfo:e,attributeUrls:r,tilesetFields:n}}function ei(t){return t.hasOwnProperty("objectIds")?"Oid32":t.hasOwnProperty("attributeValues")?t.attributeValues.valueType:""}function Wp(t){return t.find(r=>r.name.includes("OBJECTID"))?.name}function qp(t,e,r,n){let o=Wp(e),s=t.find(a=>a.value[o]);if(!s)return null;let i=s.value[o].indexOf(r);return i<0?null:Zp(t,i,e,n)}function Zp(t,e,r,n){let o={};for(let s=0;s<r.length;s++){let i=r[s].name,a=Qp(i,n),f=Yp(t,s,i);o[i]=jp(f,e,a)}return o}function Qp(t,e){return e.find(n=>n.name===t||n.alias===t)?.domain?.codedValues||[]}function Yp(t,e,r){let n=t[e];return n.status===Vp?null:n.value[r]}function jp(t,e,r){let n=Ol;return t&&e in t&&(n=String(t[e]).replace(/\u0000|NaN/g,"").trim()),r.length&&(n=r.find(s=>s.code===Number(n))?.name||Ol),n}var $p="3DObject";async function Bl(t,e){let r=JSON.parse(new TextDecoder().decode(t)),{sublayers:n}=r;return{header:r,sublayers:Dl(n,e)}}function Dl(t,e){let r=[];for(let n=0;n<t.length;n++){let o=t[n],{id:s,layerType:i,visibility:a=!0,...f}=o;if(i===$p){let c=`${e}/sublayers/${s}`;r.push({url:c,id:s,layerType:i,visibility:a,...f})}o?.sublayers?.length&&(r=[...r,...Dl(o.sublayers,e)])}return r}var Jp="4.4.0-alpha.1",Il={dataType:null,batchType:null,name:"I3S Building Scene Layer",id:"i3s-building-scene-layer",module:"i3s",version:Jp,mimeTypes:["application/json"],parse:tm,extensions:["json"],options:{}};async function tm(t,e,r){if(!r?.url)throw new Error("Url is not provided");return Bl(t,r.url)}var fo=Ct(Ht(),1),em=4326,rm="ArcGISSceneServiceLayer",nm="BuildingSceneLayer",om="IntegratedMeshLayer",vl="GroupLayer",sm=[rm,om,nm,vl],im="NO_AVAILABLE_SUPPORTED_LAYERS_ERROR",am="NOT_SUPPORTED_CRS_ERROR",$r=class extends Error{details;constructor(e,r){super(e),this.details=r,this.name="LayerError"}};async function Ll(t){let e=JSON.parse(new TextDecoder().decode(t)),{operationalLayers:r}=e,{layers:n,unsupportedLayers:o}=await Nl(r,!0);if(!n.length)throw new $r(im,o);return{header:e,layers:n,unsupportedLayers:o}}async function Nl(t,e){let r=[],n=[];for(let o=0;o<t.length;o++){let s=t[o];if(sm.includes(s.layerType)?(e&&s.layerType!==vl&&(await cm(s),e=!1),r.push(s)):n.push(s),s.layers?.length){let{layers:a,unsupportedLayers:f}=await Nl(s.layers,e);s.layers=a,n=[...n,...f]}}return{layers:r,unsupportedLayers:n}}async function cm(t){try{if((await(0,fo.load)(t.url,fo.JSONLoader))?.spatialReference?.wkid!==em)throw new Error(am)}catch(e){throw e}}var fm="4.4.0-alpha.1",Pl={dataType:null,batchType:null,name:"ArcGIS Web Scene Loader",id:"arcgis-web-scene",module:"i3s",version:fm,mimeTypes:["application/json"],parse:lm,extensions:["json"],options:{}};async function lm(t){return Ll(t)}var Ul=Ct(Ht(),1);async function kl(t,e,r,n,o,s,i){if(!s)return t;let a={...t,value:new Uint8Array(t.value)},f=n.find(({name:h})=>h===s?.attributeName);if(!f||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(f.type))return t;let c=await Fl(f.name,r,o,i);if(!c)return t;let l=n.find(({type:h})=>h==="esriFieldTypeOID");if(!l)return t;let d=await Fl(l.name,r,o,i);if(!d)return t;let _={};for(let h=0;h<d[l.name].length;h++)_[d[l.name][h]]=hm(c[f.name][h],s);for(let h=0;h<e.length;h++){let u=_[e[h]];u&&(s.mode==="multiply"?u.forEach((A,p)=>{a.value[h*4+p]=a.value[h*4+p]*A/255}):a.value.set(u,h*4))}return a}function hm(t,e){if(!e)return[255,255,255,255];let{minValue:r,maxValue:n,minColor:o,maxColor:s}=e,i=(t-r)/(n-r),a=[255,255,255,255];for(let f=0;f<o.length;f++)a[f]=Math.round((s[f]-o[f])*i+o[f]);return a}async function Fl(t,e,r,n){let o=r.findIndex(({name:f})=>t===f);if(o===-1)return null;let s=Pt(e[o],n),i=ei(r[o]);return await(0,Ul.load)(s,jr,{attributeName:t,attributeType:i})}return Wl(Jr);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var Yl=Object.create;var hn=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var t0=Object.getPrototypeOf,e0=Object.prototype.hasOwnProperty;var tt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_n=(t,e)=>{for(var r in e)hn(t,r,{get:e[r],enumerable:!0})},ln=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Jl(e))!e0.call(t,o)&&o!==r&&hn(t,o,{get:()=>e[o],enumerable:!(n=$l(e,o))||n.enumerable});return t},dn=(t,e,r)=>(ln(t,e,"default"),r&&ln(r,e,"default")),Dt=(t,e,r)=>(r=t!=null?Yl(t0(t)):{},ln(e||!t||!t.__esModule?hn(r,"default",{value:t,enumerable:!0}):r,t)),r0=t=>ln(hn({},"__esModule",{value:!0}),t);var Vt=tt((Om,_i)=>{_i.exports=globalThis.loaders});var jt=tt(ft=>{"use strict";var ru=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function nu(t,e){return Object.prototype.hasOwnProperty.call(t,e)}ft.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)nu(r,n)&&(t[n]=r[n])}}return t};ft.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var ou={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){var e,r,n,o,s,i;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(i=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)s=t[e],i.set(s,o),o+=s.length;return i}},su={arraySet:function(t,e,r,n,o){for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};ft.setTyped=function(t){t?(ft.Buf8=Uint8Array,ft.Buf16=Uint16Array,ft.Buf32=Int32Array,ft.assign(ft,ou)):(ft.Buf8=Array,ft.Buf16=Array,ft.Buf32=Array,ft.assign(ft,su))};ft.setTyped(ru)});var uf=tt(Qe=>{"use strict";var iu=jt(),au=4,Xc=0,Wc=1,cu=2;function Ze(t){for(var e=t.length;--e>=0;)t[e]=0}var fu=0,$c=1,lu=2,hu=3,_u=258,Ds=29,Wr=256,Kr=Wr+1+Ds,qe=30,Is=19,Jc=2*Kr+1,Te=15,ys=16,du=7,vs=256,tf=16,ef=17,rf=18,Cs=[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],$n=[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],uu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pu=512,Yt=new Array((Kr+2)*2);Ze(Yt);var zr=new Array(qe*2);Ze(zr);var Hr=new Array(pu);Ze(Hr);var Vr=new Array(_u-hu+1);Ze(Vr);var Ls=new Array(Ds);Ze(Ls);var Jn=new Array(qe);Ze(Jn);function ws(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var of,sf,af;function Os(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function cf(t){return t<256?Hr[t]:Hr[256+(t>>>7)]}function Xr(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function _t(t,e,r){t.bi_valid>ys-r?(t.bi_buf|=e<<t.bi_valid&65535,Xr(t,t.bi_buf),t.bi_buf=e>>ys-t.bi_valid,t.bi_valid+=r-ys):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function kt(t,e,r){_t(t,r[e*2],r[e*2+1])}function ff(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function mu(t){t.bi_valid===16?(Xr(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function Au(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,d,_,h,u,A=0;for(_=0;_<=Te;_++)t.bl_count[_]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Jc;c++)l=t.heap[c],_=r[r[l*2+1]*2+1]+1,_>f&&(_=f,A++),r[l*2+1]=_,!(l>n)&&(t.bl_count[_]++,h=0,l>=a&&(h=i[l-a]),u=r[l*2],t.opt_len+=u*(_+h),s&&(t.static_len+=u*(o[l*2+1]+h)));if(A!==0){do{for(_=f-1;t.bl_count[_]===0;)_--;t.bl_count[_]--,t.bl_count[_+1]+=2,t.bl_count[f]--,A-=2}while(A>0);for(_=f;_!==0;_--)for(l=t.bl_count[_];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==_&&(t.opt_len+=(_-r[d*2+1])*r[d*2],r[d*2+1]=_),l--)}}function lf(t,e,r){var n=new Array(Te+1),o=0,s,i;for(s=1;s<=Te;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=e;i++){var a=t[i*2+1];a!==0&&(t[i*2]=ff(n[a]++,a))}}function xu(){var t,e,r,n,o,s=new Array(Te+1);for(r=0,n=0;n<Ds-1;n++)for(Ls[n]=r,t=0;t<1<<Cs[n];t++)Vr[r++]=n;for(Vr[r-1]=n,o=0,n=0;n<16;n++)for(Jn[n]=o,t=0;t<1<<$n[n];t++)Hr[o++]=n;for(o>>=7;n<qe;n++)for(Jn[n]=o<<7,t=0;t<1<<$n[n]-7;t++)Hr[256+o++]=n;for(e=0;e<=Te;e++)s[e]=0;for(t=0;t<=143;)Yt[t*2+1]=8,t++,s[8]++;for(;t<=255;)Yt[t*2+1]=9,t++,s[9]++;for(;t<=279;)Yt[t*2+1]=7,t++,s[7]++;for(;t<=287;)Yt[t*2+1]=8,t++,s[8]++;for(lf(Yt,Kr+1,s),t=0;t<qe;t++)zr[t*2+1]=5,zr[t*2]=ff(t,5);of=new ws(Yt,Cs,Wr+1,Kr,Te),sf=new ws(zr,$n,0,qe,Te),af=new ws(new Array(0),uu,0,Is,du)}function hf(t){var e;for(e=0;e<Kr;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qe;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Is;e++)t.bl_tree[e*2]=0;t.dyn_ltree[vs*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function _f(t){t.bi_valid>8?Xr(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function gu(t,e,r,n){_f(t),n&&(Xr(t,r),Xr(t,~r)),iu.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function qc(t,e,r,n){var o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]}function bs(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&qc(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!qc(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function Zc(t,e,r){var n,o,s=0,i,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],o=t.pending_buf[t.l_buf+s],s++,n===0?kt(t,o,e):(i=Vr[o],kt(t,i+Wr+1,e),a=Cs[i],a!==0&&(o-=Ls[i],_t(t,o,a)),n--,i=cf(n),kt(t,i,r),a=$n[i],a!==0&&(n-=Jn[i],_t(t,n,a)));while(s<t.last_lit);kt(t,vs,e)}function Bs(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,a,f=-1,c;for(t.heap_len=0,t.heap_max=Jc,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=f=i,t.depth[i]=0):r[i*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,o&&(t.static_len-=n[c*2+1]);for(e.max_code=f,i=t.heap_len>>1;i>=1;i--)bs(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],bs(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=a,r[c*2]=r[i*2]+r[a*2],t.depth[c]=(t.depth[i]>=t.depth[a]?t.depth[i]:t.depth[a])+1,r[i*2+1]=r[a*2+1]=c,t.heap[1]=c++,bs(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Au(t,e),lf(r,f,t.bl_count)}function Qc(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)&&(a<c?t.bl_tree[s*2]+=a:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[tf*2]++):a<=10?t.bl_tree[ef*2]++:t.bl_tree[rf*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function jc(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)){if(a<c)do kt(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&(kt(t,s,t.bl_tree),a--),kt(t,tf,t.bl_tree),_t(t,a-3,2)):a<=10?(kt(t,ef,t.bl_tree),_t(t,a-3,3)):(kt(t,rf,t.bl_tree),_t(t,a-11,7));a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4)}}function Eu(t){var e;for(Qc(t,t.dyn_ltree,t.l_desc.max_code),Qc(t,t.dyn_dtree,t.d_desc.max_code),Bs(t,t.bl_desc),e=Is-1;e>=3&&t.bl_tree[nf[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function Su(t,e,r,n){var o;for(_t(t,e-257,5),_t(t,r-1,5),_t(t,n-4,4),o=0;o<n;o++)_t(t,t.bl_tree[nf[o]*2+1],3);jc(t,t.dyn_ltree,e-1),jc(t,t.dyn_dtree,r-1)}function Ru(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Xc;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Wc;for(r=32;r<Wr;r++)if(t.dyn_ltree[r*2]!==0)return Wc;return Xc}var Yc=!1;function Tu(t){Yc||(xu(),Yc=!0),t.l_desc=new Os(t.dyn_ltree,of),t.d_desc=new Os(t.dyn_dtree,sf),t.bl_desc=new Os(t.bl_tree,af),t.bi_buf=0,t.bi_valid=0,hf(t)}function df(t,e,r,n){_t(t,(fu<<1)+(n?1:0),3),gu(t,e,r,!0)}function Mu(t){_t(t,$c<<1,3),kt(t,vs,Yt),mu(t)}function yu(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===cu&&(t.strm.data_type=Ru(t)),Bs(t,t.l_desc),Bs(t,t.d_desc),i=Eu(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?df(t,e,r,n):t.strategy===au||s===o?(_t(t,($c<<1)+(n?1:0),3),Zc(t,Yt,zr)):(_t(t,(lu<<1)+(n?1:0),3),Su(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),Zc(t,t.dyn_ltree,t.dyn_dtree)),hf(t),n&&_f(t)}function wu(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Vr[r]+Wr+1)*2]++,t.dyn_dtree[cf(e)*2]++),t.last_lit===t.lit_bufsize-1}Qe._tr_init=Tu;Qe._tr_stored_block=df;Qe._tr_flush_block=yu;Qe._tr_tally=wu;Qe._tr_align=Mu});var Ns=tt((rT,pf)=>{"use strict";function Ou(t,e,r,n){for(var o=t&65535|0,s=t>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}pf.exports=Ou});var Fs=tt((nT,mf)=>{"use strict";function bu(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var Cu=bu();function Bu(t,e,r,n){var o=Cu,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}mf.exports=Bu});var to=tt((oT,Af)=>{"use strict";Af.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var wf=tt(Kt=>{"use strict";var lt=jt(),Tt=uf(),Sf=Ns(),ce=Fs(),Du=to(),Oe=0,Iu=1,vu=3,de=4,xf=5,zt=0,gf=1,Mt=-2,Lu=-3,Ps=-5,Nu=-1,Fu=1,eo=2,Pu=3,Uu=4,ku=0,Gu=2,so=8,zu=9,Ku=15,Hu=8,Vu=29,Xu=256,ks=Xu+1+Vu,Wu=30,qu=19,Zu=2*ks+1,Qu=15,G=3,he=258,Ot=he+G+1,ju=32,io=42,Gs=69,ro=73,no=91,oo=103,Me=113,Zr=666,J=1,Qr=2,ye=3,$e=4,Yu=3;function _e(t,e){return t.msg=Du[e],e}function Ef(t){return(t<<1)-(t>4?9:0)}function le(t){for(var e=t.length;--e>=0;)t[e]=0}function fe(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(lt.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function ot(t,e){Tt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,fe(t.strm)}function K(t,e){t.pending_buf[t.pending++]=e}function qr(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function $u(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,lt.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=Sf(t.adler,e,o,r):t.state.wrap===2&&(t.adler=ce(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function Rf(t,e){var r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-Ot?t.strstart-(t.w_size-Ot):0,c=t.window,l=t.w_mask,d=t.prev,_=t.strstart+he,h=c[n+i-1],u=c[n+i];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+i]!==u||c[o+i-1]!==h||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<_);if(s=he-(_-n),n=_-he,s>i){if(t.match_start=e,i=s,s>=a)break;h=c[n+i-1],u=c[n+i]}}while((e=d[e&l])>f&&--r!==0);return i<=t.lookahead?i:t.lookahead}function we(t){var e=t.w_size,r,n,o,s,i;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Ot)){lt.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);s+=e}if(t.strm.avail_in===0)break;if(n=$u(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=G)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+G-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<G)););}while(t.lookahead<Ot&&t.strm.avail_in!==0)}function Ju(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(we(t),t.lookahead===0&&e===Oe)return J;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,ot(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Ot&&(ot(t,!1),t.strm.avail_out===0))return J}return t.insert=0,e===de?(ot(t,!0),t.strm.avail_out===0?ye:$e):(t.strstart>t.block_start&&(ot(t,!1),t.strm.avail_out===0),J)}function Us(t,e){for(var r,n;;){if(t.lookahead<Ot){if(we(t),t.lookahead<Ot&&e===Oe)return J;if(t.lookahead===0)break}if(r=0,t.lookahead>=G&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Ot&&(t.match_length=Rf(t,r)),t.match_length>=G)if(n=Tt._tr_tally(t,t.strstart-t.match_start,t.match_length-G),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=G){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=Tt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(ot(t,!1),t.strm.avail_out===0))return J}return t.insert=t.strstart<G-1?t.strstart:G-1,e===de?(ot(t,!0),t.strm.avail_out===0?ye:$e):t.last_lit&&(ot(t,!1),t.strm.avail_out===0)?J:Qr}function je(t,e){for(var r,n,o;;){if(t.lookahead<Ot){if(we(t),t.lookahead<Ot&&e===Oe)return J;if(t.lookahead===0)break}if(r=0,t.lookahead>=G&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=G-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Ot&&(t.match_length=Rf(t,r),t.match_length<=5&&(t.strategy===Fu||t.match_length===G&&t.strstart-t.match_start>4096)&&(t.match_length=G-1)),t.prev_length>=G&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-G,n=Tt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-G),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+G-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=G-1,t.strstart++,n&&(ot(t,!1),t.strm.avail_out===0))return J}else if(t.match_available){if(n=Tt._tr_tally(t,0,t.window[t.strstart-1]),n&&ot(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return J}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Tt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<G-1?t.strstart:G-1,e===de?(ot(t,!0),t.strm.avail_out===0?ye:$e):t.last_lit&&(ot(t,!1),t.strm.avail_out===0)?J:Qr}function tp(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=he){if(we(t),t.lookahead<=he&&e===Oe)return J;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=G&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+he;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=he-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=G?(r=Tt._tr_tally(t,1,t.match_length-G),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Tt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(ot(t,!1),t.strm.avail_out===0))return J}return t.insert=0,e===de?(ot(t,!0),t.strm.avail_out===0?ye:$e):t.last_lit&&(ot(t,!1),t.strm.avail_out===0)?J:Qr}function ep(t,e){for(var r;;){if(t.lookahead===0&&(we(t),t.lookahead===0)){if(e===Oe)return J;break}if(t.match_length=0,r=Tt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(ot(t,!1),t.strm.avail_out===0))return J}return t.insert=0,e===de?(ot(t,!0),t.strm.avail_out===0?ye:$e):t.last_lit&&(ot(t,!1),t.strm.avail_out===0)?J:Qr}function Gt(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var Ye;Ye=[new Gt(0,0,0,0,Ju),new Gt(4,4,8,4,Us),new Gt(4,5,16,8,Us),new Gt(4,6,32,32,Us),new Gt(4,4,16,16,je),new Gt(8,16,32,32,je),new Gt(8,16,128,128,je),new Gt(8,32,128,256,je),new Gt(32,128,258,1024,je),new Gt(32,258,258,4096,je)];function rp(t){t.window_size=2*t.w_size,le(t.head),t.max_lazy_match=Ye[t.level].max_lazy,t.good_match=Ye[t.level].good_length,t.nice_match=Ye[t.level].nice_length,t.max_chain_length=Ye[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=G-1,t.match_available=0,t.ins_h=0}function np(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=so,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new lt.Buf16(Zu*2),this.dyn_dtree=new lt.Buf16((2*Wu+1)*2),this.bl_tree=new lt.Buf16((2*qu+1)*2),le(this.dyn_ltree),le(this.dyn_dtree),le(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new lt.Buf16(Qu+1),this.heap=new lt.Buf16(2*ks+1),le(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new lt.Buf16(2*ks+1),le(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Tf(t){var e;return!t||!t.state?_e(t,Mt):(t.total_in=t.total_out=0,t.data_type=Gu,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?io:Me,t.adler=e.wrap===2?0:1,e.last_flush=Oe,Tt._tr_init(e),zt)}function Mf(t){var e=Tf(t);return e===zt&&rp(t.state),e}function op(t,e){return!t||!t.state||t.state.wrap!==2?Mt:(t.state.gzhead=e,zt)}function yf(t,e,r,n,o,s){if(!t)return Mt;var i=1;if(e===Nu&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>zu||r!==so||n<8||n>15||e<0||e>9||s<0||s>Uu)return _e(t,Mt);n===8&&(n=9);var a=new np;return t.state=a,a.strm=t,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+G-1)/G),a.window=new lt.Buf8(a.w_size*2),a.head=new lt.Buf16(a.hash_size),a.prev=new lt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new lt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=s,a.method=r,Mf(t)}function sp(t,e){return yf(t,e,so,Ku,Hu,ku)}function ip(t,e){var r,n,o,s;if(!t||!t.state||e>xf||e<0)return t?_e(t,Mt):Mt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Zr&&e!==de)return _e(t,t.avail_out===0?Ps:Mt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===io)if(n.wrap===2)t.adler=0,K(n,31),K(n,139),K(n,8),n.gzhead?(K(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),K(n,n.gzhead.time&255),K(n,n.gzhead.time>>8&255),K(n,n.gzhead.time>>16&255),K(n,n.gzhead.time>>24&255),K(n,n.level===9?2:n.strategy>=eo||n.level<2?4:0),K(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(K(n,n.gzhead.extra.length&255),K(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=ce(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Gs):(K(n,0),K(n,0),K(n,0),K(n,0),K(n,0),K(n,n.level===9?2:n.strategy>=eo||n.level<2?4:0),K(n,Yu),n.status=Me);else{var i=so+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=eo||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=ju),i+=31-i%31,n.status=Me,qr(n,i),n.strstart!==0&&(qr(n,t.adler>>>16),qr(n,t.adler&65535)),t.adler=1}if(n.status===Gs)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ce(t.adler,n.pending_buf,n.pending-o,o)),fe(t),o=n.pending,n.pending===n.pending_buf_size));)K(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=ce(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=ro)}else n.status=ro;if(n.status===ro)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ce(t.adler,n.pending_buf,n.pending-o,o)),fe(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,K(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=ce(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=ce(t.adler,n.pending_buf,n.pending-o,o)),fe(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,K(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=ce(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=oo)}else n.status=oo;if(n.status===oo&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&fe(t),n.pending+2<=n.pending_buf_size&&(K(n,t.adler&255),K(n,t.adler>>8&255),t.adler=0,n.status=Me)):n.status=Me),n.pending!==0){if(fe(t),t.avail_out===0)return n.last_flush=-1,zt}else if(t.avail_in===0&&Ef(e)<=Ef(r)&&e!==de)return _e(t,Ps);if(n.status===Zr&&t.avail_in!==0)return _e(t,Ps);if(t.avail_in!==0||n.lookahead!==0||e!==Oe&&n.status!==Zr){var f=n.strategy===eo?ep(n,e):n.strategy===Pu?tp(n,e):Ye[n.level].func(n,e);if((f===ye||f===$e)&&(n.status=Zr),f===J||f===ye)return t.avail_out===0&&(n.last_flush=-1),zt;if(f===Qr&&(e===Iu?Tt._tr_align(n):e!==xf&&(Tt._tr_stored_block(n,0,0,!1),e===vu&&(le(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),fe(t),t.avail_out===0))return n.last_flush=-1,zt}return e!==de?zt:n.wrap<=0?gf:(n.wrap===2?(K(n,t.adler&255),K(n,t.adler>>8&255),K(n,t.adler>>16&255),K(n,t.adler>>24&255),K(n,t.total_in&255),K(n,t.total_in>>8&255),K(n,t.total_in>>16&255),K(n,t.total_in>>24&255)):(qr(n,t.adler>>>16),qr(n,t.adler&65535)),fe(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?zt:gf)}function ap(t){var e;return!t||!t.state?Mt:(e=t.state.status,e!==io&&e!==Gs&&e!==ro&&e!==no&&e!==oo&&e!==Me&&e!==Zr?_e(t,Mt):(t.state=null,e===Me?_e(t,Lu):zt))}function cp(t,e){var r=e.length,n,o,s,i,a,f,c,l;if(!t||!t.state||(n=t.state,i=n.wrap,i===2||i===1&&n.status!==io||n.lookahead))return Mt;for(i===1&&(t.adler=Sf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(le(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new lt.Buf8(n.w_size),lt.arraySet(l,e,r-n.w_size,n.w_size,0),e=l,r=n.w_size),a=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,we(n);n.lookahead>=G;){o=n.strstart,s=n.lookahead-(G-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+G-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=G-1,we(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=G-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=i,zt}Kt.deflateInit=sp;Kt.deflateInit2=yf;Kt.deflateReset=Mf;Kt.deflateResetKeep=Tf;Kt.deflateSetHeader=op;Kt.deflate=ip;Kt.deflateEnd=ap;Kt.deflateSetDictionary=cp;Kt.deflateInfo="pako deflate (from Nodeca project)"});var zs=tt(Je=>{"use strict";var ao=jt(),Of=!0,bf=!0;try{String.fromCharCode.apply(null,[0])}catch{Of=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{bf=!1}var jr=new ao.Buf8(256);for($t=0;$t<256;$t++)jr[$t]=$t>=252?6:$t>=248?5:$t>=240?4:$t>=224?3:$t>=192?2:1;var $t;jr[254]=jr[254]=1;Je.string2buf=function(t){var e,r,n,o,s,i=t.length,a=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new ao.Buf8(a),s=0,o=0;s<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function Cf(t,e){if(e<65534&&(t.subarray&&bf||!t.subarray&&Of))return String.fromCharCode.apply(null,ao.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}Je.buf2binstring=function(t){return Cf(t,t.length)};Je.binstring2buf=function(t){for(var e=new ao.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};Je.buf2string=function(t,e){var r,n,o,s,i=e||t.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=t[r++],o<128){a[n++]=o;continue}if(s=jr[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|t[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return Cf(a,n)};Je.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+jr[t[r]]>e?r:e}});var Ks=tt((aT,Bf)=>{"use strict";function fp(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Bf.exports=fp});var Lf=tt(Jr=>{"use strict";var Yr=wf(),$r=jt(),Vs=zs(),Xs=to(),lp=Ks(),vf=Object.prototype.toString,hp=0,Hs=4,tr=0,Df=1,If=2,_p=-1,dp=0,up=8;function be(t){if(!(this instanceof be))return new be(t);this.options=$r.assign({level:_p,method:up,chunkSize:16384,windowBits:15,memLevel:8,strategy:dp,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new lp,this.strm.avail_out=0;var r=Yr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==tr)throw new Error(Xs[r]);if(e.header&&Yr.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=Vs.string2buf(e.dictionary):vf.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Yr.deflateSetDictionary(this.strm,n),r!==tr)throw new Error(Xs[r]);this._dict_set=!0}}be.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Hs:hp,typeof t=="string"?r.input=Vs.string2buf(t):vf.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new $r.Buf8(n),r.next_out=0,r.avail_out=n),o=Yr.deflate(r,s),o!==Df&&o!==tr)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Hs||s===If))&&(this.options.to==="string"?this.onData(Vs.buf2binstring($r.shrinkBuf(r.output,r.next_out))):this.onData($r.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==Df);return s===Hs?(o=Yr.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===tr):(s===If&&(this.onEnd(tr),r.avail_out=0),!0)};be.prototype.onData=function(t){this.chunks.push(t)};be.prototype.onEnd=function(t){t===tr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=$r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Ws(t,e){var r=new be(e);if(r.push(t,!0),r.err)throw r.msg||Xs[r.err];return r.result}function pp(t,e){return e=e||{},e.raw=!0,Ws(t,e)}function mp(t,e){return e=e||{},e.gzip=!0,Ws(t,e)}Jr.Deflate=be;Jr.deflate=Ws;Jr.deflateRaw=pp;Jr.gzip=mp});var Ff=tt((fT,Nf)=>{"use strict";var co=30,Ap=12;Nf.exports=function(e,r){var n,o,s,i,a,f,c,l,d,_,h,u,A,p,S,y,B,T,R,D,I,L,x,m,g;n=e.state,o=e.next_in,m=e.input,s=o+(e.avail_in-5),i=e.next_out,g=e.output,a=i-(r-e.avail_out),f=i+(e.avail_out-257),c=n.dmax,l=n.wsize,d=n.whave,_=n.wnext,h=n.window,u=n.hold,A=n.bits,p=n.lencode,S=n.distcode,y=(1<<n.lenbits)-1,B=(1<<n.distbits)-1;t:do{A<15&&(u+=m[o++]<<A,A+=8,u+=m[o++]<<A,A+=8),T=p[u&y];e:for(;;){if(R=T>>>24,u>>>=R,A-=R,R=T>>>16&255,R===0)g[i++]=T&65535;else if(R&16){D=T&65535,R&=15,R&&(A<R&&(u+=m[o++]<<A,A+=8),D+=u&(1<<R)-1,u>>>=R,A-=R),A<15&&(u+=m[o++]<<A,A+=8,u+=m[o++]<<A,A+=8),T=S[u&B];r:for(;;){if(R=T>>>24,u>>>=R,A-=R,R=T>>>16&255,R&16){if(I=T&65535,R&=15,A<R&&(u+=m[o++]<<A,A+=8,A<R&&(u+=m[o++]<<A,A+=8)),I+=u&(1<<R)-1,I>c){e.msg="invalid distance too far back",n.mode=co;break t}if(u>>>=R,A-=R,R=i-a,I>R){if(R=I-R,R>d&&n.sane){e.msg="invalid distance too far back",n.mode=co;break t}if(L=0,x=h,_===0){if(L+=l-R,R<D){D-=R;do g[i++]=h[L++];while(--R);L=i-I,x=g}}else if(_<R){if(L+=l+_-R,R-=_,R<D){D-=R;do g[i++]=h[L++];while(--R);if(L=0,_<D){R=_,D-=R;do g[i++]=h[L++];while(--R);L=i-I,x=g}}}else if(L+=_-R,R<D){D-=R;do g[i++]=h[L++];while(--R);L=i-I,x=g}for(;D>2;)g[i++]=x[L++],g[i++]=x[L++],g[i++]=x[L++],D-=3;D&&(g[i++]=x[L++],D>1&&(g[i++]=x[L++]))}else{L=i-I;do g[i++]=g[L++],g[i++]=g[L++],g[i++]=g[L++],D-=3;while(D>2);D&&(g[i++]=g[L++],D>1&&(g[i++]=g[L++]))}}else if(R&64){e.msg="invalid distance code",n.mode=co;break t}else{T=S[(T&65535)+(u&(1<<R)-1)];continue r}break}}else if(R&64)if(R&32){n.mode=Ap;break t}else{e.msg="invalid literal/length code",n.mode=co;break t}else{T=p[(T&65535)+(u&(1<<R)-1)];continue e}break}}while(o<s&&i<f);D=A>>3,o-=D,A-=D<<3,u&=(1<<A)-1,e.next_in=o,e.next_out=i,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=i<f?257+(f-i):257-(i-f),n.hold=u,n.bits=A}});var Hf=tt((lT,Kf)=>{"use strict";var Pf=jt(),er=15,Uf=852,kf=592,Gf=0,qs=1,zf=2,xp=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],gp=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Ep=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Sp=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Kf.exports=function(e,r,n,o,s,i,a,f){var c=f.bits,l=0,d=0,_=0,h=0,u=0,A=0,p=0,S=0,y=0,B=0,T,R,D,I,L,x=null,m=0,g,E=new Pf.Buf16(er+1),U=new Pf.Buf16(er+1),P=null,k=0,N,Y,st;for(l=0;l<=er;l++)E[l]=0;for(d=0;d<o;d++)E[r[n+d]]++;for(u=c,h=er;h>=1&&E[h]===0;h--);if(u>h&&(u=h),h===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,f.bits=1,0;for(_=1;_<h&&E[_]===0;_++);for(u<_&&(u=_),S=1,l=1;l<=er;l++)if(S<<=1,S-=E[l],S<0)return-1;if(S>0&&(e===Gf||h!==1))return-1;for(U[1]=0,l=1;l<er;l++)U[l+1]=U[l]+E[l];for(d=0;d<o;d++)r[n+d]!==0&&(a[U[r[n+d]]++]=d);if(e===Gf?(x=P=a,g=19):e===qs?(x=xp,m-=257,P=gp,k-=257,g=256):(x=Ep,P=Sp,g=-1),B=0,d=0,l=_,L=i,A=u,p=0,D=-1,y=1<<u,I=y-1,e===qs&&y>Uf||e===zf&&y>kf)return 1;for(;;){N=l-p,a[d]<g?(Y=0,st=a[d]):a[d]>g?(Y=P[k+a[d]],st=x[m+a[d]]):(Y=32+64,st=0),T=1<<l-p,R=1<<A,_=R;do R-=T,s[L+(B>>p)+R]=N<<24|Y<<16|st|0;while(R!==0);for(T=1<<l-1;B&T;)T>>=1;if(T!==0?(B&=T-1,B+=T):B=0,d++,--E[l]===0){if(l===h)break;l=r[n+a[d]]}if(l>u&&(B&I)!==D){for(p===0&&(p=u),L+=_,A=l-p,S=1<<A;A+p<h&&(S-=E[A+p],!(S<=0));)A++,S<<=1;if(y+=1<<A,e===qs&&y>Uf||e===zf&&y>kf)return 1;D=B&I,s[D]=u<<24|A<<16|L-i|0}}return B!==0&&(s[L+B]=l-p<<24|64<<16|0),f.bits=u,0}});var Ml=tt(bt=>{"use strict";var At=jt(),Js=Ns(),Ht=Fs(),Rp=Ff(),tn=Hf(),Tp=0,pl=1,ml=2,Vf=4,Mp=5,fo=6,Ce=0,yp=1,wp=2,yt=-2,Al=-3,ti=-4,Op=-5,Xf=8,xl=1,Wf=2,qf=3,Zf=4,Qf=5,jf=6,Yf=7,$f=8,Jf=9,tl=10,_o=11,Jt=12,Zs=13,el=14,Qs=15,rl=16,nl=17,ol=18,sl=19,lo=20,ho=21,il=22,al=23,cl=24,fl=25,ll=26,js=27,hl=28,_l=29,q=30,ei=31,bp=32,Cp=852,Bp=592,Dp=15,Ip=Dp;function dl(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function vp(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new At.Buf16(320),this.work=new At.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function gl(t){var e;return!t||!t.state?yt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=xl,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new At.Buf32(Cp),e.distcode=e.distdyn=new At.Buf32(Bp),e.sane=1,e.back=-1,Ce)}function El(t){var e;return!t||!t.state?yt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,gl(t))}function Sl(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?yt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,El(t))}function Rl(t,e){var r,n;return t?(n=new vp,t.state=n,n.window=null,r=Sl(t,e),r!==Ce&&(t.state=null),r):yt}function Lp(t){return Rl(t,Ip)}var ul=!0,Ys,$s;function Np(t){if(ul){var e;for(Ys=new At.Buf32(512),$s=new At.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(tn(pl,t.lens,0,288,Ys,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;tn(ml,t.lens,0,32,$s,0,t.work,{bits:5}),ul=!1}t.lencode=Ys,t.lenbits=9,t.distcode=$s,t.distbits=5}function Tl(t,e,r,n){var o,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new At.Buf8(s.wsize)),n>=s.wsize?(At.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),At.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(At.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function Fp(t,e){var r,n,o,s,i,a,f,c,l,d,_,h,u,A,p=0,S,y,B,T,R,D,I,L,x=new At.Buf8(4),m,g,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return yt;r=t.state,r.mode===Jt&&(r.mode=Zs),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,d=a,_=f,L=Ce;t:for(;;)switch(r.mode){case xl:if(r.wrap===0){r.mode=Zs;break}for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=Ht(r.check,x,2,0),c=0,l=0,r.mode=Wf;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=q;break}if((c&15)!==Xf){t.msg="unknown compression method",r.mode=q;break}if(c>>>=4,l-=4,I=(c&15)+8,r.wbits===0)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=q;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?tl:Jt,c=0,l=0;break;case Wf:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Xf){t.msg="unknown compression method",r.mode=q;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=q;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Ht(r.check,x,2,0)),c=0,l=0,r.mode=qf;case qf:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=Ht(r.check,x,4,0)),c=0,l=0,r.mode=Zf;case Zf:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Ht(r.check,x,2,0)),c=0,l=0,r.mode=Qf;case Qf:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Ht(r.check,x,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=jf;case jf:if(r.flags&1024&&(h=r.length,h>a&&(h=a),h&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),At.arraySet(r.head.extra,n,s,h,I)),r.flags&512&&(r.check=Ht(r.check,n,h,s)),a-=h,s+=h,r.length-=h),r.length))break t;r.length=0,r.mode=Yf;case Yf:if(r.flags&2048){if(a===0)break t;h=0;do I=n[s+h++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Ht(r.check,n,h,s)),a-=h,s+=h,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=$f;case $f:if(r.flags&4096){if(a===0)break t;h=0;do I=n[s+h++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&h<a);if(r.flags&512&&(r.check=Ht(r.check,n,h,s)),a-=h,s+=h,I)break t}else r.head&&(r.head.comment=null);r.mode=Jf;case Jf:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=q;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Jt;break;case tl:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=dl(c),c=0,l=0,r.mode=_o;case _o:if(r.havedict===0)return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,wp;t.adler=r.check=1,r.mode=Jt;case Jt:if(e===Mp||e===fo)break t;case Zs:if(r.last){c>>>=l&7,l-=l&7,r.mode=js;break}for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=el;break;case 1:if(Np(r),r.mode=lo,e===fo){c>>>=2,l-=2;break t}break;case 2:r.mode=nl;break;case 3:t.msg="invalid block type",r.mode=q}c>>>=2,l-=2;break;case el:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=q;break}if(r.length=c&65535,c=0,l=0,r.mode=Qs,e===fo)break t;case Qs:r.mode=rl;case rl:if(h=r.length,h){if(h>a&&(h=a),h>f&&(h=f),h===0)break t;At.arraySet(o,n,s,h,i),a-=h,s+=h,f-=h,i+=h,r.length-=h;break}r.mode=Jt;break;case nl:for(;l<14;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=q;break}r.have=0,r.mode=ol;case ol:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[E[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,m={bits:r.lenbits},L=tn(Tp,r.lens,0,19,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid code lengths set",r.mode=q;break}r.have=0,r.mode=sl;case sl:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(B<16)c>>>=S,l-=S,r.lens[r.have++]=B;else{if(B===16){for(g=S+2;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=q;break}I=r.lens[r.have-1],h=3+(c&3),c>>>=2,l-=2}else if(B===17){for(g=S+3;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=S,l-=S,I=0,h=3+(c&7),c>>>=3,l-=3}else{for(g=S+7;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=S,l-=S,I=0,h=11+(c&127),c>>>=7,l-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=q;break}for(;h--;)r.lens[r.have++]=I}}if(r.mode===q)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=q;break}if(r.lenbits=9,m={bits:r.lenbits},L=tn(pl,r.lens,0,r.nlen,r.lencode,0,r.work,m),r.lenbits=m.bits,L){t.msg="invalid literal/lengths set",r.mode=q;break}if(r.distbits=6,r.distcode=r.distdyn,m={bits:r.distbits},L=tn(ml,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,m),r.distbits=m.bits,L){t.msg="invalid distances set",r.mode=q;break}if(r.mode=lo,e===fo)break t;case lo:r.mode=ho;case ho:if(a>=6&&f>=258){t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,Rp(t,_),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===Jt&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(T=S,R=y,D=B;p=r.lencode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,r.length=B,y===0){r.mode=ll;break}if(y&32){r.back=-1,r.mode=Jt;break}if(y&64){t.msg="invalid literal/length code",r.mode=q;break}r.extra=y&15,r.mode=il;case il:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=al;case al:for(;p=r.distcode[c&(1<<r.distbits)-1],S=p>>>24,y=p>>>16&255,B=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(T=S,R=y,D=B;p=r.distcode[D+((c&(1<<T+R)-1)>>T)],S=p>>>24,y=p>>>16&255,B=p&65535,!(T+S<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=T,l-=T,r.back+=T}if(c>>>=S,l-=S,r.back+=S,y&64){t.msg="invalid distance code",r.mode=q;break}r.offset=B,r.extra=y&15,r.mode=cl;case cl:if(r.extra){for(g=r.extra;l<g;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=q;break}r.mode=fl;case fl:if(f===0)break t;if(h=_-f,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=q;break}h>r.wnext?(h-=r.wnext,u=r.wsize-h):u=r.wnext-h,h>r.length&&(h=r.length),A=r.window}else A=o,u=i-r.offset,h=r.length;h>f&&(h=f),f-=h,r.length-=h;do o[i++]=A[u++];while(--h);r.length===0&&(r.mode=ho);break;case ll:if(f===0)break t;o[i++]=r.length,f--,r.mode=ho;break;case js:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[s++]<<l,l+=8}if(_-=f,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?Ht(r.check,o,_,i-_):Js(r.check,o,_,i-_)),_=f,(r.flags?c:dl(c))!==r.check){t.msg="incorrect data check",r.mode=q;break}c=0,l=0}r.mode=hl;case hl:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=q;break}c=0,l=0}r.mode=_l;case _l:L=yp;break t;case q:L=Al;break t;case ei:return ti;case bp:default:return yt}return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||_!==t.avail_out&&r.mode<q&&(r.mode<js||e!==Vf))&&Tl(t,t.output,t.next_out,_-t.avail_out)?(r.mode=ei,ti):(d-=t.avail_in,_-=t.avail_out,t.total_in+=d,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?Ht(r.check,o,_,t.next_out-_):Js(r.check,o,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Jt?128:0)+(r.mode===lo||r.mode===Qs?256:0),(d===0&&_===0||e===Vf)&&L===Ce&&(L=Op),L)}function Pp(t){if(!t||!t.state)return yt;var e=t.state;return e.window&&(e.window=null),t.state=null,Ce}function Up(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?yt:(r.head=e,e.done=!1,Ce)}function kp(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==_o)?yt:n.mode===_o&&(o=1,o=Js(o,e,r,0),o!==n.check)?Al:(s=Tl(t,e,r,r),s?(n.mode=ei,ti):(n.havedict=1,Ce))}bt.inflateReset=El;bt.inflateReset2=Sl;bt.inflateResetKeep=gl;bt.inflateInit=Lp;bt.inflateInit2=Rl;bt.inflate=Fp;bt.inflateEnd=Pp;bt.inflateGetHeader=Up;bt.inflateSetDictionary=kp;bt.inflateInfo="pako inflate (from Nodeca project)"});var ri=tt((_T,yl)=>{"use strict";yl.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Ol=tt((dT,wl)=>{"use strict";function Gp(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}wl.exports=Gp});var Cl=tt(rn=>{"use strict";var rr=Ml(),en=jt(),uo=zs(),Q=ri(),ni=to(),zp=Ks(),Kp=Ol(),bl=Object.prototype.toString;function Be(t){if(!(this instanceof Be))return new Be(t);this.options=en.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zp,this.strm.avail_out=0;var r=rr.inflateInit2(this.strm,e.windowBits);if(r!==Q.Z_OK)throw new Error(ni[r]);if(this.header=new Kp,rr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=uo.string2buf(e.dictionary):bl.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=rr.inflateSetDictionary(this.strm,e.dictionary),r!==Q.Z_OK)))throw new Error(ni[r])}Be.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,f,c,l=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?Q.Z_FINISH:Q.Z_NO_FLUSH,typeof t=="string"?r.input=uo.binstring2buf(t):bl.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new en.Buf8(n),r.next_out=0,r.avail_out=n),s=rr.inflate(r,Q.Z_NO_FLUSH),s===Q.Z_NEED_DICT&&o&&(s=rr.inflateSetDictionary(this.strm,o)),s===Q.Z_BUF_ERROR&&l===!0&&(s=Q.Z_OK,l=!1),s!==Q.Z_STREAM_END&&s!==Q.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===Q.Z_STREAM_END||r.avail_in===0&&(i===Q.Z_FINISH||i===Q.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=uo.utf8border(r.output,r.next_out),f=r.next_out-a,c=uo.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&en.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(en.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==Q.Z_STREAM_END);return s===Q.Z_STREAM_END&&(i=Q.Z_FINISH),i===Q.Z_FINISH?(s=rr.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Q.Z_OK):(i===Q.Z_SYNC_FLUSH&&(this.onEnd(Q.Z_OK),r.avail_out=0),!0)};Be.prototype.onData=function(t){this.chunks.push(t)};Be.prototype.onEnd=function(t){t===Q.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=en.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function oi(t,e){var r=new Be(e);if(r.push(t,!0),r.err)throw r.msg||ni[r.err];return r.result}function Hp(t,e){return e=e||{},e.raw=!0,oi(t,e)}rn.Inflate=Be;rn.inflate=oi;rn.inflateRaw=Hp;rn.ungzip=oi});var Il=tt((pT,Dl)=>{"use strict";var Vp=jt().assign,Xp=Lf(),Wp=Cl(),qp=ri(),Bl={};Vp(Bl,Xp,Wp,qp);Dl.exports=Bl});var vl=tt(()=>{});var an={};_n(an,{ArcGISWebSceneLoader:()=>Wl,COORDINATE_SYSTEM:()=>vt,I3SAttributeLoader:()=>on,I3SBuildingSceneLayerLoader:()=>Kl,I3SContentLoader:()=>Kn,I3SLoader:()=>Lr,I3SNodePageLoader:()=>Wn,LayerError:()=>sn,SLPKArchive:()=>nr,SLPKLoader:()=>Ll,customizeColors:()=>Ql,loadFeatureAttributes:()=>kl,parseSLPKArchive:()=>mo});dn(an,Dt(Vt(),1));var n0={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},o0={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ue={...n0,...o0};var s0=1/Math.PI*180,i0=1/180*Math.PI,a0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...a0}};var X=globalThis.mathgl.config;function go(t,{precision:e=X.precision}={}){return t=c0(t),`${parseFloat(t.toPrecision(e))}`}function It(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Eo(t){return di(t)}function So(t){return ui(t)}function di(t,e){return pi(t,r=>r*i0,e)}function ui(t,e){return pi(t,r=>r*s0,e)}function dt(t,e,r){let n=X.EPSILON;r&&(X.EPSILON=r);try{if(t===e)return!0;if(It(t)&&It(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!dt(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=X.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{X.EPSILON=n}}function c0(t){return Math.round(t/X.EPSILON)*X.EPSILON}function f0(t){return t.clone?t.clone():new Array(t.length)}function pi(t,e,r){if(It(t)){let n=t;r=r||f0(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof t=="number"?t:t[o];r[o]=e(s,o,r)}return r}return e(t)}var ee=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:It(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(X)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+go(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!dt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let o=0;o<this.ELEMENTS;++o){let s=e[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(X.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function l0(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function z(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function re(t,e,r=""){if(X.debug&&!l0(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}function et(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var Ne=class extends ee{get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-e[n];r+=o*o}return z(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return z(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return et(e>=0&&e<this.ELEMENTS,"index is out of range"),z(this[e])}setComponent(e,r){return et(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,sr=Math.random;function Fe(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var km=Math.PI/180;function h0(){let t=new W(2);return W!=Float32Array&&(t[0]=0,t[1]=0),t}function mi(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function Ai(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}var Gm=function(){let t=h0();return function(e,r,n,o,s,i){let a,f;for(r||(r=2),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],s(t,t,i),e[a]=t[0],e[a+1]=t[1];return e}}();function xi(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function un(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function gi(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t}function Ei(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t[3]=e[3],t}function pn(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*s,t[1]=r[1]*n+r[4]*o+r[7]*s,t[2]=r[2]*n+r[5]*o+r[8]*s,t[3]=e[3],t}var Ae={};_n(Ae,{add:()=>p0,angle:()=>wo,bezier:()=>b0,ceil:()=>m0,clone:()=>_0,copy:()=>d0,create:()=>mn,cross:()=>pe,dist:()=>P0,distance:()=>yi,div:()=>F0,divide:()=>Mi,dot:()=>ir,equals:()=>v0,exactEquals:()=>I0,floor:()=>A0,forEach:()=>G0,fromValues:()=>An,hermite:()=>O0,inverse:()=>M0,len:()=>Oo,length:()=>Si,lerp:()=>y0,max:()=>g0,min:()=>x0,mul:()=>N0,multiply:()=>Ti,negate:()=>T0,normalize:()=>Ro,random:()=>C0,rotateX:()=>To,rotateY:()=>Mo,rotateZ:()=>yo,round:()=>E0,scale:()=>S0,scaleAndAdd:()=>R0,set:()=>u0,slerp:()=>w0,sqrDist:()=>U0,sqrLen:()=>k0,squaredDistance:()=>wi,squaredLength:()=>Oi,str:()=>D0,sub:()=>L0,subtract:()=>Ri,transformMat3:()=>ar,transformMat4:()=>me,transformQuat:()=>cr,zero:()=>B0});function mn(){let t=new W(3);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _0(t){let e=new W(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Si(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function An(t,e,r){let n=new W(3);return n[0]=t,n[1]=e,n[2]=r,n}function d0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function p0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Ri(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Ti(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Mi(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function m0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function A0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function x0(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function g0(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function E0(t,e){return t[0]=Fe(e[0]),t[1]=Fe(e[1]),t[2]=Fe(e[2]),t}function S0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function R0(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function yi(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(r*r+n*n+o*o)}function wi(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}function Oi(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function T0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Ro(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function ir(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pe(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2];return t[0]=o*f-s*a,t[1]=s*i-n*f,t[2]=n*a-o*i,t}function y0(t,e,r,n){let o=e[0],s=e[1],i=e[2];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t}function w0(t,e,r,n){let o=Math.acos(Math.min(Math.max(ir(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function O0(t,e,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,f=i*(s-2)+s,c=i*(s-1),l=i*(3-2*s);return t[0]=e[0]*a+r[0]*f+n[0]*c+o[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+o[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+o[2]*l,t}function b0(t,e,r,n,o,s){let i=1-s,a=i*i,f=s*s,c=a*i,l=3*s*a,d=3*f*i,_=f*s;return t[0]=e[0]*c+r[0]*l+n[0]*d+o[0]*_,t[1]=e[1]*c+r[1]*l+n[1]*d+o[1]*_,t[2]=e[2]*c+r[2]*l+n[2]*d+o[2]*_,t}function C0(t,e){e=e===void 0?1:e;let r=sr()*2*Math.PI,n=sr()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function me(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,t[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,t[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,t[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,t}function ar(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=n*r[0]+o*r[3]+s*r[6],t[1]=n*r[1]+o*r[4]+s*r[7],t[2]=n*r[2]+o*r[5]+s*r[8],t}function cr(t,e,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=e[0],f=e[1],c=e[2],l=o*c-s*f,d=s*a-n*c,_=n*f-o*a,h=o*_-s*d,u=s*l-n*_,A=n*d-o*l,p=i*2;return l*=p,d*=p,_*=p,h*=2,u*=2,A*=2,t[0]=a+l+h,t[1]=f+d+u,t[2]=c+_+A,t}function To(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mo(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function yo(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function wo(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&ir(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function B0(t){return t[0]=0,t[1]=0,t[2]=0,t}function D0(t){return`vec3(${t[0]}, ${t[1]}, ${t[2]})`}function I0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function v0(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var L0=Ri,N0=Ti,F0=Mi,P0=yi,U0=wi,Oo=Si,k0=Oi,G0=function(){let t=mn();return function(e,r,n,o,s,i){let a,f;for(r||(r=3),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var bo=[0,0,0],xn,v=class extends Ne{static get ZERO(){return xn||(xn=new v(0,0,0),Object.freeze(xn)),xn}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&It(e)?this.copy(e):(X.debug&&(z(e),z(r),z(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return X.debug&&(z(e.x),z(e.y),z(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=z(e)}angle(e){return wo(this,e)}cross(e){return pe(this,this,e),this.check()}rotateX({radians:e,origin:r=bo}){return To(this,this,r,e),this.check()}rotateY({radians:e,origin:r=bo}){return Mo(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=bo}){return yo(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return me(this,this,e),this.check()}transformAsVector(e){return un(this,this,e),this.check()}transformByMatrix3(e){return ar(this,this,e),this.check()}transformByMatrix2(e){return gi(this,this,e),this.check()}transformByQuaternion(e){return cr(this,this,e),this.check()}};var gn,Ue=class extends Ne{static get ZERO(){return gn||(gn=new Ue(0,0,0,0),Object.freeze(gn)),gn}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),It(e)&&arguments.length===1?this.copy(e):(X.debug&&(z(e),z(r),z(n),z(o)),this[0]=e,this[1]=r,this[2]=n,this[3]=o)}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return X.debug&&(z(e.x),z(e.y),z(e.z),z(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}transform(e){return me(this,this,e),this.check()}transformByMatrix3(e){return pn(this,this,e),this.check()}transformByMatrix2(e){return Ei(this,this,e),this.check()}transformByQuaternion(e){return cr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var ke=class extends ee{toString(){let e="[";if(X.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${this[r]}`}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=z(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(e,r){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function bi(){let t=new W(9);return W!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Ci(t,e){if(t===e){let r=e[1],n=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Bi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=l*i-a*c,_=-l*s+a*f,h=c*s-i*f,u=r*d+n*_+o*h;return u?(u=1/u,t[0]=d*u,t[1]=(-l*n+o*c)*u,t[2]=(a*n-o*i)*u,t[3]=_*u,t[4]=(l*r-o*f)*u,t[5]=(-a*r+o*s)*u,t[6]=h*u,t[7]=(-c*r+n*f)*u,t[8]=(i*r-n*s)*u,t):null}function Di(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8];return e*(c*s-i*f)+r*(-c*o+i*a)+n*(f*o-s*a)}function Co(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1],u=r[2],A=r[3],p=r[4],S=r[5],y=r[6],B=r[7],T=r[8];return t[0]=_*n+h*i+u*c,t[1]=_*o+h*a+u*l,t[2]=_*s+h*f+u*d,t[3]=A*n+p*i+S*c,t[4]=A*o+p*a+S*l,t[5]=A*s+p*f+S*d,t[6]=y*n+B*i+T*c,t[7]=y*o+B*a+T*l,t[8]=y*s+B*f+T*d,t}function Ii(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=r[0],h=r[1];return t[0]=n,t[1]=o,t[2]=s,t[3]=i,t[4]=a,t[5]=f,t[6]=_*n+h*i+c,t[7]=_*o+h*a+l,t[8]=_*s+h*f+d,t}function vi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=Math.sin(r),h=Math.cos(r);return t[0]=h*n+_*i,t[1]=h*o+_*a,t[2]=h*s+_*f,t[3]=h*i-_*n,t[4]=h*a-_*o,t[5]=h*f-_*s,t[6]=c,t[7]=l,t[8]=d,t}function Bo(t,e,r){let n=r[0],o=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Li(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,d=n*a,_=o*i,h=o*a,u=o*f,A=s*i,p=s*a,S=s*f;return t[0]=1-d-u,t[3]=l-S,t[6]=_+p,t[1]=l+S,t[4]=1-c-u,t[7]=h-A,t[2]=_-p,t[5]=h+A,t[8]=1-c-d,t}var Do;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(Do||(Do={}));var K0=Object.freeze([1,0,0,0,1,0,0,0,1]),j=class extends ke{static get IDENTITY(){return V0()}static get ZERO(){return H0()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Do}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(K0)}fromObject(e){return this.check()}fromQuaternion(e){return Li(this,e),this.check()}set(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return Di(this)}transpose(){return Ci(this,this),this.check()}invert(){return Bi(this,this),this.check()}multiplyLeft(e){return Co(this,e,this),this.check()}multiplyRight(e){return Co(this,this,e),this.check()}rotate(e){return vi(this,this,e),this.check()}scale(e){return Array.isArray(e)?Bo(this,this,e):Bo(this,this,[e,e]),this.check()}translate(e){return Ii(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=mi(r||[-0,-0],e,this);break;case 3:n=ar(r||[-0,-0,-0],e,this);break;case 4:n=pn(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return re(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},En,Sn=null;function H0(){return En||(En=new j([0,0,0,0,0,0,0,0,0]),Object.freeze(En)),En}function V0(){return Sn||(Sn=new j,Object.freeze(Sn)),Sn}var lr={};_n(lr,{add:()=>ph,adjoint:()=>j0,clone:()=>W0,copy:()=>q0,create:()=>X0,decompose:()=>ih,determinant:()=>Lo,equals:()=>gh,exactEquals:()=>xh,frob:()=>uh,fromQuat:()=>zo,fromQuat2:()=>nh,fromRotation:()=>J0,fromRotationTranslation:()=>Fi,fromRotationTranslationScale:()=>ah,fromRotationTranslationScaleOrigin:()=>ch,fromScaling:()=>$0,fromTranslation:()=>Y0,fromValues:()=>Z0,fromXRotation:()=>th,fromYRotation:()=>eh,fromZRotation:()=>rh,frustum:()=>Ko,getRotation:()=>sh,getScaling:()=>Pi,getTranslation:()=>oh,identity:()=>Ni,invert:()=>vo,lookAt:()=>Xo,mul:()=>Eh,multiply:()=>fr,multiplyScalar:()=>mh,multiplyScalarAndAdd:()=>Ah,ortho:()=>Vo,orthoNO:()=>ki,orthoZO:()=>hh,perspective:()=>Ho,perspectiveFromFieldOfView:()=>lh,perspectiveNO:()=>Ui,perspectiveZO:()=>fh,rotate:()=>Po,rotateX:()=>Uo,rotateY:()=>ko,rotateZ:()=>Go,scale:()=>Fo,set:()=>Q0,str:()=>dh,sub:()=>Sh,subtract:()=>Gi,targetTo:()=>_h,translate:()=>No,transpose:()=>Io});function X0(){let t=new W(16);return W!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function W0(t){let e=new W(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function q0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Z0(t,e,r,n,o,s,i,a,f,c,l,d,_,h,u,A){let p=new W(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=d,p[12]=_,p[13]=h,p[14]=u,p[15]=A,p}function Q0(t,e,r,n,o,s,i,a,f,c,l,d,_,h,u,A,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=s,t[5]=i,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=d,t[11]=_,t[12]=h,t[13]=u,t[14]=A,t[15]=p,t}function Ni(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Io(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],s=e[6],i=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=o,t[13]=i,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function vo(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],A=e[13],p=e[14],S=e[15],y=r*a-n*i,B=r*f-o*i,T=r*c-s*i,R=n*f-o*a,D=n*c-s*a,I=o*c-s*f,L=l*A-d*u,x=l*p-_*u,m=l*S-h*u,g=d*p-_*A,E=d*S-h*A,U=_*S-h*p,P=y*U-B*E+T*g+R*m-D*x+I*L;return P?(P=1/P,t[0]=(a*U-f*E+c*g)*P,t[1]=(o*E-n*U-s*g)*P,t[2]=(A*I-p*D+S*R)*P,t[3]=(_*D-d*I-h*R)*P,t[4]=(f*m-i*U-c*x)*P,t[5]=(r*U-o*m+s*x)*P,t[6]=(p*T-u*I-S*B)*P,t[7]=(l*I-_*T+h*B)*P,t[8]=(i*E-a*m+c*L)*P,t[9]=(n*m-r*E-s*L)*P,t[10]=(u*D-A*T+S*y)*P,t[11]=(d*T-l*D-h*y)*P,t[12]=(a*x-i*g-f*L)*P,t[13]=(r*g-n*x+o*L)*P,t[14]=(A*B-u*R-p*y)*P,t[15]=(l*R-d*B+_*y)*P,t):null}function j0(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],d=e[9],_=e[10],h=e[11],u=e[12],A=e[13],p=e[14],S=e[15],y=r*a-n*i,B=r*f-o*i,T=r*c-s*i,R=n*f-o*a,D=n*c-s*a,I=o*c-s*f,L=l*A-d*u,x=l*p-_*u,m=l*S-h*u,g=d*p-_*A,E=d*S-h*A,U=_*S-h*p;return t[0]=a*U-f*E+c*g,t[1]=o*E-n*U-s*g,t[2]=A*I-p*D+S*R,t[3]=_*D-d*I-h*R,t[4]=f*m-i*U-c*x,t[5]=r*U-o*m+s*x,t[6]=p*T-u*I-S*B,t[7]=l*I-_*T+h*B,t[8]=i*E-a*m+c*L,t[9]=n*m-r*E-s*L,t[10]=u*D-A*T+S*y,t[11]=d*T-l*D-h*y,t[12]=a*x-i*g-f*L,t[13]=r*g-n*x+o*L,t[14]=A*B-u*R-p*y,t[15]=l*R-d*B+_*y,t}function Lo(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8],l=t[9],d=t[10],_=t[11],h=t[12],u=t[13],A=t[14],p=t[15],S=e*i-r*s,y=e*a-n*s,B=r*a-n*i,T=c*u-l*h,R=c*A-d*h,D=l*A-d*u,I=e*D-r*R+n*T,L=s*D-i*R+a*T,x=c*B-l*y+d*S,m=h*B-u*y+A*S;return f*I-o*L+p*x-_*m}function fr(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=e[8],_=e[9],h=e[10],u=e[11],A=e[12],p=e[13],S=e[14],y=e[15],B=r[0],T=r[1],R=r[2],D=r[3];return t[0]=B*n+T*a+R*d+D*A,t[1]=B*o+T*f+R*_+D*p,t[2]=B*s+T*c+R*h+D*S,t[3]=B*i+T*l+R*u+D*y,B=r[4],T=r[5],R=r[6],D=r[7],t[4]=B*n+T*a+R*d+D*A,t[5]=B*o+T*f+R*_+D*p,t[6]=B*s+T*c+R*h+D*S,t[7]=B*i+T*l+R*u+D*y,B=r[8],T=r[9],R=r[10],D=r[11],t[8]=B*n+T*a+R*d+D*A,t[9]=B*o+T*f+R*_+D*p,t[10]=B*s+T*c+R*h+D*S,t[11]=B*i+T*l+R*u+D*y,B=r[12],T=r[13],R=r[14],D=r[15],t[12]=B*n+T*a+R*d+D*A,t[13]=B*o+T*f+R*_+D*p,t[14]=B*s+T*c+R*h+D*S,t[15]=B*i+T*l+R*u+D*y,t}function No(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,d,_,h,u,A,p,S;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*s+e[12],t[13]=e[1]*n+e[5]*o+e[9]*s+e[13],t[14]=e[2]*n+e[6]*o+e[10]*s+e[14],t[15]=e[3]*n+e[7]*o+e[11]*s+e[15]):(i=e[0],a=e[1],f=e[2],c=e[3],l=e[4],d=e[5],_=e[6],h=e[7],u=e[8],A=e[9],p=e[10],S=e[11],t[0]=i,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=d,t[6]=_,t[7]=h,t[8]=u,t[9]=A,t[10]=p,t[11]=S,t[12]=i*n+l*o+u*s+e[12],t[13]=a*n+d*o+A*s+e[13],t[14]=f*n+_*o+p*s+e[14],t[15]=c*n+h*o+S*s+e[15]),t}function Fo(t,e,r){let n=r[0],o=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Po(t,e,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),f,c,l,d,_,h,u,A,p,S,y,B,T,R,D,I,L,x,m,g,E,U,P,k;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,d=e[0],_=e[1],h=e[2],u=e[3],A=e[4],p=e[5],S=e[6],y=e[7],B=e[8],T=e[9],R=e[10],D=e[11],I=o*o*l+f,L=s*o*l+i*c,x=i*o*l-s*c,m=o*s*l-i*c,g=s*s*l+f,E=i*s*l+o*c,U=o*i*l+s*c,P=s*i*l-o*c,k=i*i*l+f,t[0]=d*I+A*L+B*x,t[1]=_*I+p*L+T*x,t[2]=h*I+S*L+R*x,t[3]=u*I+y*L+D*x,t[4]=d*m+A*g+B*E,t[5]=_*m+p*g+T*E,t[6]=h*m+S*g+R*E,t[7]=u*m+y*g+D*E,t[8]=d*U+A*P+B*k,t[9]=_*U+p*P+T*k,t[10]=h*U+S*P+R*k,t[11]=u*U+y*P+D*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function Uo(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[4],i=e[5],a=e[6],f=e[7],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*o+c*n,t[5]=i*o+l*n,t[6]=a*o+d*n,t[7]=f*o+_*n,t[8]=c*o-s*n,t[9]=l*o-i*n,t[10]=d*o-a*n,t[11]=_*o-f*n,t}function ko(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[8],l=e[9],d=e[10],_=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o-c*n,t[1]=i*o-l*n,t[2]=a*o-d*n,t[3]=f*o-_*n,t[8]=s*n+c*o,t[9]=i*n+l*o,t[10]=a*n+d*o,t[11]=f*n+_*o,t}function Go(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[4],l=e[5],d=e[6],_=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o+c*n,t[1]=i*o+l*n,t[2]=a*o+d*n,t[3]=f*o+_*n,t[4]=c*o-s*n,t[5]=l*o-i*n,t[6]=d*o-a*n,t[7]=_*o-f*n,t}function Y0(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function $0(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function J0(t,e,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,f,c;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+s*f,t[2]=s*n*c-o*f,t[3]=0,t[4]=n*o*c-s*f,t[5]=o*o*c+a,t[6]=s*o*c+n*f,t[7]=0,t[8]=n*s*c+o*f,t[9]=o*s*c-n*f,t[10]=s*s*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function th(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function eh(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function rh(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Fi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=n+n,f=o+o,c=s+s,l=n*a,d=n*f,_=n*c,h=o*f,u=o*c,A=s*c,p=i*a,S=i*f,y=i*c;return t[0]=1-(h+A),t[1]=d+y,t[2]=_-S,t[3]=0,t[4]=d-y,t[5]=1-(l+A),t[6]=u+p,t[7]=0,t[8]=_+S,t[9]=u-p,t[10]=1-(l+h),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function nh(t,e){let r=new W(3),n=-e[0],o=-e[1],s=-e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],d=n*n+o*o+s*s+i*i;return d>0?(r[0]=(a*i+l*n+f*s-c*o)*2/d,r[1]=(f*i+l*o+c*n-a*s)*2/d,r[2]=(c*i+l*s+a*o-f*n)*2/d):(r[0]=(a*i+l*n+f*s-c*o)*2,r[1]=(f*i+l*o+c*n-a*s)*2,r[2]=(c*i+l*s+a*o-f*n)*2),Fi(t,e,r),t}function oh(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Pi(t,e){let r=e[0],n=e[1],o=e[2],s=e[4],i=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+o*o),t[1]=Math.sqrt(s*s+i*i+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function sh(t,e){let r=new W(3);Pi(r,e);let n=1/r[0],o=1/r[1],s=1/r[2],i=e[0]*n,a=e[1]*o,f=e[2]*s,c=e[4]*n,l=e[5]*o,d=e[6]*s,_=e[8]*n,h=e[9]*o,u=e[10]*s,A=i+l+u,p=0;return A>0?(p=Math.sqrt(A+1)*2,t[3]=.25*p,t[0]=(d-h)/p,t[1]=(_-f)/p,t[2]=(a-c)/p):i>l&&i>u?(p=Math.sqrt(1+i-l-u)*2,t[3]=(d-h)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(_+f)/p):l>u?(p=Math.sqrt(1+l-i-u)*2,t[3]=(_-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(d+h)/p):(p=Math.sqrt(1+u-i-l)*2,t[3]=(a-c)/p,t[0]=(_+f)/p,t[1]=(d+h)/p,t[2]=.25*p),t}function ih(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],f=n[5],c=n[6],l=n[8],d=n[9],_=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+d*d+_*_);let h=1/r[0],u=1/r[1],A=1/r[2],p=o*h,S=s*u,y=i*A,B=a*h,T=f*u,R=c*A,D=l*h,I=d*u,L=_*A,x=p+T+L,m=0;return x>0?(m=Math.sqrt(x+1)*2,t[3]=.25*m,t[0]=(R-I)/m,t[1]=(D-y)/m,t[2]=(S-B)/m):p>T&&p>L?(m=Math.sqrt(1+p-T-L)*2,t[3]=(R-I)/m,t[0]=.25*m,t[1]=(S+B)/m,t[2]=(D+y)/m):T>L?(m=Math.sqrt(1+T-p-L)*2,t[3]=(D-y)/m,t[0]=(S+B)/m,t[1]=.25*m,t[2]=(R+I)/m):(m=Math.sqrt(1+L-p-T)*2,t[3]=(S-B)/m,t[0]=(D+y)/m,t[1]=(R+I)/m,t[2]=.25*m),t}function ah(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=o+o,c=s+s,l=i+i,d=o*f,_=o*c,h=o*l,u=s*c,A=s*l,p=i*l,S=a*f,y=a*c,B=a*l,T=n[0],R=n[1],D=n[2];return t[0]=(1-(u+p))*T,t[1]=(_+B)*T,t[2]=(h-y)*T,t[3]=0,t[4]=(_-B)*R,t[5]=(1-(d+p))*R,t[6]=(A+S)*R,t[7]=0,t[8]=(h+y)*D,t[9]=(A-S)*D,t[10]=(1-(d+u))*D,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function ch(t,e,r,n,o){let s=e[0],i=e[1],a=e[2],f=e[3],c=s+s,l=i+i,d=a+a,_=s*c,h=s*l,u=s*d,A=i*l,p=i*d,S=a*d,y=f*c,B=f*l,T=f*d,R=n[0],D=n[1],I=n[2],L=o[0],x=o[1],m=o[2],g=(1-(A+S))*R,E=(h+T)*R,U=(u-B)*R,P=(h-T)*D,k=(1-(_+S))*D,N=(p+y)*D,Y=(u+B)*I,st=(p-y)*I,V=(1-(_+A))*I;return t[0]=g,t[1]=E,t[2]=U,t[3]=0,t[4]=P,t[5]=k,t[6]=N,t[7]=0,t[8]=Y,t[9]=st,t[10]=V,t[11]=0,t[12]=r[0]+L-(g*L+P*x+Y*m),t[13]=r[1]+x-(E*L+k*x+st*m),t[14]=r[2]+m-(U*L+N*x+V*m),t[15]=1,t}function zo(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,d=n*a,_=o*i,h=o*a,u=o*f,A=s*i,p=s*a,S=s*f;return t[0]=1-d-u,t[1]=l+S,t[2]=_-p,t[3]=0,t[4]=l-S,t[5]=1-c-u,t[6]=h+A,t[7]=0,t[8]=_+p,t[9]=h-A,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ko(t,e,r,n,o,s,i){let a=1/(r-e),f=1/(o-n),c=1/(s-i);return t[0]=s*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(i+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*c,t[15]=0,t}function Ui(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=(o+n)*i,t[14]=2*o*n*i}else t[10]=-1,t[14]=-2*n;return t}var Ho=Ui;function fh(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=o*i,t[14]=o*n*i}else t[10]=-1,t[14]=-n;return t}function lh(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(o+s);return t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((i-a)*f*.5),t[9]=(o-s)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ki(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=(i+s)*c,t[15]=1,t}var Vo=ki;function hh(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=s*c,t[15]=1,t}function Xo(t,e,r,n){let o,s,i,a,f,c,l,d,_,h,u=e[0],A=e[1],p=e[2],S=n[0],y=n[1],B=n[2],T=r[0],R=r[1],D=r[2];return Math.abs(u-T)<1e-6&&Math.abs(A-R)<1e-6&&Math.abs(p-D)<1e-6?Ni(t):(d=u-T,_=A-R,h=p-D,o=1/Math.sqrt(d*d+_*_+h*h),d*=o,_*=o,h*=o,s=y*h-B*_,i=B*d-S*h,a=S*_-y*d,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),f=_*a-h*i,c=h*s-d*a,l=d*i-_*s,o=Math.sqrt(f*f+c*c+l*l),o?(o=1/o,f*=o,c*=o,l*=o):(f=0,c=0,l=0),t[0]=s,t[1]=f,t[2]=d,t[3]=0,t[4]=i,t[5]=c,t[6]=_,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(s*u+i*A+a*p),t[13]=-(f*u+c*A+l*p),t[14]=-(d*u+_*A+h*p),t[15]=1,t)}function _h(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],d=s-r[1],_=i-r[2],h=l*l+d*d+_*_;h>0&&(h=1/Math.sqrt(h),l*=h,d*=h,_*=h);let u=f*_-c*d,A=c*l-a*_,p=a*d-f*l;return h=u*u+A*A+p*p,h>0&&(h=1/Math.sqrt(h),u*=h,A*=h,p*=h),t[0]=u,t[1]=A,t[2]=p,t[3]=0,t[4]=d*p-_*A,t[5]=_*u-l*p,t[6]=l*A-d*u,t[7]=0,t[8]=l,t[9]=d,t[10]=_,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t}function dh(t){return`mat4(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}, ${t[4]}, ${t[5]}, ${t[6]}, ${t[7]}, ${t[8]}, ${t[9]}, ${t[10]}, ${t[11]}, ${t[12]}, ${t[13]}, ${t[14]}, ${t[15]})`}function uh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function ph(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Gi(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function mh(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Ah(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function xh(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function gh(t,e){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],f=t[6],c=t[7],l=t[8],d=t[9],_=t[10],h=t[11],u=t[12],A=t[13],p=t[14],S=t[15],y=e[0],B=e[1],T=e[2],R=e[3],D=e[4],I=e[5],L=e[6],x=e[7],m=e[8],g=e[9],E=e[10],U=e[11],P=e[12],k=e[13],N=e[14],Y=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-B)<=1e-6*Math.max(1,Math.abs(n),Math.abs(B))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(i-D)<=1e-6*Math.max(1,Math.abs(i),Math.abs(D))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(l-m)<=1e-6*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(d-g)<=1e-6*Math.max(1,Math.abs(d),Math.abs(g))&&Math.abs(_-E)<=1e-6*Math.max(1,Math.abs(_),Math.abs(E))&&Math.abs(h-U)<=1e-6*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(u-P)<=1e-6*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(A-k)<=1e-6*Math.max(1,Math.abs(A),Math.abs(k))&&Math.abs(p-N)<=1e-6*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(S-Y)<=1e-6*Math.max(1,Math.abs(S),Math.abs(Y))}var Eh=fr,Sh=Gi;function Rh(){let t=new W(4);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function zi(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Ki(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Hi(t){let e=t[0],r=t[1],n=t[2],o=t[3];return Math.sqrt(e*e+r*r+n*n+o*o)}function Vi(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function Xi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=r*i,t[1]=n*i,t[2]=o*i,t[3]=s*i,t}function Wi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function qi(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t[3]=a+n*(r[3]-a),t}function Zi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,t[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,t[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,t[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,t}function Qi(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*s-f*o,d=c*o+f*n-i*s,_=c*s+i*o-a*n,h=-i*n-a*o-f*s;return t[0]=l*c+h*-i+d*-f-_*-a,t[1]=d*c+h*-a+_*-i-l*-f,t[2]=_*c+h*-f+l*-a-d*-i,t[3]=e[3],t}var _A=function(){let t=Rh();return function(e,r,n,o,s,i){let a,f;for(r||(r=4),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Zo;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Zo||(Zo={}));var Mh=45*Math.PI/180,yh=1,Wo=.1,qo=500,wh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ut=class extends ke{static get IDENTITY(){return bh()}static get ZERO(){return Oh()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Zo}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,o,s,i,a,f,c,l,d,_,h,u,A,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=d,this[11]=_,this[12]=h,this[13]=u,this[14]=A,this[15]=p,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,d,_,h,u,A,p){return this[0]=e,this[1]=s,this[2]=c,this[3]=h,this[4]=r,this[5]=i,this[6]=l,this[7]=u,this[8]=n,this[9]=a,this[10]=d,this[11]=A,this[12]=o,this[13]=f,this[14]=_,this[15]=p,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(wh)}fromObject(e){return this.check()}fromQuaternion(e){return zo(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=Wo,far:a=qo}=e;return a===1/0?Ch(this,r,n,o,s,i):Ko(this,r,n,o,s,i,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return Xo(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=Wo,far:a=qo}=e;return Vo(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=Mh,aspect:n=yh,focalDistance:o=1,near:s=Wo,far:i=qo}=e;ji(r);let a=r/2,f=o*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:s,far:i})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=e;return ji(r),Ho(this,r,n,o,s),this.check()}determinant(){return Lo(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*s,e[6]=this[6]*i,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*s,e[10]=this[10]*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=this[4]*o,e[4]=this[5]*s,e[5]=this[6]*i,e[6]=this[8]*o,e[7]=this[9]*s,e[8]=this[10]*i,e}transpose(){return Io(this,this),this.check()}invert(){return vo(this,this),this.check()}multiplyLeft(e){return fr(this,e,this),this.check()}multiplyRight(e){return fr(this,this,e),this.check()}rotateX(e){return Uo(this,this,e),this.check()}rotateY(e){return ko(this,this,e),this.check()}rotateZ(e){return Go(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return Po(this,this,e,r),this.check()}scale(e){return Fo(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return No(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Zi(r||[-0,-0,-0,-0],e,this),re(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=Ai(r||[-0,-0],e,this);break;case 3:o=me(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return re(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=xi(r||[-0,-0],e,this);break;case 3:n=un(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return re(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},Rn,Tn;function Oh(){return Rn||(Rn=new ut([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Rn)),Rn}function bh(){return Tn||(Tn=new ut,Object.freeze(Tn)),Tn}function ji(t){if(t>Math.PI*2)throw Error("expected radians")}function Ch(t,e,r,n,o,s){let i=2*s/(r-e),a=2*s/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,d=-1,_=-2*s;return t[0]=i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=f,t[9]=c,t[10]=l,t[11]=d,t[12]=0,t[13]=0,t[14]=_,t[15]=0,t}function Yi(){let t=new W(4);return W!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function $i(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Qo(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function jo(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+i*a+o*c-s*f,t[1]=o*l+i*f+s*a-n*c,t[2]=s*l+i*c+n*f-o*a,t[3]=i*l-n*a-o*f-s*c,t}function Ji(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+i*a,t[1]=o*f+s*a,t[2]=s*f-o*a,t[3]=i*f-n*a,t}function ta(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-s*a,t[1]=o*f+i*a,t[2]=s*f+n*a,t[3]=i*f-o*a,t}function ea(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+o*a,t[1]=o*f-n*a,t[2]=s*f+i*a,t[3]=i*f-s*a,t}function ra(t,e){let r=e[0],n=e[1],o=e[2];return t[0]=r,t[1]=n,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t}function hr(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=r[0],c=r[1],l=r[2],d=r[3],_,h,u,A,p;return _=o*f+s*c+i*l+a*d,_<0&&(_=-_,f=-f,c=-c,l=-l,d=-d),1-_>1e-6?(h=Math.acos(_),p=Math.sin(h),u=Math.sin((1-n)*h)/p,A=Math.sin(n*h)/p):(u=1-n,A=n),t[0]=u*o+A*f,t[1]=u*s+A*c,t[2]=u*i+A*l,t[3]=u*a+A*d,t}function na(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=s*a,t}function oa(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Yo(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[o*3+o]&&(o=2);let s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[s*3+s]-e[i*3+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[s*3+i]-e[i*3+s])*n,t[s]=(e[s*3+o]+e[o*3+s])*n,t[i]=(e[i*3+o]+e[o*3+i])*n}return t}var sa=zi;var ia=Ki,aa=Wi,ca=qi,fa=Hi;var la=Vi;var ha=Xi;var _a=function(){let t=mn(),e=An(1,0,0),r=An(0,1,0);return function(n,o,s){let i=ir(o,s);return i<-.999999?(pe(t,e,o),Oo(t)<1e-6&&pe(t,r,o),Ro(t,t),Qo(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(pe(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,ha(n,n))}}(),wA=function(){let t=Yi(),e=Yi();return function(r,n,o,s,i,a){return hr(t,n,i,a),hr(e,o,s,a),hr(r,t,e,2*a*(1-a)),r}}(),OA=function(){let t=bi();return function(e,r,n,o){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],ha(e,Yo(e,t))}}();var Bh=[0,0,0,1],Ge=class extends ee{constructor(e=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,o)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Yo(this,e),this.check()}fromAxisRotation(e,r){return Qo(this,e,r),this.check()}identity(){return $i(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=z(e)}get y(){return this[1]}set y(e){this[1]=z(e)}get z(){return this[2]}set z(e){this[2]=z(e)}get w(){return this[3]}set w(e){this[3]=z(e)}len(){return fa(this)}lengthSquared(){return la(this)}dot(e){return aa(this,e)}rotationTo(e,r){return _a(this,e,r),this.check()}add(e){return sa(this,this,e),this.check()}calculateW(){return ra(this,this),this.check()}conjugate(){return oa(this,this),this.check()}invert(){return na(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(ca(this,e,r,n),this.check())}multiplyRight(e){return jo(this,this,e),this.check()}multiplyLeft(e){return jo(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return Ji(this,this,e),this.check()}rotateY(e){return ta(this,this,e),this.check()}rotateZ(e){return ea(this,this,e),this.check()}scale(e){return ia(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=Bh,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return hr(this,o,s,i),this.check()}transformVector4(e,r=new Ue){return Qi(r,e,this),re(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var Xt={};_n(Xt,{EPSILON1:()=>Dh,EPSILON10:()=>Gh,EPSILON11:()=>zh,EPSILON12:()=>Kh,EPSILON13:()=>Hh,EPSILON14:()=>Vh,EPSILON15:()=>Xh,EPSILON16:()=>Wh,EPSILON17:()=>qh,EPSILON18:()=>Zh,EPSILON19:()=>Qh,EPSILON2:()=>Ih,EPSILON20:()=>jh,EPSILON3:()=>vh,EPSILON4:()=>Lh,EPSILON5:()=>Nh,EPSILON6:()=>Fh,EPSILON7:()=>Ph,EPSILON8:()=>Uh,EPSILON9:()=>kh,PI_OVER_FOUR:()=>$h,PI_OVER_SIX:()=>Jh,PI_OVER_TWO:()=>Yh,TWO_PI:()=>t1});var Dh=.1,Ih=.01,vh=.001,Lh=1e-4,Nh=1e-5,Fh=1e-6,Ph=1e-7,Uh=1e-8,kh=1e-9,Gh=1e-10,zh=1e-11,Kh=1e-12,Hh=1e-13,Vh=1e-14,Xh=1e-15,Wh=1e-16,qh=1e-17,Zh=1e-18,Qh=1e-19,jh=1e-20,Yh=Math.PI/2,$h=Math.PI/4,Jh=Math.PI/6,t1=Math.PI*2;function $o(t){switch(t){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${t}`)}}var da={UInt8:ue.UNSIGNED_BYTE,UInt16:ue.UNSIGNED_SHORT,Float32:ue.FLOAT,UInt32:ue.UNSIGNED_INT,UInt64:ue.DOUBLE};function ze(t){switch(t){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${t}`)}}var ua="String",pa="Oid32",ma="Float64",Aa="Int16",vt;(function(t){t[t.DEFAULT=-1]="DEFAULT",t[t.LNGLAT=1]="LNGLAT",t[t.METER_OFFSETS=2]="METER_OFFSETS",t[t.LNGLAT_OFFSETS=3]="LNGLAT_OFFSETS",t[t.CARTESIAN=0]="CARTESIAN"})(vt||(vt={}));var Ic=Dt(Vt(),1);var br=Dt(Vt(),1);var Wt=6356752314245179e-9,e1={radii:[6378137,6378137,Wt],radiiSquared:[6378137*6378137,6378137*6378137,Wt*Wt],oneOverRadii:[1/6378137,1/6378137,1/Wt],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Wt*Wt)],maximumRadius:Math.max(6378137,6378137,Wt),centerToleranceSquared:.1};function Mn(t){return t}var ax=new v;function r1(t,e=[],r=Mn){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function xa(t,e=[]){return r1(t,e,X._cartographicRadians?Mn:Eo)}function n1(t,e,r=Mn){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function ga(t,e){return n1(t,e,X._cartographicRadians?Mn:So)}var Ea=1e-14,o1=new v,Sa={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Jo={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},_r={east:new v,north:new v,up:new v,west:new v,south:new v,down:new v},s1=new v,i1=new v,a1=new v;function ts(t,e,r,n,o,s){let i=Sa[e]&&Sa[e][r];et(i&&(!n||n===i));let a,f,c,l=o1.copy(o);if(dt(l.x,0,Ea)&&dt(l.y,0,Ea)){let _=Math.sign(l.z);a=s1.fromArray(Jo[e]),e!=="east"&&e!=="west"&&a.scale(_),f=i1.fromArray(Jo[r]),r!=="east"&&r!=="west"&&f.scale(_),c=a1.fromArray(Jo[n]),n!=="east"&&n!=="west"&&c.scale(_)}else{let{up:_,east:h,north:u}=_r;h.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,_),u.copy(_).cross(h);let{down:A,west:p,south:S}=_r;A.copy(_).scale(-1),p.copy(h).scale(-1),S.copy(u).scale(-1),a=_r[e],f=_r[r],c=_r[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=c.x,s[9]=c.y,s[10]=c.z,s[11]=0,s[12]=l.x,s[13]=l.y,s[14]=l.z,s[15]=1,s}var Ke=new v,c1=new v,f1=new v;function Ra(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;Ke.from(t);let i=Ke.x,a=Ke.y,f=Ke.z,c=n.x,l=n.y,d=n.z,_=i*i*c*c,h=a*a*l*l,u=f*f*d*d,A=_+h+u,p=Math.sqrt(1/A);if(!Number.isFinite(p))return;let S=c1;if(S.copy(t).scale(p),A<s)return S.to(r);let y=o.x,B=o.y,T=o.z,R=f1;R.set(S.x*y*2,S.y*B*2,S.z*T*2);let D=(1-p)*Ke.len()/(.5*R.len()),I=0,L,x,m,g;do{D-=I,L=1/(1+D*y),x=1/(1+D*B),m=1/(1+D*T);let E=L*L,U=x*x,P=m*m,k=E*L,N=U*x,Y=P*m;g=_*E+h*U+u*P-1;let V=-2*(_*k*y+h*N*B+u*Y*T);I=g/V}while(Math.abs(g)>Xt.EPSILON12);return Ke.scale([L,x,m]).to(r)}var yn=new v,Ta=new v,_1=new v,wt=new v,d1=new v,wn=new v,xt=class{constructor(e=0,r=0,n=0){this.centerToleranceSquared=Xt.EPSILON1,et(e>=0),et(r>=0),et(n>=0),this.radii=new v(e,r,n),this.radiiSquared=new v(e*e,r*r,n*n),this.radiiToTheFourth=new v(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new v(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new v(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=Ta,o=_1,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){wn.from(e);let n=this.scaleToGeodeticSurface(wn,wt);if(!n)return;let o=this.geodeticSurfaceNormal(n,Ta),s=d1;s.copy(wn).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(Ae.dot(s,wn))*Ae.length(s);return ga([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new ut){return ts(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new ut){return ts(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return yn.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=xa(e),o=n[0],s=n[1],i=Math.cos(s);return yn.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),yn.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return yn.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return Ra(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){wt.from(e);let n=wt.x,o=wt.y,s=wt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return wt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return wt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return wt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){et(dt(this.radii.x,this.radii.y,Xt.EPSILON15)),et(this.radii.z>0),wt.from(e);let o=wt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return wt.set(0,0,o).to(n)}};xt.WGS84=new xt(6378137,6378137,Wt);async function es(t,e,r,n){return n._parse(t,e,r,n)}function ne(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var Lt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},u1=Lt.self||Lt.window||Lt.global||{},p1=Lt.window||Lt.self||Lt.global||{},m1=Lt.global||Lt.self||Lt.window||{},A1=Lt.document||{};var gt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Ma=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),x1=Ma&&parseFloat(Ma[1])||0;var ya=t=>typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer;function dr(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function rs(t){return globalThis.loaders?.modules?.[t]||null}function g1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.4.0-alpha.9"),globalThis._loadersgl_.version}var wa=g1();function Oa(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var Nt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Bx=Nt.self||Nt.window||Nt.global||{},Dx=Nt.window||Nt.self||Nt.global||{},Ix=Nt.global||Nt.self||Nt.window||{},vx=Nt.document||{};var qt=typeof process!="object"||String(process)!=="[object process]"||process.browser,ur=typeof importScripts=="function",Lx=typeof window<"u"&&typeof window.orientation<"u",ba=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Nx=ba&&parseFloat(ba[1])||0;var ns={};async function Et(t,e=null,r={},n=null){return e&&(t=Ca(t,e,r,n)),ns[t]=ns[t]||E1(t),await ns[t]}function Ca(t,e,r={},n=null){if(r?.core)throw new Error("loadLibrary: options.core must be pre-normalized");if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:qt?r.CDN?(Oa(r.CDN.startsWith("http")),`${r.CDN}/${e}@${wa}/dist/libs/${n}`):ur?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function E1(t){if(t.endsWith("wasm"))return await R1(t);if(!qt){let{requireFromFile:r}=globalThis.loaders||{};try{let n=await r?.(t);return n||!t.includes("/dist/libs/")?n:await r?.(t.replace("/dist/libs/","/src/libs/"))}catch(n){if(t.includes("/dist/libs/"))try{return await r?.(t.replace("/dist/libs/","/src/libs/"))}catch{}return console.error(n),null}}if(ur)return importScripts(t);let e=await T1(t);return S1(e,t)}function S1(t,e){if(!qt){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(ur)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function R1(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(qt||!e||t.startsWith("http"))return await(await fetch(t)).arrayBuffer();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${t}`)}}async function T1(t){let{readFileAsText:e}=globalThis.loaders||{};if(qt||!e||t.startsWith("http"))return await(await fetch(t)).text();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${t}`)}}function oe(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),o=new Uint8Array(e);for(let s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function He(...t){return Ba(t)}function Ba(t){let e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=e.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.byteLength;return n.buffer}async function pr(t){let e=[];for await(let r of t)e.push(M1(r));return He(...e)}function M1(t){if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)){let{buffer:e,byteOffset:r,byteLength:n}=t;return Da(e,r,n)}return Da(t)}function Da(t,e=0,r=t.byteLength-e){let n=new Uint8Array(t,e,r),o=new Uint8Array(n.length);return o.set(n),o.buffer}function Ia(t){return t&&typeof t=="object"&&t.isBuffer}function se(t){if(Ia(t))return t;if(t instanceof ArrayBuffer)return t;if(ya(t))return On(t);if(ArrayBuffer.isView(t)){let e=t.buffer;return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(typeof t=="string"){let e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function On(t,e=0,r=t.byteLength-e){let n=new Uint8Array(t,e,r),o=new Uint8Array(n.length);return o.set(n),o.buffer}function Ve(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var mr=class{handle;size;bigsize;url;constructor(e){this.handle=e instanceof ArrayBuffer?new Blob([e]):e,this.size=e instanceof ArrayBuffer?e.byteLength:e.size,this.bigsize=BigInt(this.size),this.url=e instanceof File?e.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(e,r){return await this.handle.slice(Number(e),Number(e)+Number(r)).arrayBuffer()}};var Ar=new Error("Not implemented"),xr=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw gt?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(e,r){throw Ar}async write(e,r,n){throw Ar}async stat(){throw Ar}async truncate(e){throw Ar}async append(e){throw Ar}async close(){}};var va="4.4.0-alpha.9";var y1=globalThis.loaders?.parseImageNode,os=typeof Image<"u",ss=typeof ImageBitmap<"u",w1=Boolean(y1),is=gt?!0:w1;function La(t){switch(t){case"auto":return ss||os||is;case"imagebitmap":return ss;case"image":return os;case"data":return is;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Na(){if(ss)return"imagebitmap";if(os)return"image";if(is)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function O1(t){let e=b1(t);if(!e)throw new Error("Not an image");return e}function Fa(t){switch(O1(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function b1(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var C1=/^data:image\/svg\+xml/,B1=/\.svg((\?|#).*)?$/;function bn(t){return t&&(C1.test(t)||B1.test(t))}function Pa(t,e){if(bn(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return as(t,e)}function as(t,e){if(bn(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Cn(t,e,r){let n=Pa(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await D1(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function D1(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var Ua=!0;async function ka(t,e,r){let n;bn(r)?n=await Cn(t,e,r):n=as(t,r);let o=e&&e.imagebitmap;return await I1(n,o)}async function I1(t,e=null){if((v1(e)||!Ua)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Ua=!1}return await createImageBitmap(t)}function v1(t){if(!t)return!0;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Ga(t){return!P1(t,"ftyp",4)||!(t[8]&96)?null:L1(t)}function L1(t){switch(N1(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function N1(t,e,r){return String.fromCharCode(...t.slice(e,r))}function F1(t){return[...t].map(e=>e.charCodeAt(0))}function P1(t,e,r=0){let n=F1(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var Ft=!1,gr=!0;function Bn(t){let e=Er(t);return k1(e)||K1(e)||G1(e)||z1(e)||U1(e)}function U1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Ga(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function k1(t){let e=Er(t);return e.byteLength>=24&&e.getUint32(0,Ft)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Ft),height:e.getUint32(20,Ft)}:null}function G1(t){let e=Er(t);return e.byteLength>=10&&e.getUint32(0,Ft)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,gr),height:e.getUint16(8,gr)}:null}function z1(t){let e=Er(t);return e.byteLength>=14&&e.getUint16(0,Ft)===16973&&e.getUint32(2,gr)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,gr),height:e.getUint32(22,gr)}:null}function K1(t){let e=Er(t);if(!(e.byteLength>=3&&e.getUint16(0,Ft)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=H1(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,Ft);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,Ft),width:e.getUint16(s+7,Ft)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,Ft)}return null}function H1(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Er(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function za(t,e){let{mimeType:r}=Bn(t)||{},n=globalThis.loaders?.parseImageNode;return ne(n),await n(t,r)}async function Ka(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=V1(o),a;switch(i){case"imagebitmap":a=await ka(t,e,s);break;case"image":a=await Cn(t,e,s);break;case"data":a=await za(t,e);break;default:ne(!1)}return o==="data"&&(a=Fa(a)),a}function V1(t){switch(t){case"auto":case"data":return Na();default:return La(t),t}}var X1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],W1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],q1={image:{type:"auto",decode:!0}},Dn={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:va,mimeTypes:W1,extensions:X1,parse:Ka,tests:[t=>Boolean(Bn(new DataView(t)))],options:q1};var Z1="1.5.6",Q1="1.4.1",cs=`https://www.gstatic.com/draco/versioned/decoders/${Z1}`,rt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Sr={[rt.DECODER]:`${cs}/${rt.DECODER}`,[rt.DECODER_WASM]:`${cs}/${rt.DECODER_WASM}`,[rt.FALLBACK_DECODER]:`${cs}/${rt.FALLBACK_DECODER}`,[rt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${Q1}/javascript/${rt.ENCODER}`},fs;async function Va(t={},e){let r=t.modules||{};return r.draco3d?fs||=r.draco3d.createDecoderModule({}).then(n=>({draco:n})):fs||=j1(t,e),await fs}function Ha(t,e){if(t&&typeof t=="object"){if(t.default)return t.default;if(t[e])return t[e]}return t}async function j1(t,e){let r,n;switch(e){case"js":r=await Et(Sr[rt.FALLBACK_DECODER],"draco",t,rt.FALLBACK_DECODER);break;case"wasm":default:try{[r,n]=await Promise.all([await Et(Sr[rt.DECODER],"draco",t,rt.DECODER),await Et(Sr[rt.DECODER_WASM],"draco",t,rt.DECODER_WASM)])}catch{r=null,n=null}}return r=Ha(r,"DracoDecoderModule"),r=r||globalThis.DracoDecoderModule,!r&&!qt&&([r,n]=await Promise.all([await Et(Sr[rt.DECODER],"draco",{...t,useLocalLibraries:!0},rt.DECODER),await Et(Sr[rt.DECODER_WASM],"draco",{...t,useLocalLibraries:!0},rt.DECODER_WASM)]),r=Ha(r,"DracoDecoderModule"),r=r||globalThis.DracoDecoderModule),await Y1(r,n)}function Y1(t,e){if(typeof t!="function")throw new Error("DracoDecoderModule could not be loaded");let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Xa="4.4.0-alpha.9";function Wa(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function ls(t){let e=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],d=a[c+1],_=a[c+2];e=l<e?l:e,r=d<r?d:r,n=_<n?_:n,o=l>o?l:o,s=d>s?d:s,i=_>i?_:i}return[[e,r,n],[o,s,i]]}function hs(t,e,r){let n=Wa(e.value),o=r||qa(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function qa(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function Qa(t,e,r){let n=ja(e.metadata),o=[],s=$1(e.attributes);for(let i in t){let a=t[i],f=Za(i,a,s[i]);o.push(f)}if(r){let i=Za("indices",r);o.push(i)}return{fields:o,metadata:n}}function $1(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function Za(t,e,r){let n=r?ja(r.metadata):void 0;return hs(t,e,n)}function ja(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Ya={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},J1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},t_=4,Rr=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let _=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(_)}let a=this._getDracoLoaderData(s,o,r),f=this._getMeshData(s,a,r),c=ls(f.attributes),l=Qa(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:s}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let s=this.decoder.GetAttribute(e,o),i=this._getAttributeMetadata(e,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(s,r);f&&(n[s.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let o=this._getMeshAttributes(r,e,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,r,n){let o={};for(let s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:f,size:c}=a;o[i]={value:f,size:c,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*t_,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),n_(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=J1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=e_(this.draco,n),c,l=this.draco._malloc(a);try{let d=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,d,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,i).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=e.attribute_type;for(let i in Ya)if(this.draco[i]===o)return Ya[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let o=0;o<n;o++){let s=this.metadataQuerier.GetEntryName(e,o);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=r_(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,o=[...r,...n];for(let s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function e_(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function r_(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function n_(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var $a={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Xa,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}},_s={...$a,parse:o_};async function o_(t,e){let{draco:r}=await Va(e?.core,e?.draco?.decoderType||"wasm"),n=new Rr(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var In="4.4.0-alpha.9";var vn={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Ja;async function us(t){dr(t.modules);let e=rs("basis");return e||(Ja||=s_(t),await Ja)}async function s_(t){let e=null,r=null;return[e,r]=await Promise.all([await Et(vn.TRANSCODER,"textures",t),await Et(vn.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await i_(e,r)}function i_(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var ds;async function ps(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(ds=ds||a_(t),await ds)}async function a_(t){let e=null,r=null;return[e,r]=await Promise.all([await Et(vn.ENCODER,"textures",t),await Et(vn.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await c_(e,r)}function c_(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:f})})})}var M={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var f_=["","WEBKIT_","MOZ_"],tc={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Ln=null;function Tr(t){if(!Ln){t=t||l_()||void 0,Ln=new Set;for(let e of f_)for(let r in tc)if(t&&t.getExtension(`${e}${r}`)){let n=tc[r];Ln.add(n)}}return Ln}function l_(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var ms=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},xe=class{constructor(e,r,n,o){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=o,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*r;return this._offset+=8,n}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){let n=this._offset,o=0;for(;this._dataView.getUint8(this._offset)!==r&&o<e;)o++,this._offset++;return o<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,o)}};var bg=new Uint8Array([0]),ct=[171,75,84,88,32,50,48,187,13,10,26,10];function ec(t){return new TextDecoder().decode(t)}function rc(t){let e=new Uint8Array(t.buffer,t.byteOffset,ct.length);if(e[0]!==ct[0]||e[1]!==ct[1]||e[2]!==ct[2]||e[3]!==ct[3]||e[4]!==ct[4]||e[5]!==ct[5]||e[6]!==ct[6]||e[7]!==ct[7]||e[8]!==ct[8]||e[9]!==ct[9]||e[10]!==ct[10]||e[11]!==ct[11])throw new Error("Missing KTX 2.0 identifier.");let r=new ms,n=17*Uint32Array.BYTES_PER_ELEMENT,o=new xe(t,ct.length,n,!0);r.vkFormat=o._nextUint32(),r.typeSize=o._nextUint32(),r.pixelWidth=o._nextUint32(),r.pixelHeight=o._nextUint32(),r.pixelDepth=o._nextUint32(),r.layerCount=o._nextUint32(),r.faceCount=o._nextUint32();let s=o._nextUint32();r.supercompressionScheme=o._nextUint32();let i=o._nextUint32(),a=o._nextUint32(),f=o._nextUint32(),c=o._nextUint32(),l=o._nextUint64(),d=o._nextUint64(),_=s*3*8,h=new xe(t,ct.length+n,_,!0);for(let it=0;it<s;it++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+h._nextUint64(),h._nextUint64()),uncompressedByteLength:h._nextUint64()});let u=new xe(t,i,a,!0),A={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},p=6,S=4,y=(A.descriptorBlockSize/4-p)/S;for(let it=0;it<y;it++){let Ct={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};Ct.channelType&64?(Ct.sampleLower=u._nextInt32(),Ct.sampleUpper=u._nextInt32()):(Ct.sampleLower=u._nextUint32(),Ct.sampleUpper=u._nextUint32()),A.samples[it]=Ct}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(A);let B=new xe(t,f,c,!0);for(;B._offset<c;){let it=B._nextUint32(),Ct=B._scan(it),Le=ec(Ct);if(r.keyValue[Le]=B._nextUint8Array(it-Ct.byteLength-1),Le.match(/^ktx/i)){let w=ec(r.keyValue[Le]);r.keyValue[Le]=w.substring(0,w.lastIndexOf("\0"))}let O=it%4?4-it%4:0;B._skip(O)}if(d<=0)return r;let T=new xe(t,l,d,!0),R=T._nextUint16(),D=T._nextUint16(),I=T._nextUint32(),L=T._nextUint32(),x=T._nextUint32(),m=T._nextUint32(),g=[];for(let it=0;it<s;it++)g.push({imageFlags:T._nextUint32(),rgbSliceByteOffset:T._nextUint32(),rgbSliceByteLength:T._nextUint32(),alphaSliceByteOffset:T._nextUint32(),alphaSliceByteLength:T._nextUint32()});let E=l+T._offset,U=E+I,P=U+L,k=P+x,N=new Uint8Array(t.buffer,t.byteOffset+E,I),Y=new Uint8Array(t.buffer,t.byteOffset+U,L),st=new Uint8Array(t.buffer,t.byteOffset+P,x),V=new Uint8Array(t.buffer,t.byteOffset+k,m);return r.globalData={endpointCount:R,selectorCount:D,imageDescs:g,endpointsData:N,selectorsData:Y,tablesData:st,extendedData:V},r}function Xe(t,e){let r=new Array(e.mipMapLevels),n=e.width,o=e.height,s=0;for(let i=0;i<e.mipMapLevels;++i){let a=__(e,n,o,t,i),f=h_(t,i,s,a);r[i]={compressed:!0,format:e.internalFormat,data:f,width:n,height:o,levelSize:a},n=Math.max(1,n>>1),o=Math.max(1,o>>1),s+=a}return r}function h_(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function __(t,e,r,n,o){return Array.isArray(n)?t.sizeFunction(n[o]):t.sizeFunction(e,r)}var d_={131:M.COMPRESSED_RGB_S3TC_DXT1_EXT,132:M.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:M.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:M.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:M.COMPRESSED_RED_RGTC1_EXT,140:M.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:M.COMPRESSED_RED_GREEN_RGTC2_EXT,142:M.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:M.COMPRESSED_RGB8_ETC2,148:M.COMPRESSED_SRGB8_ETC2,149:M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:M.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:M.COMPRESSED_RGBA8_ETC2_EAC,152:M.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:M.COMPRESSED_R11_EAC,154:M.COMPRESSED_SIGNED_R11_EAC,155:M.COMPRESSED_RG11_EAC,156:M.COMPRESSED_SIGNED_RG11_EAC,157:M.COMPRESSED_RGBA_ASTC_4x4_KHR,158:M.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:M.COMPRESSED_RGBA_ASTC_5x4_KHR,160:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:M.COMPRESSED_RGBA_ASTC_5x5_KHR,162:M.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:M.COMPRESSED_RGBA_ASTC_6x5_KHR,164:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:M.COMPRESSED_RGBA_ASTC_6x6_KHR,166:M.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:M.COMPRESSED_RGBA_ASTC_8x5_KHR,168:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:M.COMPRESSED_RGBA_ASTC_8x6_KHR,170:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:M.COMPRESSED_RGBA_ASTC_8x8_KHR,172:M.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:M.COMPRESSED_RGBA_ASTC_10x5_KHR,174:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:M.COMPRESSED_RGBA_ASTC_10x6_KHR,176:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:M.COMPRESSED_RGBA_ASTC_10x8_KHR,178:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:M.COMPRESSED_RGBA_ASTC_10x10_KHR,180:M.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:M.COMPRESSED_RGBA_ASTC_12x10_KHR,182:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:M.COMPRESSED_RGBA_ASTC_12x12_KHR,184:M.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:M.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:M.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:M.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:M.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:M.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:M.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:M.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:M.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:M.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:M.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:M.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:M.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:M.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:M.COMPRESSED_RGBA_ASTC_12x12_KHR};function nc(t){return d_[t]}var pt=[171,75,84,88,32,50,48,187,13,10,26,10];function Nn(t){let e=new Uint8Array(t);return!(e.byteLength<pt.length||e[0]!==pt[0]||e[1]!==pt[1]||e[2]!==pt[2]||e[3]!==pt[3]||e[4]!==pt[4]||e[5]!==pt[5]||e[6]!==pt[6]||e[7]!==pt[7]||e[8]!==pt[8]||e[9]!==pt[9]||e[10]!==pt[10]||e[11]!==pt[11])}function oc(t){let e=new Uint8Array(t),r=rc(e),n=Math.max(1,r.levels.length),o=r.pixelWidth,s=r.pixelHeight,i=nc(r.vkFormat);return Xe(r.levels,{mipMapLevels:n,width:o,height:s,sizeFunction:a=>a.uncompressedByteLength,internalFormat:i})}var u_={etc1:{basisFormat:0,compressed:!0,format:M.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:M.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:M.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:M.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function Fn(t,e={}){if(!e.basis?.containerFormat||e.basis.containerFormat==="auto"){if(Nn(t)){let n=await ps(e?.core||{});return sc(n.KTX2File,t,e)}let{BasisFile:r}=await us(e?.core||{});return As(r,t,e)}switch(e.basis.module){case"encoder":let r=await ps(e?.core||{});switch(e.basis.containerFormat){case"ktx2":return sc(r.KTX2File,t,e);case"basis":default:return As(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await us(e.core||{});return As(n,t,e)}}function As(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(p_(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function p_(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ic(n,i),l=t.getImageTranscodedSizeInBytes(e,r,c),d=new Uint8Array(l);if(!t.transcodeImage(d,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:d,compressed:a,format:f,hasAlpha:i}}function sc(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),s=[];for(let i=0;i<o;i++)s.push(m_(n,i,r));return[s]}finally{n.close(),n.delete()}}function m_(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=ic(r,n),c=t.getImageTranscodedSizeInBytes(e,0,0,f),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:s,height:o,data:l,compressed:i,levelSize:c,hasAlpha:n,format:a}}function ic(t,e){let r=t.basis?.format;return r==="auto"&&(r=Pn()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),u_[r]}function Pn(){let t=Tr();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var ac={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:In,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Mr={...ac,parse:Fn};var mt={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},A_={DXT1:M.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":M.COMPRESSED_RGB_ATC_WEBGL,ATCA:M.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:M.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},x_=lc,g_=Un,E_=Un,S_={DXT1:lc,DXT3:Un,DXT5:Un,"ATC ":x_,ATCA:g_,ATCI:E_};function cc(t){return new Uint32Array(t,0,mt.HEADER_LENGTH)[mt.MAGIC_NUMBER_INDEX]===mt.MAGIC_NUMBER}function fc(t){let e=new Int32Array(t,0,mt.HEADER_LENGTH),r=e[mt.HEADER_PF_FOURCC_INDEX];ne(Boolean(e[mt.HEADER_PF_FLAGS_INDEX]&mt.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=R_(r),o=A_[n],s=S_[n];ne(o&&s,`DDS: Unknown pixel format ${r}`);let i=1;e[mt.HEADER_FLAGS_INDEX]&mt.DDSD_MIPMAPCOUNT&&(i=Math.max(1,e[mt.MIPMAPCOUNT_INDEX]));let a=e[mt.HEADER_WIDTH_INDEX],f=e[mt.HEADER_HEIGHT_INDEX],c=e[mt.HEADER_SIZE_INDEX]+4,l=new Uint8Array(t,c);return Xe(l,{mipMapLevels:i,width:a,height:f,sizeFunction:s,internalFormat:o})}function lc(t,e){return(t+3>>2)*(e+3>>2)*8}function Un(t,e){return(t+3>>2)*(e+3>>2)*16}function R_(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var St={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},T_={0:[M.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[M.COMPRESSED_RGB_ETC1_WEBGL],7:[M.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[M.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[M.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[M.COMPRESSED_RGB8_ETC2],23:[M.COMPRESSED_RGBA8_ETC2_EAC],24:[M.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[M.COMPRESSED_R11_EAC],26:[M.COMPRESSED_RG11_EAC],27:[M.COMPRESSED_RGBA_ASTC_4X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[M.COMPRESSED_RGBA_ASTC_5X4_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[M.COMPRESSED_RGBA_ASTC_5X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[M.COMPRESSED_RGBA_ASTC_6X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[M.COMPRESSED_RGBA_ASTC_6X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[M.COMPRESSED_RGBA_ASTC_8X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[M.COMPRESSED_RGBA_ASTC_8X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[M.COMPRESSED_RGBA_ASTC_8X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[M.COMPRESSED_RGBA_ASTC_10X5_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[M.COMPRESSED_RGBA_ASTC_10X6_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[M.COMPRESSED_RGBA_ASTC_10X8_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[M.COMPRESSED_RGBA_ASTC_10X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[M.COMPRESSED_RGBA_ASTC_12X10_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[M.COMPRESSED_RGBA_ASTC_12X12_KHR,M.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},M_={0:hc,1:hc,2:_c,3:_c,6:yr,7:yr,9:wr,11:wr,22:yr,23:wr,24:yr,25:yr,26:wr,27:wr,28:y_,29:w_,30:O_,31:b_,32:C_,33:B_,34:D_,35:I_,36:v_,37:L_,38:N_,39:F_,40:P_};function dc(t){let r=new Uint32Array(t,0,St.HEADER_LENGTH)[St.MAGIC_NUMBER_INDEX];return r===St.MAGIC_NUMBER||r===St.MAGIC_NUMBER_EXTRA}function uc(t){let e=new Uint32Array(t,0,St.HEADER_LENGTH),r=e[St.PIXEL_FORMAT_INDEX],n=e[St.COLOUR_SPACE_INDEX],o=T_[r]||[],s=o.length>1&&n?o[1]:o[0],i=M_[r],a=e[St.MIPMAPCOUNT_INDEX],f=e[St.WIDTH_INDEX],c=e[St.HEIGHT_INDEX],l=St.HEADER_SIZE+e[St.METADATA_SIZE_INDEX],d=new Uint8Array(t,l);return Xe(d,{mipMapLevels:a,width:f,height:c,sizeFunction:i,internalFormat:s})}function hc(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function _c(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function yr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function wr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function y_(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function w_(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function O_(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function b_(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function C_(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function B_(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function D_(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function I_(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function v_(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function L_(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function N_(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function F_(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function P_(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}function pc(t){if(Nn(t))return oc(t);if(cc(t))return fc(t);if(dc(t))return uc(t);throw new Error("Texture container format not recognized")}var mc={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:In,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},kn={...mc,parse:async(t,e)=>(e={...e},e?.["compressed-texture"]?.useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},(await Fn(t,e))[0]):pc(t))};var Or;(function(t){t.vertexCount="vertexCount",t.featureCount="featureCount"})(Or||(Or={}));function Gn(t){let e;try{let r=new URL(t);e=`${r.origin}${r.pathname}`,e.startsWith("null")&&(e=null)}catch{e=null}return e||t}function Pt(t,e=null){return e?`${t}?token=${e}`:t}function Ac(t,e){let{attributeData:r=[]}=e,n=[];for(let o=0;o<r.length;o++){let s=r[o].href.replace("./","");n.push(`${t}/${s}`)}return n}function xc(t,e,r){let n=[],{attributeStorageInfo:o=[]}=t;for(let s=0;s<o.length;s++){let i=o[s].key;n.push(`${e}/nodes/${r}/attributes/${i}/0`)}return n}var zn=new v([0,0,0]);function U_(t){switch(t){case"ktx-etc2":case"dds":return kn;case"ktx2":return Mr;case"jpg":case"png":default:return Dn}}var k_="i3s-attribute-type";async function Rc(t,e,r,n,o){let s={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ut,coordinateSystem:0,byteLength:0,texture:null};if(e.textureUrl){let i=Pt(e.textureUrl,n?.i3s?.token),a=U_(e.textureFormat),l=await(await(o?.fetch||fetch)(i)).arrayBuffer();if(n?.i3s.decodeTextures){if(a===Dn){let d={...e.textureLoaderOptions,image:{type:"data"}};try{let _=await es(l,[],d,o);s.texture=_}catch{let h=await(0,br.parse)(l,a,d,o);s.texture=h}}else if(a===kn||a===Mr){let d=await(0,br.load)(l,a,e.textureLoaderOptions);a===Mr&&(d=d[0]),s.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else s.texture=l}return s.material=Z_(e.materialDefinition,s.texture),s.material&&(s.texture=null),await G_(t,s,e,r,n)}async function G_(t,e,r,n,o){let s=t.byteLength,i,a,f=0,c=0,l;if(r.isDracoGeometry){let d=await(0,br.parse)(t,_s,{draco:{attributeNameEntry:k_}});a=d.header.vertexCount,l=d.indices?.value;let{POSITION:_,NORMAL:h,COLOR_0:u,TEXCOORD_0:A,["feature-index"]:p,["uv-region"]:S}=d.attributes;i={position:_,normal:h,color:u,uv0:A,uvRegion:S,id:p},z_(i,d);let y=$_(p);y&&Y_(i,y)}else{let{vertexAttributes:d,ordering:_,featureAttributes:h,featureAttributeOrder:u}=n.store.defaultGeometrySchema,A=H_(t,n);f=A.byteOffset,a=A.vertexCount,c=A.featureCount;let{attributes:p,byteOffset:S}=Ec(t,f,d,a,_),{attributes:y}=Ec(t,S,h,c,u);j_(y),i=K_(p,y)}if(!o?.i3s?.coordinateSystem||o.i3s.coordinateSystem===vt.METER_OFFSETS){let d=X_(i.position,r);e.modelMatrix=d.invert(),e.coordinateSystem=vt.METER_OFFSETS}else e.modelMatrix=q_(i.position),e.coordinateSystem=vt.LNGLAT_OFFSETS;e.attributes={positions:i.position,normals:i.normal,colors:gc(i.color),texCoords:i.uv0,uvRegions:gc(i.uvRegion||i.region)},e.indices=l||null,i.id&&i.id.value&&(e.featureIds=i.id.value);for(let d in e.attributes)e.attributes[d]||delete e.attributes[d];return e.vertexCount=a,e.byteLength=s,e}function z_(t,e){for(let r in e.loaderData.attributes){let n=e.loaderData.attributes[r];switch(n.name){case"POSITION":t.position.metadata=n.metadata;break;case"feature-index":t.id.metadata=n.metadata;break;default:break}}}function K_(t,e){return{...t,...e}}function gc(t){return t&&(t.normalized=!0,t)}function H_(t,e){let r=0,n=0,o=0;for(let{property:s,type:i}of e.store.defaultGeometrySchema.header){let a=$o(i);switch(s){case Or.vertexCount.toString():n=new a(t,0,4)[0],r+=ze(i);break;case Or.featureCount.toString():o=new a(t,4,4)[0],r+=ze(i);break;default:break}}return{vertexCount:n,featureCount:o,byteOffset:r}}function Ec(t,e,r,n,o){let s={};for(let i of o)if(r[i]){let{valueType:a,valuesPerElement:f}=r[i];if(e+n*f*ze(a)<=t.byteLength){let c=t.slice(e),l;if(a==="UInt64")l=V_(c,n*f,ze(a));else{let d=$o(a);l=new d(c,0,n*f)}switch(s[i]={value:l,type:da[a],size:f},i){case"color":s.color.normalized=!0;break;case"position":case"region":case"normal":default:}e=e+n*f*ze(a)}else if(i!=="uv0")break}return{attributes:s,byteOffset:e}}function V_(t,e,r){let n=[],o=new DataView(t),s=0;for(let i=0;i<e;i++){let a=o.getUint32(s,!0),f=o.getUint32(s+4,!0),c=a+2**32*f;n.push(c),s+=r}return new Uint32Array(n)}function X_(t,e){let r=e.mbs,n=t.value,o=t.metadata,s=new ut,i=new v(r[0],r[1],r[2]),a=new v;return xt.WGS84.cartographicToCartesian(i,a),xt.WGS84.eastNorthUpToFixedFrame(a,s),t.value=W_(n,o,i),s}function W_(t,e={},r){let n=new Float64Array(t.length),o=e["i3s-scale_x"]&&e["i3s-scale_x"].double||1,s=e["i3s-scale_y"]&&e["i3s-scale_y"].double||1;for(let i=0;i<n.length;i+=3)n[i]=t[i]*o+r.x,n[i+1]=t[i+1]*s+r.y,n[i+2]=t[i+2]+r.z;for(let i=0;i<n.length;i+=3)xt.WGS84.cartographicToCartesian(n.subarray(i,i+3),zn),n[i]=zn.x,n[i+1]=zn.y,n[i+2]=zn.z;return n}function q_(t){let e=t.metadata,r=e?.["i3s-scale_x"]?.double||1,n=e?.["i3s-scale_y"]?.double||1,o=new ut;return o[0]=r,o[5]=n,o}function Z_(t,e){let r;return t?r={...t,pbrMetallicRoughness:t.pbrMetallicRoughness?{...t.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},e?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=Sc(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=Sc(r.pbrMetallicRoughness.baseColorFactor)),e&&Q_(r,e),r}function Sc(t){let e=[...t];for(let r=0;r<t.length;r++)e[r]=t[r]/255;return e}function Q_(t,e){let r={source:{image:e}};t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?t.pbrMetallicRoughness.baseColorTexture={...t.pbrMetallicRoughness.baseColorTexture,texture:r}:t.emissiveTexture?t.emissiveTexture={...t.emissiveTexture,texture:r}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?t.pbrMetallicRoughness.metallicRoughnessTexture={...t.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:t.normalTexture?t.normalTexture={...t.normalTexture,texture:r}:t.occlusionTexture&&(t.occlusionTexture={...t.occlusionTexture,texture:r})}function j_(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,o=r.value,s=o[o.length-1]+1,i=new Uint32Array(s*3),a=0,f=0;for(let c=1;c<o.length;c+=2){let l=Number(n[a]),d=o[c],_=o[c-1],h=d-_+1,u=f+h*3;i.fill(l,f,u),a++,f=u}t.id.value=i}function Y_(t,e){let r=t.id.value,n=new Float32Array(r.length);for(let o=0;o<r.length;o++)n[o]=e[r[o]];t.id.value=n}function $_(t){return t?.metadata?.["i3s-feature-ids"]?.intArray}var J_="4.4.0-alpha.9",Kn={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:J_,mimeTypes:["application/octet-stream"],parse:td,extensions:["bin"],options:{"i3s-content":{}}};async function td(t,e,r){let{tile:n,_tileOptions:o,tileset:s,_tilesetOptions:i}=e?.i3s||{},a=o||n,f=i||s;return!a||!f?null:await Rc(t,a,f,e,r)}var nt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var bE=new v,CE=new v;var Cr=new v,Tc=new v,ie=class{constructor(e=[0,0,0],r=0){this.radius=-0,this.center=new v,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Cr.from(r),this.center=new v().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new ie(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=Cr.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return e.clone();let f=(n+a+s)*.5;return Tc.copy(i).scale((-n+f)/a).add(r),this.center.copy(Tc),this.radius=f,this}expand(e){let n=Cr.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=lr.getScaling(Cr,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=Cr.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,s=e.normal.dot(r)+e.distance;return s<-n?nt.OUTSIDE:s<n?nt.INTERSECTING:nt.INSIDE}};var ed=new v,rd=new v,Hn=new v,Vn=new v,Xn=new v,nd=new v,od=new v,Zt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},ae=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new v().from(e),this.halfAxes=new j(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new v(e).len(),new v(r).len(),new v(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new v(e).normalize(),s=new v(r).normalize(),i=new v(n).normalize();return new Ge().fromMatrix3(new j([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new Ge(n),s=new j().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new v().from(e),this.halfAxes=s,this}clone(){return new ae(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ie){let r=this.halfAxes,n=r.getColumn(0,Hn),o=r.getColumn(1,Vn),s=r.getColumn(2,Xn),i=ed.copy(n).add(o).add(s);return e.center.copy(this.center),e.radius=i.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,f=Math.abs(s*o[Zt.COLUMN0ROW0]+i*o[Zt.COLUMN0ROW1]+a*o[Zt.COLUMN0ROW2])+Math.abs(s*o[Zt.COLUMN1ROW0]+i*o[Zt.COLUMN1ROW1]+a*o[Zt.COLUMN1ROW2])+Math.abs(s*o[Zt.COLUMN2ROW0]+i*o[Zt.COLUMN2ROW1]+a*o[Zt.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?nt.OUTSIDE:c>=f?nt.INSIDE:nt.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=rd.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Hn),s=n.getColumn(1,Vn),i=n.getColumn(2,Xn),a=o.magnitude(),f=s.magnitude(),c=i.magnitude();o.normalize(),s.normalize(),i.normalize();let l=0,d;return d=Math.abs(r.dot(o))-a,d>0&&(l+=d*d),d=Math.abs(r.dot(s))-f,d>0&&(l+=d*d),d=Math.abs(r.dot(i))-c,d>0&&(l+=d*d),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,Hn),c=a.getColumn(1,Vn),l=a.getColumn(2,Xn),d=nd.copy(f).add(c).add(l).add(i),_=od.copy(d).subtract(e),h=r.dot(_);return o=Math.min(h,o),s=Math.max(h,s),d.copy(i).add(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),d.copy(i).add(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),d.copy(i).add(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).add(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).add(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).subtract(c).add(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),i.copy(d).subtract(f).subtract(c).subtract(l),_.copy(d).subtract(e),h=r.dot(_),o=Math.min(h,o),s=Math.max(h,s),n[0]=o,n[1]=s,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Hn);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Vn);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,Xn);return o.transformAsPoint(e),this.halfAxes=new j([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var Mc=new v,yc=new v,Qt=class{constructor(e=[0,0,1],r=0){this.normal=new v,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return et(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=Mc.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,o){return this.normal.set(e,r,n),et(dt(this.normal.len(),1)),this.distance=o,this}clone(){return new Qt(this.normal,this.distance)}equals(e){return dt(this.distance,e.distance)&&dt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=yc.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=Mc.from(e),o=this.getPointDistance(n),s=yc.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var wc=[new v([1,0,0]),new v([0,1,0]),new v([0,0,1])],Oc=new v,sd=new v,Rt=class{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*wc.length;let r=e.center,n=e.radius,o=0;for(let s of wc){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new Qt),a||(a=this.planes[o+1]=new Qt);let f=Oc.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=Oc.copy(s).scale(n).add(r),l=sd.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=nt.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case nt.OUTSIDE:return nt.OUTSIDE;case nt.INTERSECTING:r=nt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(et(Number.isFinite(r),"parentPlaneMask is required."),r===Rt.MASK_OUTSIDE||r===Rt.MASK_INSIDE)return r;let n=Rt.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],f=e.intersectPlane(a);if(f===nt.OUTSIDE)return Rt.MASK_OUTSIDE;f===nt.INTERSECTING&&(n|=i)}return n}};Rt.MASK_OUTSIDE=4294967295;Rt.MASK_INSIDE=0;Rt.MASK_INDETERMINATE=2147483647;var qE=new v,ZE=new v,QE=new v,jE=new v,YE=new v;var nS=new v,oS=new v,sS=new v,iS=new v,aS=new v,cS=new v,fS=new v,lS=new v,hS=new v,_S=new v,dS=new v,uS=new v;var AS=new j,xS=new j,gS=new j,ES=new j,SS=new j;var OS=new v,bS=new v,CS=new v,BS=new v,DS=new v,IS=new j,vS={diagonal:new j,unitary:new j};var Cc=Dt(Vt(),1);var Br;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Br||(Br={}));var Dr;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Dr||(Dr={}));var Ir;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(Ir||(Ir={}));var xs;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(xs||(xs={}));var bc=Dt(Vt(),1);var fd="4.4.0-alpha.9",Wn={dataType:null,batchType:null,name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:fd,mimeTypes:["application/json"],parse:ld,extensions:["json"],options:{i3s:{}}};async function ld(t,e){return JSON.parse(new TextDecoder().decode(t))}var vr=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(e,r="",n){this.tileset={...e},this.url=r,this.nodesPerPage=e.nodePages?.nodesPerPage||64,this.lodSelectionMetricType=e.nodePages?.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(e)}async getNodeById(e){let r=Math.floor(e/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let o=Pt(`${this.url}/nodepages/${r}`,this.options.i3s?.token);this.pendingNodePages[r]={status:"Pending",promise:(0,bc.load)(o,Wn,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=e%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(e){let r=await this.getNodeById(e),n=[],o=[];for(let h of r.children||[])o.push(this.getNodeById(h));let s=await Promise.all(o);for(let h of s)n.push({id:h.index.toString(),obb:h.obb});let i,a,f,c="jpg",l=[],d=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:u}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};i=h,d=u;let{textureData:A,materialDefinition:p}=this.getInformationFromMaterial(r.mesh.material);f=p,c=A.format||c,A.name&&(a=`${this.url}/nodes/${r.mesh.material.resource}/textures/${A.name}`),this.tileset.attributeStorageInfo&&(l=xc(this.tileset,this.url,r.mesh.attribute.resource))}let _=this.getLodSelection(r);return gs({id:e.toString(),lodSelection:_,obb:r.obb,contentUrl:i,textureUrl:a,attributeUrls:l,materialDefinition:f,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:d})}getContentUrl(e){let r=null,n=this.tileset.geometryDefinitions[e.definition],o=-1,s=this.options.i3s;if(s&&typeof s=="object"&&s.useDracoGeometry&&(o=n.geometryBuffers.findIndex(i=>i.compressedAttributes&&i.compressedAttributes.encoding==="draco")),o===-1&&(o=n.geometryBuffers.findIndex(i=>!i.compressedAttributes)),o!==-1){let i=Boolean(n.geometryBuffers[o].compressedAttributes);r={url:`${this.url}/nodes/${e.resource}/geometries/${o}`,isDracoGeometry:i}}return r}getLodSelection(e){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(e.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:e.lodThreshold}),r}getInformationFromMaterial(e){let r={textureData:{name:null}};if(e){let n=this.tileset.materialDefinitions?.[e.definition];if(n){r.materialDefinition=n;let o=n?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;typeof o=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[o]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=e.textureSetDefinitions||[];for(let o of n){let s=o&&o.formats||[],i=null;for(let a of r){let f=s.find(c=>c.format===a);if(f){i=f;break}}i&&i.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Pn(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(i)}}getSupportedTextureFormats(){let e=[],r=this.options.i3s;if(!r||r.useCompressedTextures){let n=Tr();n.has("etc2")&&e.push("ktx-etc2"),n.has("dxt")&&e.push("dds"),e.push("ktx2")}return e.push("jpg"),e.push("png"),e}};function Bc(t,e){let r=e.url||"",n;t.geometryData&&(n=`${r}/${t.geometryData[0].href}`);let o;t.textureData&&(o=`${r}/${t.textureData[0].href}`);let s;t.attributeData&&(s=Ac(r,t));let i=t.children||[];return gs({...t,children:i,url:r,contentUrl:n,textureUrl:o,textureFormat:"jpg",attributeUrls:s,isDracoGeometry:!1})}function gs(t){let e={},r=[0,0,0,1];if(t.mbs)r=t.mbs,e.sphere=[...xt.WGS84.cartographicToCartesian(t.mbs.slice(0,3)),t.mbs[3]];else if(t.obb){e.box=[...xt.WGS84.cartographicToCartesian(t.obb.center),...t.obb.halfSize,...t.obb.quaternion];let f=new ae().fromCenterHalfSizeQuaternion(e.box.slice(0,3),t.obb.halfSize,t.obb.quaternion).getBoundingSphere();e.sphere=[...f.center,f.radius],r=[...t.obb.center,f.radius]}let n=t.lodSelection?.[0].metricType,o=t.lodSelection?.[0].maxError,s=Dr.MESH,i=Br.REPLACE;return{...t,mbs:r,boundingVolume:e,lodMetricType:n,lodMetricValue:o,type:s,refine:i}}async function Dc(t,e,r){let n=Gn(r.url||""),o,s;if(t.nodePages)o=new vr(t,n,e),s=await o.formTileFromNodePages(0);else{let i=e.i3s&&typeof e.i3s=="object"?e.i3s:{},a=Pt(`${n}/nodes/root`,i.token);s=await(0,Cc.load)(a,Lr,{...e,i3s:{...i,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...t,loader:Lr,url:n,basePath:n,type:Ir.I3S,nodePagesTile:o,root:s,lodMetricType:s.lodMetricType,lodMetricValue:s.lodMetricValue}}var hd="4.4.0-alpha.9",_d=/layers\/[0-9]+$/,dd=/\.slpk$/,ud=/nodes\/([0-9-]+|root)$/,pd="504b0304",md="PointCloud",Lr={dataType:null,batchType:null,name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:hd,mimeTypes:["application/octet-stream"],parse:Ad,extensions:["bin"],options:{i3s:{token:void 0,isTileset:"auto",isTileHeader:"auto",tile:void 0,tileset:void 0,_tileOptions:void 0,_tilesetOptions:void 0,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:vt.METER_OFFSETS}}};async function Ad(t,e={},r){let n=r.url;if(e.i3s=e.i3s||{},Sd(t)===pd)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let s=Gn(n),i;e.i3s.isTileset==="auto"?i=_d.test(s)||dd.test(s):i=e.i3s.isTileset;let a;return e.i3s.isTileHeader==="auto"?a=ud.test(s):a=e.i3s.isTileHeader,i?t=await gd(t,e,r):a?t=await Ed(t,r):t=await xd(t,e),t}async function xd(t,e){return await(0,Ic.parse)(t,Kn,e)}async function gd(t,e,r){let n=JSON.parse(new TextDecoder().decode(t));if(n?.layerType===md)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await Dc(n,e,r)}async function Ed(t,e){return t=JSON.parse(new TextDecoder().decode(t)),Bc(t,e)}function Sd(t){return t instanceof ArrayBuffer?[...new Uint8Array(t,0,4)].map(e=>e.toString(16).padStart(2,"0")).join(""):null}function Nr(t){return typeof t=="bigint"?t:BigInt(t)}function Lc(t){let e=Number(t);if(!Number.isFinite(e))throw new Error("Offset is out of bounds");return e}function vc(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}async function $(t,e,r){let n=Nr(e),s=Nr(r)-n;if(s<0)throw new Error("Invalid range requested");return await t.read(n,Lc(s))}async function Ee(t,e,r){let n=await $(t,e,r);return new DataView(n)}async function Nc(t,e){return(await Ee(t,e,Nr(e)+2n)).getUint16(0,!0)}async function Es(t,e){return(await Ee(t,e,Nr(e)+4n)).getUint32(0,!0)}async function Fr(t,e){return(await Ee(t,e,Nr(e)+8n)).getBigUint64(0,!0)}async function Pr(t){if(t.bigsize>0n)return t.bigsize;if(t.size>0)return BigInt(t.size);if(t.stat){let e=await t.stat();if(e?.bigsize!==void 0)return e.bigsize;if(e?.size!==void 0)return BigInt(e.size)}return 0n}var ge=class{handle;size;bigsize;url;constructor(e,r=""){this.handle=e,this.size=e.byteLength,this.bigsize=BigInt(e.byteLength),this.url=r}async close(){}async stat(){return{size:this.size,bigsize:this.bigsize,isDirectory:!1}}async read(e=0,r){let n=Lc(e),o=r?n+r:this.size,s=vc(n,this.size),i=vc(o,this.size),f=Math.max(i,s)-s;return f<=0?new ArrayBuffer(0):On(this.handle.buffer,s,f)}};var Rd=1024,Ur=async(t,e)=>{let r=await Pr(t),n=new Uint8Array(await $(t,r-3n,r+1n)),o=[n[3],n[2],n[1],void 0],s=-1,i=r-4n;do{let a=i;i-=BigInt(Rd),i=i>=0n?i:0n;let f=new Uint8Array(await $(t,i,a));for(let c=f.length-1;c>-1;c--)if(o[3]=o[2],o[2]=o[1],o[1]=o[0],o[0]=f[c],o.every((l,d)=>l===e[d])){s=c;break}}while(s===-1&&i>0n);return i+BigInt(s)};var Fc=new Uint8Array([80,75,5,6]),Pc=new Uint8Array([80,75,6,7]),Uc=new Uint8Array([80,75,6,6]),Td=8n;var Md=12n,yd=16n;var wd=8n,Od=24n;var bd=40n,Cd=48n;var kc=async t=>{let e=await Ur(t,Fc),r=BigInt(await Nc(t,e+Td)),n=BigInt(await Es(t,e+Md)),o=BigInt(await Es(t,e+yd)),s=e-20n,i=0n,a=await $(t,s,s+4n);if(oe(a,Pc.buffer)){i=await Fr(t,s+wd);let f=await $(t,i,i+4n);if(!oe(f,Uc.buffer))throw new Error("zip64 EoCD not found");r=await Fr(t,i+Od),n=await Fr(t,i+bd),o=await Fr(t,i+Cd)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:e}}};var wR=[{offset:0,size:4,default:new DataView(Fc.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var OR=[{offset:0,size:4,default:new DataView(Pc.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],bR=[{offset:0,size:4,default:new DataView(Uc.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var Bd=20,Dd=24,Id=28,vd=30,Ld=32,Nd=42,qn=46n,Gr=new Uint8Array([80,75,1,2]),kr=async(t,e)=>{let r=await Pr(e);if(t>=r)return null;let n=await Ee(e,t,t+qn),o=n.buffer.slice(0,4);if(!oe(o,Gr.buffer))return null;let s=BigInt(n.getUint32(Bd,!0)),i=BigInt(n.getUint32(Dd,!0)),a=n.getUint16(vd,!0),f=BigInt(n.getUint16(Ld,!0)),c=n.getUint16(Id,!0),l=await $(e,t+qn,t+qn+BigInt(c+a)),d=l.slice(0,c),_=new TextDecoder().decode(d),h=t+qn+BigInt(c),u=n.getUint32(Nd,!0),A=BigInt(u),p=new DataView(l.slice(c,l.byteLength)),S={uncompressedSize:i,compressedSize:s,localHeaderOffset:A,startDisk:f},y=Fd(S,p);return{...S,...y,extraFieldLength:a,fileNameLength:c,fileName:_,extraOffset:h}};async function*We(t){let{cdStartOffset:e,cdByteSize:r}=await kc(t),n=new ge(new DataView(await $(t,e,e+r))),o=await kr(0n,n);for(;o;)yield o,o=await kr(o.extraOffset+BigInt(o.extraFieldLength),n)}var Gc=(...t)=>t[0]+t[1]*16,Fd=(t,e)=>{let r=Pd(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),s=new Uint8Array(e.buffer).findIndex((a,f,c)=>Gc(c[f],c[f+1])===1&&Gc(c[f+2],c[f+3])===o),i=0;for(let a of r){let f=i;n[a.name]=e.getBigUint64(s+4+f,!0),i=f+a.length}}return n},Pd=t=>{let e=[];return t.uncompressedSize===BigInt(4294967295)&&e.push({name:"uncompressedSize",length:8}),t.compressedSize===BigInt(4294967295)&&e.push({name:"compressedSize",length:8}),t.localHeaderOffset===BigInt(4294967295)&&e.push({name:"localHeaderOffset",length:8}),t.startDisk===BigInt(4294967295)&&e.push({name:"startDisk",length:4}),e};var vR=[{offset:0,size:4,default:new DataView(Gr.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var Ud=8,kd=18,Gd=22,zd=26,Kd=28,Zn=30n,Ss=new Uint8Array([80,75,3,4]),Se=async(t,e)=>{let r=await Ee(e,t,t+Zn),n=r.buffer.slice(0,4);if(!oe(n,Ss.buffer))return null;let o=r.getUint16(zd,!0),s=r.getUint16(Kd,!0),i=await $(e,t+Zn,t+Zn+BigInt(o+s)),a=i.slice(0,o),f=new DataView(i.slice(o,i.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+Zn+BigInt(o+s),d=r.getUint16(Ud,!0),_=BigInt(r.getUint32(kd,!0)),h=BigInt(r.getUint32(Gd,!0)),u=4;return h===BigInt(4294967295)&&(h=f.getBigUint64(u,!0),u+=8),_===BigInt(4294967295)&&(_=f.getBigUint64(u,!0),u+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(u,!0)),{fileNameLength:o,fileName:c,extraFieldLength:s,fileDataOffset:l,compressedSize:_,compressionMethod:d}};var PR=[{offset:0,size:4,default:new DataView(Ss.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var Qn=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let i of e)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(e){return await pr(e)}};function zc(t){t=`${t}`;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return null;let e="";for(let r=0;r<t.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=t.charCodeAt(r)>>2,n[1]=(t.charCodeAt(r)&3)<<4,t.length>r+1&&(n[1]|=t.charCodeAt(r+1)>>4,n[2]=(t.charCodeAt(r+1)&15)<<2),t.length>r+2&&(n[2]|=t.charCodeAt(r+2)>>6,n[3]=t.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?e+="=":e+=Hd(n[o])}return e}function Hd(t){if(t<26)return String.fromCharCode(t+"A".charCodeAt(0));if(t<52)return String.fromCharCode(t-26+"a".charCodeAt(0));if(t<62)return String.fromCharCode(t-52+"0".charCodeAt(0));if(t===62)return"+";if(t===63)return"/"}function Kc(t,e){switch(e){case"hex":return t;case"base64":return Vd(t);default:throw new Error(e)}}function Vd(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return zc(r)||""}var jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Hc=jd("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),Rs=typeof WebAssembly<"u"&&Hc?Hc.buffer:!1,Ut=eu(),Ts=240*16*16,Vc=Math.floor(Ts*16*1.066666667),Xd=268435456-65536,Wd="Parameter must be ArrayBuffer, ArrayBufferView or string",qd="Parameter exceeds max size of 255.9 Mbytes";Rs||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Ms(t){var e,r,n,o,s,i,a,f,c,l;let d=Qd(),_=Zd(),h={},u=new Date().getTime();return h.then=function(y){return a=y,p(),h},h.catch=function(y){return f=y,h},i=tu(t),i||S(new TypeError(Wd)),i&&(s=i.length,Rs&&s>Vc?s>Xd?S(new Error(qd)):(e=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(Rs,n).then(A)):p(d(i))),h;function A(y){p(_(i,y.instance.exports,r))}function p(y){var B=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(B)&&(a(B,l-u),a=f=null):Boolean(y)&&(c=y)}function S(y){typeof f=="function"&&f(y)}}function Zd(){var t,e,r,n,o,s,i,a,f,c,l,d,_,h=function(u){var A,p,S,y,B,T,R,D,I,L,x,m,g,E,U,P,k,N,Y,st,V,it,Ct=new Date().getTime(),Le=0,O=1732584193,w=-271733879,b=-1732584194,C=271733878,Z=0,or=u.length*8,cn;for(cn=jl(u,_),_[or>>>5]|=128<<or%32,_[(or+64>>>9<<4)+14]=or,cn=(or+64>>>9<<4)+15,V=_;Z<cn;)cn>Z+Vc?(n(O),s(w),a(b),c(C),e(Ts),Z=Z+Ts*16,O=r(),w=o(),b=i(),C=f(),Le++):(k=O,N=w,Y=b,st=C,A=V[Z+0]>>>0,p=V[Z+1]>>>0,S=V[Z+2]>>>0,y=V[Z+3]>>>0,B=V[Z+4]>>>0,T=V[Z+5]>>>0,R=V[Z+6]>>>0,D=V[Z+7]>>>0,I=V[Z+8]>>>0,L=V[Z+9]>>>0,x=V[Z+10]>>>0,m=V[Z+11]>>>0,g=V[Z+12]>>>0,E=V[Z+13]>>>0,U=V[Z+14]>>>0,P=V[Z+15]>>>0,O=F(7,25,O+(w&b|~w&C)+A-680876936)+w,C=F(12,20,C+(O&w|~O&b)+p-389564586)+O,b=F(17,15,b+(C&O|~C&w)+S+606105819)+C,w=F(22,10,w+(b&C|~b&O)+y-1044525330)+b,O=F(7,25,O+(w&b|~w&C)+B-176418897)+w,C=F(12,20,C+(O&w|~O&b)+T+1200080426)+O,b=F(17,15,b+(C&O|~C&w)+R-1473231341)+C,w=F(22,10,w+(b&C|~b&O)+D-45705983)+b,O=F(7,25,O+(w&b|~w&C)+I+1770035416)+w,C=F(12,20,C+(O&w|~O&b)+L-1958414417)+O,b=F(17,15,b+(C&O|~C&w)+x-42063)+C,w=F(22,10,w+(b&C|~b&O)+m-1990404162)+b,O=F(7,25,O+(w&b|~w&C)+g+1804603682)+w,C=F(12,20,C+(O&w|~O&b)+E-40341101)+O,b=F(17,15,b+(C&O|~C&w)+U-1502002290)+C,w=F(22,10,w+(b&C|~b&O)+P+1236535329)+b,O=F(5,27,O+(w&C|b&~C)+p-165796510)+w,C=F(9,23,C+(O&b|w&~b)+R-1069501632)+O,b=F(14,18,b+(C&w|O&~w)+m+643717713)+C,w=F(20,12,w+(b&O|C&~O)+A-373897302)+b,O=F(5,27,O+(w&C|b&~C)+T-701558691)+w,C=F(9,23,C+(O&b|w&~b)+x+38016083)+O,b=F(14,18,b+(C&w|O&~w)+P-660478335)+C,w=F(20,12,w+(b&O|C&~O)+B-405537848)+b,O=F(5,27,O+(w&C|b&~C)+L+568446438)+w,C=F(9,23,C+(O&b|w&~b)+U-1019803690)+O,b=F(14,18,b+(C&w|O&~w)+y-187363961)+C,w=F(20,12,w+(b&O|C&~O)+I+1163531501)+b,O=F(5,27,O+(w&C|b&~C)+E-1444681467)+w,C=F(9,23,C+(O&b|w&~b)+S-51403784)+O,b=F(14,18,b+(C&w|O&~w)+D+1735328473)+C,w=F(20,12,w+(b&O|C&~O)+g-1926607734)+b,O=F(4,28,O+(w^b^C)+T-378558)+w,C=F(11,21,C+(O^w^b)+I-2022574463)+O,b=F(16,16,b+(C^O^w)+m+1839030562)+C,w=F(23,9,w+(b^C^O)+U-35309556)+b,O=F(4,28,O+(w^b^C)+p-1530992060)+w,C=F(11,21,C+(O^w^b)+B+1272893353)+O,b=F(16,16,b+(C^O^w)+D-155497632)+C,w=F(23,9,w+(b^C^O)+x-1094730640)+b,O=F(4,28,O+(w^b^C)+E+681279174)+w,C=F(11,21,C+(O^w^b)+A-358537222)+O,b=F(16,16,b+(C^O^w)+y-722521979)+C,w=F(23,9,w+(b^C^O)+R+76029189)+b,O=F(4,28,O+(w^b^C)+L-640364487)+w,C=F(11,21,C+(O^w^b)+g-421815835)+O,b=F(16,16,b+(C^O^w)+P+530742520)+C,w=F(23,9,w+(b^C^O)+S-995338651)+b,O=F(6,26,O+(b^(w|~C))+A-198630844)+w,C=F(10,22,C+(w^(O|~b))+D+1126891415)+O,b=F(15,17,b+(O^(C|~w))+U-1416354905)+C,w=F(21,11,w+(C^(b|~O))+T-57434055)+b,O=F(6,26,O+(b^(w|~C))+g+1700485571)+w,C=F(10,22,C+(w^(O|~b))+y-1894986606)+O,b=F(15,17,b+(O^(C|~w))+x-1051523)+C,w=F(21,11,w+(C^(b|~O))+p-2054922799)+b,O=F(6,26,O+(b^(w|~C))+I+1873313359)+w,C=F(10,22,C+(w^(O|~b))+P-30611744)+O,b=F(15,17,b+(O^(C|~w))+R-1560198380)+C,w=F(21,11,w+(C^(b|~O))+E+1309151649)+b,O=F(6,26,O+(b^(w|~C))+B-145523070)+w,C=F(10,22,C+(w^(O|~b))+m-1120210379)+O,b=F(15,17,b+(O^(C|~w))+S+718787259)+C,w=F(21,11,w+(C^(b|~O))+L-343485551)+b,Z=Z+16,O=O+k>>>0,w=w+N>>>0,b=b+Y>>>0,C=C+st>>>0);return Ut.endian([O,w,b,C]);function F(at,fn,Bt){return Bt<<at|Bt>>>fn}function jl(at,fn){for(var Bt=-1,xo=Math.floor((at.length-1)/4),ht=0,ci,fi,li,hi;xo-8>Bt++;)ht=Bt<<2,fn[Bt]=at[ht+0]|at[ht+1]<<8|at[ht+2]<<16|at[ht+3]<<24;for(Bt--;xo>Bt++;)ht=Bt<<2,ci=typeof at[ht+0]>"u"?0:at[ht+0],fi=typeof at[ht+1]>"u"?0:at[ht+1],li=typeof at[ht+2]>"u"?0:at[ht+2],hi=typeof at[ht+3]>"u"?0:at[ht+3],fn[Bt]=ci|fi<<8|li<<16|hi<<24;return xo+1}};return function(u,A,p,S){var y;return e=A.loops,t=A.loop,r=A.getA,o=A.getB,i=A.getC,f=A.getD,l=A.getX,n=A.setA,s=A.setB,a=A.setC,c=A.setD,d=A.setX,_=p,y=Ut.wordsToBytes(h(u)),S&&S.asBytes?y:Ut.bytesconvertNumberToHex(y)}}function Qd(){var t=function(e,r){var n,o,s,i,a,f,c,l,d,_,h,u,A,p,S,y,B,T,R,D,I,L=new Date().getTime(),x=1732584193,m=-271733879,g=-1732584194,E=271733878,U=e.length*8;I=Ut.bytesToWords(e);for(var P=0;P<I.length;P++)I[P]=(I[P]<<8|I[P]>>>24)&16711935|(I[P]<<24|I[P]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var k=0;k<I.length;k+=16)B=x,T=m,R=g,D=E,n=I[k+0]>>>0,o=I[k+1]>>>0,s=I[k+2]>>>0,i=I[k+3]>>>0,a=I[k+4]>>>0,f=I[k+5]>>>0,c=I[k+6]>>>0,l=I[k+7]>>>0,d=I[k+8]>>>0,_=I[k+9]>>>0,h=I[k+10]>>>0,u=I[k+11]>>>0,A=I[k+12]>>>0,p=I[k+13]>>>0,S=I[k+14]>>>0,y=I[k+15]>>>0,x=N(7,25,x+(m&g|~m&E)+n-680876936)+m,E=N(12,20,E+(x&m|~x&g)+o-389564586)+x,g=N(17,15,g+(E&x|~E&m)+s+606105819)+E,m=N(22,10,m+(g&E|~g&x)+i-1044525330)+g,x=N(7,25,x+(m&g|~m&E)+a-176418897)+m,E=N(12,20,E+(x&m|~x&g)+f+1200080426)+x,g=N(17,15,g+(E&x|~E&m)+c-1473231341)+E,m=N(22,10,m+(g&E|~g&x)+l-45705983)+g,x=N(7,25,x+(m&g|~m&E)+d+1770035416)+m,E=N(12,20,E+(x&m|~x&g)+_-1958414417)+x,g=N(17,15,g+(E&x|~E&m)+h-42063)+E,m=N(22,10,m+(g&E|~g&x)+u-1990404162)+g,x=N(7,25,x+(m&g|~m&E)+A+1804603682)+m,E=N(12,20,E+(x&m|~x&g)+p-40341101)+x,g=N(17,15,g+(E&x|~E&m)+S-1502002290)+E,m=N(22,10,m+(g&E|~g&x)+y+1236535329)+g,x=N(5,27,x+(m&E|g&~E)+o-165796510)+m,E=N(9,23,E+(x&g|m&~g)+c-1069501632)+x,g=N(14,18,g+(E&m|x&~m)+u+643717713)+E,m=N(20,12,m+(g&x|E&~x)+n-373897302)+g,x=N(5,27,x+(m&E|g&~E)+f-701558691)+m,E=N(9,23,E+(x&g|m&~g)+h+38016083)+x,g=N(14,18,g+(E&m|x&~m)+y-660478335)+E,m=N(20,12,m+(g&x|E&~x)+a-405537848)+g,x=N(5,27,x+(m&E|g&~E)+_+568446438)+m,E=N(9,23,E+(x&g|m&~g)+S-1019803690)+x,g=N(14,18,g+(E&m|x&~m)+i-187363961)+E,m=N(20,12,m+(g&x|E&~x)+d+1163531501)+g,x=N(5,27,x+(m&E|g&~E)+p-1444681467)+m,E=N(9,23,E+(x&g|m&~g)+s-51403784)+x,g=N(14,18,g+(E&m|x&~m)+l+1735328473)+E,m=N(20,12,m+(g&x|E&~x)+A-1926607734)+g,x=N(4,28,x+(m^g^E)+f-378558)+m,E=N(11,21,E+(x^m^g)+d-2022574463)+x,g=N(16,16,g+(E^x^m)+u+1839030562)+E,m=N(23,9,m+(g^E^x)+S-35309556)+g,x=N(4,28,x+(m^g^E)+o-1530992060)+m,E=N(11,21,E+(x^m^g)+a+1272893353)+x,g=N(16,16,g+(E^x^m)+l-155497632)+E,m=N(23,9,m+(g^E^x)+h-1094730640)+g,x=N(4,28,x+(m^g^E)+p+681279174)+m,E=N(11,21,E+(x^m^g)+n-358537222)+x,g=N(16,16,g+(E^x^m)+i-722521979)+E,m=N(23,9,m+(g^E^x)+c+76029189)+g,x=N(4,28,x+(m^g^E)+_-640364487)+m,E=N(11,21,E+(x^m^g)+A-421815835)+x,g=N(16,16,g+(E^x^m)+y+530742520)+E,m=N(23,9,m+(g^E^x)+s-995338651)+g,x=N(6,26,x+(g^(m|~E))+n-198630844)+m,E=N(10,22,E+(m^(x|~g))+l+1126891415)+x,g=N(15,17,g+(x^(E|~m))+S-1416354905)+E,m=N(21,11,m+(E^(g|~x))+f-57434055)+g,x=N(6,26,x+(g^(m|~E))+A+1700485571)+m,E=N(10,22,E+(m^(x|~g))+i-1894986606)+x,g=N(15,17,g+(x^(E|~m))+h-1051523)+E,m=N(21,11,m+(E^(g|~x))+o-2054922799)+g,x=N(6,26,x+(g^(m|~E))+d+1873313359)+m,E=N(10,22,E+(m^(x|~g))+y-30611744)+x,g=N(15,17,g+(x^(E|~m))+c-1560198380)+E,m=N(21,11,m+(E^(g|~x))+p+1309151649)+g,x=N(6,26,x+(g^(m|~E))+a-145523070)+m,E=N(10,22,E+(m^(x|~g))+u-1120210379)+x,g=N(15,17,g+(x^(E|~m))+s+718787259)+E,m=N(21,11,m+(E^(g|~x))+_-343485551)+g,x=x+B>>>0,m=m+T>>>0,g=g+R>>>0,E=E+D>>>0;return Ut.endian([x,m,g,E]);function N(Y,st,V){return V<<Y|V>>>st}};return function(e,r){var n=Ut.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:Ut.bytesconvertNumberToHex(n);return o}}function jd(t){try{return Yd(t)}catch{return null}}function Yd(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");return typeof atob=="function"?Jd(atob(e)):$d(e)}function $d(t){for(var e=t.endsWith("==")?2:t.endsWith("=")?1:0,r=t.length*3/4-e,n=new Uint8Array(r),o=0,s=0,i,a,f,c;s<t.length;){if(i=jn.indexOf(t.charAt(s++)),a=jn.indexOf(t.charAt(s++)),f=jn.indexOf(t.charAt(s++)),c=jn.indexOf(t.charAt(s++)),i<0||a<0||f<0||c<0)throw new TypeError("Invalid base64 input");n[o++]=i<<2|a>>4,f<64&&o<r&&(n[o++]=(a&15)<<4|f>>2),c<64&&o<r&&(n[o++]=(f&3)<<6|c)}return n}function Jd(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;)r[n]=t.charCodeAt(n),n++;return r}function tu(t){return t instanceof Uint8Array?t:typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?new Uint8Array(t):t&&typeof t=="object"&&ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):typeof t=="string"?new TextEncoder().encode(t):null}function eu(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return Ut.rotl(e,8)&16711935|Ut.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=Ut.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,o=0;n<e.length;n++,o+=8)r[o>>>5]|=e[n]<<24-o%32;return r},wordsToBytes:function(e){for(var r=[],n=0;n<e.length*32;n+=8)r.push(e[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(e){for(var r=[],n=0;n<e.length;n++)r.push((e[n]>>>4).toString(16)),r.push((e[n]&15).toString(16));return r.join("")}}}var Re=class extends Qn{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((s,i)=>Ms(e).then(s).catch(i));return Kc(o,r)}};var Yn=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){dr(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}concatenate(e){return pr(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var De=Dt(Il(),1),te=Dt(vl(),1),Ie=class extends Yn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!gt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Ve(te.default.gzip)(e):await Ve(te.default.deflate)(e);return se(r)}return this.compressSync(e)}async decompress(e){if(!gt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Ve(te.default.gunzip)(e):await Ve(te.default.inflate)(e);return se(r)}return this.decompressSync(e)}compressSync(e){if(!gt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?te.default.gzipSync(e):te.default.deflateSync(e);return se(s)}let r=this.options?.deflate||{},n=new Uint8Array(e),o=this.options?.raw?De.default.deflateRaw:De.default.deflate;return se(o(n,r).buffer)}decompressSync(e){if(!gt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?te.default.gunzipSync(e):te.default.inflateSync(e);return se(s)}let r=this.options?.deflate||{},n=new Uint8Array(e),o=this.options?.raw?De.default.inflateRaw:De.default.inflate;return se(o(n,r).buffer)}async*compressBatches(e){let r=this.options?.deflate||{},n=new De.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new De.default.Inflate(r);yield*this.transformBatches(n,e)}async*transformBatches(e,r){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=e.push(n,!0);yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw new Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[e]}`}};var nn=class extends Ie{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}};var Zp={0:async t=>t,8:async t=>await new Ie({raw:!0}).decompress(t)},po=class{file=null;fileName;archive=null;constructor(e){if(typeof e=="string"){if(this.fileName=e,gt)throw new Error("ZipFileSystem cannot open file paths in browser environments");this.file=new xr(e)}else e instanceof Blob||e instanceof ArrayBuffer?this.file=new mr(e):e instanceof ve?(this.file=e.file,this.archive=e,this.fileName=e.fileName):this.file=e}async destroy(){this.file&&await this.file.close()}async readdir(){if(!this.file)throw new Error("No data detected in the zip archive");let e=[],r=We(this.file);for await(let n of r)e.push(n.fileName);return e}async stat(e){let r=await this.getCDFileHeader(e);return{...r,size:Number(r.uncompressedSize)}}async fetch(e){this.fileName&&e.indexOf(this.fileName)===0&&(e=e.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(e,"http");else{if(!this.file)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(e),s=await Se(o.localHeaderOffset,this.file);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=Zp[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await $(this.file,s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:e?`${this.fileName||""}/${e}`:this.fileName||""}),n}async getCDFileHeader(e){if(!this.file)throw new Error("No data detected in the zip archive");let r=We(this.file),n=null;for await(let o of r)if(o.fileName===e){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var ve=class{file;fileName;constructor(e,r,n){this.file=e,this.fileName=n}async getFileWithoutHash(e){return await(await new po(this.file).fetch(e)).arrayBuffer()}};function si(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),s=Qp(t,n,16);r[s]=o}return r}function Qp(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function ii(t){let e=We(t);return jp(e)}async function jp(t){let e=new Re,r=new TextEncoder,n={};for await(let o of t){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await e.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var Yp=[{test:/^$/,extensions:["3dSceneLayer.json.gz"]},{test:/nodepages\/\d+$/,extensions:[".json.gz"]},{test:/sublayers\/\d+$/,extensions:["/3dSceneLayer.json.gz"]},{test:/nodes\/(\d+|root)$/,extensions:["/3dNodeIndexDocument.json.gz"]},{test:/nodes\/\d+\/textures\/.+$/,extensions:[".jpg",".png",".bin.dds.gz",".ktx",".ktx2"]},{test:/nodes\/\d+\/geometries\/\d+$/,extensions:[".bin.gz",".draco.gz"]},{test:/nodes\/\d+\/attributes\/f_\d+\/\d+$/,extensions:[".bin.gz"]},{test:/statistics\/(f_\d+\/\d+|summary)$/,extensions:[".json.gz"]},{test:/nodes\/\d+\/shared$/,extensions:["/sharedResource.json.gz"]}],nr=class extends ve{hashTable;_textEncoder=new TextEncoder;_textDecoder=new TextDecoder;_md5Hash=new Re;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e,r="raw"){if(r==="http"){let n=Yp.find(o=>o.test.test(e))?.extensions;if(n){let o;for(let s of n)if(o=await this.getDataByPath(`${e}${s}`),o)break;if(o)return o}}if(r==="raw"){let n=await this.getDataByPath(`${e}.gz`);if(n)return n;let o=await this.getFileBytes(e);if(o)return o}throw new Error(`No such file in the archive: ${e}`)}async getDataByPath(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!!r)return/\.gz$/.test(e)?await new nn().decompress(r):r}async getFileBytes(e){let r;if(this.hashTable){let n=this._textEncoder.encode(e),o=await this._md5Hash.hash(n.buffer,"hex"),s=this.hashTable[o];if(s===void 0)return;let i=await Se(s,this.file);if(!i)return;r=await $(this.file,i.fileDataOffset,i.fileDataOffset+i.compressedSize)}else try{r=await this.getFileWithoutHash(e)}catch{r=void 0}return r}};async function mo(t,e,r){let n=await Ur(t,Gr),o=await kr(n,t),s;if(o?.fileName!=="@specialIndexFileHASH128@")s=await ii(t),e?.("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");else{let i=await Se(o.localHeaderOffset,t);if(!i)throw new Error("corrupted SLPK");let a=i.fileDataOffset,f=await $(t,a,a+i.compressedSize);s=si(f)}return new nr(t,s,r)}var $p="4.4.0-alpha.9",Ll={dataType:null,batchType:null,name:"I3S SLPK (Scene Layer Package)",id:"slpk",module:"i3s",version:$p,mimeTypes:["application/octet-stream"],extensions:["slpk"],options:{slpk:{path:"",pathMode:void 0}},parse:async(t,e={})=>(await mo(new ge(new DataView(t)))).getFile(e.slpk?.path??"",e.slpk?.pathMode)};var Ul=Dt(Vt(),1);function Fl(t,e){let{attributeName:r,attributeType:n}=e;return r?{[r]:n?Jp(n,t):null}:{}}function Jp(t,e){switch(t){case ua:return rm(e);case pa:return Nl(e);case ma:return em(e);case Aa:return tm(e);default:return Nl(e)}}function Nl(t){return new Uint32Array(t,4)}function tm(t){return new Int16Array(t,4)}function em(t){return new Float64Array(t,8)}function rm(t){let o=[];try{let s=new DataView(t,0,4).getUint32(0,!0),i=new Uint32Array(t,8,s),a=8+s*4;for(let f of i){let c=new TextDecoder("utf-8"),l=new Uint8Array(t,a,f);o.push(c.decode(l)),a+=f}}catch(s){console.error("Parse string attribute error: ",s.message)}return o}var nm="4.4.0-alpha.9",Pl="",om="rejected",on={dataType:null,batchType:null,name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:nm,mimeTypes:["application/binary"],parse:async(t,e)=>Fl(t,e),extensions:["bin"],options:{},binary:!0};async function kl(t,e,r={}){let{attributeStorageInfo:n,attributeUrls:o,tilesetFields:s}=sm(t);if(!n||!o||e<0)return null;let i=[],a=[];for(let f=0;f<n.length;f++){let c=Pt(o[f],r.i3s?.token),l=n[f].name,d=ai(n[f]),_={...r,attributeName:l,attributeType:d},h=(0,Ul.load)(c,on,_);a.push(h)}try{i=await Promise.allSettled(a)}catch{}return i.length?am(i,n,e,s):null}function sm(t){let e=t.tileset?.tileset?.attributeStorageInfo,r=t.header?.attributeUrls,n=t.tileset?.tileset?.fields||[];return{attributeStorageInfo:e,attributeUrls:r,tilesetFields:n}}function ai(t){return t.hasOwnProperty("objectIds")?"Oid32":t.hasOwnProperty("attributeValues")?t.attributeValues.valueType:""}function im(t){return t.find(r=>r.name.includes("OBJECTID"))?.name}function am(t,e,r,n){let o=im(e),s=t.find(a=>a.value[o]);if(!s)return null;let i=s.value[o].indexOf(r);return i<0?null:cm(t,i,e,n)}function cm(t,e,r,n){let o={};for(let s=0;s<r.length;s++){let i=r[s].name,a=fm(i,n),f=lm(t,s,i);o[i]=hm(f,e,a)}return o}function fm(t,e){return e.find(n=>n.name===t||n.alias===t)?.domain?.codedValues||[]}function lm(t,e,r){let n=t[e];return n.status===om?null:n.value[r]}function hm(t,e,r){let n=Pl;return t&&e in t&&(n=String(t[e]).replace(/\u0000|NaN/g,"").trim()),r.length&&(n=r.find(s=>s.code===Number(n))?.name||Pl),n}var _m="3DObject";async function Gl(t,e){let r=JSON.parse(new TextDecoder().decode(t)),{sublayers:n}=r;return{header:r,sublayers:zl(n,e)}}function zl(t,e){let r=[];for(let n=0;n<t.length;n++){let o=t[n],{id:s,layerType:i,visibility:a=!0,...f}=o;if(i===_m){let c=`${e}/sublayers/${s}`;r.push({url:c,id:s,layerType:i,visibility:a,...f})}o?.sublayers?.length&&(r=[...r,...zl(o.sublayers,e)])}return r}var dm="4.4.0-alpha.9",Kl={dataType:null,batchType:null,name:"I3S Building Scene Layer",id:"i3s-building-scene-layer",module:"i3s",version:dm,mimeTypes:["application/json"],parse:um,extensions:["json"],options:{}};async function um(t,e,r){if(!r?.url)throw new Error("Url is not provided");return Gl(t,r.url)}var Ao=Dt(Vt(),1),pm=4326,mm="ArcGISSceneServiceLayer",Am="BuildingSceneLayer",xm="IntegratedMeshLayer",Hl="GroupLayer",gm=[mm,xm,Am,Hl],Em="NO_AVAILABLE_SUPPORTED_LAYERS_ERROR",Sm="NOT_SUPPORTED_CRS_ERROR",sn=class extends Error{details;constructor(e,r){super(e),this.details=r,this.name="LayerError"}};async function Vl(t){let e=JSON.parse(new TextDecoder().decode(t)),{operationalLayers:r}=e,{layers:n,unsupportedLayers:o}=await Xl(r,!0);if(!n.length)throw new sn(Em,o);return{header:e,layers:n,unsupportedLayers:o}}async function Xl(t,e){let r=[],n=[];for(let o=0;o<t.length;o++){let s=t[o];if(gm.includes(s.layerType)?(e&&s.layerType!==Hl&&(await Rm(s),e=!1),r.push(s)):n.push(s),s.layers?.length){let{layers:a,unsupportedLayers:f}=await Xl(s.layers,e);s.layers=a,n=[...n,...f]}}return{layers:r,unsupportedLayers:n}}async function Rm(t){try{if((await(0,Ao.load)(t.url,Ao.JSONLoader))?.spatialReference?.wkid!==pm)throw new Error(Sm)}catch(e){throw e}}var Tm="4.4.0-alpha.9",Wl={dataType:null,batchType:null,name:"ArcGIS Web Scene Loader",id:"arcgis-web-scene",module:"i3s",version:Tm,mimeTypes:["application/json"],parse:Mm,extensions:["json"],options:{}};async function Mm(t){return Vl(t)}var Zl=Dt(Vt(),1);async function Ql(t,e,r,n,o,s,i){if(!s)return t;let a={...t,value:new Uint8Array(t.value)},f=n.find(({name:h})=>h===s?.attributeName);if(!f||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(f.type))return t;let c=await ql(f.name,r,o,i);if(!c)return t;let l=n.find(({type:h})=>h==="esriFieldTypeOID");if(!l)return t;let d=await ql(l.name,r,o,i);if(!d)return t;let _={};for(let h=0;h<d[l.name].length;h++)_[d[l.name][h]]=ym(c[f.name][h],s);for(let h=0;h<e.length;h++){let u=_[e[h]];u&&(s.mode==="multiply"?u.forEach((A,p)=>{a.value[h*4+p]=a.value[h*4+p]*A/255}):a.value.set(u,h*4))}return a}function ym(t,e){if(!e)return[255,255,255,255];let{minValue:r,maxValue:n,minColor:o,maxColor:s}=e,i=(t-r)/(n-r),a=[255,255,255,255];for(let f=0;f<o.length;f++)a[f]=Math.round((s[f]-o[f])*i+o[f]);return a}async function ql(t,e,r,n){let o=r.findIndex(({name:f})=>t===f);if(o===-1)return null;let s=Pt(e[o],n),i=ai(r[o]);return await(0,Zl.load)(s,on,{i3s:{attributeName:t,attributeType:i}})}return r0(an);})();
|
|
8
8
|
return __exports__;
|
|
9
9
|
});
|