@loaders.gl/i3s 4.3.0-alpha.2 → 4.3.0-alpha.3

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/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 Jl=Object.create;var rn=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var t0=Object.getOwnPropertyNames;var e0=Object.getPrototypeOf,r0=Object.prototype.hasOwnProperty;var tt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nn=(t,e)=>{for(var r in e)rn(t,r,{get:e[r],enumerable:!0})},en=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of t0(e))!r0.call(t,i)&&i!==r&&rn(t,i,{get:()=>e[i],enumerable:!(n=$l(e,i))||n.enumerable});return t},on=(t,e,r)=>(en(t,e,"default"),r&&en(r,e,"default")),Ct=(t,e,r)=>(r=t!=null?Jl(e0(t)):{},en(e||!t||!t.__esModule?rn(r,"default",{value:t,enumerable:!0}):r,t)),n0=t=>en(rn({},"__esModule",{value:!0}),t);var Ht=tt((T_,ds)=>{ds.exports=globalThis.loaders});var Wt=tt(at=>{"use strict";var tp=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function ep(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)ep(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 rp={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),i);return}for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){var e,r,n,i,o,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,i),i+=o.length;return s}},np={arraySet:function(t,e,r,n,i){for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};at.setTyped=function(t){t?(at.Buf8=Uint8Array,at.Buf16=Uint16Array,at.Buf32=Int32Array,at.assign(at,rp)):(at.Buf8=Array,at.Buf16=Array,at.Buf32=Array,at.assign(at,np))};at.setTyped(tp)});var pf=tt(Ze=>{"use strict";var ip=Wt(),op=4,qc=0,Wc=1,sp=2;function We(t){for(var e=t.length;--e>=0;)t[e]=0}var ap=0,Jc=1,cp=2,fp=3,lp=258,Do=29,Fr=256,Pr=Fr+1+Do,qe=30,Oo=19,$c=2*Pr+1,ge=15,Mo=16,hp=7,Bo=256,tf=16,ef=17,rf=18,vo=[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],qn=[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],dp=[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],up=512,Zt=new Array((Pr+2)*2);We(Zt);var Br=new Array(qe*2);We(Br);var Lr=new Array(up);We(Lr);var Nr=new Array(lp-fp+1);We(Nr);var Po=new Array(Do);We(Po);var Wn=new Array(qe);We(Wn);function To(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var of,sf,af;function Ro(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function cf(t){return t<256?Lr[t]:Lr[256+(t>>>7)]}function kr(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>Mo-r?(t.bi_buf|=e<<t.bi_valid&65535,kr(t,t.bi_buf),t.bi_buf=e>>Mo-t.bi_valid,t.bi_valid+=r-Mo):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function kt(t,e,r){ht(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 pp(t){t.bi_valid===16?(kr(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 mp(t,e){var r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,u,d,h,m,x=0;for(d=0;d<=ge;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<$c;c++)l=t.heap[c],d=r[r[l*2+1]*2+1]+1,d>f&&(d=f,x++),r[l*2+1]=d,!(l>n)&&(t.bl_count[d]++,h=0,l>=a&&(h=s[l-a]),m=r[l*2],t.opt_len+=m*(d+h),o&&(t.static_len+=m*(i[l*2+1]+h)));if(x!==0){do{for(d=f-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[f]--,x-=2}while(x>0);for(d=f;d!==0;d--)for(l=t.bl_count[d];l!==0;)u=t.heap[--c],!(u>n)&&(r[u*2+1]!==d&&(t.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),l--)}}function lf(t,e,r){var n=new Array(ge+1),i=0,o,s;for(o=1;o<=ge;o++)n[o]=i=i+r[o-1]<<1;for(s=0;s<=e;s++){var a=t[s*2+1];a!==0&&(t[s*2]=ff(n[a]++,a))}}function _p(){var t,e,r,n,i,o=new Array(ge+1);for(r=0,n=0;n<Do-1;n++)for(Po[n]=r,t=0;t<1<<vo[n];t++)Nr[r++]=n;for(Nr[r-1]=n,i=0,n=0;n<16;n++)for(Wn[n]=i,t=0;t<1<<qn[n];t++)Lr[i++]=n;for(i>>=7;n<qe;n++)for(Wn[n]=i<<7,t=0;t<1<<qn[n]-7;t++)Lr[256+i++]=n;for(e=0;e<=ge;e++)o[e]=0;for(t=0;t<=143;)Zt[t*2+1]=8,t++,o[8]++;for(;t<=255;)Zt[t*2+1]=9,t++,o[9]++;for(;t<=279;)Zt[t*2+1]=7,t++,o[7]++;for(;t<=287;)Zt[t*2+1]=8,t++,o[8]++;for(lf(Zt,Pr+1,o),t=0;t<qe;t++)Br[t*2+1]=5,Br[t*2]=ff(t,5);of=new To(Zt,vo,Fr+1,Pr,ge),sf=new To(Br,qn,0,qe,ge),af=new To(new Array(0),dp,0,Oo,hp)}function hf(t){var e;for(e=0;e<Pr;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qe;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Oo;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Bo*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function df(t){t.bi_valid>8?kr(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 xp(t,e,r,n){df(t),n&&(kr(t,r),kr(t,~r)),ip.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function Zc(t,e,r,n){var i=e*2,o=r*2;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]}function Co(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&Zc(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Zc(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function Qc(t,e,r){var n,i,o=0,s,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+o*2]<<8|t.pending_buf[t.d_buf+o*2+1],i=t.pending_buf[t.l_buf+o],o++,n===0?kt(t,i,e):(s=Nr[i],kt(t,s+Fr+1,e),a=vo[s],a!==0&&(i-=Po[s],ht(t,i,a)),n--,s=cf(n),kt(t,s,r),a=qn[s],a!==0&&(n-=Wn[s],ht(t,n,a)));while(o<t.last_lit);kt(t,Bo,e)}function Io(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems,s,a,f=-1,c;for(t.heap_len=0,t.heap_max=$c,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*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--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)Co(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Co(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[c*2]=r[s*2]+r[a*2],t.depth[c]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[s*2+1]=r[a*2+1]=c,t.heap[1]=c++,Co(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],mp(t,e),lf(r,f,t.bl_count)}function Kc(t,e,r){var n,i=-1,o,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)o=s,s=e[(n+1)*2+1],!(++a<f&&o===s)&&(a<c?t.bl_tree[o*2]+=a:o!==0?(o!==i&&t.bl_tree[o*2]++,t.bl_tree[tf*2]++):a<=10?t.bl_tree[ef*2]++:t.bl_tree[rf*2]++,a=0,i=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4))}function jc(t,e,r){var n,i=-1,o,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),n=0;n<=r;n++)if(o=s,s=e[(n+1)*2+1],!(++a<f&&o===s)){if(a<c)do kt(t,o,t.bl_tree);while(--a!==0);else o!==0?(o!==i&&(kt(t,o,t.bl_tree),a--),kt(t,tf,t.bl_tree),ht(t,a-3,2)):a<=10?(kt(t,ef,t.bl_tree),ht(t,a-3,3)):(kt(t,rf,t.bl_tree),ht(t,a-11,7));a=0,i=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4)}}function gp(t){var e;for(Kc(t,t.dyn_ltree,t.l_desc.max_code),Kc(t,t.dyn_dtree,t.d_desc.max_code),Io(t,t.bl_desc),e=Oo-1;e>=3&&t.bl_tree[nf[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function Ap(t,e,r,n){var i;for(ht(t,e-257,5),ht(t,r-1,5),ht(t,n-4,4),i=0;i<n;i++)ht(t,t.bl_tree[nf[i]*2+1],3);jc(t,t.dyn_ltree,e-1),jc(t,t.dyn_dtree,r-1)}function Ep(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return qc;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<Fr;r++)if(t.dyn_ltree[r*2]!==0)return Wc;return qc}var Yc=!1;function Sp(t){Yc||(_p(),Yc=!0),t.l_desc=new Ro(t.dyn_ltree,of),t.d_desc=new Ro(t.dyn_dtree,sf),t.bl_desc=new Ro(t.bl_tree,af),t.bi_buf=0,t.bi_valid=0,hf(t)}function uf(t,e,r,n){ht(t,(ap<<1)+(n?1:0),3),xp(t,e,r,!0)}function yp(t){ht(t,Jc<<1,3),kt(t,Bo,Zt),pp(t)}function wp(t,e,r,n){var i,o,s=0;t.level>0?(t.strm.data_type===sp&&(t.strm.data_type=Ep(t)),Io(t,t.l_desc),Io(t,t.d_desc),s=gp(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&e!==-1?uf(t,e,r,n):t.strategy===op||o===i?(ht(t,(Jc<<1)+(n?1:0),3),Qc(t,Zt,Br)):(ht(t,(cp<<1)+(n?1:0),3),Ap(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Qc(t,t.dyn_ltree,t.dyn_dtree)),hf(t),n&&df(t)}function bp(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[(Nr[r]+Fr+1)*2]++,t.dyn_dtree[cf(e)*2]++),t.last_lit===t.lit_bufsize-1}Ze._tr_init=Sp;Ze._tr_stored_block=uf;Ze._tr_flush_block=wp;Ze._tr_tally=bp;Ze._tr_align=yp});var Lo=tt((lw,mf)=>{"use strict";function Mp(t,e,r,n){for(var i=t&65535|0,o=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do i=i+e[n++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}mf.exports=Mp});var No=tt((hw,_f)=>{"use strict";function Tp(){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 Rp=Tp();function Cp(t,e,r,n){var i=Rp,o=n+r;t^=-1;for(var s=n;s<o;s++)t=t>>>8^i[(t^e[s])&255];return t^-1}_f.exports=Cp});var Zn=tt((dw,xf)=>{"use strict";xf.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 Tf=tt(zt=>{"use strict";var ct=Wt(),St=pf(),Sf=Lo(),oe=No(),vp=Zn(),ye=0,Ip=1,Dp=3,le=4,gf=5,Ut=0,Af=1,yt=-2,Op=-3,ko=-5,Bp=-1,Pp=1,Qn=2,Lp=3,Np=4,kp=0,Fp=2,Jn=8,Up=9,zp=15,Gp=8,Hp=29,Xp=256,Uo=Xp+1+Hp,Vp=30,qp=19,Wp=2*Uo+1,Zp=15,z=3,ce=258,Mt=ce+z+1,Qp=32,$n=42,zo=69,Kn=73,jn=91,Yn=103,Ae=113,zr=666,$=1,Gr=2,Ee=3,je=4,Kp=3;function fe(t,e){return t.msg=vp[e],e}function Ef(t){return(t<<1)-(t>4?9:0)}function ae(t){for(var e=t.length;--e>=0;)t[e]=0}function se(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 nt(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,se(t.strm)}function X(t,e){t.pending_buf[t.pending++]=e}function Ur(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function jp(t,e,r,n){var i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,ct.arraySet(e,t.input,t.next_in,i,r),t.state.wrap===1?t.adler=Sf(t.adler,e,i,r):t.state.wrap===2&&(t.adler=oe(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)}function yf(t,e){var r=t.max_chain_length,n=t.strstart,i,o,s=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-Mt?t.strstart-(t.w_size-Mt):0,c=t.window,l=t.w_mask,u=t.prev,d=t.strstart+ce,h=c[n+s-1],m=c[n+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(c[i+s]!==m||c[i+s-1]!==h||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<d);if(o=ce-(d-n),n=d-ce,o>s){if(t.match_start=e,s=o,o>=a)break;h=c[n+s-1],m=c[n+s]}}while((e=u[e&l])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}function Se(t){var e=t.w_size,r,n,i,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Mt)){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 i=t.head[--r],t.head[r]=i>=e?i-e:0;while(--n);n=e,r=n;do i=t.prev[--r],t.prev[r]=i>=e?i-e:0;while(--n);o+=e}if(t.strm.avail_in===0)break;if(n=jp(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=n,t.lookahead+t.insert>=z)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+z-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<z)););}while(t.lookahead<Mt&&t.strm.avail_in!==0)}function Yp(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Se(t),t.lookahead===0&&e===ye)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,nt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Mt&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):(t.strstart>t.block_start&&(nt(t,!1),t.strm.avail_out===0),$)}function Fo(t,e){for(var r,n;;){if(t.lookahead<Mt){if(Se(t),t.lookahead<Mt&&e===ye)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=z&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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-Mt&&(t.match_length=yf(t,r)),t.match_length>=z)if(n=St._tr_tally(t,t.strstart-t.match_start,t.match_length-z),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=z){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=t.strstart<z-1?t.strstart:z-1,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function Qe(t,e){for(var r,n,i;;){if(t.lookahead<Mt){if(Se(t),t.lookahead<Mt&&e===ye)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=z&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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=z-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Mt&&(t.match_length=yf(t,r),t.match_length<=5&&(t.strategy===Pp||t.match_length===z&&t.strstart-t.match_start>4096)&&(t.match_length=z-1)),t.prev_length>=z&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-z,n=St._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-z),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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=z-1,t.strstart++,n&&(nt(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&&nt(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<z-1?t.strstart:z-1,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function Jp(t,e){for(var r,n,i,o,s=t.window;;){if(t.lookahead<=ce){if(Se(t),t.lookahead<=ce&&e===ye)return $;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=z&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=t.strstart+ce;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);t.match_length=ce-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=z?(r=St._tr_tally(t,1,t.match_length-z),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&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function $p(t,e){for(var r;;){if(t.lookahead===0&&(Se(t),t.lookahead===0)){if(e===ye)return $;break}if(t.match_length=0,r=St._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function Ft(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var Ke;Ke=[new Ft(0,0,0,0,Yp),new Ft(4,4,8,4,Fo),new Ft(4,5,16,8,Fo),new Ft(4,6,32,32,Fo),new Ft(4,4,16,16,Qe),new Ft(8,16,32,32,Qe),new Ft(8,16,128,128,Qe),new Ft(8,32,128,256,Qe),new Ft(32,128,258,1024,Qe),new Ft(32,258,258,4096,Qe)];function tm(t){t.window_size=2*t.w_size,ae(t.head),t.max_lazy_match=Ke[t.level].max_lazy,t.good_match=Ke[t.level].good_length,t.nice_match=Ke[t.level].nice_length,t.max_chain_length=Ke[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=z-1,t.match_available=0,t.ins_h=0}function em(){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=Jn,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(Wp*2),this.dyn_dtree=new ct.Buf16((2*Vp+1)*2),this.bl_tree=new ct.Buf16((2*qp+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(Zp+1),this.heap=new ct.Buf16(2*Uo+1),ae(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ct.Buf16(2*Uo+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 wf(t){var e;return!t||!t.state?fe(t,yt):(t.total_in=t.total_out=0,t.data_type=Fp,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?$n:Ae,t.adler=e.wrap===2?0:1,e.last_flush=ye,St._tr_init(e),Ut)}function bf(t){var e=wf(t);return e===Ut&&tm(t.state),e}function rm(t,e){return!t||!t.state||t.state.wrap!==2?yt:(t.state.gzhead=e,Ut)}function Mf(t,e,r,n,i,o){if(!t)return yt;var s=1;if(e===Bp&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>Up||r!==Jn||n<8||n>15||e<0||e>9||o<0||o>Np)return fe(t,yt);n===8&&(n=9);var a=new em;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+z-1)/z),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<<i+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=o,a.method=r,bf(t)}function nm(t,e){return Mf(t,e,Jn,zp,Gp,kp)}function im(t,e){var r,n,i,o;if(!t||!t.state||e>gf||e<0)return t?fe(t,yt):yt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===zr&&e!==le)return fe(t,t.avail_out===0?ko:yt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===$n)if(n.wrap===2)t.adler=0,X(n,31),X(n,139),X(n,8),n.gzhead?(X(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)),X(n,n.gzhead.time&255),X(n,n.gzhead.time>>8&255),X(n,n.gzhead.time>>16&255),X(n,n.gzhead.time>>24&255),X(n,n.level===9?2:n.strategy>=Qn||n.level<2?4:0),X(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(X(n,n.gzhead.extra.length&255),X(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=oe(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=zo):(X(n,0),X(n,0),X(n,0),X(n,0),X(n,0),X(n,n.level===9?2:n.strategy>=Qn||n.level<2?4:0),X(n,Kp),n.status=Ae);else{var s=Jn+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Qn||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,s|=a<<6,n.strstart!==0&&(s|=Qp),s+=31-s%31,n.status=Ae,Ur(n,s),n.strstart!==0&&(Ur(n,t.adler>>>16),Ur(n,t.adler&65535)),t.adler=1}if(n.status===zo)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),se(t),i=n.pending,n.pending===n.pending_buf_size));)X(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Kn)}else n.status=Kn;if(n.status===Kn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),se(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,X(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=jn)}else n.status=jn;if(n.status===jn)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),se(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,X(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=Yn)}else n.status=Yn;if(n.status===Yn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&se(t),n.pending+2<=n.pending_buf_size&&(X(n,t.adler&255),X(n,t.adler>>8&255),t.adler=0,n.status=Ae)):n.status=Ae),n.pending!==0){if(se(t),t.avail_out===0)return n.last_flush=-1,Ut}else if(t.avail_in===0&&Ef(e)<=Ef(r)&&e!==le)return fe(t,ko);if(n.status===zr&&t.avail_in!==0)return fe(t,ko);if(t.avail_in!==0||n.lookahead!==0||e!==ye&&n.status!==zr){var f=n.strategy===Qn?$p(n,e):n.strategy===Lp?Jp(n,e):Ke[n.level].func(n,e);if((f===Ee||f===je)&&(n.status=zr),f===$||f===Ee)return t.avail_out===0&&(n.last_flush=-1),Ut;if(f===Gr&&(e===Ip?St._tr_align(n):e!==gf&&(St._tr_stored_block(n,0,0,!1),e===Dp&&(ae(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),se(t),t.avail_out===0))return n.last_flush=-1,Ut}return e!==le?Ut:n.wrap<=0?Af:(n.wrap===2?(X(n,t.adler&255),X(n,t.adler>>8&255),X(n,t.adler>>16&255),X(n,t.adler>>24&255),X(n,t.total_in&255),X(n,t.total_in>>8&255),X(n,t.total_in>>16&255),X(n,t.total_in>>24&255)):(Ur(n,t.adler>>>16),Ur(n,t.adler&65535)),se(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ut:Af)}function om(t){var e;return!t||!t.state?yt:(e=t.state.status,e!==$n&&e!==zo&&e!==Kn&&e!==jn&&e!==Yn&&e!==Ae&&e!==zr?fe(t,yt):(t.state=null,e===Ae?fe(t,Op):Ut))}function sm(t,e){var r=e.length,n,i,o,s,a,f,c,l;if(!t||!t.state||(n=t.state,s=n.wrap,s===2||s===1&&n.status!==$n||n.lookahead))return yt;for(s===1&&(t.adler=Sf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(s===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,Se(n);n.lookahead>=z;){i=n.strstart,o=n.lookahead-(z-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+z-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=z-1,Se(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=z-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=s,Ut}zt.deflateInit=nm;zt.deflateInit2=Mf;zt.deflateReset=bf;zt.deflateResetKeep=wf;zt.deflateSetHeader=rm;zt.deflate=im;zt.deflateEnd=om;zt.deflateSetDictionary=sm;zt.deflateInfo="pako deflate (from Nodeca project)"});var Go=tt(Ye=>{"use strict";var ti=Wt(),Rf=!0,Cf=!0;try{String.fromCharCode.apply(null,[0])}catch{Rf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Cf=!1}var Hr=new ti.Buf8(256);for(Qt=0;Qt<256;Qt++)Hr[Qt]=Qt>=252?6:Qt>=248?5:Qt>=240?4:Qt>=224?3:Qt>=192?2:1;var Qt;Hr[254]=Hr[254]=1;Ye.string2buf=function(t){var e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<s&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new ti.Buf8(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<s&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e};function vf(t,e){if(e<65534&&(t.subarray&&Cf||!t.subarray&&Rf))return String.fromCharCode.apply(null,ti.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}Ye.buf2binstring=function(t){return vf(t,t.length)};Ye.binstring2buf=function(t){for(var e=new ti.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};Ye.buf2string=function(t,e){var r,n,i,o,s=e||t.length,a=new Array(s*2);for(n=0,r=0;r<s;){if(i=t[r++],i<128){a[n++]=i;continue}if(o=Hr[i],o>4){a[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<s;)i=i<<6|t[r++]&63,o--;if(o>1){a[n++]=65533;continue}i<65536?a[n++]=i:(i-=65536,a[n++]=55296|i>>10&1023,a[n++]=56320|i&1023)}return vf(a,n)};Ye.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 Ho=tt((mw,If)=>{"use strict";function am(){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}If.exports=am});var Pf=tt(qr=>{"use strict";var Xr=Tf(),Vr=Wt(),Vo=Go(),qo=Zn(),cm=Ho(),Bf=Object.prototype.toString,fm=0,Xo=4,Je=0,Df=1,Of=2,lm=-1,hm=0,dm=8;function we(t){if(!(this instanceof we))return new we(t);this.options=Vr.assign({level:lm,method:dm,chunkSize:16384,windowBits:15,memLevel:8,strategy:hm,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 cm,this.strm.avail_out=0;var r=Xr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Je)throw new Error(qo[r]);if(e.header&&Xr.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=Vo.string2buf(e.dictionary):Bf.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Xr.deflateSetDictionary(this.strm,n),r!==Je)throw new Error(qo[r]);this._dict_set=!0}}we.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=e===~~e?e:e===!0?Xo:fm,typeof t=="string"?r.input=Vo.string2buf(t):Bf.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 Vr.Buf8(n),r.next_out=0,r.avail_out=n),i=Xr.deflate(r,o),i!==Df&&i!==Je)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Xo||o===Of))&&(this.options.to==="string"?this.onData(Vo.buf2binstring(Vr.shrinkBuf(r.output,r.next_out))):this.onData(Vr.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==Df);return o===Xo?(i=Xr.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Je):(o===Of&&(this.onEnd(Je),r.avail_out=0),!0)};we.prototype.onData=function(t){this.chunks.push(t)};we.prototype.onEnd=function(t){t===Je&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Vr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Wo(t,e){var r=new we(e);if(r.push(t,!0),r.err)throw r.msg||qo[r.err];return r.result}function um(t,e){return e=e||{},e.raw=!0,Wo(t,e)}function pm(t,e){return e=e||{},e.gzip=!0,Wo(t,e)}qr.Deflate=we;qr.deflate=Wo;qr.deflateRaw=um;qr.gzip=pm});var Nf=tt((xw,Lf)=>{"use strict";var ei=30,mm=12;Lf.exports=function(e,r){var n,i,o,s,a,f,c,l,u,d,h,m,x,p,S,b,D,M,y,I,O,P,g,_,A;n=e.state,i=e.next_in,_=e.input,o=i+(e.avail_in-5),s=e.next_out,A=e.output,a=s-(r-e.avail_out),f=s+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,h=n.window,m=n.hold,x=n.bits,p=n.lencode,S=n.distcode,b=(1<<n.lenbits)-1,D=(1<<n.distbits)-1;t:do{x<15&&(m+=_[i++]<<x,x+=8,m+=_[i++]<<x,x+=8),M=p[m&b];e:for(;;){if(y=M>>>24,m>>>=y,x-=y,y=M>>>16&255,y===0)A[s++]=M&65535;else if(y&16){I=M&65535,y&=15,y&&(x<y&&(m+=_[i++]<<x,x+=8),I+=m&(1<<y)-1,m>>>=y,x-=y),x<15&&(m+=_[i++]<<x,x+=8,m+=_[i++]<<x,x+=8),M=S[m&D];r:for(;;){if(y=M>>>24,m>>>=y,x-=y,y=M>>>16&255,y&16){if(O=M&65535,y&=15,x<y&&(m+=_[i++]<<x,x+=8,x<y&&(m+=_[i++]<<x,x+=8)),O+=m&(1<<y)-1,O>c){e.msg="invalid distance too far back",n.mode=ei;break t}if(m>>>=y,x-=y,y=s-a,O>y){if(y=O-y,y>u&&n.sane){e.msg="invalid distance too far back",n.mode=ei;break t}if(P=0,g=h,d===0){if(P+=l-y,y<I){I-=y;do A[s++]=h[P++];while(--y);P=s-O,g=A}}else if(d<y){if(P+=l+d-y,y-=d,y<I){I-=y;do A[s++]=h[P++];while(--y);if(P=0,d<I){y=d,I-=y;do A[s++]=h[P++];while(--y);P=s-O,g=A}}}else if(P+=d-y,y<I){I-=y;do A[s++]=h[P++];while(--y);P=s-O,g=A}for(;I>2;)A[s++]=g[P++],A[s++]=g[P++],A[s++]=g[P++],I-=3;I&&(A[s++]=g[P++],I>1&&(A[s++]=g[P++]))}else{P=s-O;do A[s++]=A[P++],A[s++]=A[P++],A[s++]=A[P++],I-=3;while(I>2);I&&(A[s++]=A[P++],I>1&&(A[s++]=A[P++]))}}else if(y&64){e.msg="invalid distance code",n.mode=ei;break t}else{M=S[(M&65535)+(m&(1<<y)-1)];continue r}break}}else if(y&64)if(y&32){n.mode=mm;break t}else{e.msg="invalid literal/length code",n.mode=ei;break t}else{M=p[(M&65535)+(m&(1<<y)-1)];continue e}break}}while(i<o&&s<f);I=x>>3,i-=I,x-=I<<3,m&=(1<<x)-1,e.next_in=i,e.next_out=s,e.avail_in=i<o?5+(o-i):5-(i-o),e.avail_out=s<f?257+(f-s):257-(s-f),n.hold=m,n.bits=x}});var Xf=tt((gw,Hf)=>{"use strict";var kf=Wt(),$e=15,Ff=852,Uf=592,zf=0,Zo=1,Gf=2,_m=[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],xm=[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],gm=[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],Am=[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];Hf.exports=function(e,r,n,i,o,s,a,f){var c=f.bits,l=0,u=0,d=0,h=0,m=0,x=0,p=0,S=0,b=0,D=0,M,y,I,O,P,g=null,_=0,A,E=new kf.Buf16($e+1),F=new kf.Buf16($e+1),k=null,U=0,L,G,it;for(l=0;l<=$e;l++)E[l]=0;for(u=0;u<i;u++)E[r[n+u]]++;for(m=c,h=$e;h>=1&&E[h]===0;h--);if(m>h&&(m=h),h===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,f.bits=1,0;for(d=1;d<h&&E[d]===0;d++);for(m<d&&(m=d),S=1,l=1;l<=$e;l++)if(S<<=1,S-=E[l],S<0)return-1;if(S>0&&(e===zf||h!==1))return-1;for(F[1]=0,l=1;l<$e;l++)F[l+1]=F[l]+E[l];for(u=0;u<i;u++)r[n+u]!==0&&(a[F[r[n+u]]++]=u);if(e===zf?(g=k=a,A=19):e===Zo?(g=_m,_-=257,k=xm,U-=257,A=256):(g=gm,k=Am,A=-1),D=0,u=0,l=d,P=s,x=m,p=0,I=-1,b=1<<m,O=b-1,e===Zo&&b>Ff||e===Gf&&b>Uf)return 1;for(;;){L=l-p,a[u]<A?(G=0,it=a[u]):a[u]>A?(G=k[U+a[u]],it=g[_+a[u]]):(G=32+64,it=0),M=1<<l-p,y=1<<x,d=y;do y-=M,o[P+(D>>p)+y]=L<<24|G<<16|it|0;while(y!==0);for(M=1<<l-1;D&M;)M>>=1;if(M!==0?(D&=M-1,D+=M):D=0,u++,--E[l]===0){if(l===h)break;l=r[n+a[u]]}if(l>m&&(D&O)!==I){for(p===0&&(p=m),P+=d,x=l-p,S=1<<x;x+p<h&&(S-=E[x+p],!(S<=0));)x++,S<<=1;if(b+=1<<x,e===Zo&&b>Ff||e===Gf&&b>Uf)return 1;I=D&O,o[I]=m<<24|x<<16|P-s|0}}return D!==0&&(o[P+D]=l-p<<24|64<<16|0),f.bits=m,0}});var bl=tt(Tt=>{"use strict";var _t=Wt(),$o=Lo(),Gt=No(),Em=Nf(),Wr=Xf(),Sm=0,ml=1,_l=2,Vf=4,ym=5,ri=6,be=0,wm=1,bm=2,wt=-2,xl=-3,ts=-4,Mm=-5,qf=8,gl=1,Wf=2,Zf=3,Qf=4,Kf=5,jf=6,Yf=7,Jf=8,$f=9,tl=10,oi=11,Kt=12,Qo=13,el=14,Ko=15,rl=16,nl=17,il=18,ol=19,ni=20,ii=21,sl=22,al=23,cl=24,fl=25,ll=26,jo=27,hl=28,dl=29,K=30,es=31,Tm=32,Rm=852,Cm=592,vm=15,Im=vm;function ul(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function Dm(){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 _t.Buf16(320),this.work=new _t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Al(t){var e;return!t||!t.state?wt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=gl,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new _t.Buf32(Rm),e.distcode=e.distdyn=new _t.Buf32(Cm),e.sane=1,e.back=-1,be)}function El(t){var e;return!t||!t.state?wt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Al(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))?wt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,El(t))}function yl(t,e){var r,n;return t?(n=new Dm,t.state=n,n.window=null,r=Sl(t,e),r!==be&&(t.state=null),r):wt}function Om(t){return yl(t,Im)}var pl=!0,Yo,Jo;function Bm(t){if(pl){var e;for(Yo=new _t.Buf32(512),Jo=new _t.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(Wr(ml,t.lens,0,288,Yo,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Wr(_l,t.lens,0,32,Jo,0,t.work,{bits:5}),pl=!1}t.lencode=Yo,t.lenbits=9,t.distcode=Jo,t.distbits=5}function wl(t,e,r,n){var i,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _t.Buf8(o.wsize)),n>=o.wsize?(_t.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),_t.arraySet(o.window,e,r-n,i,o.wnext),n-=i,n?(_t.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function Pm(t,e){var r,n,i,o,s,a,f,c,l,u,d,h,m,x,p=0,S,b,D,M,y,I,O,P,g=new _t.Buf8(4),_,A,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 wt;r=t.state,r.mode===Kt&&(r.mode=Qo),s=t.next_out,i=t.output,f=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,u=a,d=f,P=be;t:for(;;)switch(r.mode){case gl:if(r.wrap===0){r.mode=Qo;break}for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,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=K;break}if((c&15)!==qf){t.msg="unknown compression method",r.mode=K;break}if(c>>>=4,l-=4,O=(c&15)+8,r.wbits===0)r.wbits=O;else if(O>r.wbits){t.msg="invalid window size",r.mode=K;break}r.dmax=1<<O,t.adler=r.check=1,r.mode=c&512?tl:Kt,c=0,l=0;break;case Wf:for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==qf){t.msg="unknown compression method",r.mode=K;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=K;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,2,0)),c=0,l=0,r.mode=Zf;case Zf:for(;l<32;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,g[2]=c>>>16&255,g[3]=c>>>24&255,r.check=Gt(r.check,g,4,0)),c=0,l=0,r.mode=Qf;case Qf:for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,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[o++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,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&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_t.arraySet(r.head.extra,n,o,h,O)),r.flags&512&&(r.check=Gt(r.check,n,h,o)),a-=h,o+=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 O=n[o+h++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&h<a);if(r.flags&512&&(r.check=Gt(r.check,n,h,o)),a-=h,o+=h,O)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=Jf;case Jf:if(r.flags&4096){if(a===0)break t;h=0;do O=n[o+h++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&h<a);if(r.flags&512&&(r.check=Gt(r.check,n,h,o)),a-=h,o+=h,O)break t}else r.head&&(r.head.comment=null);r.mode=$f;case $f:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=K;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=Kt;break;case tl:for(;l<32;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}t.adler=r.check=ul(c),c=0,l=0,r.mode=oi;case oi:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=l,bm;t.adler=r.check=1,r.mode=Kt;case Kt:if(e===ym||e===ri)break t;case Qo:if(r.last){c>>>=l&7,l-=l&7,r.mode=jo;break}for(;l<3;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=el;break;case 1:if(Bm(r),r.mode=ni,e===ri){c>>>=2,l-=2;break t}break;case 2:r.mode=nl;break;case 3:t.msg="invalid block type",r.mode=K}c>>>=2,l-=2;break;case el:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=K;break}if(r.length=c&65535,c=0,l=0,r.mode=Ko,e===ri)break t;case Ko:r.mode=rl;case rl:if(h=r.length,h){if(h>a&&(h=a),h>f&&(h=f),h===0)break t;_t.arraySet(i,n,o,h,s),a-=h,o+=h,f-=h,s+=h,r.length-=h;break}r.mode=Kt;break;case nl:for(;l<14;){if(a===0)break t;a--,c+=n[o++]<<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=K;break}r.have=0,r.mode=il;case il:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[o++]<<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,_={bits:r.lenbits},P=Wr(Sm,r.lens,0,19,r.lencode,0,r.work,_),r.lenbits=_.bits,P){t.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=ol;case ol:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,b=p>>>16&255,D=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(D<16)c>>>=S,l-=S,r.lens[r.have++]=D;else{if(D===16){for(A=S+2;l<A;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=K;break}O=r.lens[r.have-1],h=3+(c&3),c>>>=2,l-=2}else if(D===17){for(A=S+3;l<A;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=S,l-=S,O=0,h=3+(c&7),c>>>=3,l-=3}else{for(A=S+7;l<A;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=S,l-=S,O=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=K;break}for(;h--;)r.lens[r.have++]=O}}if(r.mode===K)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,_={bits:r.lenbits},P=Wr(ml,r.lens,0,r.nlen,r.lencode,0,r.work,_),r.lenbits=_.bits,P){t.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,_={bits:r.distbits},P=Wr(_l,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,_),r.distbits=_.bits,P){t.msg="invalid distances set",r.mode=K;break}if(r.mode=ni,e===ri)break t;case ni:r.mode=ii;case ii:if(a>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=l,Em(t,d),s=t.next_out,i=t.output,f=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===Kt&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,b=p>>>16&255,D=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(b&&!(b&240)){for(M=S,y=b,I=D;p=r.lencode[I+((c&(1<<M+y)-1)>>M)],S=p>>>24,b=p>>>16&255,D=p&65535,!(M+S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=M,l-=M,r.back+=M}if(c>>>=S,l-=S,r.back+=S,r.length=D,b===0){r.mode=ll;break}if(b&32){r.back=-1,r.mode=Kt;break}if(b&64){t.msg="invalid literal/length code",r.mode=K;break}r.extra=b&15,r.mode=sl;case sl:if(r.extra){for(A=r.extra;l<A;){if(a===0)break t;a--,c+=n[o++]<<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,b=p>>>16&255,D=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(!(b&240)){for(M=S,y=b,I=D;p=r.distcode[I+((c&(1<<M+y)-1)>>M)],S=p>>>24,b=p>>>16&255,D=p&65535,!(M+S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=M,l-=M,r.back+=M}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=K;break}r.offset=D,r.extra=b&15,r.mode=cl;case cl:if(r.extra){for(A=r.extra;l<A;){if(a===0)break t;a--,c+=n[o++]<<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=K;break}r.mode=fl;case fl:if(f===0)break t;if(h=d-f,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=K;break}h>r.wnext?(h-=r.wnext,m=r.wsize-h):m=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,m=s-r.offset,h=r.length;h>f&&(h=f),f-=h,r.length-=h;do i[s++]=x[m++];while(--h);r.length===0&&(r.mode=ii);break;case ll:if(f===0)break t;i[s++]=r.length,f--,r.mode=ii;break;case jo:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[o++]<<l,l+=8}if(d-=f,t.total_out+=d,r.total+=d,d&&(t.adler=r.check=r.flags?Gt(r.check,i,d,s-d):$o(r.check,i,d,s-d)),d=f,(r.flags?c:ul(c))!==r.check){t.msg="incorrect data check",r.mode=K;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[o++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=K;break}c=0,l=0}r.mode=dl;case dl:P=wm;break t;case K:P=xl;break t;case es:return ts;case Tm:default:return wt}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||d!==t.avail_out&&r.mode<K&&(r.mode<jo||e!==Vf))&&wl(t,t.output,t.next_out,d-t.avail_out)?(r.mode=es,ts):(u-=t.avail_in,d-=t.avail_out,t.total_in+=u,t.total_out+=d,r.total+=d,r.wrap&&d&&(t.adler=r.check=r.flags?Gt(r.check,i,d,t.next_out-d):$o(r.check,i,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Kt?128:0)+(r.mode===ni||r.mode===Ko?256:0),(u===0&&d===0||e===Vf)&&P===be&&(P=Mm),P)}function Lm(t){if(!t||!t.state)return wt;var e=t.state;return e.window&&(e.window=null),t.state=null,be}function Nm(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?wt:(r.head=e,e.done=!1,be)}function km(t,e){var r=e.length,n,i,o;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==oi)?wt:n.mode===oi&&(i=1,i=$o(i,e,r,0),i!==n.check)?xl:(o=wl(t,e,r,r),o?(n.mode=es,ts):(n.havedict=1,be))}Tt.inflateReset=El;Tt.inflateReset2=Sl;Tt.inflateResetKeep=Al;Tt.inflateInit=Om;Tt.inflateInit2=yl;Tt.inflate=Pm;Tt.inflateEnd=Lm;Tt.inflateGetHeader=Nm;Tt.inflateSetDictionary=km;Tt.inflateInfo="pako inflate (from Nodeca project)"});var rs=tt((Ew,Ml)=>{"use strict";Ml.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 Rl=tt((Sw,Tl)=>{"use strict";function Fm(){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}Tl.exports=Fm});var vl=tt(Qr=>{"use strict";var tr=bl(),Zr=Wt(),si=Go(),Y=rs(),ns=Zn(),Um=Ho(),zm=Rl(),Cl=Object.prototype.toString;function Me(t){if(!(this instanceof Me))return new Me(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 Um,this.strm.avail_out=0;var r=tr.inflateInit2(this.strm,e.windowBits);if(r!==Y.Z_OK)throw new Error(ns[r]);if(this.header=new zm,tr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=si.string2buf(e.dictionary):Cl.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=tr.inflateSetDictionary(this.strm,e.dictionary),r!==Y.Z_OK)))throw new Error(ns[r])}Me.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,s,a,f,c,l=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof t=="string"?r.input=si.binstring2buf(t):Cl.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),o=tr.inflate(r,Y.Z_NO_FLUSH),o===Y.Z_NEED_DICT&&i&&(o=tr.inflateSetDictionary(this.strm,i)),o===Y.Z_BUF_ERROR&&l===!0&&(o=Y.Z_OK,l=!1),o!==Y.Z_STREAM_END&&o!==Y.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===Y.Z_STREAM_END||r.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=si.utf8border(r.output,r.next_out),f=r.next_out-a,c=si.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)&&o!==Y.Z_STREAM_END);return o===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(o=tr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),r.avail_out=0),!0)};Me.prototype.onData=function(t){this.chunks.push(t)};Me.prototype.onEnd=function(t){t===Y.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 is(t,e){var r=new Me(e);if(r.push(t,!0),r.err)throw r.msg||ns[r.err];return r.result}function Gm(t,e){return e=e||{},e.raw=!0,is(t,e)}Qr.Inflate=Me;Qr.inflate=is;Qr.inflateRaw=Gm;Qr.ungzip=is});var Ol=tt((ww,Dl)=>{"use strict";var Hm=Wt().assign,Xm=Pf(),Vm=vl(),qm=rs(),Il={};Hm(Il,Xm,Vm,qm);Dl.exports=Il});var Bl=tt(()=>{});var Jr={};nn(Jr,{ArcGISWebSceneLoader:()=>Wl,COORDINATE_SYSTEM:()=>Bt,I3SAttributeLoader:()=>jr,I3SBuildingSceneLayerLoader:()=>Hl,I3SContentLoader:()=>Nn,I3SLoader:()=>vr,I3SNodePageLoader:()=>zn,LayerError:()=>Yr,SLPKArchive:()=>er,SLPKLoader:()=>Pl,customizeColors:()=>Kl,loadFeatureAttributes:()=>Ul,parseSLPKArchive:()=>ci});on(Jr,Ct(Ht(),1));var i0={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},he={...i0,...o0};async function di(t,e,r,n){return n._parse(t,e,r,n)}function Yt(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var vt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},s0=vt.self||vt.window||vt.global||{},a0=vt.window||vt.self||vt.global||{},c0=vt.global||vt.self||vt.window||{},f0=vt.document||{};var xt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var us=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),l0=us&&parseFloat(us[1])||0;function Jt(t){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(t)}function ui(t,e){if(Jt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pi(t){var e=ui(t,"string");return Jt(e)==="symbol"?e:String(e)}function q(t,e,r){return e=pi(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function mi(t){return globalThis.loaders?.modules?.[t]||null}function h0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.1"),globalThis._loadersgl_.version}var ps=h0();function ms(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var It={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},H_=It.self||It.window||It.global||{},X_=It.window||It.self||It.global||{},V_=It.global||It.self||It.window||{},q_=It.document||{};var ve=typeof process!="object"||String(process)!=="[object process]"||process.browser,sn=typeof importScripts=="function",W_=typeof window<"u"&&typeof window.orientation<"u",_s=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Z_=_s&&parseFloat(_s[1])||0;var _i={};async function Dt(t,e=null,r={},n=null){return e&&(t=xs(t,e,r,n)),_i[t]=_i[t]||d0(t),await _i[t]}function xs(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let i=r.modules||{};return i[n]?i[n]:ve?r.CDN?(ms(r.CDN.startsWith("http")),`${r.CDN}/${e}@${ps}/dist/libs/${n}`):sn?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function d0(t){if(t.endsWith("wasm"))return await p0(t);if(!ve)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(sn)return importScripts(t);let e=await m0(t);return u0(e,t)}function u0(t,e){if(!ve){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(sn)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 p0(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return ve||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function m0(t){let{readFileAsText:e}=globalThis.loaders||{};return ve||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function $t(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),i=new Uint8Array(e);for(let o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}function Ie(...t){return gs(t)}function gs(t){let e=t.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(r),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n.buffer}async function ir(t){let e=[];for await(let r of t)e.push(r);return Ie(...e)}function As(t){return t&&typeof t=="object"&&t.isBuffer}function De(t){if(As(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 Oe(t){return e=>new Promise((r,n)=>t(e,(i,o)=>i?n(i):r(o)))}var or=new Error("Not implemented"),an=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 or}async write(e,r,n){throw or}async stat(){throw or}async truncate(e){throw or}async append(e){throw or}async close(){}};var xi=t=>t?.getUint8&&t?.slice&&t?.length;var sr=class{file;constructor(e,r=!1){this.file=new an(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 i=Number(n);return await this.file.read(e,i)}get length(){return this.file.bigsize}};var Be=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},de=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(Be(e))}async getUint16(e){return this.file.getUint16(Be(e),!0)}async getUint32(e){return this.file.getUint32(Be(e),!0)}async getBigUint64(e){return this.file.getBigUint64(Be(e),!0)}async slice(e,r){return this.file.buffer.slice(Be(e),Be(r))}get length(){return BigInt(this.file.byteLength)}};var _0=1/Math.PI*180,x0=1/180*Math.PI,g0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...g0}};var Z=globalThis.mathgl.config;function gi(t,{precision:e=Z.precision}={}){return t=A0(t),"".concat(parseFloat(t.toPrecision(e)))}function Ot(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ai(t){return Es(t)}function Ei(t){return Ss(t)}function Es(t,e){return ys(t,r=>r*x0,e)}function Ss(t,e){return ys(t,r=>r*_0,e)}function dt(t,e,r){let n=Z.EPSILON;r&&(Z.EPSILON=r);try{if(t===e)return!0;if(Ot(t)&&Ot(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!dt(t[i],e[i]))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)<=Z.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Z.EPSILON=n}}function A0(t){return Math.round(t/Z.EPSILON)*Z.EPSILON}function E0(t){return t.clone?t.clone():new Array(t.length)}function ys(t,e,r){if(Ot(t)){let n=t;r=r||E0(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof t=="number"?t:t[i];r[i]=e(o,i,r)}return r}return e(t)}function S0(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var te=class extends S0(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:Ot(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Z)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+gi(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(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 i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}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(Z.debug&&!this.validate())throw new Error("math.gl: ".concat(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 y0(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 H(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function ee(t,e,r=""){if(Z.debug&&!y0(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function et(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Pe=class extends te{get x(){return this[0]}set x(e){this[0]=H(e)}get y(){return this[1]}set y(e){this[1]=H(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 i=this[n]-e[n];r+=i*i}return H(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return H(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"),H(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 Q=typeof Float32Array<"u"?Float32Array:Array,ar=Math.random;function Le(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var qx=Math.PI/180;function w0(){let t=new Q(2);return Q!=Float32Array&&(t[0]=0,t[1]=0),t}function ws(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function bs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var Wx=function(){let t=w0();return function(e,r,n,i,o,s){let a,f;for(r||(r=2),n||(n=0),i?f=Math.min(i*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Ms(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function cn(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function Ts(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function Rs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3],t}function fn(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}var ke={};nn(ke,{add:()=>R0,angle:()=>Mi,bezier:()=>z0,ceil:()=>C0,clone:()=>b0,copy:()=>M0,create:()=>ln,cross:()=>ue,dist:()=>K0,distance:()=>Os,div:()=>Q0,divide:()=>Ds,dot:()=>cr,equals:()=>q0,exactEquals:()=>V0,floor:()=>v0,forEach:()=>J0,fromValues:()=>hn,hermite:()=>U0,inverse:()=>N0,len:()=>Ti,length:()=>Cs,lerp:()=>k0,max:()=>D0,min:()=>I0,mul:()=>Z0,multiply:()=>Is,negate:()=>L0,normalize:()=>Si,random:()=>G0,rotateX:()=>yi,rotateY:()=>wi,rotateZ:()=>bi,round:()=>O0,scale:()=>B0,scaleAndAdd:()=>P0,set:()=>T0,slerp:()=>F0,sqrDist:()=>j0,sqrLen:()=>Y0,squaredDistance:()=>Bs,squaredLength:()=>Ps,str:()=>X0,sub:()=>W0,subtract:()=>vs,transformMat3:()=>fr,transformMat4:()=>pe,transformQuat:()=>lr,zero:()=>H0});function ln(){let t=new Q(3);return Q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function b0(t){let e=new Q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Cs(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function hn(t,e,r){let n=new Q(3);return n[0]=t,n[1]=e,n[2]=r,n}function M0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function T0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function R0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function vs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Is(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Ds(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function C0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function v0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function I0(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 D0(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 O0(t,e){return t[0]=Le(e[0]),t[1]=Le(e[1]),t[2]=Le(e[2]),t}function B0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function P0(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 Os(t,e){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}function Bs(t,e){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function Ps(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function L0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function N0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Si(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function cr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ue(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],f=r[2];return t[0]=i*f-o*a,t[1]=o*s-n*f,t[2]=n*a-i*s,t}function k0(t,e,r,n){let i=e[0],o=e[1],s=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t}function F0(t,e,r,n){let i=Math.acos(Math.min(Math.max(cr(e,r),-1),1)),o=Math.sin(i),s=Math.sin((1-n)*i)/o,a=Math.sin(n*i)/o;return t[0]=s*e[0]+a*r[0],t[1]=s*e[1]+a*r[1],t[2]=s*e[2]+a*r[2],t}function U0(t,e,r,n,i,o){let s=o*o,a=s*(2*o-3)+1,f=s*(o-2)+o,c=s*(o-1),l=s*(3-2*o);return t[0]=e[0]*a+r[0]*f+n[0]*c+i[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+i[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+i[2]*l,t}function z0(t,e,r,n,i,o){let s=1-o,a=s*s,f=o*o,c=a*s,l=3*o*a,u=3*f*s,d=f*o;return t[0]=e[0]*c+r[0]*l+n[0]*u+i[0]*d,t[1]=e[1]*c+r[1]*l+n[1]*u+i[1]*d,t[2]=e[2]*c+r[2]*l+n[2]*u+i[2]*d,t}function G0(t,e){e=e===void 0?1:e;let r=ar()*2*Math.PI,n=ar()*2-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function pe(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function fr(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function lr(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],f=e[1],c=e[2],l=i*c-o*f,u=o*a-n*c,d=n*f-i*a,h=i*d-o*u,m=o*l-n*d,x=n*u-i*l,p=s*2;return l*=p,u*=p,d*=p,h*=2,m*=2,x*=2,t[0]=a+l+h,t[1]=f+u+m,t[2]=c+d+x,t}function yi(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function wi(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function bi(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Mi(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],f=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),c=f&&cr(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function H0(t){return t[0]=0,t[1]=0,t[2]=0,t}function X0(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function V0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function q0(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=1e-6*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=1e-6*Math.max(1,Math.abs(i),Math.abs(a))}var W0=vs,Z0=Is,Q0=Ds,K0=Os,j0=Bs,Ti=Cs,Y0=Ps,J0=function(){let t=ln();return function(e,r,n,i,o,s){let a,f;for(r||(r=3),n||(n=0),i?f=Math.min(i*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],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var Ri=[0,0,0],dn,B=class extends Pe{static get ZERO(){return dn||(dn=new B(0,0,0),Object.freeze(dn)),dn}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Ot(e)?this.copy(e):(Z.debug&&(H(e),H(r),H(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 Z.debug&&(H(e.x),H(e.y),H(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]=H(e)}angle(e){return Mi(this,e)}cross(e){return ue(this,this,e),this.check()}rotateX({radians:e,origin:r=Ri}){return yi(this,this,r,e),this.check()}rotateY({radians:e,origin:r=Ri}){return wi(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=Ri}){return bi(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return pe(this,this,e),this.check()}transformAsVector(e){return cn(this,this,e),this.check()}transformByMatrix3(e){return fr(this,this,e),this.check()}transformByMatrix2(e){return Ts(this,this,e),this.check()}transformByQuaternion(e){return lr(this,this,e),this.check()}};var un,Fe=class extends Pe{static get ZERO(){return un||(un=new Fe(0,0,0,0),Object.freeze(un)),un}constructor(e=0,r=0,n=0,i=0){super(-0,-0,-0,-0),Ot(e)&&arguments.length===1?this.copy(e):(Z.debug&&(H(e),H(r),H(n),H(i)),this[0]=e,this[1]=r,this[2]=n,this[3]=i)}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,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 Z.debug&&(H(e.x),H(e.y),H(e.z),H(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]=H(e)}get w(){return this[3]}set w(e){this[3]=H(e)}transform(e){return pe(this,this,e),this.check()}transformByMatrix3(e){return fn(this,this,e),this.check()}transformByMatrix2(e){return Rs(this,this,e),this.check()}transformByQuaternion(e){return lr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Ue=class extends te{toString(){let e="[";if(Z.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(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]=H(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function Ls(){let t=new Q(9);return Q!=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 Ns(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}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 ks(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],u=l*s-a*c,d=-l*o+a*f,h=c*o-s*f,m=r*u+n*d+i*h;return m?(m=1/m,t[0]=u*m,t[1]=(-l*n+i*c)*m,t[2]=(a*n-i*s)*m,t[3]=d*m,t[4]=(l*r-i*f)*m,t[5]=(-a*r+i*o)*m,t[6]=h*m,t[7]=(-c*r+n*f)*m,t[8]=(s*r-n*o)*m,t):null}function Fs(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],f=t[7],c=t[8];return e*(c*o-s*f)+r*(-c*i+s*a)+n*(f*i-o*a)}function Ci(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=r[0],h=r[1],m=r[2],x=r[3],p=r[4],S=r[5],b=r[6],D=r[7],M=r[8];return t[0]=d*n+h*s+m*c,t[1]=d*i+h*a+m*l,t[2]=d*o+h*f+m*u,t[3]=x*n+p*s+S*c,t[4]=x*i+p*a+S*l,t[5]=x*o+p*f+S*u,t[6]=b*n+D*s+M*c,t[7]=b*i+D*a+M*l,t[8]=b*o+D*f+M*u,t}function Us(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=r[0],h=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=f,t[6]=d*n+h*s+c,t[7]=d*i+h*a+l,t[8]=d*o+h*f+u,t}function zs(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=Math.sin(r),h=Math.cos(r);return t[0]=h*n+d*s,t[1]=h*i+d*a,t[2]=h*o+d*f,t[3]=h*s-d*n,t[4]=h*a-d*i,t[5]=h*f-d*o,t[6]=c,t[7]=l,t[8]=u,t}function vi(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Gs(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,f=i+i,c=r*s,l=n*s,u=n*a,d=i*s,h=i*a,m=i*f,x=o*s,p=o*a,S=o*f;return t[0]=1-u-m,t[3]=l-S,t[6]=d+p,t[1]=l+S,t[4]=1-c-m,t[7]=h-x,t[2]=d-p,t[5]=h+x,t[8]=1-c-u,t}var Ii;(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"})(Ii||(Ii={}));var th=Object.freeze([1,0,0,0,1,0,0,0,1]),J=class extends Ue{static get IDENTITY(){return rh()}static get ZERO(){return eh()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Ii}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(th)}fromObject(e){return this.check()}fromQuaternion(e){return Gs(this,e),this.check()}set(e,r,n,i,o,s,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,i,o,s,a,f,c){return this[0]=e,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=s,this[8]=c,this.check()}determinant(){return Fs(this)}transpose(){return Ns(this,this),this.check()}invert(){return ks(this,this),this.check()}multiplyLeft(e){return Ci(this,e,this),this.check()}multiplyRight(e){return Ci(this,this,e),this.check()}rotate(e){return zs(this,this,e),this.check()}scale(e){return Array.isArray(e)?vi(this,this,e):vi(this,this,[e,e]),this.check()}translate(e){return Us(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=ws(r||[-0,-0],e,this);break;case 3:n=fr(r||[-0,-0,-0],e,this);break;case 4:n=fn(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ee(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)}},pn,mn=null;function eh(){return pn||(pn=new J([0,0,0,0,0,0,0,0,0]),Object.freeze(pn)),pn}function rh(){return mn||(mn=new J,Object.freeze(mn)),mn}var _n={};nn(_n,{add:()=>Rh,adjoint:()=>ch,clone:()=>ih,copy:()=>oh,create:()=>nh,decompose:()=>gh,determinant:()=>Bi,equals:()=>Dh,exactEquals:()=>Ih,frob:()=>Th,fromQuat:()=>zi,fromQuat2:()=>mh,fromRotation:()=>hh,fromRotationTranslation:()=>Xs,fromRotationTranslationScale:()=>Ah,fromRotationTranslationScaleOrigin:()=>Eh,fromScaling:()=>lh,fromTranslation:()=>fh,fromValues:()=>sh,fromXRotation:()=>dh,fromYRotation:()=>uh,fromZRotation:()=>ph,frustum:()=>Gi,getRotation:()=>xh,getScaling:()=>Vs,getTranslation:()=>_h,identity:()=>Hs,invert:()=>Oi,lookAt:()=>Vi,mul:()=>Oh,multiply:()=>hr,multiplyScalar:()=>Ch,multiplyScalarAndAdd:()=>vh,ortho:()=>Xi,orthoNO:()=>Ws,orthoZO:()=>wh,perspective:()=>Hi,perspectiveFromFieldOfView:()=>yh,perspectiveNO:()=>qs,perspectiveZO:()=>Sh,rotate:()=>Ni,rotateX:()=>ki,rotateY:()=>Fi,rotateZ:()=>Ui,scale:()=>Li,set:()=>ah,str:()=>Mh,sub:()=>Bh,subtract:()=>Zs,targetTo:()=>bh,translate:()=>Pi,transpose:()=>Di});function nh(){let t=new Q(16);return Q!=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 ih(t){let e=new Q(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 oh(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 sh(t,e,r,n,i,o,s,a,f,c,l,u,d,h,m,x){let p=new Q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=i,p[5]=o,p[6]=s,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=u,p[12]=d,p[13]=h,p[14]=m,p[15]=x,p}function ah(t,e,r,n,i,o,s,a,f,c,l,u,d,h,m,x,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=u,t[11]=d,t[12]=h,t[13]=m,t[14]=x,t[15]=p,t}function Hs(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 Di(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=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]=o,t[11]=e[14],t[12]=i,t[13]=s,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 Oi(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],u=e[9],d=e[10],h=e[11],m=e[12],x=e[13],p=e[14],S=e[15],b=r*a-n*s,D=r*f-i*s,M=r*c-o*s,y=n*f-i*a,I=n*c-o*a,O=i*c-o*f,P=l*x-u*m,g=l*p-d*m,_=l*S-h*m,A=u*p-d*x,E=u*S-h*x,F=d*S-h*p,k=b*F-D*E+M*A+y*_-I*g+O*P;return k?(k=1/k,t[0]=(a*F-f*E+c*A)*k,t[1]=(i*E-n*F-o*A)*k,t[2]=(x*O-p*I+S*y)*k,t[3]=(d*I-u*O-h*y)*k,t[4]=(f*_-s*F-c*g)*k,t[5]=(r*F-i*_+o*g)*k,t[6]=(p*M-m*O-S*D)*k,t[7]=(l*O-d*M+h*D)*k,t[8]=(s*E-a*_+c*P)*k,t[9]=(n*_-r*E-o*P)*k,t[10]=(m*I-x*M+S*b)*k,t[11]=(u*M-l*I-h*b)*k,t[12]=(a*g-s*A-f*P)*k,t[13]=(r*A-n*g+i*P)*k,t[14]=(x*D-m*y-p*b)*k,t[15]=(l*y-u*D+d*b)*k,t):null}function ch(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],u=e[9],d=e[10],h=e[11],m=e[12],x=e[13],p=e[14],S=e[15],b=r*a-n*s,D=r*f-i*s,M=r*c-o*s,y=n*f-i*a,I=n*c-o*a,O=i*c-o*f,P=l*x-u*m,g=l*p-d*m,_=l*S-h*m,A=u*p-d*x,E=u*S-h*x,F=d*S-h*p;return t[0]=a*F-f*E+c*A,t[1]=i*E-n*F-o*A,t[2]=x*O-p*I+S*y,t[3]=d*I-u*O-h*y,t[4]=f*_-s*F-c*g,t[5]=r*F-i*_+o*g,t[6]=p*M-m*O-S*D,t[7]=l*O-d*M+h*D,t[8]=s*E-a*_+c*P,t[9]=n*_-r*E-o*P,t[10]=m*I-x*M+S*b,t[11]=u*M-l*I-h*b,t[12]=a*g-s*A-f*P,t[13]=r*A-n*g+i*P,t[14]=x*D-m*y-p*b,t[15]=l*y-u*D+d*b,t}function Bi(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],f=t[7],c=t[8],l=t[9],u=t[10],d=t[11],h=t[12],m=t[13],x=t[14],p=t[15],S=e*s-r*o,b=e*a-n*o,D=r*a-n*s,M=c*m-l*h,y=c*x-u*h,I=l*x-u*m,O=e*I-r*y+n*M,P=o*I-s*y+a*M,g=c*D-l*b+u*S,_=h*D-m*b+x*S;return f*O-i*P+p*g-d*_}function hr(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=e[9],h=e[10],m=e[11],x=e[12],p=e[13],S=e[14],b=e[15],D=r[0],M=r[1],y=r[2],I=r[3];return t[0]=D*n+M*a+y*u+I*x,t[1]=D*i+M*f+y*d+I*p,t[2]=D*o+M*c+y*h+I*S,t[3]=D*s+M*l+y*m+I*b,D=r[4],M=r[5],y=r[6],I=r[7],t[4]=D*n+M*a+y*u+I*x,t[5]=D*i+M*f+y*d+I*p,t[6]=D*o+M*c+y*h+I*S,t[7]=D*s+M*l+y*m+I*b,D=r[8],M=r[9],y=r[10],I=r[11],t[8]=D*n+M*a+y*u+I*x,t[9]=D*i+M*f+y*d+I*p,t[10]=D*o+M*c+y*h+I*S,t[11]=D*s+M*l+y*m+I*b,D=r[12],M=r[13],y=r[14],I=r[15],t[12]=D*n+M*a+y*u+I*x,t[13]=D*i+M*f+y*d+I*p,t[14]=D*o+M*c+y*h+I*S,t[15]=D*s+M*l+y*m+I*b,t}function Pi(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,f,c,l,u,d,h,m,x,p,S;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],f=e[2],c=e[3],l=e[4],u=e[5],d=e[6],h=e[7],m=e[8],x=e[9],p=e[10],S=e[11],t[0]=s,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=h,t[8]=m,t[9]=x,t[10]=p,t[11]=S,t[12]=s*n+l*i+m*o+e[12],t[13]=a*n+u*i+x*o+e[13],t[14]=f*n+d*i+p*o+e[14],t[15]=c*n+h*i+S*o+e[15]),t}function Li(t,e,r){let n=r[0],i=r[1],o=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]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ni(t,e,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),f,c,l,u,d,h,m,x,p,S,b,D,M,y,I,O,P,g,_,A,E,F,k,U;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,u=e[0],d=e[1],h=e[2],m=e[3],x=e[4],p=e[5],S=e[6],b=e[7],D=e[8],M=e[9],y=e[10],I=e[11],O=i*i*l+f,P=o*i*l+s*c,g=s*i*l-o*c,_=i*o*l-s*c,A=o*o*l+f,E=s*o*l+i*c,F=i*s*l+o*c,k=o*s*l-i*c,U=s*s*l+f,t[0]=u*O+x*P+D*g,t[1]=d*O+p*P+M*g,t[2]=h*O+S*P+y*g,t[3]=m*O+b*P+I*g,t[4]=u*_+x*A+D*E,t[5]=d*_+p*A+M*E,t[6]=h*_+S*A+y*E,t[7]=m*_+b*A+I*E,t[8]=u*F+x*k+D*U,t[9]=d*F+p*k+M*U,t[10]=h*F+S*k+y*U,t[11]=m*F+b*k+I*U,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function ki(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],f=e[7],c=e[8],l=e[9],u=e[10],d=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]=o*i+c*n,t[5]=s*i+l*n,t[6]=a*i+u*n,t[7]=f*i+d*n,t[8]=c*i-o*n,t[9]=l*i-s*n,t[10]=u*i-a*n,t[11]=d*i-f*n,t}function Fi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],f=e[3],c=e[8],l=e[9],u=e[10],d=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]=o*i-c*n,t[1]=s*i-l*n,t[2]=a*i-u*n,t[3]=f*i-d*n,t[8]=o*n+c*i,t[9]=s*n+l*i,t[10]=a*n+u*i,t[11]=f*n+d*i,t}function Ui(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],f=e[3],c=e[4],l=e[5],u=e[6],d=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]=o*i+c*n,t[1]=s*i+l*n,t[2]=a*i+u*n,t[3]=f*i+d*n,t[4]=c*i-o*n,t[5]=l*i-s*n,t[6]=u*i-a*n,t[7]=d*i-f*n,t}function fh(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 lh(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 hh(t,e,r){let n=r[0],i=r[1],o=r[2],s=Math.sqrt(n*n+i*i+o*o),a,f,c;return s<1e-6?null:(s=1/s,n*=s,i*=s,o*=s,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=i*n*c+o*f,t[2]=o*n*c-i*f,t[3]=0,t[4]=n*i*c-o*f,t[5]=i*i*c+a,t[6]=o*i*c+n*f,t[7]=0,t[8]=n*o*c+i*f,t[9]=i*o*c-n*f,t[10]=o*o*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function dh(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 uh(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 ph(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 Xs(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=n+n,f=i+i,c=o+o,l=n*a,u=n*f,d=n*c,h=i*f,m=i*c,x=o*c,p=s*a,S=s*f,b=s*c;return t[0]=1-(h+x),t[1]=u+b,t[2]=d-S,t[3]=0,t[4]=u-b,t[5]=1-(l+x),t[6]=m+p,t[7]=0,t[8]=d+S,t[9]=m-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 mh(t,e){let r=new Q(3),n=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=n*n+i*i+o*o+s*s;return u>0?(r[0]=(a*s+l*n+f*o-c*i)*2/u,r[1]=(f*s+l*i+c*n-a*o)*2/u,r[2]=(c*s+l*o+a*i-f*n)*2/u):(r[0]=(a*s+l*n+f*o-c*i)*2,r[1]=(f*s+l*i+c*n-a*o)*2,r[2]=(c*s+l*o+a*i-f*n)*2),Xs(t,e,r),t}function _h(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Vs(t,e){let r=e[0],n=e[1],i=e[2],o=e[4],s=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function xh(t,e){let r=new Q(3);Vs(r,e);let n=1/r[0],i=1/r[1],o=1/r[2],s=e[0]*n,a=e[1]*i,f=e[2]*o,c=e[4]*n,l=e[5]*i,u=e[6]*o,d=e[8]*n,h=e[9]*i,m=e[10]*o,x=s+l+m,p=0;return x>0?(p=Math.sqrt(x+1)*2,t[3]=.25*p,t[0]=(u-h)/p,t[1]=(d-f)/p,t[2]=(a-c)/p):s>l&&s>m?(p=Math.sqrt(1+s-l-m)*2,t[3]=(u-h)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(d+f)/p):l>m?(p=Math.sqrt(1+l-s-m)*2,t[3]=(d-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(u+h)/p):(p=Math.sqrt(1+m-s-l)*2,t[3]=(a-c)/p,t[0]=(d+f)/p,t[1]=(u+h)/p,t[2]=.25*p),t}function gh(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let i=n[0],o=n[1],s=n[2],a=n[4],f=n[5],c=n[6],l=n[8],u=n[9],d=n[10];r[0]=Math.sqrt(i*i+o*o+s*s),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+u*u+d*d);let h=1/r[0],m=1/r[1],x=1/r[2],p=i*h,S=o*m,b=s*x,D=a*h,M=f*m,y=c*x,I=l*h,O=u*m,P=d*x,g=p+M+P,_=0;return g>0?(_=Math.sqrt(g+1)*2,t[3]=.25*_,t[0]=(y-O)/_,t[1]=(I-b)/_,t[2]=(S-D)/_):p>M&&p>P?(_=Math.sqrt(1+p-M-P)*2,t[3]=(y-O)/_,t[0]=.25*_,t[1]=(S+D)/_,t[2]=(I+b)/_):M>P?(_=Math.sqrt(1+M-p-P)*2,t[3]=(I-b)/_,t[0]=(S+D)/_,t[1]=.25*_,t[2]=(y+O)/_):(_=Math.sqrt(1+P-p-M)*2,t[3]=(S-D)/_,t[0]=(I+b)/_,t[1]=(y+O)/_,t[2]=.25*_),t}function Ah(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],f=i+i,c=o+o,l=s+s,u=i*f,d=i*c,h=i*l,m=o*c,x=o*l,p=s*l,S=a*f,b=a*c,D=a*l,M=n[0],y=n[1],I=n[2];return t[0]=(1-(m+p))*M,t[1]=(d+D)*M,t[2]=(h-b)*M,t[3]=0,t[4]=(d-D)*y,t[5]=(1-(u+p))*y,t[6]=(x+S)*y,t[7]=0,t[8]=(h+b)*I,t[9]=(x-S)*I,t[10]=(1-(u+m))*I,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Eh(t,e,r,n,i){let o=e[0],s=e[1],a=e[2],f=e[3],c=o+o,l=s+s,u=a+a,d=o*c,h=o*l,m=o*u,x=s*l,p=s*u,S=a*u,b=f*c,D=f*l,M=f*u,y=n[0],I=n[1],O=n[2],P=i[0],g=i[1],_=i[2],A=(1-(x+S))*y,E=(h+M)*y,F=(m-D)*y,k=(h-M)*I,U=(1-(d+S))*I,L=(p+b)*I,G=(m+D)*O,it=(p-b)*O,W=(1-(d+x))*O;return t[0]=A,t[1]=E,t[2]=F,t[3]=0,t[4]=k,t[5]=U,t[6]=L,t[7]=0,t[8]=G,t[9]=it,t[10]=W,t[11]=0,t[12]=r[0]+P-(A*P+k*g+G*_),t[13]=r[1]+g-(E*P+U*g+it*_),t[14]=r[2]+_-(F*P+L*g+W*_),t[15]=1,t}function zi(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,f=i+i,c=r*s,l=n*s,u=n*a,d=i*s,h=i*a,m=i*f,x=o*s,p=o*a,S=o*f;return t[0]=1-u-m,t[1]=l+S,t[2]=d-p,t[3]=0,t[4]=l-S,t[5]=1-c-m,t[6]=h+x,t[7]=0,t[8]=d+p,t[9]=h-x,t[10]=1-c-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gi(t,e,r,n,i,o,s){let a=1/(r-e),f=1/(i-n),c=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*f,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t}function qs(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}var Hi=qs;function Sh(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=i*s,t[14]=i*n*s}else t[10]=-1,t[14]=-n;return t}function yh(t,e,r,n){let i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(s+a),c=2/(i+o);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]=-((s-a)*f*.5),t[9]=(i-o)*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 Ws(t,e,r,n,i,o,s){let a=1/(e-r),f=1/(n-i),c=1/(o-s);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]=(i+n)*f,t[14]=(s+o)*c,t[15]=1,t}var Xi=Ws;function wh(t,e,r,n,i,o,s){let a=1/(e-r),f=1/(n-i),c=1/(o-s);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]=(i+n)*f,t[14]=o*c,t[15]=1,t}function Vi(t,e,r,n){let i,o,s,a,f,c,l,u,d,h,m=e[0],x=e[1],p=e[2],S=n[0],b=n[1],D=n[2],M=r[0],y=r[1],I=r[2];return Math.abs(m-M)<1e-6&&Math.abs(x-y)<1e-6&&Math.abs(p-I)<1e-6?Hs(t):(u=m-M,d=x-y,h=p-I,i=1/Math.sqrt(u*u+d*d+h*h),u*=i,d*=i,h*=i,o=b*h-D*d,s=D*u-S*h,a=S*d-b*u,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),f=d*a-h*s,c=h*o-u*a,l=u*s-d*o,i=Math.sqrt(f*f+c*c+l*l),i?(i=1/i,f*=i,c*=i,l*=i):(f=0,c=0,l=0),t[0]=o,t[1]=f,t[2]=u,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(o*m+s*x+a*p),t[13]=-(f*m+c*x+l*p),t[14]=-(u*m+d*x+h*p),t[15]=1,t)}function bh(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=n[0],f=n[1],c=n[2],l=i-r[0],u=o-r[1],d=s-r[2],h=l*l+u*u+d*d;h>0&&(h=1/Math.sqrt(h),l*=h,u*=h,d*=h);let m=f*d-c*u,x=c*l-a*d,p=a*u-f*l;return h=m*m+x*x+p*p,h>0&&(h=1/Math.sqrt(h),m*=h,x*=h,p*=h),t[0]=m,t[1]=x,t[2]=p,t[3]=0,t[4]=u*p-d*x,t[5]=d*m-l*p,t[6]=l*x-u*m,t[7]=0,t[8]=l,t[9]=u,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t}function Mh(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function Th(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 Rh(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 Zs(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 Ch(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 vh(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 Ih(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 Dh(t,e){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],f=t[6],c=t[7],l=t[8],u=t[9],d=t[10],h=t[11],m=t[12],x=t[13],p=t[14],S=t[15],b=e[0],D=e[1],M=e[2],y=e[3],I=e[4],O=e[5],P=e[6],g=e[7],_=e[8],A=e[9],E=e[10],F=e[11],k=e[12],U=e[13],L=e[14],G=e[15];return Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-D)<=1e-6*Math.max(1,Math.abs(n),Math.abs(D))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(o-y)<=1e-6*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(s-I)<=1e-6*Math.max(1,Math.abs(s),Math.abs(I))&&Math.abs(a-O)<=1e-6*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(c-g)<=1e-6*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-A)<=1e-6*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(d-E)<=1e-6*Math.max(1,Math.abs(d),Math.abs(E))&&Math.abs(h-F)<=1e-6*Math.max(1,Math.abs(h),Math.abs(F))&&Math.abs(m-k)<=1e-6*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(x-U)<=1e-6*Math.max(1,Math.abs(x),Math.abs(U))&&Math.abs(p-L)<=1e-6*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(S-G)<=1e-6*Math.max(1,Math.abs(S),Math.abs(G))}var Oh=hr,Bh=Zs;function Ph(){let t=new Q(4);return Q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Qs(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 Ks(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 js(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function Ys(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Js(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function $s(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function ta(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function ea(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}function ra(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*o-f*i,u=c*i+f*n-s*o,d=c*o+s*i-a*n,h=-s*n-a*i-f*o;return t[0]=l*c+h*-s+u*-f-d*-a,t[1]=u*c+h*-a+d*-s-l*-f,t[2]=d*c+h*-f+l*-a-u*-s,t[3]=e[3],t}var g2=function(){let t=Ph();return function(e,r,n,i,o,s){let a,f;for(r||(r=4),n||(n=0),i?f=Math.min(i*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],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Zi;(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"})(Zi||(Zi={}));var Nh=45*Math.PI/180,kh=1,qi=.1,Wi=500,Fh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ut=class extends Ue{static get IDENTITY(){return zh()}static get ZERO(){return Uh()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Zi}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,i,o,s,a,f,c,l,u,d,h,m,x,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=u,this[11]=d,this[12]=h,this[13]=m,this[14]=x,this[15]=p,this.check()}setRowMajor(e,r,n,i,o,s,a,f,c,l,u,d,h,m,x,p){return this[0]=e,this[1]=o,this[2]=c,this[3]=h,this[4]=r,this[5]=s,this[6]=l,this[7]=m,this[8]=n,this[9]=a,this[10]=u,this[11]=x,this[12]=i,this[13]=f,this[14]=d,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(Fh)}fromObject(e){return this.check()}fromQuaternion(e){return zi(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=qi,far:a=Wi}=e;return a===1/0?Gh(this,r,n,i,o,s):Gi(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return Vi(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=qi,far:a=Wi}=e;return Xi(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=Nh,aspect:n=kh,focalDistance:i=1,near:o=qi,far:s=Wi}=e;na(r);let a=r/2,f=i*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:o,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return na(r),Hi(this,r,n,i,o),this.check()}determinant(){return Bi(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),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*o,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*o,e[10]=this[10]*s,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),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=this[4]*i,e[4]=this[5]*o,e[5]=this[6]*s,e[6]=this[8]*i,e[7]=this[9]*o,e[8]=this[10]*s,e}transpose(){return Di(this,this),this.check()}invert(){return Oi(this,this),this.check()}multiplyLeft(e){return hr(this,e,this),this.check()}multiplyRight(e){return hr(this,this,e),this.check()}rotateX(e){return ki(this,this,e),this.check()}rotateY(e){return Fi(this,this,e),this.check()}rotateZ(e){return Ui(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return Ni(this,this,e,r),this.check()}scale(e){return Li(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return Pi(this,this,e),this.check()}transform(e,r){return e.length===4?(r=ea(r||[-0,-0,-0,-0],e,this),ee(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=bs(r||[-0,-0],e,this);break;case 3:i=pe(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ee(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=Ms(r||[-0,-0],e,this);break;case 3:n=cn(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ee(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])}},xn,gn;function Uh(){return xn||(xn=new ut([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(xn)),xn}function zh(){return gn||(gn=new ut,Object.freeze(gn)),gn}function na(t){if(t>Math.PI*2)throw Error("expected radians")}function Gh(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),f=(r+e)/(r-e),c=(i+n)/(i-n),l=-1,u=-1,d=-2*o;return t[0]=s,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]=u,t[12]=0,t[13]=0,t[14]=d,t[15]=0,t}function ia(){let t=new Q(4);return Q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function oa(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Qi(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 Ki(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+s*a+i*c-o*f,t[1]=i*l+s*f+o*a-n*c,t[2]=o*l+s*c+n*f-i*a,t[3]=s*l-n*a-i*f-o*c,t}function sa(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+s*a,t[1]=i*f+o*a,t[2]=o*f-i*a,t[3]=s*f-n*a,t}function aa(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-o*a,t[1]=i*f+s*a,t[2]=o*f+n*a,t[3]=s*f-i*a,t}function ca(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+i*a,t[1]=i*f-n*a,t[2]=o*f+s*a,t[3]=s*f-o*a,t}function fa(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function dr(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],f=r[0],c=r[1],l=r[2],u=r[3],d,h,m,x,p;return d=i*f+o*c+s*l+a*u,d<0&&(d=-d,f=-f,c=-c,l=-l,u=-u),1-d>1e-6?(h=Math.acos(d),p=Math.sin(h),m=Math.sin((1-n)*h)/p,x=Math.sin(n*h)/p):(m=1-n,x=n),t[0]=m*i+x*f,t[1]=m*o+x*c,t[2]=m*s+x*l,t[3]=m*a+x*u,t}function la(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function ha(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function ji(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 i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}var da=Qs;var ua=Ks,pa=$s,ma=ta,_a=js;var xa=Ys;var ga=Js;var Aa=function(){let t=ln(),e=hn(1,0,0),r=hn(0,1,0);return function(n,i,o){let s=cr(i,o);return s<-.999999?(ue(t,e,i),Ti(t)<1e-6&&ue(t,r,i),Si(t,t),Qi(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ue(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,ga(n,n))}}(),O2=function(){let t=ia(),e=ia();return function(r,n,i,o,s,a){return dr(t,n,s,a),dr(e,i,o,a),dr(r,t,e,2*a*(1-a)),r}}(),B2=function(){let t=Ls();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],ga(e,ji(e,t))}}();var Hh=[0,0,0,1],ze=class extends te{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}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,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,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 ji(this,e),this.check()}fromAxisRotation(e,r){return Qi(this,e,r),this.check()}identity(){return oa(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]=H(e)}get y(){return this[1]}set y(e){this[1]=H(e)}get z(){return this[2]}set z(e){this[2]=H(e)}get w(){return this[3]}set w(e){this[3]=H(e)}len(){return _a(this)}lengthSquared(){return xa(this)}dot(e){return pa(this,e)}rotationTo(e,r){return Aa(this,e,r),this.check()}add(e){return da(this,this,e),this.check()}calculateW(){return fa(this,this),this.check()}conjugate(){return ha(this,this),this.check()}invert(){return la(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(ma(this,e,r,n),this.check())}multiplyRight(e){return Ki(this,this,e),this.check()}multiplyLeft(e){return Ki(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 sa(this,this,e),this.check()}rotateY(e){return aa(this,this,e),this.check()}rotateZ(e){return ca(this,this,e),this.check()}scale(e){return ua(this,this,e),this.check()}slerp(e,r,n){let i,o,s;switch(arguments.length){case 1:({start:i=Hh,target:o,ratio:s}=e);break;case 2:i=this,o=e,s=r;break;default:i=e,o=r,s=n}return dr(this,i,o,s),this.check()}transformVector4(e,r=new Fe){return ra(r,e,this),ee(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 re={};nn(re,{EPSILON1:()=>Xh,EPSILON10:()=>Jh,EPSILON11:()=>$h,EPSILON12:()=>t1,EPSILON13:()=>e1,EPSILON14:()=>r1,EPSILON15:()=>n1,EPSILON16:()=>i1,EPSILON17:()=>o1,EPSILON18:()=>s1,EPSILON19:()=>a1,EPSILON2:()=>Vh,EPSILON20:()=>c1,EPSILON3:()=>qh,EPSILON4:()=>Wh,EPSILON5:()=>Zh,EPSILON6:()=>Qh,EPSILON7:()=>Kh,EPSILON8:()=>jh,EPSILON9:()=>Yh,PI_OVER_FOUR:()=>l1,PI_OVER_SIX:()=>h1,PI_OVER_TWO:()=>f1,TWO_PI:()=>d1});var Xh=.1,Vh=.01,qh=.001,Wh=1e-4,Zh=1e-5,Qh=1e-6,Kh=1e-7,jh=1e-8,Yh=1e-9,Jh=1e-10,$h=1e-11,t1=1e-12,e1=1e-13,r1=1e-14,n1=1e-15,i1=1e-16,o1=1e-17,s1=1e-18,a1=1e-19,c1=1e-20,f1=Math.PI/2,l1=Math.PI/4,h1=Math.PI/6,d1=Math.PI*2;function Yi(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 Ea={UInt8:he.UNSIGNED_BYTE,UInt16:he.UNSIGNED_SHORT,Float32:he.FLOAT,UInt32:he.UNSIGNED_INT,UInt64:he.DOUBLE};function Ge(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 Sa="String",ya="Oid32",wa="Float64",ba="Int16",Bt;(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"})(Bt||(Bt={}));var Bc=Ct(Ht(),1);var wr=Ct(Ht(),1);var Xt=6356752314245179e-9,u1={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 ug=new B;function p1(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 Ma(t,e=[]){return p1(t,e,Z._cartographicRadians?An:Ai)}function m1(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 Ta(t,e){return m1(t,e,Z._cartographicRadians?An:Ei)}var Ra=1e-14,_1=new B,Ca={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"}},Ji={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ur={east:new B,north:new B,up:new B,west:new B,south:new B,down:new B},x1=new B,g1=new B,A1=new B;function $i(t,e,r,n,i,o){let s=Ca[e]&&Ca[e][r];et(s&&(!n||n===s));let a,f,c,l=_1.copy(i);if(dt(l.x,0,Ra)&&dt(l.y,0,Ra)){let d=Math.sign(l.z);a=x1.fromArray(Ji[e]),e!=="east"&&e!=="west"&&a.scale(d),f=g1.fromArray(Ji[r]),r!=="east"&&r!=="west"&&f.scale(d),c=A1.fromArray(Ji[n]),n!=="east"&&n!=="west"&&c.scale(d)}else{let{up:d,east:h,north:m}=ur;h.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,d),m.copy(d).cross(h);let{down:x,west:p,south:S}=ur;x.copy(d).scale(-1),p.copy(h).scale(-1),S.copy(m).scale(-1),a=ur[e],f=ur[r],c=ur[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=f.x,o[5]=f.y,o[6]=f.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}var He=new B,E1=new B,S1=new B;function va(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:o}=e;He.from(t);let s=He.x,a=He.y,f=He.z,c=n.x,l=n.y,u=n.z,d=s*s*c*c,h=a*a*l*l,m=f*f*u*u,x=d+h+m,p=Math.sqrt(1/x);if(!Number.isFinite(p))return;let S=E1;if(S.copy(t).scale(p),x<o)return S.to(r);let b=i.x,D=i.y,M=i.z,y=S1;y.set(S.x*b*2,S.y*D*2,S.z*M*2);let I=(1-p)*He.len()/(.5*y.len()),O=0,P,g,_,A;do{I-=O,P=1/(1+I*b),g=1/(1+I*D),_=1/(1+I*M);let E=P*P,F=g*g,k=_*_,U=E*P,L=F*g,G=k*_;A=d*E+h*F+m*k-1;let W=-2*(d*U*b+h*L*D+m*G*M);O=A/W}while(Math.abs(A)>re.EPSILON12);return He.scale([P,g,_]).to(r)}var En=new B,Ia=new B,b1=new B,bt=new B,M1=new B,Sn=new B,gt=class{constructor(e=0,r=0,n=0){q(this,"radii",void 0),q(this,"radiiSquared",void 0),q(this,"radiiToTheFourth",void 0),q(this,"oneOverRadii",void 0),q(this,"oneOverRadiiSquared",void 0),q(this,"minimumRadius",void 0),q(this,"maximumRadius",void 0),q(this,"centerToleranceSquared",re.EPSILON1),q(this,"squaredXOverSquaredZ",void 0),et(e>=0),et(r>=0),et(n>=0),this.radii=new B(e,r,n),this.radiiSquared=new B(e*e,r*r,n*n),this.radiiToTheFourth=new B(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new B(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new B(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=Ia,i=b1,[,,o]=e;this.geodeticSurfaceNormalCartographic(e,n),i.copy(this.radiiSquared).scale(n);let s=Math.sqrt(n.dot(i));return i.scale(1/s),n.scale(o),i.add(n),i.to(r)}cartesianToCartographic(e,r=[0,0,0]){Sn.from(e);let n=this.scaleToGeodeticSurface(Sn,bt);if(!n)return;let i=this.geodeticSurfaceNormal(n,Ia),o=M1;o.copy(Sn).subtract(n);let s=Math.atan2(i.y,i.x),a=Math.asin(i.z),f=Math.sign(ke.dot(o,Sn))*ke.length(o);return Ta([s,a,f],r)}eastNorthUpToFixedFrame(e,r=new ut){return $i(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,i,o=new ut){return $i(this,e,r,n,i,o)}geocentricSurfaceNormal(e,r=[0,0,0]){return En.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Ma(e),i=n[0],o=n[1],s=Math.cos(o);return En.set(s*Math.cos(i),s*Math.sin(i),Math.sin(o)).normalize(),En.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return En.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return va(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){bt.from(e);let n=bt.x,i=bt.y,o=bt.z,s=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+i*i*s.y+o*o*s.z);return bt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return bt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return bt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){et(dt(this.radii.x,this.radii.y,re.EPSILON15)),et(this.radii.z>0),bt.from(e);let i=bt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return bt.set(0,0,i).to(n)}};q(gt,"WGS84",new gt(6378137,6378137,Xt));var Da="4.3.0-alpha.1";var T1=globalThis.loaders?.parseImageNode,to=typeof Image<"u",eo=typeof ImageBitmap<"u",R1=Boolean(T1),ro=xt?!0:R1;function Oa(t){switch(t){case"auto":return eo||to||ro;case"imagebitmap":return eo;case"image":return to;case"data":return ro;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Ba(){if(eo)return"imagebitmap";if(to)return"image";if(ro)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function C1(t){let e=v1(t);if(!e)throw new Error("Not an image");return e}function Pa(t){switch(C1(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 v1(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 I1=/^data:image\/svg\+xml/,D1=/\.svg((\?|#).*)?$/;function yn(t){return t&&(I1.test(t)||D1.test(t))}function La(t,e){if(yn(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return no(t,e)}function no(t,e){if(yn(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function wn(t,e,r){let n=La(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await O1(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function O1(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,i)=>{try{r.onload=()=>n(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}var B1={},Na=!0;async function ka(t,e,r){let n;yn(r)?n=await wn(t,e,r):n=no(t,r);let i=e&&e.imagebitmap;return await P1(n,i)}async function P1(t,e=null){if((L1(e)||!Na)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Na=!1}return await createImageBitmap(t)}function L1(t){for(let e in t||B1)return!1;return!0}function Fa(t){return!U1(t,"ftyp",4)||!(t[8]&96)?null:N1(t)}function N1(t){switch(k1(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function k1(t,e,r){return String.fromCharCode(...t.slice(e,r))}function F1(t){return[...t].map(e=>e.charCodeAt(0))}function U1(t,e,r=0){let n=F1(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var Pt=!1,pr=!0;function bn(t){let e=mr(t);return G1(e)||V1(e)||H1(e)||X1(e)||z1(e)}function z1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Fa(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function G1(t){let e=mr(t);return e.byteLength>=24&&e.getUint32(0,Pt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Pt),height:e.getUint32(20,Pt)}:null}function H1(t){let e=mr(t);return e.byteLength>=10&&e.getUint32(0,Pt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,pr),height:e.getUint16(8,pr)}:null}function X1(t){let e=mr(t);return e.byteLength>=14&&e.getUint16(0,Pt)===16973&&e.getUint32(2,pr)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pr),height:e.getUint32(22,pr)}:null}function V1(t){let e=mr(t);if(!(e.byteLength>=3&&e.getUint16(0,Pt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=q1(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Pt);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Pt),width:e.getUint16(o+7,Pt)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Pt)}return null}function q1(){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 mr(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 Ua(t,e){let{mimeType:r}=bn(t)||{},n=globalThis.loaders?.parseImageNode;return Yt(n),await n(t,r)}async function za(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=W1(i),a;switch(s){case"imagebitmap":a=await ka(t,e,o);break;case"image":a=await wn(t,e,o);break;case"data":a=await Ua(t,e);break;default:Yt(!1)}return i==="data"&&(a=Pa(a)),a}function W1(t){switch(t){case"auto":case"data":return Ba();default:return Oa(t),t}}var Z1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Q1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],K1={image:{type:"auto",decode:!0}},Mn={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Da,mimeTypes:Q1,extensions:Z1,parse:za,tests:[t=>Boolean(bn(new DataView(t)))],options:K1};var Ga="4.3.0-alpha.1";var Ha={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ga,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}}};function Xa(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 io(t){let e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],u=a[c+1],d=a[c+2];e=l<e?l:e,r=u<r?u:r,n=d<n?d:n,i=l>i?l:i,o=u>o?u:o,s=d>s?d:s}return[[e,r,n],[i,o,s]]}function oo(t,e,r){let n=Xa(e.value),i=r||Va(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Va(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 Wa(t,e,r){let n=Za(e.metadata),i=[],o=j1(e.attributes);for(let s in t){let a=t[s],f=qa(s,a,o[s]);i.push(f)}if(r){let s=qa("indices",r);i.push(s)}return{fields:i,metadata:n}}function j1(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function qa(t,e,r){let n=r?Za(r.metadata):void 0;return oo(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 Qa={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Y1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},J1=4,_r=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 i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let d=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(o,i,r),f=this._getMeshData(o,a,r),c=io(f.attributes),l=Wa(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(e,r,n){let i=this._getTopLevelMetadata(e),o=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:i,attributes:o}}_getDracoAttributes(e,r){let n={};for(let i=0;i<e.num_attributes();i++){let o=this.decoder.GetAttribute(e,i),s=this._getAttributeMetadata(e,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(o,r);f&&(n[o.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let i=this._getMeshAttributes(r,e,n);if(!i.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:i,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(e,r,n){let i={};for(let o of Object.values(e.attributes)){let s=this._deduceAttributeName(o,n);o.name=s;let a=this._getAttributeValues(r,o);if(a){let{value:f,size:c}=a;i[s]={value:f,size:c,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}}return i}_getTriangleListIndices(e){let n=e.num_faces()*3,i=n*J1,o=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),ed(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=Y1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let i=r.num_components,s=e.num_points()*i,a=s*n.BYTES_PER_ELEMENT,f=$1(this.draco,n),c,l=this.draco._malloc(a);try{let u=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,u,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,s).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=e.attribute_type;for(let s in Qa)if(this.draco[s]===i)return Qa[s];let o=r.attributeNameEntry||"name";return e.metadata[o]?e.metadata[o].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 i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(e,i);r[o]=this._getDracoMetadataField(e,o)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let i=td(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(a=>s.min_value(a))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}};function $1(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 td(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function ed(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var rd="1.5.6",nd="1.4.1",so=`https://www.gstatic.com/draco/versioned/decoders/${rd}`,lt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},ao={[lt.DECODER]:`${so}/${lt.DECODER}`,[lt.DECODER_WASM]:`${so}/${lt.DECODER_WASM}`,[lt.FALLBACK_DECODER]:`${so}/${lt.FALLBACK_DECODER}`,[lt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${nd}/javascript/${lt.ENCODER}`},co;async function Ka(t){let e=t.modules||{};return e.draco3d?co||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):co||=id(t),await co}async function id(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await Dt(ao[lt.FALLBACK_DECODER],"draco",t,lt.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await Dt(ao[lt.DECODER],"draco",t,lt.DECODER),await Dt(ao[lt.DECODER_WASM],"draco",t,lt.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await od(e,r)}function od(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:i=>n({draco:i})})})}var ja={...Ha,parse:sd};async function sd(t,e){let{draco:r}=await Ka(e),n=new _r(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var Tn="4.3.0-alpha.1";var Rn={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Ya;async function lo(t){nr(t.modules);let e=mi("basis");return e||(Ya||=ad(t),await Ya)}async function ad(t){let e=null,r=null;return[e,r]=await Promise.all([await Dt(Rn.TRANSCODER,"textures",t),await Dt(Rn.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await cd(e,r)}function cd(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(i=>{let{BasisFile:o,initializeBasis:s}=i;s(),n({BasisFile:o})})})}var fo;async function ho(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(fo=fo||fd(t),await fo)}async function fd(t){let e=null,r=null;return[e,r]=await Promise.all([await Dt(Rn.ENCODER,"textures",t),await Dt(Rn.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await ld(e,r)}function ld(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(i=>{let{BasisFile:o,KTX2File:s,initializeBasis:a,BasisEncoder:f}=i;a(),n({BasisFile:o,KTX2File:s,BasisEncoder:f})})})}var w={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 hd=["","WEBKIT_","MOZ_"],Ja={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"},Cn=null;function xr(t){if(!Cn){t=t||dd()||void 0,Cn=new Set;for(let e of hd)for(let r in Ja)if(t&&t.getExtension(`${e}${r}`)){let n=Ja[r];Cn.add(n)}}return Cn}function dd(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var PA=new Uint8Array([0]),st=[171,75,84,88,32,50,48,187,13,10,26,10],uo,po,mo,vn,$a,_o,tc,ec;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(uo||(uo={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(po||(po={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(mo||(mo={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(vn||(vn={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}($a||($a={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(_o||(_o={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(tc||(tc={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(ec||(ec={}));var xo=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=uo.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:po.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:mo.UNSPECIFIED,colorPrimaries:vn.SRGB,transferFunction:vn.SRGB,flags:_o.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}},me=class{constructor(e,r,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=i,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)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,r=0){let n=this._offset,i=0;for(;this._dataView.getUint8(this._offset)!==r&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}};function rc(t){return typeof TextDecoder<"u"?new TextDecoder().decode(t):Buffer.from(t).toString("utf8")}function nc(t){let e=new Uint8Array(t.buffer,t.byteOffset,st.length);if(e[0]!==st[0]||e[1]!==st[1]||e[2]!==st[2]||e[3]!==st[3]||e[4]!==st[4]||e[5]!==st[5]||e[6]!==st[6]||e[7]!==st[7]||e[8]!==st[8]||e[9]!==st[9]||e[10]!==st[10]||e[11]!==st[11])throw new Error("Missing KTX 2.0 identifier.");let r=new xo,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new me(t,st.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();let o=i._nextUint32();r.supercompressionScheme=i._nextUint32();let s=i._nextUint32(),a=i._nextUint32(),f=i._nextUint32(),c=i._nextUint32(),l=i._nextUint64(),u=i._nextUint64(),d=new me(t,st.length+n,3*o*8,!0);for(let G=0;G<o;G++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let h=new me(t,s,a,!0),m={vendorId:h._skip(4)._nextUint16(),descriptorType:h._nextUint16(),versionNumber:h._nextUint16(),descriptorBlockSize:h._nextUint16(),colorModel:h._nextUint8(),colorPrimaries:h._nextUint8(),transferFunction:h._nextUint8(),flags:h._nextUint8(),texelBlockDimension:{x:h._nextUint8()+1,y:h._nextUint8()+1,z:h._nextUint8()+1,w:h._nextUint8()+1},bytesPlane:[h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8()],samples:[]},x=(m.descriptorBlockSize/4-6)/4;for(let G=0;G<x;G++)m.samples[G]={bitOffset:h._nextUint16(),bitLength:h._nextUint8(),channelID:h._nextUint8(),samplePosition:[h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8()],sampleLower:h._nextUint32(),sampleUpper:h._nextUint32()};r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(m);let p=new me(t,f,c,!0);for(;p._offset<c;){let G=p._nextUint32(),it=p._scan(G),W=rc(it),li=p._scan(G-it.byteLength);r.keyValue[W]=W.match(/^ktx/i)?rc(li):li,G%4&&p._skip(4-G%4)}if(u<=0)return r;let S=new me(t,l,u,!0),b=S._nextUint16(),D=S._nextUint16(),M=S._nextUint32(),y=S._nextUint32(),I=S._nextUint32(),O=S._nextUint32(),P=[];for(let G=0;G<o;G++)P.push({imageFlags:S._nextUint32(),rgbSliceByteOffset:S._nextUint32(),rgbSliceByteLength:S._nextUint32(),alphaSliceByteOffset:S._nextUint32(),alphaSliceByteLength:S._nextUint32()});let g=l+S._offset,_=g+M,A=_+y,E=A+I,F=new Uint8Array(t.buffer,t.byteOffset+g,M),k=new Uint8Array(t.buffer,t.byteOffset+_,y),U=new Uint8Array(t.buffer,t.byteOffset+A,I),L=new Uint8Array(t.buffer,t.byteOffset+E,O);return r.globalData={endpointCount:b,selectorCount:D,imageDescs:P,endpointsData:F,selectorsData:k,tablesData:U,extendedData:L},r}function Xe(t,e){let r=new Array(e.mipMapLevels),n=e.width,i=e.height,o=0;for(let s=0;s<e.mipMapLevels;++s){let a=pd(e,n,i,t,s),f=ud(t,s,o,a);r[s]={compressed:!0,format:e.internalFormat,data:f,width:n,height:i,levelSize:a},n=Math.max(1,n>>1),i=Math.max(1,i>>1),o+=a}return r}function ud(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function pd(t,e,r,n,i){return Array.isArray(n)?t.sizeFunction(n[i]):t.sizeFunction(e,r)}var md={131:w.COMPRESSED_RGB_S3TC_DXT1_EXT,132:w.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:w.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:w.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:w.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:w.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:w.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:w.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:w.COMPRESSED_RED_RGTC1_EXT,140:w.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:w.COMPRESSED_RED_GREEN_RGTC2_EXT,142:w.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:w.COMPRESSED_RGB8_ETC2,148:w.COMPRESSED_SRGB8_ETC2,149:w.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:w.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:w.COMPRESSED_RGBA8_ETC2_EAC,152:w.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:w.COMPRESSED_R11_EAC,154:w.COMPRESSED_SIGNED_R11_EAC,155:w.COMPRESSED_RG11_EAC,156:w.COMPRESSED_SIGNED_RG11_EAC,157:w.COMPRESSED_RGBA_ASTC_4x4_KHR,158:w.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:w.COMPRESSED_RGBA_ASTC_5x4_KHR,160:w.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:w.COMPRESSED_RGBA_ASTC_5x5_KHR,162:w.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:w.COMPRESSED_RGBA_ASTC_6x5_KHR,164:w.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:w.COMPRESSED_RGBA_ASTC_6x6_KHR,166:w.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:w.COMPRESSED_RGBA_ASTC_8x5_KHR,168:w.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:w.COMPRESSED_RGBA_ASTC_8x6_KHR,170:w.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:w.COMPRESSED_RGBA_ASTC_8x8_KHR,172:w.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:w.COMPRESSED_RGBA_ASTC_10x5_KHR,174:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:w.COMPRESSED_RGBA_ASTC_10x6_KHR,176:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:w.COMPRESSED_RGBA_ASTC_10x8_KHR,178:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:w.COMPRESSED_RGBA_ASTC_10x10_KHR,180:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:w.COMPRESSED_RGBA_ASTC_12x10_KHR,182:w.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:w.COMPRESSED_RGBA_ASTC_12x12_KHR,184:w.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:w.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:w.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:w.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:w.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:w.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:w.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:w.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:w.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:w.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:w.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:w.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:w.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:w.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:w.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:w.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:w.COMPRESSED_RGBA_ASTC_12x12_KHR};function ic(t){return md[t]}var pt=[171,75,84,88,32,50,48,187,13,10,26,10];function In(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=nc(e),n=Math.max(1,r.levels.length),i=r.pixelWidth,o=r.pixelHeight,s=ic(r.vkFormat);return Xe(r.levels,{mipMapLevels:n,width:i,height:o,sizeFunction:a=>a.uncompressedByteLength,internalFormat:s})}var _d={etc1:{basisFormat:0,compressed:!0,format:w.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:w.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:w.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:w.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:w.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:w.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 gr(t,e){if(e.basis.containerFormat==="auto"){if(In(t)){let n=await ho(e);return sc(n.KTX2File,t,e)}let{BasisFile:r}=await lo(e);return go(r,t,e)}switch(e.basis.module){case"encoder":let r=await ho(e);switch(e.basis.containerFormat){case"ktx2":return sc(r.KTX2File,t,e);case"basis":default:return go(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await lo(e);return go(n,t,e)}}function go(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),o=[];for(let s=0;s<i;s++){let a=n.getNumLevels(s),f=[];for(let c=0;c<a;c++)f.push(xd(n,s,c,r));o.push(f)}return o}finally{n.close(),n.delete()}}function xd(t,e,r,n){let i=t.getImageWidth(e,r),o=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ac(n,s),l=t.getImageTranscodedSizeInBytes(e,r,c),u=new Uint8Array(l);if(!t.transcodeImage(u,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:u,compressed:a,format:f,hasAlpha:s}}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 i=n.getLevels(),o=[];for(let s=0;s<i;s++){o.push(gd(n,s,r));break}return[o]}finally{n.close(),n.delete()}}function gd(t,e,r){let{alphaFlag:n,height:i,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:f}=ac(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:o,height:i,data:l,compressed:s,levelSize:c,hasAlpha:n,format:a}}function ac(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(),_d[r]}function Dn(){let t=xr();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 cc={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Tn,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"}}},Ar={...cc,parse:gr};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},Ad={DXT1:w.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:w.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:w.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":w.COMPRESSED_RGB_ATC_WEBGL,ATCA:w.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:w.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},Ed=hc,Sd=On,yd=On,wd={DXT1:hc,DXT3:On,DXT5:On,"ATC ":Ed,ATCA:Sd,ATCI:yd};function fc(t){return new Uint32Array(t,0,mt.HEADER_LENGTH)[mt.MAGIC_NUMBER_INDEX]===mt.MAGIC_NUMBER}function lc(t){let e=new Int32Array(t,0,mt.HEADER_LENGTH),r=e[mt.HEADER_PF_FOURCC_INDEX];Yt(Boolean(e[mt.HEADER_PF_FLAGS_INDEX]&mt.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=bd(r),i=Ad[n],o=wd[n];Yt(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;e[mt.HEADER_FLAGS_INDEX]&mt.DDSD_MIPMAPCOUNT&&(s=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:s,width:a,height:f,sizeFunction:o,internalFormat:i})}function hc(t,e){return(t+3>>2)*(e+3>>2)*8}function On(t,e){return(t+3>>2)*(e+3>>2)*16}function bd(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var At={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},Md={0:[w.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[w.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[w.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[w.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[w.COMPRESSED_RGB_ETC1_WEBGL],7:[w.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[w.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[w.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[w.COMPRESSED_RGB8_ETC2],23:[w.COMPRESSED_RGBA8_ETC2_EAC],24:[w.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[w.COMPRESSED_R11_EAC],26:[w.COMPRESSED_RG11_EAC],27:[w.COMPRESSED_RGBA_ASTC_4X4_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[w.COMPRESSED_RGBA_ASTC_5X4_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[w.COMPRESSED_RGBA_ASTC_5X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[w.COMPRESSED_RGBA_ASTC_6X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[w.COMPRESSED_RGBA_ASTC_6X6_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[w.COMPRESSED_RGBA_ASTC_8X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[w.COMPRESSED_RGBA_ASTC_8X6_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[w.COMPRESSED_RGBA_ASTC_8X8_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[w.COMPRESSED_RGBA_ASTC_10X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[w.COMPRESSED_RGBA_ASTC_10X6_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[w.COMPRESSED_RGBA_ASTC_10X8_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[w.COMPRESSED_RGBA_ASTC_10X10_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[w.COMPRESSED_RGBA_ASTC_12X10_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[w.COMPRESSED_RGBA_ASTC_12X12_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Td={0:dc,1:dc,2:uc,3:uc,6:Er,7:Er,9:Sr,11:Sr,22:Er,23:Sr,24:Er,25:Er,26:Sr,27:Sr,28:Rd,29:Cd,30:vd,31:Id,32:Dd,33:Od,34:Bd,35:Pd,36:Ld,37:Nd,38:kd,39:Fd,40:Ud};function pc(t){let r=new Uint32Array(t,0,At.HEADER_LENGTH)[At.MAGIC_NUMBER_INDEX];return r===At.MAGIC_NUMBER||r===At.MAGIC_NUMBER_EXTRA}function mc(t){let e=new Uint32Array(t,0,At.HEADER_LENGTH),r=e[At.PIXEL_FORMAT_INDEX],n=e[At.COLOUR_SPACE_INDEX],i=Md[r]||[],o=i.length>1&&n?i[1]:i[0],s=Td[r],a=e[At.MIPMAPCOUNT_INDEX],f=e[At.WIDTH_INDEX],c=e[At.HEIGHT_INDEX],l=At.HEADER_SIZE+e[At.METADATA_SIZE_INDEX],u=new Uint8Array(t,l);return Xe(u,{mipMapLevels:a,width:f,height:c,sizeFunction:s,internalFormat:o})}function dc(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function uc(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function Er(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function Sr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function Rd(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function Cd(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function vd(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function Id(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function Dd(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function Od(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function Bd(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function Pd(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function Ld(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function Nd(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function kd(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function Fd(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function Ud(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}function _c(t){if(In(t))return oc(t);if(fc(t))return lc(t);if(pc(t))return mc(t);throw new Error("Texture container format not recognized")}var xc={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:Tn,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}}},Bn={...xc,parse:async(t,e)=>e?.["compressed-texture"]?.useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},(await gr(t,e))[0]):_c(t)};var yr;(function(t){t.vertexCount="vertexCount",t.featureCount="featureCount"})(yr||(yr={}));function Pn(t){let e;try{let r=new URL(t);e=`${r.origin}${r.pathname}`}catch{}return e||t}function Lt(t,e=null){return e?`${t}?token=${e}`:t}function gc(t,e){let{attributeData:r=[]}=e,n=[];for(let i=0;i<r.length;i++){let o=r[i].href.replace("./","");n.push(`${t}/${o}`)}return n}function Ac(t,e,r){let n=[],{attributeStorageInfo:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o].key;n.push(`${e}/nodes/${r}/attributes/${s}/0`)}return n}var Ln=new B([0,0,0]);function zd(t){switch(t){case"ktx-etc2":case"dds":return Bn;case"ktx2":return Ar;case"jpg":case"png":default:return Mn}}var Gd="i3s-attribute-type";async function wc(t,e,r,n,i){let o={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ut,coordinateSystem:0,byteLength:0,texture:null};if(e.textureUrl){let s=Lt(e.textureUrl,n?.i3s?.token),a=zd(e.textureFormat),l=await(await(i?.fetch||fetch)(s)).arrayBuffer();if(n?.i3s.decodeTextures){if(a===Mn){let u={...e.textureLoaderOptions,image:{type:"data"}};try{let d=await di(l,[],u,i);o.texture=d}catch{let h=await(0,wr.parse)(l,a,u,i);o.texture=h}}else if(a===Bn||a===Ar){let u=await(0,wr.load)(l,a,e.textureLoaderOptions);a===Ar&&(u=u[0]),o.texture={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u}}}else o.texture=l}return o.material=jd(e.materialDefinition,o.texture),o.material&&(o.texture=null),await Hd(t,o,e,r,n)}async function Hd(t,e,r,n,i){let o=t.byteLength,s,a,f=0,c=0,l;if(r.isDracoGeometry){let u=await(0,wr.parse)(t,ja,{draco:{attributeNameEntry:Gd}});a=u.header.vertexCount,l=u.indices?.value;let{POSITION:d,NORMAL:h,COLOR_0:m,TEXCOORD_0:x,["feature-index"]:p,["uv-region"]:S}=u.attributes;s={position:d,normal:h,color:m,uv0:x,uvRegion:S,id:p},Xd(s,u);let b=tu(p);b&&$d(s,b)}else{let{vertexAttributes:u,ordering:d,featureAttributes:h,featureAttributeOrder:m}=n.store.defaultGeometrySchema,x=qd(t,n);f=x.byteOffset,a=x.vertexCount,c=x.featureCount;let{attributes:p,byteOffset:S}=Sc(t,f,u,a,d),{attributes:b}=Sc(t,S,h,c,m);Jd(b),s=Vd(p,b)}if(!i?.i3s?.coordinateSystem||i.i3s.coordinateSystem===Bt.METER_OFFSETS){let u=Zd(s.position,r);e.modelMatrix=u.invert(),e.coordinateSystem=Bt.METER_OFFSETS}else e.modelMatrix=Kd(s.position),e.coordinateSystem=Bt.LNGLAT_OFFSETS;e.attributes={positions:s.position,normals:s.normal,colors:Ec(s.color),texCoords:s.uv0,uvRegions:Ec(s.uvRegion||s.region)},e.indices=l||null,s.id&&s.id.value&&(e.featureIds=s.id.value);for(let u in e.attributes)e.attributes[u]||delete e.attributes[u];return e.vertexCount=a,e.byteLength=o,e}function Xd(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 Vd(t,e){return{...t,...e}}function Ec(t){return t&&(t.normalized=!0,t)}function qd(t,e){let r=0,n=0,i=0;for(let{property:o,type:s}of e.store.defaultGeometrySchema.header){let a=Yi(s);switch(o){case yr.vertexCount.toString():n=new a(t,0,4)[0],r+=Ge(s);break;case yr.featureCount.toString():i=new a(t,4,4)[0],r+=Ge(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function Sc(t,e,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:f}=r[s];if(e+n*f*Ge(a)<=t.byteLength){let c=t.slice(e),l;if(a==="UInt64")l=Wd(c,n*f,Ge(a));else{let u=Yi(a);l=new u(c,0,n*f)}switch(o[s]={value:l,type:Ea[a],size:f},s){case"color":o.color.normalized=!0;break;case"position":case"region":case"normal":default:}e=e+n*f*Ge(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:e}}function Wd(t,e,r){let n=[],i=new DataView(t),o=0;for(let s=0;s<e;s++){let a=i.getUint32(o,!0),f=i.getUint32(o+4,!0),c=a+2**32*f;n.push(c),o+=r}return new Uint32Array(n)}function Zd(t,e){let r=e.mbs,n=t.value,i=t.metadata,o=new ut,s=new B(r[0],r[1],r[2]),a=new B;return gt.WGS84.cartographicToCartesian(s,a),gt.WGS84.eastNorthUpToFixedFrame(a,o),t.value=Qd(n,i,s),o}function Qd(t,e={},r){let n=new Float64Array(t.length),i=e["i3s-scale_x"]&&e["i3s-scale_x"].double||1,o=e["i3s-scale_y"]&&e["i3s-scale_y"].double||1;for(let s=0;s<n.length;s+=3)n[s]=t[s]*i+r.x,n[s+1]=t[s+1]*o+r.y,n[s+2]=t[s+2]+r.z;for(let s=0;s<n.length;s+=3)gt.WGS84.cartographicToCartesian(n.subarray(s,s+3),Ln),n[s]=Ln.x,n[s+1]=Ln.y,n[s+2]=Ln.z;return n}function Kd(t){let e=t.metadata,r=e?.["i3s-scale_x"]?.double||1,n=e?.["i3s-scale_y"]?.double||1,i=new ut;return i[0]=r,i[5]=n,i}function jd(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=yc(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=yc(r.pbrMetallicRoughness.baseColorFactor)),e&&Yd(r,e),r}function yc(t){let e=[...t];for(let r=0;r<t.length;r++)e[r]=t[r]/255;return e}function Yd(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 Jd(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,i=r.value,o=i[i.length-1]+1,s=new Uint32Array(o*3),a=0,f=0;for(let c=1;c<i.length;c+=2){let l=Number(n[a]),u=i[c],d=i[c-1],h=u-d+1,m=f+h*3;s.fill(l,f,m),a++,f=m}t.id.value=s}function $d(t,e){let r=t.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=e[r[i]];t.id.value=n}function tu(t){return t?.metadata?.["i3s-feature-ids"]?.intArray}var eu="4.3.0-alpha.1",Nn={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:eu,mimeTypes:["application/octet-stream"],parse:ru,extensions:["bin"],options:{"i3s-content":{}}};async function ru(t,e,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=e?.i3s||{},a=i||n,f=s||o;return!a||!f?null:await wc(t,a,f,e,r)}var rt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var LE=new B,NE=new B;var br=new B,bc=new B,ne=class{constructor(e=[0,0,0],r=0){q(this,"center",void 0),q(this,"radius",void 0),this.radius=-0,this.center=new B,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=br.from(r),this.center=new B().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,i=e.center,o=e.radius,s=br.copy(i).subtract(r),a=s.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return e.clone();let f=(n+a+o)*.5;return bc.copy(s).scale((-n+f)/a).add(r),this.center.copy(bc),this.radius=f,this}expand(e){let n=br.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=_n.getScaling(br,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=br.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,o=e.normal.dot(r)+e.distance;return o<-n?rt.OUTSIDE:o<n?rt.INTERSECTING:rt.INSIDE}};var nu=new B,iu=new B,kn=new B,Fn=new B,Un=new B,ou=new B,su=new B,Vt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},ie=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){q(this,"center",void 0),q(this,"halfAxes",void 0),this.center=new B().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 B(e).len(),new B(r).len(),new B(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new B(e).normalize(),o=new B(r).normalize(),s=new B(n).normalize();return new ze().fromMatrix3(new J([...i,...o,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let i=new ze(n),o=new J().fromQuaternion(i);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new B().from(e),this.halfAxes=o,this}clone(){return new ie(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,kn),i=r.getColumn(1,Fn),o=r.getColumn(2,Un),s=nu.copy(n).add(i).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,i=this.halfAxes,o=n.x,s=n.y,a=n.z,f=Math.abs(o*i[Vt.COLUMN0ROW0]+s*i[Vt.COLUMN0ROW1]+a*i[Vt.COLUMN0ROW2])+Math.abs(o*i[Vt.COLUMN1ROW0]+s*i[Vt.COLUMN1ROW1]+a*i[Vt.COLUMN1ROW2])+Math.abs(o*i[Vt.COLUMN2ROW0]+s*i[Vt.COLUMN2ROW1]+a*i[Vt.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?rt.OUTSIDE:c>=f?rt.INSIDE:rt.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=iu.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,kn),o=n.getColumn(1,Fn),s=n.getColumn(2,Un),a=i.magnitude(),f=o.magnitude(),c=s.magnitude();i.normalize(),o.normalize(),s.normalize();let l=0,u;return u=Math.abs(r.dot(i))-a,u>0&&(l+=u*u),u=Math.abs(r.dot(o))-f,u>0&&(l+=u*u),u=Math.abs(r.dot(s))-c,u>0&&(l+=u*u),l}computePlaneDistances(e,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,f=a.getColumn(0,kn),c=a.getColumn(1,Fn),l=a.getColumn(2,Un),u=ou.copy(f).add(c).add(l).add(s),d=su.copy(u).subtract(e),h=r.dot(d);return i=Math.min(h,i),o=Math.max(h,o),u.copy(s).add(f).add(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),u.copy(s).add(f).subtract(c).add(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),u.copy(s).add(f).subtract(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).add(c).add(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).add(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).subtract(c).add(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).subtract(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),n[0]=i,n[1]=o,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,kn);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Fn);n.transformAsPoint(e);let i=this.halfAxes.getColumn(2,Un);return i.transformAsPoint(e),this.halfAxes=new J([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var Mc=new B,Tc=new B,qt=class{constructor(e=[0,0,1],r=0){q(this,"normal",void 0),q(this,"distance",void 0),this.normal=new B,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,i){return this.normal.set(e,r,n),et(dt(this.normal.len(),1)),this.distance=i,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=Tc.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),i=this.getPointDistance(n),o=Tc.copy(this.normal).scale(i);return n.subtract(o).to(r)}};var Rc=[new B([1,0,0]),new B([0,1,0]),new B([0,0,1])],Cc=new B,au=new B,Et=class{constructor(e=[]){q(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Rc.length;let r=e.center,n=e.radius,i=0;for(let o of Rc){let s=this.planes[i],a=this.planes[i+1];s||(s=this.planes[i]=new qt),a||(a=this.planes[i+1]=new qt);let f=Cc.copy(o).scale(-n).add(r);s.fromPointNormal(f,o);let c=Cc.copy(o).scale(n).add(r),l=au.copy(o).negate();a.fromPointNormal(c,l),i+=2}return this}computeVisibility(e){let r=rt.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case rt.OUTSIDE:return rt.OUTSIDE;case rt.INTERSECTING:r=rt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(et(Number.isFinite(r),"parentPlaneMask is required."),r===Et.MASK_OUTSIDE||r===Et.MASK_INSIDE)return r;let n=Et.MASK_INSIDE,i=this.planes;for(let o=0;o<this.planes.length;++o){let s=o<31?1<<o:0;if(o<31&&!(r&s))continue;let a=i[o],f=e.intersectPlane(a);if(f===rt.OUTSIDE)return Et.MASK_OUTSIDE;f===rt.INTERSECTING&&(n|=s)}return n}};q(Et,"MASK_OUTSIDE",4294967295);q(Et,"MASK_INSIDE",0);q(Et,"MASK_INDETERMINATE",2147483647);var oS=new B,sS=new B,aS=new B,cS=new B,fS=new B;var _S=new B,xS=new B,gS=new B,AS=new B,ES=new B,SS=new B,yS=new B,wS=new B,bS=new B,MS=new B,TS=new B,RS=new B;var IS=new J,DS=new J,OS=new J,BS=new J,PS=new J;var zS=new B,GS=new B,HS=new B,XS=new B,VS=new B,qS=new J,WS={diagonal:new J,unitary:new J};var Ic=Ct(Ht(),1);var Mr;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Mr||(Mr={}));var Tr;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Tr||(Tr={}));var Rr;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(Rr||(Rr={}));var Ao;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(Ao||(Ao={}));var vc=Ct(Ht(),1);var hu="4.3.0-alpha.1",zn={dataType:null,batchType:null,name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:hu,mimeTypes:["application/json"],parse:du,extensions:["json"],options:{i3s:{}}};async function du(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 i=Lt(`${this.url}/nodepages/${r}`,this.options.i3s?.token);this.pendingNodePages[r]={status:"Pending",promise:(0,vc.load)(i,zn,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=[],i=[];for(let h of r.children||[])i.push(this.getNodeById(h));let o=await Promise.all(i);for(let h of o)n.push({id:h.index.toString(),obb:h.obb});let s,a,f,c="jpg",l=[],u=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:m}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};s=h,u=m;let{textureData:x,materialDefinition:p}=this.getInformationFromMaterial(r.mesh.material);f=p,c=x.format||c,x.name&&(a=`${this.url}/nodes/${r.mesh.material.resource}/textures/${x.name}`),this.tileset.attributeStorageInfo&&(l=Ac(this.tileset,this.url,r.mesh.attribute.resource))}let d=this.getLodSelection(r);return Eo({id:e.toString(),lodSelection:d,obb:r.obb,contentUrl:s,textureUrl:a,attributeUrls:l,materialDefinition:f,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:u})}getContentUrl(e){let r=null,n=this.tileset.geometryDefinitions[e.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(o=>o.compressedAttributes&&o.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(o=>!o.compressedAttributes)),i!==-1){let o=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${e.resource}/geometries/${i}`,isDracoGeometry:o}}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 i=n?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;typeof i=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[i]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=e.textureSetDefinitions||[];for(let i of n){let o=i&&i.formats||[],s=null;for(let a of r){let f=o.find(c=>c.format===a);if(f){s=f;break}}s&&s.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Dn(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(s)}}getSupportedTextureFormats(){let e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=xr();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 Dc(t,e){let r=e.url||"",n;t.geometryData&&(n=`${r}/${t.geometryData[0].href}`);let i;t.textureData&&(i=`${r}/${t.textureData[0].href}`);let o;t.attributeData&&(o=gc(r,t));let s=t.children||[];return Eo({...t,children:s,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:o,isDracoGeometry:!1})}function Eo(t){let e={},r=[0,0,0,1];if(t.mbs)r=t.mbs,e.sphere=[...gt.WGS84.cartographicToCartesian(t.mbs.slice(0,3)),t.mbs[3]];else if(t.obb){e.box=[...gt.WGS84.cartographicToCartesian(t.obb.center),...t.obb.halfSize,...t.obb.quaternion];let f=new ie().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,i=t.lodSelection?.[0].maxError,o=Tr.MESH,s=Mr.REPLACE;return{...t,mbs:r,boundingVolume:e,lodMetricType:n,lodMetricValue:i,type:o,refine:s}}async function Oc(t,e,r){let n=Pn(r.url||""),i,o;if(t.nodePages)i=new Cr(t,n,e),o=await i.formTileFromNodePages(0);else{let s=e.i3s,a=Lt(`${n}/nodes/root`,s.token);o=await(0,Ic.load)(a,vr,{...e,i3s:{...e.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...t,loader:vr,url:n,basePath:n,type:Rr.I3S,nodePagesTile:i,root:o,lodMetricType:o.lodMetricType,lodMetricValue:o.lodMetricValue}}var uu="4.3.0-alpha.1",pu=/layers\/[0-9]+$/,mu=/\.slpk$/,_u=/nodes\/([0-9-]+|root)$/,xu="504b0304",gu="PointCloud",vr={dataType:null,batchType:null,name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:uu,mimeTypes:["application/octet-stream"],parse:Au,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:Bt.METER_OFFSETS}}};async function Au(t,e={},r){let n=r.url;if(e.i3s=e.i3s||{},wu(t)===xu)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let o=Pn(n),s;e.i3s.isTileset==="auto"?s=pu.test(o)||mu.test(o):s=e.i3s.isTileset;let a;return e.isTileHeader==="auto"?a=_u.test(o):a=e.i3s.isTileHeader,s?t=await Su(t,e,r):a?t=await yu(t,r):t=await Eu(t,e),t}async function Eu(t,e){return await(0,Bc.parse)(t,Nn,e)}async function Su(t,e,r){let n=JSON.parse(new TextDecoder().decode(t));if(n?.layerType===gu)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await Oc(n,e,r)}async function yu(t,e){return t=JSON.parse(new TextDecoder().decode(t)),Dc(t,e)}function wu(t){return t instanceof ArrayBuffer?[...new Uint8Array(t,0,4)].map(e=>e.toString(16).padStart(2,"0")).join(""):null}var Ir=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,i=t.length-4n;do{let o=i;i-=BigInt(1024),i=i>=0n?i:0n;let s=new Uint8Array(await t.slice(i,o));for(let a=s.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=s[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&i>0n);return i+BigInt(n)};var Pc=new Uint8Array([80,75,5,6]),Lc=new Uint8Array([80,75,6,7]),Nc=new Uint8Array([80,75,6,6]),bu=8n;var Mu=12n,Tu=16n;var Ru=8n,Cu=24n;var vu=40n,Iu=48n;var kc=async t=>{let e=await Ir(t,Pc),r=BigInt(await t.getUint16(e+bu)),n=BigInt(await t.getUint32(e+Mu)),i=BigInt(await t.getUint32(e+Tu)),o=e-20n,s=0n,a=await t.slice(o,o+4n);if($t(a,Lc)){s=await t.getBigUint64(o+Ru);let f=await t.slice(s,s+4n);if(!$t(f,Nc.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(s+Cu),n=await t.getBigUint64(s+vu),i=await t.getBigUint64(s+Iu)}else o=0n;return{cdRecordsNumber:r,cdStartOffset:i,cdByteSize:n,offsets:{zip64EoCDOffset:s,zip64EoCDLocatorOffset:o,zipEoCDOffset:e}}};var Ly=[{offset:0,size:4,default:new DataView(Pc.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 Ny=[{offset:0,size:4,default:new DataView(Lc.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],ky=[{offset:0,size:4,default:new DataView(Nc.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 Du=20,Ou=24,Bu=28,Pu=30,Lu=32,Nu=42,Gn=46n,Or=new Uint8Array([80,75,1,2]),Dr=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+Gn)),n=r.buffer.slice(0,4);if(!$t(n,Or.buffer))return null;let i=BigInt(r.getUint32(Du,!0)),o=BigInt(r.getUint32(Ou,!0)),s=r.getUint16(Pu,!0),a=BigInt(r.getUint16(Lu,!0)),f=r.getUint16(Bu,!0),c=await e.slice(t+Gn,t+Gn+BigInt(f+s)),l=c.slice(0,f),u=new TextDecoder().decode(l),d=t+Gn+BigInt(f),h=r.getUint32(Nu,!0),m=BigInt(h),x=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:o,compressedSize:i,localHeaderOffset:m,startDisk:a},S=ku(p,x);return{...p,...S,extraFieldLength:s,fileNameLength:f,fileName:u,extraOffset:d}};async function*Ve(t){let{cdStartOffset:e,cdByteSize:r}=await kc(t),n=new de(new DataView(await t.slice(e,e+r))),i=await Dr(0n,n);for(;i;)yield i,i=await Dr(i.extraOffset+BigInt(i.extraFieldLength),n)}var Fc=(...t)=>t[0]+t[1]*16,ku=(t,e)=>{let r=Fu(t),n={};if(r.length>0){let i=r.reduce((a,f)=>a+f.length,0),o=new Uint8Array(e.buffer).findIndex((a,f,c)=>Fc(c[f],c[f+1])===1&&Fc(c[f+2],c[f+3])===i),s=0;for(let a of r){let f=s;n[a.name]=e.getBigUint64(o+4+f,!0),s=f+a.length}}return n},Fu=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 Gy=[{offset:0,size:4,default:new DataView(Or.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 Uu=8,zu=18,Gu=22,Hu=26,Xu=28,Hn=30n,So=new Uint8Array([80,75,3,4]),_e=async(t,e)=>{let r=new DataView(await e.slice(t,t+Hn)),n=r.buffer.slice(0,4);if(!$t(n,So))return null;let i=r.getUint16(Hu,!0),o=r.getUint16(Xu,!0),s=await e.slice(t+Hn,t+Hn+BigInt(i+o)),a=s.slice(0,i),f=new DataView(s.slice(i,s.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+Hn+BigInt(i+o),u=r.getUint16(Uu,!0),d=BigInt(r.getUint32(zu,!0)),h=BigInt(r.getUint32(Gu,!0)),m=4;return h===BigInt(4294967295)&&(h=f.getBigUint64(m,!0),m+=8),d===BigInt(4294967295)&&(d=f.getBigUint64(m,!0),m+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(m,!0)),{fileNameLength:i,fileName:c,extraFieldLength:o,fileDataOffset:l,compressedSize:d,compressionMethod:u}};var Vy=[{offset:0,size:4,default:new DataView(So.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 Xn=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let s of e)n.push(s),yield s;let i=await this.concatenate(n),o=await this.hash(i,r);this.options.crypto?.onEnd?.({hash:o})}async concatenate(e){return await ir(e)}};function Uc(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 i=0;i<n.length;i++)typeof n[i]>"u"?e+="=":e+=Vu(n[i])}return e}function Vu(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 zc(t,e){switch(e){case"hex":return t;case"base64":return qu(t);default:throw new Error(e)}}function qu(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Uc(r)||""}var Hc=typeof atob=="function"?atob:typeof Buffer=="function"?Ju:Vc,Wu=Hc("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="),yo=WebAssembly&&Hc!==Vc?Yu(Wu).buffer:!1,Nt=$u(),wo=240*16*16,Xc=Math.floor(wo*16*1.066666667),Zu=268435456-65536,Gc="Parameter must be Buffer, ArrayBuffer or Uint8Array",Qu="Parameter exceeds max size of 255.9 Mbytes";yo||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function bo(t){var e,r,n,i,o,s,a,f,c,l;let u=ju(),d=Ku(),h={},m=new Date().getTime();return h.then=function(b){return a=b,p(),h},h.catch=function(b){return f=b,h},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?s=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?s=t.constructor===ArrayBuffer?new Uint8Array(t):t:S(new TypeError(Gc)):S(new TypeError(Gc)),s&&(o=s.length,yo&&o>Xc?o>Zu?S(new Error(Qu)):(e=new WebAssembly.Memory({initial:o>32e6?o>64e6?o>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),i={mem:e,log:console.log},n={imports:i},WebAssembly.instantiate(yo,n).then(x)):p(u(s))),h;function x(b){p(d(s,b.instance.exports,r))}function p(b){var D=Boolean(b)?b:c;Boolean(b)&&(l=new Date().getTime()),typeof a=="function"?Boolean(D)&&(a(D,l-m),a=f=null):Boolean(b)&&(c=b)}function S(b){typeof f=="function"&&f(b)}}function Ku(){var t,e,r,n,i,o,s,a,f,c,l,u,d,h=function(m){var x,p,S,b,D,M,y,I,O,P,g,_,A,E,F,k,U,L,G,it,W,li,b_=new Date().getTime(),jl=0,T=1732584193,R=-271733879,C=-1732584194,v=271733878,j=0,rr=m.length*8,$r;for($r=Yl(m,d),d[rr>>>5]|=128<<rr%32,d[(rr+64>>>9<<4)+14]=rr,$r=(rr+64>>>9<<4)+15,W=d;j<$r;)$r>j+Xc?(n(T),o(R),a(C),c(v),e(wo),j=j+wo*16,T=r(),R=i(),C=s(),v=f(),jl++):(U=T,L=R,G=C,it=v,x=W[j+0]>>>0,p=W[j+1]>>>0,S=W[j+2]>>>0,b=W[j+3]>>>0,D=W[j+4]>>>0,M=W[j+5]>>>0,y=W[j+6]>>>0,I=W[j+7]>>>0,O=W[j+8]>>>0,P=W[j+9]>>>0,g=W[j+10]>>>0,_=W[j+11]>>>0,A=W[j+12]>>>0,E=W[j+13]>>>0,F=W[j+14]>>>0,k=W[j+15]>>>0,T=N(7,25,T+(R&C|~R&v)+x-680876936)+R,v=N(12,20,v+(T&R|~T&C)+p-389564586)+T,C=N(17,15,C+(v&T|~v&R)+S+606105819)+v,R=N(22,10,R+(C&v|~C&T)+b-1044525330)+C,T=N(7,25,T+(R&C|~R&v)+D-176418897)+R,v=N(12,20,v+(T&R|~T&C)+M+1200080426)+T,C=N(17,15,C+(v&T|~v&R)+y-1473231341)+v,R=N(22,10,R+(C&v|~C&T)+I-45705983)+C,T=N(7,25,T+(R&C|~R&v)+O+1770035416)+R,v=N(12,20,v+(T&R|~T&C)+P-1958414417)+T,C=N(17,15,C+(v&T|~v&R)+g-42063)+v,R=N(22,10,R+(C&v|~C&T)+_-1990404162)+C,T=N(7,25,T+(R&C|~R&v)+A+1804603682)+R,v=N(12,20,v+(T&R|~T&C)+E-40341101)+T,C=N(17,15,C+(v&T|~v&R)+F-1502002290)+v,R=N(22,10,R+(C&v|~C&T)+k+1236535329)+C,T=N(5,27,T+(R&v|C&~v)+p-165796510)+R,v=N(9,23,v+(T&C|R&~C)+y-1069501632)+T,C=N(14,18,C+(v&R|T&~R)+_+643717713)+v,R=N(20,12,R+(C&T|v&~T)+x-373897302)+C,T=N(5,27,T+(R&v|C&~v)+M-701558691)+R,v=N(9,23,v+(T&C|R&~C)+g+38016083)+T,C=N(14,18,C+(v&R|T&~R)+k-660478335)+v,R=N(20,12,R+(C&T|v&~T)+D-405537848)+C,T=N(5,27,T+(R&v|C&~v)+P+568446438)+R,v=N(9,23,v+(T&C|R&~C)+F-1019803690)+T,C=N(14,18,C+(v&R|T&~R)+b-187363961)+v,R=N(20,12,R+(C&T|v&~T)+O+1163531501)+C,T=N(5,27,T+(R&v|C&~v)+E-1444681467)+R,v=N(9,23,v+(T&C|R&~C)+S-51403784)+T,C=N(14,18,C+(v&R|T&~R)+I+1735328473)+v,R=N(20,12,R+(C&T|v&~T)+A-1926607734)+C,T=N(4,28,T+(R^C^v)+M-378558)+R,v=N(11,21,v+(T^R^C)+O-2022574463)+T,C=N(16,16,C+(v^T^R)+_+1839030562)+v,R=N(23,9,R+(C^v^T)+F-35309556)+C,T=N(4,28,T+(R^C^v)+p-1530992060)+R,v=N(11,21,v+(T^R^C)+D+1272893353)+T,C=N(16,16,C+(v^T^R)+I-155497632)+v,R=N(23,9,R+(C^v^T)+g-1094730640)+C,T=N(4,28,T+(R^C^v)+E+681279174)+R,v=N(11,21,v+(T^R^C)+x-358537222)+T,C=N(16,16,C+(v^T^R)+b-722521979)+v,R=N(23,9,R+(C^v^T)+y+76029189)+C,T=N(4,28,T+(R^C^v)+P-640364487)+R,v=N(11,21,v+(T^R^C)+A-421815835)+T,C=N(16,16,C+(v^T^R)+k+530742520)+v,R=N(23,9,R+(C^v^T)+S-995338651)+C,T=N(6,26,T+(C^(R|~v))+x-198630844)+R,v=N(10,22,v+(R^(T|~C))+I+1126891415)+T,C=N(15,17,C+(T^(v|~R))+F-1416354905)+v,R=N(21,11,R+(v^(C|~T))+M-57434055)+C,T=N(6,26,T+(C^(R|~v))+A+1700485571)+R,v=N(10,22,v+(R^(T|~C))+b-1894986606)+T,C=N(15,17,C+(T^(v|~R))+g-1051523)+v,R=N(21,11,R+(v^(C|~T))+p-2054922799)+C,T=N(6,26,T+(C^(R|~v))+O+1873313359)+R,v=N(10,22,v+(R^(T|~C))+k-30611744)+T,C=N(15,17,C+(T^(v|~R))+y-1560198380)+v,R=N(21,11,R+(v^(C|~T))+E+1309151649)+C,T=N(6,26,T+(C^(R|~v))+D-145523070)+R,v=N(10,22,v+(R^(T|~C))+_-1120210379)+T,C=N(15,17,C+(T^(v|~R))+S+718787259)+v,R=N(21,11,R+(v^(C|~T))+P-343485551)+C,j=j+16,T=T+U>>>0,R=R+L>>>0,C=C+G>>>0,v=v+it>>>0);return Nt.endian([T,R,C,v]);function N(ot,tn,Rt){return Rt<<ot|Rt>>>tn}function Yl(ot,tn){for(var Rt=-1,hi=Math.floor((ot.length-1)/4),ft=0,cs,fs,ls,hs;hi-8>Rt++;)ft=Rt<<2,tn[Rt]=ot[ft+0]|ot[ft+1]<<8|ot[ft+2]<<16|ot[ft+3]<<24;for(Rt--;hi>Rt++;)ft=Rt<<2,cs=typeof ot[ft+0]>"u"?0:ot[ft+0],fs=typeof ot[ft+1]>"u"?0:ot[ft+1],ls=typeof ot[ft+2]>"u"?0:ot[ft+2],hs=typeof ot[ft+3]>"u"?0:ot[ft+3],tn[Rt]=cs|fs<<8|ls<<16|hs<<24;return hi+1}};return function(m,x,p,S){var b;return e=x.loops,t=x.loop,r=x.getA,i=x.getB,s=x.getC,f=x.getD,l=x.getX,n=x.setA,o=x.setB,a=x.setC,c=x.setD,u=x.setX,d=p,b=Nt.wordsToBytes(h(m)),S&&S.asBytes?b:Nt.bytesconvertNumberToHex(b)}}function ju(){var t=function(e,r){var n,i,o,s,a,f,c,l,u,d,h,m,x,p,S,b,D,M,y,I,O,P=new Date().getTime(),g=1732584193,_=-271733879,A=-1732584194,E=271733878,F=e.length*8;O=Nt.bytesToWords(e);for(var k=0;k<O.length;k++)O[k]=(O[k]<<8|O[k]>>>24)&16711935|(O[k]<<24|O[k]>>>8)&4278255360;O[F>>>5]|=128<<F%32,O[(F+64>>>9<<4)+14]=F;for(var U=0;U<O.length;U+=16)D=g,M=_,y=A,I=E,n=O[U+0]>>>0,i=O[U+1]>>>0,o=O[U+2]>>>0,s=O[U+3]>>>0,a=O[U+4]>>>0,f=O[U+5]>>>0,c=O[U+6]>>>0,l=O[U+7]>>>0,u=O[U+8]>>>0,d=O[U+9]>>>0,h=O[U+10]>>>0,m=O[U+11]>>>0,x=O[U+12]>>>0,p=O[U+13]>>>0,S=O[U+14]>>>0,b=O[U+15]>>>0,g=L(7,25,g+(_&A|~_&E)+n-680876936)+_,E=L(12,20,E+(g&_|~g&A)+i-389564586)+g,A=L(17,15,A+(E&g|~E&_)+o+606105819)+E,_=L(22,10,_+(A&E|~A&g)+s-1044525330)+A,g=L(7,25,g+(_&A|~_&E)+a-176418897)+_,E=L(12,20,E+(g&_|~g&A)+f+1200080426)+g,A=L(17,15,A+(E&g|~E&_)+c-1473231341)+E,_=L(22,10,_+(A&E|~A&g)+l-45705983)+A,g=L(7,25,g+(_&A|~_&E)+u+1770035416)+_,E=L(12,20,E+(g&_|~g&A)+d-1958414417)+g,A=L(17,15,A+(E&g|~E&_)+h-42063)+E,_=L(22,10,_+(A&E|~A&g)+m-1990404162)+A,g=L(7,25,g+(_&A|~_&E)+x+1804603682)+_,E=L(12,20,E+(g&_|~g&A)+p-40341101)+g,A=L(17,15,A+(E&g|~E&_)+S-1502002290)+E,_=L(22,10,_+(A&E|~A&g)+b+1236535329)+A,g=L(5,27,g+(_&E|A&~E)+i-165796510)+_,E=L(9,23,E+(g&A|_&~A)+c-1069501632)+g,A=L(14,18,A+(E&_|g&~_)+m+643717713)+E,_=L(20,12,_+(A&g|E&~g)+n-373897302)+A,g=L(5,27,g+(_&E|A&~E)+f-701558691)+_,E=L(9,23,E+(g&A|_&~A)+h+38016083)+g,A=L(14,18,A+(E&_|g&~_)+b-660478335)+E,_=L(20,12,_+(A&g|E&~g)+a-405537848)+A,g=L(5,27,g+(_&E|A&~E)+d+568446438)+_,E=L(9,23,E+(g&A|_&~A)+S-1019803690)+g,A=L(14,18,A+(E&_|g&~_)+s-187363961)+E,_=L(20,12,_+(A&g|E&~g)+u+1163531501)+A,g=L(5,27,g+(_&E|A&~E)+p-1444681467)+_,E=L(9,23,E+(g&A|_&~A)+o-51403784)+g,A=L(14,18,A+(E&_|g&~_)+l+1735328473)+E,_=L(20,12,_+(A&g|E&~g)+x-1926607734)+A,g=L(4,28,g+(_^A^E)+f-378558)+_,E=L(11,21,E+(g^_^A)+u-2022574463)+g,A=L(16,16,A+(E^g^_)+m+1839030562)+E,_=L(23,9,_+(A^E^g)+S-35309556)+A,g=L(4,28,g+(_^A^E)+i-1530992060)+_,E=L(11,21,E+(g^_^A)+a+1272893353)+g,A=L(16,16,A+(E^g^_)+l-155497632)+E,_=L(23,9,_+(A^E^g)+h-1094730640)+A,g=L(4,28,g+(_^A^E)+p+681279174)+_,E=L(11,21,E+(g^_^A)+n-358537222)+g,A=L(16,16,A+(E^g^_)+s-722521979)+E,_=L(23,9,_+(A^E^g)+c+76029189)+A,g=L(4,28,g+(_^A^E)+d-640364487)+_,E=L(11,21,E+(g^_^A)+x-421815835)+g,A=L(16,16,A+(E^g^_)+b+530742520)+E,_=L(23,9,_+(A^E^g)+o-995338651)+A,g=L(6,26,g+(A^(_|~E))+n-198630844)+_,E=L(10,22,E+(_^(g|~A))+l+1126891415)+g,A=L(15,17,A+(g^(E|~_))+S-1416354905)+E,_=L(21,11,_+(E^(A|~g))+f-57434055)+A,g=L(6,26,g+(A^(_|~E))+x+1700485571)+_,E=L(10,22,E+(_^(g|~A))+s-1894986606)+g,A=L(15,17,A+(g^(E|~_))+h-1051523)+E,_=L(21,11,_+(E^(A|~g))+i-2054922799)+A,g=L(6,26,g+(A^(_|~E))+u+1873313359)+_,E=L(10,22,E+(_^(g|~A))+b-30611744)+g,A=L(15,17,A+(g^(E|~_))+c-1560198380)+E,_=L(21,11,_+(E^(A|~g))+p+1309151649)+A,g=L(6,26,g+(A^(_|~E))+a-145523070)+_,E=L(10,22,E+(_^(g|~A))+m-1120210379)+g,A=L(15,17,A+(g^(E|~_))+o+718787259)+E,_=L(21,11,_+(E^(A|~g))+d-343485551)+A,g=g+D>>>0,_=_+M>>>0,A=A+y>>>0,E=E+I>>>0;return Nt.endian([g,_,A,E]);function L(G,it,W){return W<<G|W>>>it}};return function(e,r){var n=Nt.wordsToBytes(t(e,r)),i=r&&r.asBytes?n:Nt.bytesconvertNumberToHex(n);return i}}function Yu(t){var e,r,n,i=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>i++;)n[i]=t.charCodeAt(i);return n}function Ju(t){return Buffer.from(t,"base64").toString("binary")}function Vc(t){return t}function $u(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return Nt.rotl(e,8)&16711935|Nt.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=Nt.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,i=0;n<e.length;n++,i+=8)r[i>>>5]|=e[n]<<24-i%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 Xn{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let i=await new Promise((o,s)=>bo(e).then(o).catch(s));return zc(i,r)}};var Vn=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){nr(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 ir(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var Te=Ct(Ol(),1),jt=Ct(Bl(),1);var Re=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 Oe(jt.default.gzip)(e):await Oe(jt.default.deflate)(e);return De(r)}return this.compressSync(e)}async decompress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Oe(jt.default.gunzip)(e):await Oe(jt.default.inflate)(e);return De(r)}return this.decompressSync(e)}compressSync(e){if(!xt&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?jt.default.gzipSync(e):jt.default.deflateSync(e);return De(o)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?Te.default.deflateRaw:Te.default.deflate)(n,r).buffer}decompressSync(e){if(!xt&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?jt.default.gunzipSync(e):jt.default.inflateSync(e);return De(o)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?Te.default.inflateRaw:Te.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new Te.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new Te.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 s of r){let a=new Uint8Array(s);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=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 Kr=class extends Re{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}};var Wm={0:async t=>t,8:async t=>await new Re({raw:!0}).decompress(t)},ai=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!xt)this.fileProvider=new sr(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):xi(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=Ve(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 i=await this.getCDFileHeader(e),o=await _e(i.localHeaderOffset,this.fileProvider);if(!o)throw new Error("Local file header has not been found in the zip archive`");let s=Wm[o.compressionMethod.toString()];if(!s)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(o.fileDataOffset,o.fileDataOffset+o.compressedSize);r=await s(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=Ve(this.fileProvider),n=null;for await(let i of r)if(i.fileName===e){n=i;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 ai(this.fileProvider).fetch(e)).arrayBuffer()}};function os(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let i=e.getBigUint64(n+16,!0),o=Zm(t,n,16);r[o]=i}return r}function Zm(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function ss(t){let e=Ve(t);return Qm(e)}async function Qm(t){let e=new xe,r=new TextEncoder,n={};for await(let i of t){let o=i.fileName.split("\\").join("/").toLocaleLowerCase(),s=r.encode(o).buffer,a=await e.hash(s,"hex");n[a]=i.localHeaderOffset}return n}var Km=[{test:/^$/,extensions:["3dSceneLayer.json.gz"]},{test:/^nodepages\/\d+$/,extensions:[".json.gz"]},{test:/^nodes\/(\d+|root)$/,extensions:["/3dNodeIndexDocument.json.gz"]},{test:/^nodes\/\d+\/textures\/.+$/,extensions:[".jpg",".png",".bin.dds.gz",".ktx"]},{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+$/,extensions:[".json.gz"]},{test:/^nodes\/\d+\/shared$/,extensions:["/sharedResource.json.gz"]}],er=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=Km.find(i=>i.test.test(e))?.extensions;if(n){let i;for(let o of n)if(i=await this.getDataByPath(`${e}${o}`),i)break;if(i)return i}}if(r==="raw"){let n=await this.getDataByPath(`${e}.gz`);if(n)return n;let i=await this.getFileBytes(e);if(i)return i}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 Kr().decompress(r):r}async getFileBytes(e){let r;if(this.hashTable){let n=this._textEncoder.encode(e),i=await this._md5Hash.hash(n.buffer,"hex"),o=this.hashTable[i];if(o===void 0)return;let s=await _e(o,this.fileProvider);if(!s)return;r=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize)}else try{r=await this.getFileWithoutHash(e)}catch{r=void 0}return r}};async function ci(t,e,r){let n=await Ir(t,Or),i=await Dr(n,t),o;if(i?.fileName!=="@specialIndexFileHASH128@")o=await ss(t),e?.("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await _e(i.localHeaderOffset,t);if(!s)throw new Error("corrupted SLPK");let a=s.fileDataOffset,f=await t.slice(a,a+s.compressedSize);o=os(f)}return new er(t,o,r)}var jm="4.3.0-alpha.1",Pl={dataType:null,batchType:null,name:"I3S SLPK (Scene Layer Package)",id:"slpk",module:"i3s",version:jm,mimeTypes:["application/octet-stream"],extensions:["slpk"],options:{},parse:async(t,e={})=>(await ci(new de(new DataView(t)))).getFile(e.slpk?.path??"",e.slpk?.pathMode)};var Fl=Ct(Ht(),1);function Nl(t,e){let{attributeName:r,attributeType:n}=e;return r?{[r]:n?Ym(n,t):null}:{}}function Ym(t,e){switch(t){case Sa:return t_(e);case ya:return Ll(e);case wa:return $m(e);case ba:return Jm(e);default:return Ll(e)}}function Ll(t){return new Uint32Array(t,4)}function Jm(t){return new Int16Array(t,4)}function $m(t){return new Float64Array(t,8)}function t_(t){let i=[];try{let o=new DataView(t,0,4).getUint32(0,!0),s=new Uint32Array(t,8,o),a=8+o*4;for(let f of s){let c=new TextDecoder("utf-8"),l=new Uint8Array(t,a,f);i.push(c.decode(l)),a+=f}}catch(o){console.error("Parse string attribute error: ",o.message)}return i}var e_="4.3.0-alpha.1",kl="",r_="rejected",jr={dataType:null,batchType:null,name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:e_,mimeTypes:["application/binary"],parse:async(t,e)=>Nl(t,e),extensions:["bin"],options:{},binary:!0};async function Ul(t,e,r={}){let{attributeStorageInfo:n,attributeUrls:i,tilesetFields:o}=n_(t);if(!n||!i||e<0)return null;let s=[],a=[];for(let f=0;f<n.length;f++){let c=Lt(i[f],r.i3s?.token),l=n[f].name,u=as(n[f]),d={...r,attributeName:l,attributeType:u},h=(0,Fl.load)(c,jr,d);a.push(h)}try{s=await Promise.allSettled(a)}catch{}return s.length?o_(s,n,e,o):null}function n_(t){let e=t.tileset?.tileset?.attributeStorageInfo,r=t.header?.attributeUrls,n=t.tileset?.tileset?.fields||[];return{attributeStorageInfo:e,attributeUrls:r,tilesetFields:n}}function as(t){return t.hasOwnProperty("objectIds")?"Oid32":t.hasOwnProperty("attributeValues")?t.attributeValues.valueType:""}function i_(t){return t.find(r=>r.name.includes("OBJECTID"))?.name}function o_(t,e,r,n){let i=i_(e),o=t.find(a=>a.value[i]);if(!o)return null;let s=o.value[i].indexOf(r);return s<0?null:s_(t,s,e,n)}function s_(t,e,r,n){let i={};for(let o=0;o<r.length;o++){let s=r[o].name,a=a_(s,n),f=c_(t,o,s);i[s]=f_(f,e,a)}return i}function a_(t,e){return e.find(n=>n.name===t||n.alias===t)?.domain?.codedValues||[]}function c_(t,e,r){let n=t[e];return n.status===r_?null:n.value[r]}function f_(t,e,r){let n=kl;return t&&e in t&&(n=String(t[e]).replace(/\u0000|NaN/g,"").trim()),r.length&&(n=r.find(o=>o.code===Number(n))?.name||kl),n}var l_="3DObject";async function zl(t,e){let r=JSON.parse(new TextDecoder().decode(t)),{sublayers:n}=r;return{header:r,sublayers:Gl(n,e)}}function Gl(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],{id:o,layerType:s,visibility:a=!0,...f}=i;if(s===l_){let c=`${e}/sublayers/${o}`;r.push({url:c,id:o,layerType:s,visibility:a,...f})}i?.sublayers?.length&&(r=[...r,...Gl(i.sublayers,e)])}return r}var h_="4.3.0-alpha.1",Hl={dataType:null,batchType:null,name:"I3S Building Scene Layer",id:"i3s-building-scene-layer",module:"i3s",version:h_,mimeTypes:["application/json"],parse:d_,extensions:["json"],options:{}};async function d_(t,e,r){if(!r?.url)throw new Error("Url is not provided");return zl(t,r.url)}var fi=Ct(Ht(),1),u_=4326,p_="ArcGISSceneServiceLayer",m_="BuildingSceneLayer",__="IntegratedMeshLayer",Xl="GroupLayer",x_=[p_,__,m_,Xl],g_="NO_AVAILABLE_SUPPORTED_LAYERS_ERROR",A_="NOT_SUPPORTED_CRS_ERROR",Yr=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:i}=await ql(r,!0);if(!n.length)throw new Yr(g_,i);return{header:e,layers:n,unsupportedLayers:i}}async function ql(t,e){let r=[],n=[];for(let i=0;i<t.length;i++){let o=t[i];if(x_.includes(o.layerType)?(e&&o.layerType!==Xl&&(await E_(o),e=!1),r.push(o)):n.push(o),o.layers?.length){let{layers:a,unsupportedLayers:f}=await ql(o.layers,e);o.layers=a,n=[...n,...f]}}return{layers:r,unsupportedLayers:n}}async function E_(t){try{if((await(0,fi.load)(t.url,fi.JSONLoader))?.spatialReference?.wkid!==u_)throw new Error(A_)}catch(e){throw e}}var S_="4.3.0-alpha.1",Wl={dataType:null,batchType:null,name:"ArcGIS Web Scene Loader",id:"arcgis-web-scene",module:"i3s",version:S_,mimeTypes:["application/json"],parse:y_,extensions:["json"],options:{}};async function y_(t){return Vl(t)}var Ql=Ct(Ht(),1);async function Kl(t,e,r,n,i,o,s){if(!o)return t;let a={...t,value:new Uint8Array(t.value)},f=n.find(({name:h})=>h===o?.attributeName);if(!f||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(f.type))return t;let c=await Zl(f.name,r,i,s);if(!c)return t;let l=n.find(({type:h})=>h==="esriFieldTypeOID");if(!l)return t;let u=await Zl(l.name,r,i,s);if(!u)return t;let d={};for(let h=0;h<u[l.name].length;h++)d[u[l.name][h]]=w_(c[f.name][h],o);for(let h=0;h<e.length;h++){let m=d[e[h]];m&&(o.mode==="multiply"?m.forEach((x,p)=>{a.value[h*4+p]=a.value[h*4+p]*x/255}):a.value.set(m,h*4))}return a}function w_(t,e){if(!e)return[255,255,255,255];let{minValue:r,maxValue:n,minColor:i,maxColor:o}=e,s=(t-r)/(n-r),a=[255,255,255,255];for(let f=0;f<i.length;f++)a[f]=Math.round((o[f]-i[f])*s+i[f]);return a}async function Zl(t,e,r,n){let i=r.findIndex(({name:f})=>t===f);if(i===-1)return null;let o=Lt(e[i],n),s=as(r[i]);return await(0,Ql.load)(o,jr,{attributeName:t,attributeType:s})}return n0(Jr);})();
7
+ "use strict";var __exports__=(()=>{var Jl=Object.create;var rn=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var t0=Object.getOwnPropertyNames;var e0=Object.getPrototypeOf,r0=Object.prototype.hasOwnProperty;var tt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nn=(t,e)=>{for(var r in e)rn(t,r,{get:e[r],enumerable:!0})},en=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of t0(e))!r0.call(t,i)&&i!==r&&rn(t,i,{get:()=>e[i],enumerable:!(n=$l(e,i))||n.enumerable});return t},on=(t,e,r)=>(en(t,e,"default"),r&&en(r,e,"default")),Ct=(t,e,r)=>(r=t!=null?Jl(e0(t)):{},en(e||!t||!t.__esModule?rn(r,"default",{value:t,enumerable:!0}):r,t)),n0=t=>en(rn({},"__esModule",{value:!0}),t);var Ht=tt((T_,ds)=>{ds.exports=globalThis.loaders});var qt=tt(at=>{"use strict";var tp=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function ep(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)ep(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 rp={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),i);return}for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){var e,r,n,i,o,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,i),i+=o.length;return s}},np={arraySet:function(t,e,r,n,i){for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};at.setTyped=function(t){t?(at.Buf8=Uint8Array,at.Buf16=Uint16Array,at.Buf32=Int32Array,at.assign(at,rp)):(at.Buf8=Array,at.Buf16=Array,at.Buf32=Array,at.assign(at,np))};at.setTyped(tp)});var pf=tt(Ze=>{"use strict";var ip=qt(),op=4,Wc=0,qc=1,sp=2;function qe(t){for(var e=t.length;--e>=0;)t[e]=0}var ap=0,Jc=1,cp=2,fp=3,lp=258,Do=29,Fr=256,Pr=Fr+1+Do,We=30,Oo=19,$c=2*Pr+1,ge=15,Mo=16,hp=7,Bo=256,tf=16,ef=17,rf=18,vo=[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],Wn=[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],dp=[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],up=512,Zt=new Array((Pr+2)*2);qe(Zt);var Br=new Array(We*2);qe(Br);var Lr=new Array(up);qe(Lr);var Nr=new Array(lp-fp+1);qe(Nr);var Po=new Array(Do);qe(Po);var qn=new Array(We);qe(qn);function To(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var of,sf,af;function Ro(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function cf(t){return t<256?Lr[t]:Lr[256+(t>>>7)]}function kr(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>Mo-r?(t.bi_buf|=e<<t.bi_valid&65535,kr(t,t.bi_buf),t.bi_buf=e>>Mo-t.bi_valid,t.bi_valid+=r-Mo):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function kt(t,e,r){ht(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 pp(t){t.bi_valid===16?(kr(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 mp(t,e){var r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,u,d,h,m,x=0;for(d=0;d<=ge;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<$c;c++)l=t.heap[c],d=r[r[l*2+1]*2+1]+1,d>f&&(d=f,x++),r[l*2+1]=d,!(l>n)&&(t.bl_count[d]++,h=0,l>=a&&(h=s[l-a]),m=r[l*2],t.opt_len+=m*(d+h),o&&(t.static_len+=m*(i[l*2+1]+h)));if(x!==0){do{for(d=f-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[f]--,x-=2}while(x>0);for(d=f;d!==0;d--)for(l=t.bl_count[d];l!==0;)u=t.heap[--c],!(u>n)&&(r[u*2+1]!==d&&(t.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),l--)}}function lf(t,e,r){var n=new Array(ge+1),i=0,o,s;for(o=1;o<=ge;o++)n[o]=i=i+r[o-1]<<1;for(s=0;s<=e;s++){var a=t[s*2+1];a!==0&&(t[s*2]=ff(n[a]++,a))}}function _p(){var t,e,r,n,i,o=new Array(ge+1);for(r=0,n=0;n<Do-1;n++)for(Po[n]=r,t=0;t<1<<vo[n];t++)Nr[r++]=n;for(Nr[r-1]=n,i=0,n=0;n<16;n++)for(qn[n]=i,t=0;t<1<<Wn[n];t++)Lr[i++]=n;for(i>>=7;n<We;n++)for(qn[n]=i<<7,t=0;t<1<<Wn[n]-7;t++)Lr[256+i++]=n;for(e=0;e<=ge;e++)o[e]=0;for(t=0;t<=143;)Zt[t*2+1]=8,t++,o[8]++;for(;t<=255;)Zt[t*2+1]=9,t++,o[9]++;for(;t<=279;)Zt[t*2+1]=7,t++,o[7]++;for(;t<=287;)Zt[t*2+1]=8,t++,o[8]++;for(lf(Zt,Pr+1,o),t=0;t<We;t++)Br[t*2+1]=5,Br[t*2]=ff(t,5);of=new To(Zt,vo,Fr+1,Pr,ge),sf=new To(Br,Wn,0,We,ge),af=new To(new Array(0),dp,0,Oo,hp)}function hf(t){var e;for(e=0;e<Pr;e++)t.dyn_ltree[e*2]=0;for(e=0;e<We;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Oo;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Bo*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function df(t){t.bi_valid>8?kr(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 xp(t,e,r,n){df(t),n&&(kr(t,r),kr(t,~r)),ip.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function Zc(t,e,r,n){var i=e*2,o=r*2;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]}function Co(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&Zc(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Zc(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function Qc(t,e,r){var n,i,o=0,s,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+o*2]<<8|t.pending_buf[t.d_buf+o*2+1],i=t.pending_buf[t.l_buf+o],o++,n===0?kt(t,i,e):(s=Nr[i],kt(t,s+Fr+1,e),a=vo[s],a!==0&&(i-=Po[s],ht(t,i,a)),n--,s=cf(n),kt(t,s,r),a=Wn[s],a!==0&&(n-=qn[s],ht(t,n,a)));while(o<t.last_lit);kt(t,Bo,e)}function Io(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems,s,a,f=-1,c;for(t.heap_len=0,t.heap_max=$c,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*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--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)Co(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Co(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[c*2]=r[s*2]+r[a*2],t.depth[c]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[s*2+1]=r[a*2+1]=c,t.heap[1]=c++,Co(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],mp(t,e),lf(r,f,t.bl_count)}function Kc(t,e,r){var n,i=-1,o,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)o=s,s=e[(n+1)*2+1],!(++a<f&&o===s)&&(a<c?t.bl_tree[o*2]+=a:o!==0?(o!==i&&t.bl_tree[o*2]++,t.bl_tree[tf*2]++):a<=10?t.bl_tree[ef*2]++:t.bl_tree[rf*2]++,a=0,i=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4))}function jc(t,e,r){var n,i=-1,o,s=e[0*2+1],a=0,f=7,c=4;for(s===0&&(f=138,c=3),n=0;n<=r;n++)if(o=s,s=e[(n+1)*2+1],!(++a<f&&o===s)){if(a<c)do kt(t,o,t.bl_tree);while(--a!==0);else o!==0?(o!==i&&(kt(t,o,t.bl_tree),a--),kt(t,tf,t.bl_tree),ht(t,a-3,2)):a<=10?(kt(t,ef,t.bl_tree),ht(t,a-3,3)):(kt(t,rf,t.bl_tree),ht(t,a-11,7));a=0,i=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4)}}function gp(t){var e;for(Kc(t,t.dyn_ltree,t.l_desc.max_code),Kc(t,t.dyn_dtree,t.d_desc.max_code),Io(t,t.bl_desc),e=Oo-1;e>=3&&t.bl_tree[nf[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function Ap(t,e,r,n){var i;for(ht(t,e-257,5),ht(t,r-1,5),ht(t,n-4,4),i=0;i<n;i++)ht(t,t.bl_tree[nf[i]*2+1],3);jc(t,t.dyn_ltree,e-1),jc(t,t.dyn_dtree,r-1)}function Ep(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Wc;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return qc;for(r=32;r<Fr;r++)if(t.dyn_ltree[r*2]!==0)return qc;return Wc}var Yc=!1;function Sp(t){Yc||(_p(),Yc=!0),t.l_desc=new Ro(t.dyn_ltree,of),t.d_desc=new Ro(t.dyn_dtree,sf),t.bl_desc=new Ro(t.bl_tree,af),t.bi_buf=0,t.bi_valid=0,hf(t)}function uf(t,e,r,n){ht(t,(ap<<1)+(n?1:0),3),xp(t,e,r,!0)}function yp(t){ht(t,Jc<<1,3),kt(t,Bo,Zt),pp(t)}function wp(t,e,r,n){var i,o,s=0;t.level>0?(t.strm.data_type===sp&&(t.strm.data_type=Ep(t)),Io(t,t.l_desc),Io(t,t.d_desc),s=gp(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&e!==-1?uf(t,e,r,n):t.strategy===op||o===i?(ht(t,(Jc<<1)+(n?1:0),3),Qc(t,Zt,Br)):(ht(t,(cp<<1)+(n?1:0),3),Ap(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Qc(t,t.dyn_ltree,t.dyn_dtree)),hf(t),n&&df(t)}function bp(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[(Nr[r]+Fr+1)*2]++,t.dyn_dtree[cf(e)*2]++),t.last_lit===t.lit_bufsize-1}Ze._tr_init=Sp;Ze._tr_stored_block=uf;Ze._tr_flush_block=wp;Ze._tr_tally=bp;Ze._tr_align=yp});var Lo=tt((lw,mf)=>{"use strict";function Mp(t,e,r,n){for(var i=t&65535|0,o=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do i=i+e[n++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}mf.exports=Mp});var No=tt((hw,_f)=>{"use strict";function Tp(){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 Rp=Tp();function Cp(t,e,r,n){var i=Rp,o=n+r;t^=-1;for(var s=n;s<o;s++)t=t>>>8^i[(t^e[s])&255];return t^-1}_f.exports=Cp});var Zn=tt((dw,xf)=>{"use strict";xf.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 Tf=tt(zt=>{"use strict";var ct=qt(),St=pf(),Sf=Lo(),oe=No(),vp=Zn(),ye=0,Ip=1,Dp=3,le=4,gf=5,Ut=0,Af=1,yt=-2,Op=-3,ko=-5,Bp=-1,Pp=1,Qn=2,Lp=3,Np=4,kp=0,Fp=2,Jn=8,Up=9,zp=15,Gp=8,Hp=29,Xp=256,Uo=Xp+1+Hp,Vp=30,Wp=19,qp=2*Uo+1,Zp=15,z=3,ce=258,Mt=ce+z+1,Qp=32,$n=42,zo=69,Kn=73,jn=91,Yn=103,Ae=113,zr=666,$=1,Gr=2,Ee=3,je=4,Kp=3;function fe(t,e){return t.msg=vp[e],e}function Ef(t){return(t<<1)-(t>4?9:0)}function ae(t){for(var e=t.length;--e>=0;)t[e]=0}function se(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 nt(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,se(t.strm)}function X(t,e){t.pending_buf[t.pending++]=e}function Ur(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function jp(t,e,r,n){var i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,ct.arraySet(e,t.input,t.next_in,i,r),t.state.wrap===1?t.adler=Sf(t.adler,e,i,r):t.state.wrap===2&&(t.adler=oe(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)}function yf(t,e){var r=t.max_chain_length,n=t.strstart,i,o,s=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-Mt?t.strstart-(t.w_size-Mt):0,c=t.window,l=t.w_mask,u=t.prev,d=t.strstart+ce,h=c[n+s-1],m=c[n+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(c[i+s]!==m||c[i+s-1]!==h||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<d);if(o=ce-(d-n),n=d-ce,o>s){if(t.match_start=e,s=o,o>=a)break;h=c[n+s-1],m=c[n+s]}}while((e=u[e&l])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}function Se(t){var e=t.w_size,r,n,i,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Mt)){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 i=t.head[--r],t.head[r]=i>=e?i-e:0;while(--n);n=e,r=n;do i=t.prev[--r],t.prev[r]=i>=e?i-e:0;while(--n);o+=e}if(t.strm.avail_in===0)break;if(n=jp(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=n,t.lookahead+t.insert>=z)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+z-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<z)););}while(t.lookahead<Mt&&t.strm.avail_in!==0)}function Yp(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Se(t),t.lookahead===0&&e===ye)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,nt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Mt&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):(t.strstart>t.block_start&&(nt(t,!1),t.strm.avail_out===0),$)}function Fo(t,e){for(var r,n;;){if(t.lookahead<Mt){if(Se(t),t.lookahead<Mt&&e===ye)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=z&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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-Mt&&(t.match_length=yf(t,r)),t.match_length>=z)if(n=St._tr_tally(t,t.strstart-t.match_start,t.match_length-z),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=z){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=t.strstart<z-1?t.strstart:z-1,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function Qe(t,e){for(var r,n,i;;){if(t.lookahead<Mt){if(Se(t),t.lookahead<Mt&&e===ye)return $;if(t.lookahead===0)break}if(r=0,t.lookahead>=z&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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=z-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Mt&&(t.match_length=yf(t,r),t.match_length<=5&&(t.strategy===Pp||t.match_length===z&&t.strstart-t.match_start>4096)&&(t.match_length=z-1)),t.prev_length>=z&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-z,n=St._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-z),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+z-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=z-1,t.strstart++,n&&(nt(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&&nt(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<z-1?t.strstart:z-1,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function Jp(t,e){for(var r,n,i,o,s=t.window;;){if(t.lookahead<=ce){if(Se(t),t.lookahead<=ce&&e===ye)return $;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=z&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=t.strstart+ce;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);t.match_length=ce-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=z?(r=St._tr_tally(t,1,t.match_length-z),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&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function $p(t,e){for(var r;;){if(t.lookahead===0&&(Se(t),t.lookahead===0)){if(e===ye)return $;break}if(t.match_length=0,r=St._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(nt(t,!1),t.strm.avail_out===0))return $}return t.insert=0,e===le?(nt(t,!0),t.strm.avail_out===0?Ee:je):t.last_lit&&(nt(t,!1),t.strm.avail_out===0)?$:Gr}function Ft(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var Ke;Ke=[new Ft(0,0,0,0,Yp),new Ft(4,4,8,4,Fo),new Ft(4,5,16,8,Fo),new Ft(4,6,32,32,Fo),new Ft(4,4,16,16,Qe),new Ft(8,16,32,32,Qe),new Ft(8,16,128,128,Qe),new Ft(8,32,128,256,Qe),new Ft(32,128,258,1024,Qe),new Ft(32,258,258,4096,Qe)];function tm(t){t.window_size=2*t.w_size,ae(t.head),t.max_lazy_match=Ke[t.level].max_lazy,t.good_match=Ke[t.level].good_length,t.nice_match=Ke[t.level].nice_length,t.max_chain_length=Ke[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=z-1,t.match_available=0,t.ins_h=0}function em(){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=Jn,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(qp*2),this.dyn_dtree=new ct.Buf16((2*Vp+1)*2),this.bl_tree=new ct.Buf16((2*Wp+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(Zp+1),this.heap=new ct.Buf16(2*Uo+1),ae(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ct.Buf16(2*Uo+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 wf(t){var e;return!t||!t.state?fe(t,yt):(t.total_in=t.total_out=0,t.data_type=Fp,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?$n:Ae,t.adler=e.wrap===2?0:1,e.last_flush=ye,St._tr_init(e),Ut)}function bf(t){var e=wf(t);return e===Ut&&tm(t.state),e}function rm(t,e){return!t||!t.state||t.state.wrap!==2?yt:(t.state.gzhead=e,Ut)}function Mf(t,e,r,n,i,o){if(!t)return yt;var s=1;if(e===Bp&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>Up||r!==Jn||n<8||n>15||e<0||e>9||o<0||o>Np)return fe(t,yt);n===8&&(n=9);var a=new em;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+z-1)/z),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<<i+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=o,a.method=r,bf(t)}function nm(t,e){return Mf(t,e,Jn,zp,Gp,kp)}function im(t,e){var r,n,i,o;if(!t||!t.state||e>gf||e<0)return t?fe(t,yt):yt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===zr&&e!==le)return fe(t,t.avail_out===0?ko:yt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===$n)if(n.wrap===2)t.adler=0,X(n,31),X(n,139),X(n,8),n.gzhead?(X(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)),X(n,n.gzhead.time&255),X(n,n.gzhead.time>>8&255),X(n,n.gzhead.time>>16&255),X(n,n.gzhead.time>>24&255),X(n,n.level===9?2:n.strategy>=Qn||n.level<2?4:0),X(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(X(n,n.gzhead.extra.length&255),X(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=oe(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=zo):(X(n,0),X(n,0),X(n,0),X(n,0),X(n,0),X(n,n.level===9?2:n.strategy>=Qn||n.level<2?4:0),X(n,Kp),n.status=Ae);else{var s=Jn+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Qn||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,s|=a<<6,n.strstart!==0&&(s|=Qp),s+=31-s%31,n.status=Ae,Ur(n,s),n.strstart!==0&&(Ur(n,t.adler>>>16),Ur(n,t.adler&65535)),t.adler=1}if(n.status===zo)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),se(t),i=n.pending,n.pending===n.pending_buf_size));)X(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Kn)}else n.status=Kn;if(n.status===Kn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),se(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,X(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=jn)}else n.status=jn;if(n.status===jn)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),se(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,X(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=oe(t.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=Yn)}else n.status=Yn;if(n.status===Yn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&se(t),n.pending+2<=n.pending_buf_size&&(X(n,t.adler&255),X(n,t.adler>>8&255),t.adler=0,n.status=Ae)):n.status=Ae),n.pending!==0){if(se(t),t.avail_out===0)return n.last_flush=-1,Ut}else if(t.avail_in===0&&Ef(e)<=Ef(r)&&e!==le)return fe(t,ko);if(n.status===zr&&t.avail_in!==0)return fe(t,ko);if(t.avail_in!==0||n.lookahead!==0||e!==ye&&n.status!==zr){var f=n.strategy===Qn?$p(n,e):n.strategy===Lp?Jp(n,e):Ke[n.level].func(n,e);if((f===Ee||f===je)&&(n.status=zr),f===$||f===Ee)return t.avail_out===0&&(n.last_flush=-1),Ut;if(f===Gr&&(e===Ip?St._tr_align(n):e!==gf&&(St._tr_stored_block(n,0,0,!1),e===Dp&&(ae(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),se(t),t.avail_out===0))return n.last_flush=-1,Ut}return e!==le?Ut:n.wrap<=0?Af:(n.wrap===2?(X(n,t.adler&255),X(n,t.adler>>8&255),X(n,t.adler>>16&255),X(n,t.adler>>24&255),X(n,t.total_in&255),X(n,t.total_in>>8&255),X(n,t.total_in>>16&255),X(n,t.total_in>>24&255)):(Ur(n,t.adler>>>16),Ur(n,t.adler&65535)),se(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ut:Af)}function om(t){var e;return!t||!t.state?yt:(e=t.state.status,e!==$n&&e!==zo&&e!==Kn&&e!==jn&&e!==Yn&&e!==Ae&&e!==zr?fe(t,yt):(t.state=null,e===Ae?fe(t,Op):Ut))}function sm(t,e){var r=e.length,n,i,o,s,a,f,c,l;if(!t||!t.state||(n=t.state,s=n.wrap,s===2||s===1&&n.status!==$n||n.lookahead))return yt;for(s===1&&(t.adler=Sf(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(s===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,Se(n);n.lookahead>=z;){i=n.strstart,o=n.lookahead-(z-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+z-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=z-1,Se(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=z-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=s,Ut}zt.deflateInit=nm;zt.deflateInit2=Mf;zt.deflateReset=bf;zt.deflateResetKeep=wf;zt.deflateSetHeader=rm;zt.deflate=im;zt.deflateEnd=om;zt.deflateSetDictionary=sm;zt.deflateInfo="pako deflate (from Nodeca project)"});var Go=tt(Ye=>{"use strict";var ti=qt(),Rf=!0,Cf=!0;try{String.fromCharCode.apply(null,[0])}catch{Rf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Cf=!1}var Hr=new ti.Buf8(256);for(Qt=0;Qt<256;Qt++)Hr[Qt]=Qt>=252?6:Qt>=248?5:Qt>=240?4:Qt>=224?3:Qt>=192?2:1;var Qt;Hr[254]=Hr[254]=1;Ye.string2buf=function(t){var e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<s&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new ti.Buf8(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<s&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e};function vf(t,e){if(e<65534&&(t.subarray&&Cf||!t.subarray&&Rf))return String.fromCharCode.apply(null,ti.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}Ye.buf2binstring=function(t){return vf(t,t.length)};Ye.binstring2buf=function(t){for(var e=new ti.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};Ye.buf2string=function(t,e){var r,n,i,o,s=e||t.length,a=new Array(s*2);for(n=0,r=0;r<s;){if(i=t[r++],i<128){a[n++]=i;continue}if(o=Hr[i],o>4){a[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<s;)i=i<<6|t[r++]&63,o--;if(o>1){a[n++]=65533;continue}i<65536?a[n++]=i:(i-=65536,a[n++]=55296|i>>10&1023,a[n++]=56320|i&1023)}return vf(a,n)};Ye.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 Ho=tt((mw,If)=>{"use strict";function am(){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}If.exports=am});var Pf=tt(Wr=>{"use strict";var Xr=Tf(),Vr=qt(),Vo=Go(),Wo=Zn(),cm=Ho(),Bf=Object.prototype.toString,fm=0,Xo=4,Je=0,Df=1,Of=2,lm=-1,hm=0,dm=8;function we(t){if(!(this instanceof we))return new we(t);this.options=Vr.assign({level:lm,method:dm,chunkSize:16384,windowBits:15,memLevel:8,strategy:hm,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 cm,this.strm.avail_out=0;var r=Xr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Je)throw new Error(Wo[r]);if(e.header&&Xr.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=Vo.string2buf(e.dictionary):Bf.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Xr.deflateSetDictionary(this.strm,n),r!==Je)throw new Error(Wo[r]);this._dict_set=!0}}we.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=e===~~e?e:e===!0?Xo:fm,typeof t=="string"?r.input=Vo.string2buf(t):Bf.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 Vr.Buf8(n),r.next_out=0,r.avail_out=n),i=Xr.deflate(r,o),i!==Df&&i!==Je)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Xo||o===Of))&&(this.options.to==="string"?this.onData(Vo.buf2binstring(Vr.shrinkBuf(r.output,r.next_out))):this.onData(Vr.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==Df);return o===Xo?(i=Xr.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Je):(o===Of&&(this.onEnd(Je),r.avail_out=0),!0)};we.prototype.onData=function(t){this.chunks.push(t)};we.prototype.onEnd=function(t){t===Je&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Vr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function qo(t,e){var r=new we(e);if(r.push(t,!0),r.err)throw r.msg||Wo[r.err];return r.result}function um(t,e){return e=e||{},e.raw=!0,qo(t,e)}function pm(t,e){return e=e||{},e.gzip=!0,qo(t,e)}Wr.Deflate=we;Wr.deflate=qo;Wr.deflateRaw=um;Wr.gzip=pm});var Nf=tt((xw,Lf)=>{"use strict";var ei=30,mm=12;Lf.exports=function(e,r){var n,i,o,s,a,f,c,l,u,d,h,m,x,p,S,b,D,M,y,I,O,P,g,_,A;n=e.state,i=e.next_in,_=e.input,o=i+(e.avail_in-5),s=e.next_out,A=e.output,a=s-(r-e.avail_out),f=s+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,h=n.window,m=n.hold,x=n.bits,p=n.lencode,S=n.distcode,b=(1<<n.lenbits)-1,D=(1<<n.distbits)-1;t:do{x<15&&(m+=_[i++]<<x,x+=8,m+=_[i++]<<x,x+=8),M=p[m&b];e:for(;;){if(y=M>>>24,m>>>=y,x-=y,y=M>>>16&255,y===0)A[s++]=M&65535;else if(y&16){I=M&65535,y&=15,y&&(x<y&&(m+=_[i++]<<x,x+=8),I+=m&(1<<y)-1,m>>>=y,x-=y),x<15&&(m+=_[i++]<<x,x+=8,m+=_[i++]<<x,x+=8),M=S[m&D];r:for(;;){if(y=M>>>24,m>>>=y,x-=y,y=M>>>16&255,y&16){if(O=M&65535,y&=15,x<y&&(m+=_[i++]<<x,x+=8,x<y&&(m+=_[i++]<<x,x+=8)),O+=m&(1<<y)-1,O>c){e.msg="invalid distance too far back",n.mode=ei;break t}if(m>>>=y,x-=y,y=s-a,O>y){if(y=O-y,y>u&&n.sane){e.msg="invalid distance too far back",n.mode=ei;break t}if(P=0,g=h,d===0){if(P+=l-y,y<I){I-=y;do A[s++]=h[P++];while(--y);P=s-O,g=A}}else if(d<y){if(P+=l+d-y,y-=d,y<I){I-=y;do A[s++]=h[P++];while(--y);if(P=0,d<I){y=d,I-=y;do A[s++]=h[P++];while(--y);P=s-O,g=A}}}else if(P+=d-y,y<I){I-=y;do A[s++]=h[P++];while(--y);P=s-O,g=A}for(;I>2;)A[s++]=g[P++],A[s++]=g[P++],A[s++]=g[P++],I-=3;I&&(A[s++]=g[P++],I>1&&(A[s++]=g[P++]))}else{P=s-O;do A[s++]=A[P++],A[s++]=A[P++],A[s++]=A[P++],I-=3;while(I>2);I&&(A[s++]=A[P++],I>1&&(A[s++]=A[P++]))}}else if(y&64){e.msg="invalid distance code",n.mode=ei;break t}else{M=S[(M&65535)+(m&(1<<y)-1)];continue r}break}}else if(y&64)if(y&32){n.mode=mm;break t}else{e.msg="invalid literal/length code",n.mode=ei;break t}else{M=p[(M&65535)+(m&(1<<y)-1)];continue e}break}}while(i<o&&s<f);I=x>>3,i-=I,x-=I<<3,m&=(1<<x)-1,e.next_in=i,e.next_out=s,e.avail_in=i<o?5+(o-i):5-(i-o),e.avail_out=s<f?257+(f-s):257-(s-f),n.hold=m,n.bits=x}});var Xf=tt((gw,Hf)=>{"use strict";var kf=qt(),$e=15,Ff=852,Uf=592,zf=0,Zo=1,Gf=2,_m=[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],xm=[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],gm=[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],Am=[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];Hf.exports=function(e,r,n,i,o,s,a,f){var c=f.bits,l=0,u=0,d=0,h=0,m=0,x=0,p=0,S=0,b=0,D=0,M,y,I,O,P,g=null,_=0,A,E=new kf.Buf16($e+1),F=new kf.Buf16($e+1),k=null,U=0,L,G,it;for(l=0;l<=$e;l++)E[l]=0;for(u=0;u<i;u++)E[r[n+u]]++;for(m=c,h=$e;h>=1&&E[h]===0;h--);if(m>h&&(m=h),h===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,f.bits=1,0;for(d=1;d<h&&E[d]===0;d++);for(m<d&&(m=d),S=1,l=1;l<=$e;l++)if(S<<=1,S-=E[l],S<0)return-1;if(S>0&&(e===zf||h!==1))return-1;for(F[1]=0,l=1;l<$e;l++)F[l+1]=F[l]+E[l];for(u=0;u<i;u++)r[n+u]!==0&&(a[F[r[n+u]]++]=u);if(e===zf?(g=k=a,A=19):e===Zo?(g=_m,_-=257,k=xm,U-=257,A=256):(g=gm,k=Am,A=-1),D=0,u=0,l=d,P=s,x=m,p=0,I=-1,b=1<<m,O=b-1,e===Zo&&b>Ff||e===Gf&&b>Uf)return 1;for(;;){L=l-p,a[u]<A?(G=0,it=a[u]):a[u]>A?(G=k[U+a[u]],it=g[_+a[u]]):(G=32+64,it=0),M=1<<l-p,y=1<<x,d=y;do y-=M,o[P+(D>>p)+y]=L<<24|G<<16|it|0;while(y!==0);for(M=1<<l-1;D&M;)M>>=1;if(M!==0?(D&=M-1,D+=M):D=0,u++,--E[l]===0){if(l===h)break;l=r[n+a[u]]}if(l>m&&(D&O)!==I){for(p===0&&(p=m),P+=d,x=l-p,S=1<<x;x+p<h&&(S-=E[x+p],!(S<=0));)x++,S<<=1;if(b+=1<<x,e===Zo&&b>Ff||e===Gf&&b>Uf)return 1;I=D&O,o[I]=m<<24|x<<16|P-s|0}}return D!==0&&(o[P+D]=l-p<<24|64<<16|0),f.bits=m,0}});var bl=tt(Tt=>{"use strict";var _t=qt(),$o=Lo(),Gt=No(),Em=Nf(),qr=Xf(),Sm=0,ml=1,_l=2,Vf=4,ym=5,ri=6,be=0,wm=1,bm=2,wt=-2,xl=-3,ts=-4,Mm=-5,Wf=8,gl=1,qf=2,Zf=3,Qf=4,Kf=5,jf=6,Yf=7,Jf=8,$f=9,tl=10,oi=11,Kt=12,Qo=13,el=14,Ko=15,rl=16,nl=17,il=18,ol=19,ni=20,ii=21,sl=22,al=23,cl=24,fl=25,ll=26,jo=27,hl=28,dl=29,K=30,es=31,Tm=32,Rm=852,Cm=592,vm=15,Im=vm;function ul(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function Dm(){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 _t.Buf16(320),this.work=new _t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Al(t){var e;return!t||!t.state?wt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=gl,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new _t.Buf32(Rm),e.distcode=e.distdyn=new _t.Buf32(Cm),e.sane=1,e.back=-1,be)}function El(t){var e;return!t||!t.state?wt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Al(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))?wt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,El(t))}function yl(t,e){var r,n;return t?(n=new Dm,t.state=n,n.window=null,r=Sl(t,e),r!==be&&(t.state=null),r):wt}function Om(t){return yl(t,Im)}var pl=!0,Yo,Jo;function Bm(t){if(pl){var e;for(Yo=new _t.Buf32(512),Jo=new _t.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(ml,t.lens,0,288,Yo,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;qr(_l,t.lens,0,32,Jo,0,t.work,{bits:5}),pl=!1}t.lencode=Yo,t.lenbits=9,t.distcode=Jo,t.distbits=5}function wl(t,e,r,n){var i,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _t.Buf8(o.wsize)),n>=o.wsize?(_t.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),_t.arraySet(o.window,e,r-n,i,o.wnext),n-=i,n?(_t.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function Pm(t,e){var r,n,i,o,s,a,f,c,l,u,d,h,m,x,p=0,S,b,D,M,y,I,O,P,g=new _t.Buf8(4),_,A,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 wt;r=t.state,r.mode===Kt&&(r.mode=Qo),s=t.next_out,i=t.output,f=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,u=a,d=f,P=be;t:for(;;)switch(r.mode){case gl:if(r.wrap===0){r.mode=Qo;break}for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,2,0),c=0,l=0,r.mode=qf;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=K;break}if((c&15)!==Wf){t.msg="unknown compression method",r.mode=K;break}if(c>>>=4,l-=4,O=(c&15)+8,r.wbits===0)r.wbits=O;else if(O>r.wbits){t.msg="invalid window size",r.mode=K;break}r.dmax=1<<O,t.adler=r.check=1,r.mode=c&512?tl:Kt,c=0,l=0;break;case qf:for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Wf){t.msg="unknown compression method",r.mode=K;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=K;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,2,0)),c=0,l=0,r.mode=Zf;case Zf:for(;l<32;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,g[2]=c>>>16&255,g[3]=c>>>24&255,r.check=Gt(r.check,g,4,0)),c=0,l=0,r.mode=Qf;case Qf:for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,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[o++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(g[0]=c&255,g[1]=c>>>8&255,r.check=Gt(r.check,g,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&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_t.arraySet(r.head.extra,n,o,h,O)),r.flags&512&&(r.check=Gt(r.check,n,h,o)),a-=h,o+=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 O=n[o+h++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&h<a);if(r.flags&512&&(r.check=Gt(r.check,n,h,o)),a-=h,o+=h,O)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=Jf;case Jf:if(r.flags&4096){if(a===0)break t;h=0;do O=n[o+h++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&h<a);if(r.flags&512&&(r.check=Gt(r.check,n,h,o)),a-=h,o+=h,O)break t}else r.head&&(r.head.comment=null);r.mode=$f;case $f:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=K;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=Kt;break;case tl:for(;l<32;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}t.adler=r.check=ul(c),c=0,l=0,r.mode=oi;case oi:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=l,bm;t.adler=r.check=1,r.mode=Kt;case Kt:if(e===ym||e===ri)break t;case Qo:if(r.last){c>>>=l&7,l-=l&7,r.mode=jo;break}for(;l<3;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=el;break;case 1:if(Bm(r),r.mode=ni,e===ri){c>>>=2,l-=2;break t}break;case 2:r.mode=nl;break;case 3:t.msg="invalid block type",r.mode=K}c>>>=2,l-=2;break;case el:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=K;break}if(r.length=c&65535,c=0,l=0,r.mode=Ko,e===ri)break t;case Ko:r.mode=rl;case rl:if(h=r.length,h){if(h>a&&(h=a),h>f&&(h=f),h===0)break t;_t.arraySet(i,n,o,h,s),a-=h,o+=h,f-=h,s+=h,r.length-=h;break}r.mode=Kt;break;case nl:for(;l<14;){if(a===0)break t;a--,c+=n[o++]<<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=K;break}r.have=0,r.mode=il;case il:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[o++]<<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,_={bits:r.lenbits},P=qr(Sm,r.lens,0,19,r.lencode,0,r.work,_),r.lenbits=_.bits,P){t.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=ol;case ol:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,b=p>>>16&255,D=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(D<16)c>>>=S,l-=S,r.lens[r.have++]=D;else{if(D===16){for(A=S+2;l<A;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=K;break}O=r.lens[r.have-1],h=3+(c&3),c>>>=2,l-=2}else if(D===17){for(A=S+3;l<A;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=S,l-=S,O=0,h=3+(c&7),c>>>=3,l-=3}else{for(A=S+7;l<A;){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=S,l-=S,O=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=K;break}for(;h--;)r.lens[r.have++]=O}}if(r.mode===K)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,_={bits:r.lenbits},P=qr(ml,r.lens,0,r.nlen,r.lencode,0,r.work,_),r.lenbits=_.bits,P){t.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,_={bits:r.distbits},P=qr(_l,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,_),r.distbits=_.bits,P){t.msg="invalid distances set",r.mode=K;break}if(r.mode=ni,e===ri)break t;case ni:r.mode=ii;case ii:if(a>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=l,Em(t,d),s=t.next_out,i=t.output,f=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===Kt&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],S=p>>>24,b=p>>>16&255,D=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(b&&!(b&240)){for(M=S,y=b,I=D;p=r.lencode[I+((c&(1<<M+y)-1)>>M)],S=p>>>24,b=p>>>16&255,D=p&65535,!(M+S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=M,l-=M,r.back+=M}if(c>>>=S,l-=S,r.back+=S,r.length=D,b===0){r.mode=ll;break}if(b&32){r.back=-1,r.mode=Kt;break}if(b&64){t.msg="invalid literal/length code",r.mode=K;break}r.extra=b&15,r.mode=sl;case sl:if(r.extra){for(A=r.extra;l<A;){if(a===0)break t;a--,c+=n[o++]<<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,b=p>>>16&255,D=p&65535,!(S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}if(!(b&240)){for(M=S,y=b,I=D;p=r.distcode[I+((c&(1<<M+y)-1)>>M)],S=p>>>24,b=p>>>16&255,D=p&65535,!(M+S<=l);){if(a===0)break t;a--,c+=n[o++]<<l,l+=8}c>>>=M,l-=M,r.back+=M}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=K;break}r.offset=D,r.extra=b&15,r.mode=cl;case cl:if(r.extra){for(A=r.extra;l<A;){if(a===0)break t;a--,c+=n[o++]<<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=K;break}r.mode=fl;case fl:if(f===0)break t;if(h=d-f,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=K;break}h>r.wnext?(h-=r.wnext,m=r.wsize-h):m=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,m=s-r.offset,h=r.length;h>f&&(h=f),f-=h,r.length-=h;do i[s++]=x[m++];while(--h);r.length===0&&(r.mode=ii);break;case ll:if(f===0)break t;i[s++]=r.length,f--,r.mode=ii;break;case jo:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[o++]<<l,l+=8}if(d-=f,t.total_out+=d,r.total+=d,d&&(t.adler=r.check=r.flags?Gt(r.check,i,d,s-d):$o(r.check,i,d,s-d)),d=f,(r.flags?c:ul(c))!==r.check){t.msg="incorrect data check",r.mode=K;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[o++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=K;break}c=0,l=0}r.mode=dl;case dl:P=wm;break t;case K:P=xl;break t;case es:return ts;case Tm:default:return wt}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||d!==t.avail_out&&r.mode<K&&(r.mode<jo||e!==Vf))&&wl(t,t.output,t.next_out,d-t.avail_out)?(r.mode=es,ts):(u-=t.avail_in,d-=t.avail_out,t.total_in+=u,t.total_out+=d,r.total+=d,r.wrap&&d&&(t.adler=r.check=r.flags?Gt(r.check,i,d,t.next_out-d):$o(r.check,i,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Kt?128:0)+(r.mode===ni||r.mode===Ko?256:0),(u===0&&d===0||e===Vf)&&P===be&&(P=Mm),P)}function Lm(t){if(!t||!t.state)return wt;var e=t.state;return e.window&&(e.window=null),t.state=null,be}function Nm(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?wt:(r.head=e,e.done=!1,be)}function km(t,e){var r=e.length,n,i,o;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==oi)?wt:n.mode===oi&&(i=1,i=$o(i,e,r,0),i!==n.check)?xl:(o=wl(t,e,r,r),o?(n.mode=es,ts):(n.havedict=1,be))}Tt.inflateReset=El;Tt.inflateReset2=Sl;Tt.inflateResetKeep=Al;Tt.inflateInit=Om;Tt.inflateInit2=yl;Tt.inflate=Pm;Tt.inflateEnd=Lm;Tt.inflateGetHeader=Nm;Tt.inflateSetDictionary=km;Tt.inflateInfo="pako inflate (from Nodeca project)"});var rs=tt((Ew,Ml)=>{"use strict";Ml.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 Rl=tt((Sw,Tl)=>{"use strict";function Fm(){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}Tl.exports=Fm});var vl=tt(Qr=>{"use strict";var tr=bl(),Zr=qt(),si=Go(),Y=rs(),ns=Zn(),Um=Ho(),zm=Rl(),Cl=Object.prototype.toString;function Me(t){if(!(this instanceof Me))return new Me(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 Um,this.strm.avail_out=0;var r=tr.inflateInit2(this.strm,e.windowBits);if(r!==Y.Z_OK)throw new Error(ns[r]);if(this.header=new zm,tr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=si.string2buf(e.dictionary):Cl.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=tr.inflateSetDictionary(this.strm,e.dictionary),r!==Y.Z_OK)))throw new Error(ns[r])}Me.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,s,a,f,c,l=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof t=="string"?r.input=si.binstring2buf(t):Cl.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),o=tr.inflate(r,Y.Z_NO_FLUSH),o===Y.Z_NEED_DICT&&i&&(o=tr.inflateSetDictionary(this.strm,i)),o===Y.Z_BUF_ERROR&&l===!0&&(o=Y.Z_OK,l=!1),o!==Y.Z_STREAM_END&&o!==Y.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===Y.Z_STREAM_END||r.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=si.utf8border(r.output,r.next_out),f=r.next_out-a,c=si.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)&&o!==Y.Z_STREAM_END);return o===Y.Z_STREAM_END&&(s=Y.Z_FINISH),s===Y.Z_FINISH?(o=tr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Y.Z_OK):(s===Y.Z_SYNC_FLUSH&&(this.onEnd(Y.Z_OK),r.avail_out=0),!0)};Me.prototype.onData=function(t){this.chunks.push(t)};Me.prototype.onEnd=function(t){t===Y.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 is(t,e){var r=new Me(e);if(r.push(t,!0),r.err)throw r.msg||ns[r.err];return r.result}function Gm(t,e){return e=e||{},e.raw=!0,is(t,e)}Qr.Inflate=Me;Qr.inflate=is;Qr.inflateRaw=Gm;Qr.ungzip=is});var Ol=tt((ww,Dl)=>{"use strict";var Hm=qt().assign,Xm=Pf(),Vm=vl(),Wm=rs(),Il={};Hm(Il,Xm,Vm,Wm);Dl.exports=Il});var Bl=tt(()=>{});var Jr={};nn(Jr,{ArcGISWebSceneLoader:()=>ql,COORDINATE_SYSTEM:()=>Bt,I3SAttributeLoader:()=>jr,I3SBuildingSceneLayerLoader:()=>Hl,I3SContentLoader:()=>Nn,I3SLoader:()=>vr,I3SNodePageLoader:()=>zn,LayerError:()=>Yr,SLPKArchive:()=>er,SLPKLoader:()=>Pl,customizeColors:()=>Kl,loadFeatureAttributes:()=>Ul,parseSLPKArchive:()=>ci});on(Jr,Ct(Ht(),1));var i0={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},he={...i0,...o0};async function di(t,e,r,n){return n._parse(t,e,r,n)}function Yt(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var vt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},s0=vt.self||vt.window||vt.global||{},a0=vt.window||vt.self||vt.global||{},c0=vt.global||vt.self||vt.window||{},f0=vt.document||{};var xt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var us=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),l0=us&&parseFloat(us[1])||0;function Jt(t){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(t)}function ui(t,e){if(Jt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pi(t){var e=ui(t,"string");return Jt(e)==="symbol"?e:String(e)}function W(t,e,r){return e=pi(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function mi(t){return globalThis.loaders?.modules?.[t]||null}function h0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.2"),globalThis._loadersgl_.version}var ps=h0();function ms(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var It={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},H_=It.self||It.window||It.global||{},X_=It.window||It.self||It.global||{},V_=It.global||It.self||It.window||{},W_=It.document||{};var ve=typeof process!="object"||String(process)!=="[object process]"||process.browser,sn=typeof importScripts=="function",q_=typeof window<"u"&&typeof window.orientation<"u",_s=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Z_=_s&&parseFloat(_s[1])||0;var _i={};async function Dt(t,e=null,r={},n=null){return e&&(t=xs(t,e,r,n)),_i[t]=_i[t]||d0(t),await _i[t]}function xs(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let i=r.modules||{};return i[n]?i[n]:ve?r.CDN?(ms(r.CDN.startsWith("http")),`${r.CDN}/${e}@${ps}/dist/libs/${n}`):sn?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function d0(t){if(t.endsWith("wasm"))return await p0(t);if(!ve)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(sn)return importScripts(t);let e=await m0(t);return u0(e,t)}function u0(t,e){if(!ve){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(sn)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 p0(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return ve||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function m0(t){let{readFileAsText:e}=globalThis.loaders||{};return ve||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function $t(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),i=new Uint8Array(e);for(let o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}function Ie(...t){return gs(t)}function gs(t){let e=t.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(r),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n.buffer}async function ir(t){let e=[];for await(let r of t)e.push(r);return Ie(...e)}function As(t){return t&&typeof t=="object"&&t.isBuffer}function De(t){if(As(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 Oe(t){return e=>new Promise((r,n)=>t(e,(i,o)=>i?n(i):r(o)))}var or=new Error("Not implemented"),an=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 or}async write(e,r,n){throw or}async stat(){throw or}async truncate(e){throw or}async append(e){throw or}async close(){}};var xi=t=>t?.getUint8&&t?.slice&&t?.length;var sr=class{file;constructor(e,r=!1){this.file=new an(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 i=Number(n);return await this.file.read(e,i)}get length(){return this.file.bigsize}};var Be=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},de=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(Be(e))}async getUint16(e){return this.file.getUint16(Be(e),!0)}async getUint32(e){return this.file.getUint32(Be(e),!0)}async getBigUint64(e){return this.file.getBigUint64(Be(e),!0)}async slice(e,r){return this.file.buffer.slice(Be(e),Be(r))}get length(){return BigInt(this.file.byteLength)}};var _0=1/Math.PI*180,x0=1/180*Math.PI,g0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...g0}};var Z=globalThis.mathgl.config;function gi(t,{precision:e=Z.precision}={}){return t=A0(t),"".concat(parseFloat(t.toPrecision(e)))}function Ot(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ai(t){return Es(t)}function Ei(t){return Ss(t)}function Es(t,e){return ys(t,r=>r*x0,e)}function Ss(t,e){return ys(t,r=>r*_0,e)}function dt(t,e,r){let n=Z.EPSILON;r&&(Z.EPSILON=r);try{if(t===e)return!0;if(Ot(t)&&Ot(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!dt(t[i],e[i]))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)<=Z.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Z.EPSILON=n}}function A0(t){return Math.round(t/Z.EPSILON)*Z.EPSILON}function E0(t){return t.clone?t.clone():new Array(t.length)}function ys(t,e,r){if(Ot(t)){let n=t;r=r||E0(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof t=="number"?t:t[i];r[i]=e(o,i,r)}return r}return e(t)}function S0(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var te=class extends S0(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:Ot(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Z)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+gi(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(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 i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}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(Z.debug&&!this.validate())throw new Error("math.gl: ".concat(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 y0(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 H(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function ee(t,e,r=""){if(Z.debug&&!y0(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function et(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Pe=class extends te{get x(){return this[0]}set x(e){this[0]=H(e)}get y(){return this[1]}set y(e){this[1]=H(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 i=this[n]-e[n];r+=i*i}return H(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return H(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"),H(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 Q=typeof Float32Array<"u"?Float32Array:Array,ar=Math.random;function Le(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var Wx=Math.PI/180;function w0(){let t=new Q(2);return Q!=Float32Array&&(t[0]=0,t[1]=0),t}function ws(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function bs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var qx=function(){let t=w0();return function(e,r,n,i,o,s){let a,f;for(r||(r=2),n||(n=0),i?f=Math.min(i*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Ms(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function cn(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function Ts(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function Rs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3],t}function fn(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}var ke={};nn(ke,{add:()=>R0,angle:()=>Mi,bezier:()=>z0,ceil:()=>C0,clone:()=>b0,copy:()=>M0,create:()=>ln,cross:()=>ue,dist:()=>K0,distance:()=>Os,div:()=>Q0,divide:()=>Ds,dot:()=>cr,equals:()=>W0,exactEquals:()=>V0,floor:()=>v0,forEach:()=>J0,fromValues:()=>hn,hermite:()=>U0,inverse:()=>N0,len:()=>Ti,length:()=>Cs,lerp:()=>k0,max:()=>D0,min:()=>I0,mul:()=>Z0,multiply:()=>Is,negate:()=>L0,normalize:()=>Si,random:()=>G0,rotateX:()=>yi,rotateY:()=>wi,rotateZ:()=>bi,round:()=>O0,scale:()=>B0,scaleAndAdd:()=>P0,set:()=>T0,slerp:()=>F0,sqrDist:()=>j0,sqrLen:()=>Y0,squaredDistance:()=>Bs,squaredLength:()=>Ps,str:()=>X0,sub:()=>q0,subtract:()=>vs,transformMat3:()=>fr,transformMat4:()=>pe,transformQuat:()=>lr,zero:()=>H0});function ln(){let t=new Q(3);return Q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function b0(t){let e=new Q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Cs(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function hn(t,e,r){let n=new Q(3);return n[0]=t,n[1]=e,n[2]=r,n}function M0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function T0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function R0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function vs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Is(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Ds(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function C0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function v0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function I0(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 D0(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 O0(t,e){return t[0]=Le(e[0]),t[1]=Le(e[1]),t[2]=Le(e[2]),t}function B0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function P0(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 Os(t,e){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}function Bs(t,e){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function Ps(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function L0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function N0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Si(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function cr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ue(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],f=r[2];return t[0]=i*f-o*a,t[1]=o*s-n*f,t[2]=n*a-i*s,t}function k0(t,e,r,n){let i=e[0],o=e[1],s=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t}function F0(t,e,r,n){let i=Math.acos(Math.min(Math.max(cr(e,r),-1),1)),o=Math.sin(i),s=Math.sin((1-n)*i)/o,a=Math.sin(n*i)/o;return t[0]=s*e[0]+a*r[0],t[1]=s*e[1]+a*r[1],t[2]=s*e[2]+a*r[2],t}function U0(t,e,r,n,i,o){let s=o*o,a=s*(2*o-3)+1,f=s*(o-2)+o,c=s*(o-1),l=s*(3-2*o);return t[0]=e[0]*a+r[0]*f+n[0]*c+i[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+i[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+i[2]*l,t}function z0(t,e,r,n,i,o){let s=1-o,a=s*s,f=o*o,c=a*s,l=3*o*a,u=3*f*s,d=f*o;return t[0]=e[0]*c+r[0]*l+n[0]*u+i[0]*d,t[1]=e[1]*c+r[1]*l+n[1]*u+i[1]*d,t[2]=e[2]*c+r[2]*l+n[2]*u+i[2]*d,t}function G0(t,e){e=e===void 0?1:e;let r=ar()*2*Math.PI,n=ar()*2-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function pe(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function fr(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function lr(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],f=e[1],c=e[2],l=i*c-o*f,u=o*a-n*c,d=n*f-i*a,h=i*d-o*u,m=o*l-n*d,x=n*u-i*l,p=s*2;return l*=p,u*=p,d*=p,h*=2,m*=2,x*=2,t[0]=a+l+h,t[1]=f+u+m,t[2]=c+d+x,t}function yi(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function wi(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function bi(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Mi(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],f=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),c=f&&cr(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function H0(t){return t[0]=0,t[1]=0,t[2]=0,t}function X0(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function V0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function W0(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=1e-6*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=1e-6*Math.max(1,Math.abs(i),Math.abs(a))}var q0=vs,Z0=Is,Q0=Ds,K0=Os,j0=Bs,Ti=Cs,Y0=Ps,J0=function(){let t=ln();return function(e,r,n,i,o,s){let a,f;for(r||(r=3),n||(n=0),i?f=Math.min(i*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],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var Ri=[0,0,0],dn,B=class extends Pe{static get ZERO(){return dn||(dn=new B(0,0,0),Object.freeze(dn)),dn}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Ot(e)?this.copy(e):(Z.debug&&(H(e),H(r),H(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 Z.debug&&(H(e.x),H(e.y),H(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]=H(e)}angle(e){return Mi(this,e)}cross(e){return ue(this,this,e),this.check()}rotateX({radians:e,origin:r=Ri}){return yi(this,this,r,e),this.check()}rotateY({radians:e,origin:r=Ri}){return wi(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=Ri}){return bi(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return pe(this,this,e),this.check()}transformAsVector(e){return cn(this,this,e),this.check()}transformByMatrix3(e){return fr(this,this,e),this.check()}transformByMatrix2(e){return Ts(this,this,e),this.check()}transformByQuaternion(e){return lr(this,this,e),this.check()}};var un,Fe=class extends Pe{static get ZERO(){return un||(un=new Fe(0,0,0,0),Object.freeze(un)),un}constructor(e=0,r=0,n=0,i=0){super(-0,-0,-0,-0),Ot(e)&&arguments.length===1?this.copy(e):(Z.debug&&(H(e),H(r),H(n),H(i)),this[0]=e,this[1]=r,this[2]=n,this[3]=i)}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,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 Z.debug&&(H(e.x),H(e.y),H(e.z),H(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]=H(e)}get w(){return this[3]}set w(e){this[3]=H(e)}transform(e){return pe(this,this,e),this.check()}transformByMatrix3(e){return fn(this,this,e),this.check()}transformByMatrix2(e){return Rs(this,this,e),this.check()}transformByQuaternion(e){return lr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Ue=class extends te{toString(){let e="[";if(Z.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(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]=H(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function Ls(){let t=new Q(9);return Q!=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 Ns(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}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 ks(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],u=l*s-a*c,d=-l*o+a*f,h=c*o-s*f,m=r*u+n*d+i*h;return m?(m=1/m,t[0]=u*m,t[1]=(-l*n+i*c)*m,t[2]=(a*n-i*s)*m,t[3]=d*m,t[4]=(l*r-i*f)*m,t[5]=(-a*r+i*o)*m,t[6]=h*m,t[7]=(-c*r+n*f)*m,t[8]=(s*r-n*o)*m,t):null}function Fs(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],f=t[7],c=t[8];return e*(c*o-s*f)+r*(-c*i+s*a)+n*(f*i-o*a)}function Ci(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=r[0],h=r[1],m=r[2],x=r[3],p=r[4],S=r[5],b=r[6],D=r[7],M=r[8];return t[0]=d*n+h*s+m*c,t[1]=d*i+h*a+m*l,t[2]=d*o+h*f+m*u,t[3]=x*n+p*s+S*c,t[4]=x*i+p*a+S*l,t[5]=x*o+p*f+S*u,t[6]=b*n+D*s+M*c,t[7]=b*i+D*a+M*l,t[8]=b*o+D*f+M*u,t}function Us(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=r[0],h=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=f,t[6]=d*n+h*s+c,t[7]=d*i+h*a+l,t[8]=d*o+h*f+u,t}function zs(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=Math.sin(r),h=Math.cos(r);return t[0]=h*n+d*s,t[1]=h*i+d*a,t[2]=h*o+d*f,t[3]=h*s-d*n,t[4]=h*a-d*i,t[5]=h*f-d*o,t[6]=c,t[7]=l,t[8]=u,t}function vi(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Gs(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,f=i+i,c=r*s,l=n*s,u=n*a,d=i*s,h=i*a,m=i*f,x=o*s,p=o*a,S=o*f;return t[0]=1-u-m,t[3]=l-S,t[6]=d+p,t[1]=l+S,t[4]=1-c-m,t[7]=h-x,t[2]=d-p,t[5]=h+x,t[8]=1-c-u,t}var Ii;(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"})(Ii||(Ii={}));var th=Object.freeze([1,0,0,0,1,0,0,0,1]),J=class extends Ue{static get IDENTITY(){return rh()}static get ZERO(){return eh()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Ii}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(th)}fromObject(e){return this.check()}fromQuaternion(e){return Gs(this,e),this.check()}set(e,r,n,i,o,s,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,i,o,s,a,f,c){return this[0]=e,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=s,this[8]=c,this.check()}determinant(){return Fs(this)}transpose(){return Ns(this,this),this.check()}invert(){return ks(this,this),this.check()}multiplyLeft(e){return Ci(this,e,this),this.check()}multiplyRight(e){return Ci(this,this,e),this.check()}rotate(e){return zs(this,this,e),this.check()}scale(e){return Array.isArray(e)?vi(this,this,e):vi(this,this,[e,e]),this.check()}translate(e){return Us(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=ws(r||[-0,-0],e,this);break;case 3:n=fr(r||[-0,-0,-0],e,this);break;case 4:n=fn(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ee(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)}},pn,mn=null;function eh(){return pn||(pn=new J([0,0,0,0,0,0,0,0,0]),Object.freeze(pn)),pn}function rh(){return mn||(mn=new J,Object.freeze(mn)),mn}var _n={};nn(_n,{add:()=>Rh,adjoint:()=>ch,clone:()=>ih,copy:()=>oh,create:()=>nh,decompose:()=>gh,determinant:()=>Bi,equals:()=>Dh,exactEquals:()=>Ih,frob:()=>Th,fromQuat:()=>zi,fromQuat2:()=>mh,fromRotation:()=>hh,fromRotationTranslation:()=>Xs,fromRotationTranslationScale:()=>Ah,fromRotationTranslationScaleOrigin:()=>Eh,fromScaling:()=>lh,fromTranslation:()=>fh,fromValues:()=>sh,fromXRotation:()=>dh,fromYRotation:()=>uh,fromZRotation:()=>ph,frustum:()=>Gi,getRotation:()=>xh,getScaling:()=>Vs,getTranslation:()=>_h,identity:()=>Hs,invert:()=>Oi,lookAt:()=>Vi,mul:()=>Oh,multiply:()=>hr,multiplyScalar:()=>Ch,multiplyScalarAndAdd:()=>vh,ortho:()=>Xi,orthoNO:()=>qs,orthoZO:()=>wh,perspective:()=>Hi,perspectiveFromFieldOfView:()=>yh,perspectiveNO:()=>Ws,perspectiveZO:()=>Sh,rotate:()=>Ni,rotateX:()=>ki,rotateY:()=>Fi,rotateZ:()=>Ui,scale:()=>Li,set:()=>ah,str:()=>Mh,sub:()=>Bh,subtract:()=>Zs,targetTo:()=>bh,translate:()=>Pi,transpose:()=>Di});function nh(){let t=new Q(16);return Q!=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 ih(t){let e=new Q(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 oh(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 sh(t,e,r,n,i,o,s,a,f,c,l,u,d,h,m,x){let p=new Q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=i,p[5]=o,p[6]=s,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=u,p[12]=d,p[13]=h,p[14]=m,p[15]=x,p}function ah(t,e,r,n,i,o,s,a,f,c,l,u,d,h,m,x,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=u,t[11]=d,t[12]=h,t[13]=m,t[14]=x,t[15]=p,t}function Hs(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 Di(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=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]=o,t[11]=e[14],t[12]=i,t[13]=s,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 Oi(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],u=e[9],d=e[10],h=e[11],m=e[12],x=e[13],p=e[14],S=e[15],b=r*a-n*s,D=r*f-i*s,M=r*c-o*s,y=n*f-i*a,I=n*c-o*a,O=i*c-o*f,P=l*x-u*m,g=l*p-d*m,_=l*S-h*m,A=u*p-d*x,E=u*S-h*x,F=d*S-h*p,k=b*F-D*E+M*A+y*_-I*g+O*P;return k?(k=1/k,t[0]=(a*F-f*E+c*A)*k,t[1]=(i*E-n*F-o*A)*k,t[2]=(x*O-p*I+S*y)*k,t[3]=(d*I-u*O-h*y)*k,t[4]=(f*_-s*F-c*g)*k,t[5]=(r*F-i*_+o*g)*k,t[6]=(p*M-m*O-S*D)*k,t[7]=(l*O-d*M+h*D)*k,t[8]=(s*E-a*_+c*P)*k,t[9]=(n*_-r*E-o*P)*k,t[10]=(m*I-x*M+S*b)*k,t[11]=(u*M-l*I-h*b)*k,t[12]=(a*g-s*A-f*P)*k,t[13]=(r*A-n*g+i*P)*k,t[14]=(x*D-m*y-p*b)*k,t[15]=(l*y-u*D+d*b)*k,t):null}function ch(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],f=e[6],c=e[7],l=e[8],u=e[9],d=e[10],h=e[11],m=e[12],x=e[13],p=e[14],S=e[15],b=r*a-n*s,D=r*f-i*s,M=r*c-o*s,y=n*f-i*a,I=n*c-o*a,O=i*c-o*f,P=l*x-u*m,g=l*p-d*m,_=l*S-h*m,A=u*p-d*x,E=u*S-h*x,F=d*S-h*p;return t[0]=a*F-f*E+c*A,t[1]=i*E-n*F-o*A,t[2]=x*O-p*I+S*y,t[3]=d*I-u*O-h*y,t[4]=f*_-s*F-c*g,t[5]=r*F-i*_+o*g,t[6]=p*M-m*O-S*D,t[7]=l*O-d*M+h*D,t[8]=s*E-a*_+c*P,t[9]=n*_-r*E-o*P,t[10]=m*I-x*M+S*b,t[11]=u*M-l*I-h*b,t[12]=a*g-s*A-f*P,t[13]=r*A-n*g+i*P,t[14]=x*D-m*y-p*b,t[15]=l*y-u*D+d*b,t}function Bi(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],f=t[7],c=t[8],l=t[9],u=t[10],d=t[11],h=t[12],m=t[13],x=t[14],p=t[15],S=e*s-r*o,b=e*a-n*o,D=r*a-n*s,M=c*m-l*h,y=c*x-u*h,I=l*x-u*m,O=e*I-r*y+n*M,P=o*I-s*y+a*M,g=c*D-l*b+u*S,_=h*D-m*b+x*S;return f*O-i*P+p*g-d*_}function hr(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=e[8],d=e[9],h=e[10],m=e[11],x=e[12],p=e[13],S=e[14],b=e[15],D=r[0],M=r[1],y=r[2],I=r[3];return t[0]=D*n+M*a+y*u+I*x,t[1]=D*i+M*f+y*d+I*p,t[2]=D*o+M*c+y*h+I*S,t[3]=D*s+M*l+y*m+I*b,D=r[4],M=r[5],y=r[6],I=r[7],t[4]=D*n+M*a+y*u+I*x,t[5]=D*i+M*f+y*d+I*p,t[6]=D*o+M*c+y*h+I*S,t[7]=D*s+M*l+y*m+I*b,D=r[8],M=r[9],y=r[10],I=r[11],t[8]=D*n+M*a+y*u+I*x,t[9]=D*i+M*f+y*d+I*p,t[10]=D*o+M*c+y*h+I*S,t[11]=D*s+M*l+y*m+I*b,D=r[12],M=r[13],y=r[14],I=r[15],t[12]=D*n+M*a+y*u+I*x,t[13]=D*i+M*f+y*d+I*p,t[14]=D*o+M*c+y*h+I*S,t[15]=D*s+M*l+y*m+I*b,t}function Pi(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,f,c,l,u,d,h,m,x,p,S;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],f=e[2],c=e[3],l=e[4],u=e[5],d=e[6],h=e[7],m=e[8],x=e[9],p=e[10],S=e[11],t[0]=s,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=h,t[8]=m,t[9]=x,t[10]=p,t[11]=S,t[12]=s*n+l*i+m*o+e[12],t[13]=a*n+u*i+x*o+e[13],t[14]=f*n+d*i+p*o+e[14],t[15]=c*n+h*i+S*o+e[15]),t}function Li(t,e,r){let n=r[0],i=r[1],o=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]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ni(t,e,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),f,c,l,u,d,h,m,x,p,S,b,D,M,y,I,O,P,g,_,A,E,F,k,U;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,u=e[0],d=e[1],h=e[2],m=e[3],x=e[4],p=e[5],S=e[6],b=e[7],D=e[8],M=e[9],y=e[10],I=e[11],O=i*i*l+f,P=o*i*l+s*c,g=s*i*l-o*c,_=i*o*l-s*c,A=o*o*l+f,E=s*o*l+i*c,F=i*s*l+o*c,k=o*s*l-i*c,U=s*s*l+f,t[0]=u*O+x*P+D*g,t[1]=d*O+p*P+M*g,t[2]=h*O+S*P+y*g,t[3]=m*O+b*P+I*g,t[4]=u*_+x*A+D*E,t[5]=d*_+p*A+M*E,t[6]=h*_+S*A+y*E,t[7]=m*_+b*A+I*E,t[8]=u*F+x*k+D*U,t[9]=d*F+p*k+M*U,t[10]=h*F+S*k+y*U,t[11]=m*F+b*k+I*U,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function ki(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],f=e[7],c=e[8],l=e[9],u=e[10],d=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]=o*i+c*n,t[5]=s*i+l*n,t[6]=a*i+u*n,t[7]=f*i+d*n,t[8]=c*i-o*n,t[9]=l*i-s*n,t[10]=u*i-a*n,t[11]=d*i-f*n,t}function Fi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],f=e[3],c=e[8],l=e[9],u=e[10],d=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]=o*i-c*n,t[1]=s*i-l*n,t[2]=a*i-u*n,t[3]=f*i-d*n,t[8]=o*n+c*i,t[9]=s*n+l*i,t[10]=a*n+u*i,t[11]=f*n+d*i,t}function Ui(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],f=e[3],c=e[4],l=e[5],u=e[6],d=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]=o*i+c*n,t[1]=s*i+l*n,t[2]=a*i+u*n,t[3]=f*i+d*n,t[4]=c*i-o*n,t[5]=l*i-s*n,t[6]=u*i-a*n,t[7]=d*i-f*n,t}function fh(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 lh(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 hh(t,e,r){let n=r[0],i=r[1],o=r[2],s=Math.sqrt(n*n+i*i+o*o),a,f,c;return s<1e-6?null:(s=1/s,n*=s,i*=s,o*=s,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=i*n*c+o*f,t[2]=o*n*c-i*f,t[3]=0,t[4]=n*i*c-o*f,t[5]=i*i*c+a,t[6]=o*i*c+n*f,t[7]=0,t[8]=n*o*c+i*f,t[9]=i*o*c-n*f,t[10]=o*o*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function dh(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 uh(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 ph(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 Xs(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=n+n,f=i+i,c=o+o,l=n*a,u=n*f,d=n*c,h=i*f,m=i*c,x=o*c,p=s*a,S=s*f,b=s*c;return t[0]=1-(h+x),t[1]=u+b,t[2]=d-S,t[3]=0,t[4]=u-b,t[5]=1-(l+x),t[6]=m+p,t[7]=0,t[8]=d+S,t[9]=m-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 mh(t,e){let r=new Q(3),n=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],f=e[5],c=e[6],l=e[7],u=n*n+i*i+o*o+s*s;return u>0?(r[0]=(a*s+l*n+f*o-c*i)*2/u,r[1]=(f*s+l*i+c*n-a*o)*2/u,r[2]=(c*s+l*o+a*i-f*n)*2/u):(r[0]=(a*s+l*n+f*o-c*i)*2,r[1]=(f*s+l*i+c*n-a*o)*2,r[2]=(c*s+l*o+a*i-f*n)*2),Xs(t,e,r),t}function _h(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Vs(t,e){let r=e[0],n=e[1],i=e[2],o=e[4],s=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function xh(t,e){let r=new Q(3);Vs(r,e);let n=1/r[0],i=1/r[1],o=1/r[2],s=e[0]*n,a=e[1]*i,f=e[2]*o,c=e[4]*n,l=e[5]*i,u=e[6]*o,d=e[8]*n,h=e[9]*i,m=e[10]*o,x=s+l+m,p=0;return x>0?(p=Math.sqrt(x+1)*2,t[3]=.25*p,t[0]=(u-h)/p,t[1]=(d-f)/p,t[2]=(a-c)/p):s>l&&s>m?(p=Math.sqrt(1+s-l-m)*2,t[3]=(u-h)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(d+f)/p):l>m?(p=Math.sqrt(1+l-s-m)*2,t[3]=(d-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(u+h)/p):(p=Math.sqrt(1+m-s-l)*2,t[3]=(a-c)/p,t[0]=(d+f)/p,t[1]=(u+h)/p,t[2]=.25*p),t}function gh(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let i=n[0],o=n[1],s=n[2],a=n[4],f=n[5],c=n[6],l=n[8],u=n[9],d=n[10];r[0]=Math.sqrt(i*i+o*o+s*s),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+u*u+d*d);let h=1/r[0],m=1/r[1],x=1/r[2],p=i*h,S=o*m,b=s*x,D=a*h,M=f*m,y=c*x,I=l*h,O=u*m,P=d*x,g=p+M+P,_=0;return g>0?(_=Math.sqrt(g+1)*2,t[3]=.25*_,t[0]=(y-O)/_,t[1]=(I-b)/_,t[2]=(S-D)/_):p>M&&p>P?(_=Math.sqrt(1+p-M-P)*2,t[3]=(y-O)/_,t[0]=.25*_,t[1]=(S+D)/_,t[2]=(I+b)/_):M>P?(_=Math.sqrt(1+M-p-P)*2,t[3]=(I-b)/_,t[0]=(S+D)/_,t[1]=.25*_,t[2]=(y+O)/_):(_=Math.sqrt(1+P-p-M)*2,t[3]=(S-D)/_,t[0]=(I+b)/_,t[1]=(y+O)/_,t[2]=.25*_),t}function Ah(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],f=i+i,c=o+o,l=s+s,u=i*f,d=i*c,h=i*l,m=o*c,x=o*l,p=s*l,S=a*f,b=a*c,D=a*l,M=n[0],y=n[1],I=n[2];return t[0]=(1-(m+p))*M,t[1]=(d+D)*M,t[2]=(h-b)*M,t[3]=0,t[4]=(d-D)*y,t[5]=(1-(u+p))*y,t[6]=(x+S)*y,t[7]=0,t[8]=(h+b)*I,t[9]=(x-S)*I,t[10]=(1-(u+m))*I,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Eh(t,e,r,n,i){let o=e[0],s=e[1],a=e[2],f=e[3],c=o+o,l=s+s,u=a+a,d=o*c,h=o*l,m=o*u,x=s*l,p=s*u,S=a*u,b=f*c,D=f*l,M=f*u,y=n[0],I=n[1],O=n[2],P=i[0],g=i[1],_=i[2],A=(1-(x+S))*y,E=(h+M)*y,F=(m-D)*y,k=(h-M)*I,U=(1-(d+S))*I,L=(p+b)*I,G=(m+D)*O,it=(p-b)*O,q=(1-(d+x))*O;return t[0]=A,t[1]=E,t[2]=F,t[3]=0,t[4]=k,t[5]=U,t[6]=L,t[7]=0,t[8]=G,t[9]=it,t[10]=q,t[11]=0,t[12]=r[0]+P-(A*P+k*g+G*_),t[13]=r[1]+g-(E*P+U*g+it*_),t[14]=r[2]+_-(F*P+L*g+q*_),t[15]=1,t}function zi(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,f=i+i,c=r*s,l=n*s,u=n*a,d=i*s,h=i*a,m=i*f,x=o*s,p=o*a,S=o*f;return t[0]=1-u-m,t[1]=l+S,t[2]=d-p,t[3]=0,t[4]=l-S,t[5]=1-c-m,t[6]=h+x,t[7]=0,t[8]=d+p,t[9]=h-x,t[10]=1-c-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gi(t,e,r,n,i,o,s){let a=1/(r-e),f=1/(i-n),c=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*f,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t}function Ws(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}var Hi=Ws;function Sh(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=i*s,t[14]=i*n*s}else t[10]=-1,t[14]=-n;return t}function yh(t,e,r,n){let i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(s+a),c=2/(i+o);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]=-((s-a)*f*.5),t[9]=(i-o)*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 qs(t,e,r,n,i,o,s){let a=1/(e-r),f=1/(n-i),c=1/(o-s);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]=(i+n)*f,t[14]=(s+o)*c,t[15]=1,t}var Xi=qs;function wh(t,e,r,n,i,o,s){let a=1/(e-r),f=1/(n-i),c=1/(o-s);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]=(i+n)*f,t[14]=o*c,t[15]=1,t}function Vi(t,e,r,n){let i,o,s,a,f,c,l,u,d,h,m=e[0],x=e[1],p=e[2],S=n[0],b=n[1],D=n[2],M=r[0],y=r[1],I=r[2];return Math.abs(m-M)<1e-6&&Math.abs(x-y)<1e-6&&Math.abs(p-I)<1e-6?Hs(t):(u=m-M,d=x-y,h=p-I,i=1/Math.sqrt(u*u+d*d+h*h),u*=i,d*=i,h*=i,o=b*h-D*d,s=D*u-S*h,a=S*d-b*u,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),f=d*a-h*s,c=h*o-u*a,l=u*s-d*o,i=Math.sqrt(f*f+c*c+l*l),i?(i=1/i,f*=i,c*=i,l*=i):(f=0,c=0,l=0),t[0]=o,t[1]=f,t[2]=u,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(o*m+s*x+a*p),t[13]=-(f*m+c*x+l*p),t[14]=-(u*m+d*x+h*p),t[15]=1,t)}function bh(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=n[0],f=n[1],c=n[2],l=i-r[0],u=o-r[1],d=s-r[2],h=l*l+u*u+d*d;h>0&&(h=1/Math.sqrt(h),l*=h,u*=h,d*=h);let m=f*d-c*u,x=c*l-a*d,p=a*u-f*l;return h=m*m+x*x+p*p,h>0&&(h=1/Math.sqrt(h),m*=h,x*=h,p*=h),t[0]=m,t[1]=x,t[2]=p,t[3]=0,t[4]=u*p-d*x,t[5]=d*m-l*p,t[6]=l*x-u*m,t[7]=0,t[8]=l,t[9]=u,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t}function Mh(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function Th(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 Rh(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 Zs(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 Ch(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 vh(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 Ih(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 Dh(t,e){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],f=t[6],c=t[7],l=t[8],u=t[9],d=t[10],h=t[11],m=t[12],x=t[13],p=t[14],S=t[15],b=e[0],D=e[1],M=e[2],y=e[3],I=e[4],O=e[5],P=e[6],g=e[7],_=e[8],A=e[9],E=e[10],F=e[11],k=e[12],U=e[13],L=e[14],G=e[15];return Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-D)<=1e-6*Math.max(1,Math.abs(n),Math.abs(D))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(o-y)<=1e-6*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(s-I)<=1e-6*Math.max(1,Math.abs(s),Math.abs(I))&&Math.abs(a-O)<=1e-6*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(c-g)<=1e-6*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-A)<=1e-6*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(d-E)<=1e-6*Math.max(1,Math.abs(d),Math.abs(E))&&Math.abs(h-F)<=1e-6*Math.max(1,Math.abs(h),Math.abs(F))&&Math.abs(m-k)<=1e-6*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(x-U)<=1e-6*Math.max(1,Math.abs(x),Math.abs(U))&&Math.abs(p-L)<=1e-6*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(S-G)<=1e-6*Math.max(1,Math.abs(S),Math.abs(G))}var Oh=hr,Bh=Zs;function Ph(){let t=new Q(4);return Q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Qs(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 Ks(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 js(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function Ys(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Js(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function $s(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function ta(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function ea(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}function ra(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*o-f*i,u=c*i+f*n-s*o,d=c*o+s*i-a*n,h=-s*n-a*i-f*o;return t[0]=l*c+h*-s+u*-f-d*-a,t[1]=u*c+h*-a+d*-s-l*-f,t[2]=d*c+h*-f+l*-a-u*-s,t[3]=e[3],t}var g2=function(){let t=Ph();return function(e,r,n,i,o,s){let a,f;for(r||(r=4),n||(n=0),i?f=Math.min(i*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],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Zi;(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"})(Zi||(Zi={}));var Nh=45*Math.PI/180,kh=1,Wi=.1,qi=500,Fh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ut=class extends Ue{static get IDENTITY(){return zh()}static get ZERO(){return Uh()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Zi}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,i,o,s,a,f,c,l,u,d,h,m,x,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=u,this[11]=d,this[12]=h,this[13]=m,this[14]=x,this[15]=p,this.check()}setRowMajor(e,r,n,i,o,s,a,f,c,l,u,d,h,m,x,p){return this[0]=e,this[1]=o,this[2]=c,this[3]=h,this[4]=r,this[5]=s,this[6]=l,this[7]=m,this[8]=n,this[9]=a,this[10]=u,this[11]=x,this[12]=i,this[13]=f,this[14]=d,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(Fh)}fromObject(e){return this.check()}fromQuaternion(e){return zi(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=Wi,far:a=qi}=e;return a===1/0?Gh(this,r,n,i,o,s):Gi(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return Vi(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=Wi,far:a=qi}=e;return Xi(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=Nh,aspect:n=kh,focalDistance:i=1,near:o=Wi,far:s=qi}=e;na(r);let a=r/2,f=i*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:o,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return na(r),Hi(this,r,n,i,o),this.check()}determinant(){return Bi(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),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*o,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*o,e[10]=this[10]*s,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),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=this[4]*i,e[4]=this[5]*o,e[5]=this[6]*s,e[6]=this[8]*i,e[7]=this[9]*o,e[8]=this[10]*s,e}transpose(){return Di(this,this),this.check()}invert(){return Oi(this,this),this.check()}multiplyLeft(e){return hr(this,e,this),this.check()}multiplyRight(e){return hr(this,this,e),this.check()}rotateX(e){return ki(this,this,e),this.check()}rotateY(e){return Fi(this,this,e),this.check()}rotateZ(e){return Ui(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return Ni(this,this,e,r),this.check()}scale(e){return Li(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return Pi(this,this,e),this.check()}transform(e,r){return e.length===4?(r=ea(r||[-0,-0,-0,-0],e,this),ee(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=bs(r||[-0,-0],e,this);break;case 3:i=pe(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ee(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=Ms(r||[-0,-0],e,this);break;case 3:n=cn(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return ee(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])}},xn,gn;function Uh(){return xn||(xn=new ut([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(xn)),xn}function zh(){return gn||(gn=new ut,Object.freeze(gn)),gn}function na(t){if(t>Math.PI*2)throw Error("expected radians")}function Gh(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),f=(r+e)/(r-e),c=(i+n)/(i-n),l=-1,u=-1,d=-2*o;return t[0]=s,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]=u,t[12]=0,t[13]=0,t[14]=d,t[15]=0,t}function ia(){let t=new Q(4);return Q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function oa(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Qi(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 Ki(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+s*a+i*c-o*f,t[1]=i*l+s*f+o*a-n*c,t[2]=o*l+s*c+n*f-i*a,t[3]=s*l-n*a-i*f-o*c,t}function sa(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+s*a,t[1]=i*f+o*a,t[2]=o*f-i*a,t[3]=s*f-n*a,t}function aa(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-o*a,t[1]=i*f+s*a,t[2]=o*f+n*a,t[3]=s*f-i*a,t}function ca(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+i*a,t[1]=i*f-n*a,t[2]=o*f+s*a,t[3]=s*f-o*a,t}function fa(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function dr(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],f=r[0],c=r[1],l=r[2],u=r[3],d,h,m,x,p;return d=i*f+o*c+s*l+a*u,d<0&&(d=-d,f=-f,c=-c,l=-l,u=-u),1-d>1e-6?(h=Math.acos(d),p=Math.sin(h),m=Math.sin((1-n)*h)/p,x=Math.sin(n*h)/p):(m=1-n,x=n),t[0]=m*i+x*f,t[1]=m*o+x*c,t[2]=m*s+x*l,t[3]=m*a+x*u,t}function la(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function ha(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function ji(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 i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}var da=Qs;var ua=Ks,pa=$s,ma=ta,_a=js;var xa=Ys;var ga=Js;var Aa=function(){let t=ln(),e=hn(1,0,0),r=hn(0,1,0);return function(n,i,o){let s=cr(i,o);return s<-.999999?(ue(t,e,i),Ti(t)<1e-6&&ue(t,r,i),Si(t,t),Qi(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ue(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,ga(n,n))}}(),O2=function(){let t=ia(),e=ia();return function(r,n,i,o,s,a){return dr(t,n,s,a),dr(e,i,o,a),dr(r,t,e,2*a*(1-a)),r}}(),B2=function(){let t=Ls();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],ga(e,ji(e,t))}}();var Hh=[0,0,0,1],ze=class extends te{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}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,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,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 ji(this,e),this.check()}fromAxisRotation(e,r){return Qi(this,e,r),this.check()}identity(){return oa(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]=H(e)}get y(){return this[1]}set y(e){this[1]=H(e)}get z(){return this[2]}set z(e){this[2]=H(e)}get w(){return this[3]}set w(e){this[3]=H(e)}len(){return _a(this)}lengthSquared(){return xa(this)}dot(e){return pa(this,e)}rotationTo(e,r){return Aa(this,e,r),this.check()}add(e){return da(this,this,e),this.check()}calculateW(){return fa(this,this),this.check()}conjugate(){return ha(this,this),this.check()}invert(){return la(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(ma(this,e,r,n),this.check())}multiplyRight(e){return Ki(this,this,e),this.check()}multiplyLeft(e){return Ki(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 sa(this,this,e),this.check()}rotateY(e){return aa(this,this,e),this.check()}rotateZ(e){return ca(this,this,e),this.check()}scale(e){return ua(this,this,e),this.check()}slerp(e,r,n){let i,o,s;switch(arguments.length){case 1:({start:i=Hh,target:o,ratio:s}=e);break;case 2:i=this,o=e,s=r;break;default:i=e,o=r,s=n}return dr(this,i,o,s),this.check()}transformVector4(e,r=new Fe){return ra(r,e,this),ee(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 re={};nn(re,{EPSILON1:()=>Xh,EPSILON10:()=>Jh,EPSILON11:()=>$h,EPSILON12:()=>t1,EPSILON13:()=>e1,EPSILON14:()=>r1,EPSILON15:()=>n1,EPSILON16:()=>i1,EPSILON17:()=>o1,EPSILON18:()=>s1,EPSILON19:()=>a1,EPSILON2:()=>Vh,EPSILON20:()=>c1,EPSILON3:()=>Wh,EPSILON4:()=>qh,EPSILON5:()=>Zh,EPSILON6:()=>Qh,EPSILON7:()=>Kh,EPSILON8:()=>jh,EPSILON9:()=>Yh,PI_OVER_FOUR:()=>l1,PI_OVER_SIX:()=>h1,PI_OVER_TWO:()=>f1,TWO_PI:()=>d1});var Xh=.1,Vh=.01,Wh=.001,qh=1e-4,Zh=1e-5,Qh=1e-6,Kh=1e-7,jh=1e-8,Yh=1e-9,Jh=1e-10,$h=1e-11,t1=1e-12,e1=1e-13,r1=1e-14,n1=1e-15,i1=1e-16,o1=1e-17,s1=1e-18,a1=1e-19,c1=1e-20,f1=Math.PI/2,l1=Math.PI/4,h1=Math.PI/6,d1=Math.PI*2;function Yi(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 Ea={UInt8:he.UNSIGNED_BYTE,UInt16:he.UNSIGNED_SHORT,Float32:he.FLOAT,UInt32:he.UNSIGNED_INT,UInt64:he.DOUBLE};function Ge(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 Sa="String",ya="Oid32",wa="Float64",ba="Int16",Bt;(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"})(Bt||(Bt={}));var Bc=Ct(Ht(),1);var wr=Ct(Ht(),1);var Xt=6356752314245179e-9,u1={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 ug=new B;function p1(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 Ma(t,e=[]){return p1(t,e,Z._cartographicRadians?An:Ai)}function m1(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 Ta(t,e){return m1(t,e,Z._cartographicRadians?An:Ei)}var Ra=1e-14,_1=new B,Ca={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"}},Ji={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ur={east:new B,north:new B,up:new B,west:new B,south:new B,down:new B},x1=new B,g1=new B,A1=new B;function $i(t,e,r,n,i,o){let s=Ca[e]&&Ca[e][r];et(s&&(!n||n===s));let a,f,c,l=_1.copy(i);if(dt(l.x,0,Ra)&&dt(l.y,0,Ra)){let d=Math.sign(l.z);a=x1.fromArray(Ji[e]),e!=="east"&&e!=="west"&&a.scale(d),f=g1.fromArray(Ji[r]),r!=="east"&&r!=="west"&&f.scale(d),c=A1.fromArray(Ji[n]),n!=="east"&&n!=="west"&&c.scale(d)}else{let{up:d,east:h,north:m}=ur;h.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,d),m.copy(d).cross(h);let{down:x,west:p,south:S}=ur;x.copy(d).scale(-1),p.copy(h).scale(-1),S.copy(m).scale(-1),a=ur[e],f=ur[r],c=ur[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=f.x,o[5]=f.y,o[6]=f.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}var He=new B,E1=new B,S1=new B;function va(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:o}=e;He.from(t);let s=He.x,a=He.y,f=He.z,c=n.x,l=n.y,u=n.z,d=s*s*c*c,h=a*a*l*l,m=f*f*u*u,x=d+h+m,p=Math.sqrt(1/x);if(!Number.isFinite(p))return;let S=E1;if(S.copy(t).scale(p),x<o)return S.to(r);let b=i.x,D=i.y,M=i.z,y=S1;y.set(S.x*b*2,S.y*D*2,S.z*M*2);let I=(1-p)*He.len()/(.5*y.len()),O=0,P,g,_,A;do{I-=O,P=1/(1+I*b),g=1/(1+I*D),_=1/(1+I*M);let E=P*P,F=g*g,k=_*_,U=E*P,L=F*g,G=k*_;A=d*E+h*F+m*k-1;let q=-2*(d*U*b+h*L*D+m*G*M);O=A/q}while(Math.abs(A)>re.EPSILON12);return He.scale([P,g,_]).to(r)}var En=new B,Ia=new B,b1=new B,bt=new B,M1=new B,Sn=new B,gt=class{constructor(e=0,r=0,n=0){W(this,"radii",void 0),W(this,"radiiSquared",void 0),W(this,"radiiToTheFourth",void 0),W(this,"oneOverRadii",void 0),W(this,"oneOverRadiiSquared",void 0),W(this,"minimumRadius",void 0),W(this,"maximumRadius",void 0),W(this,"centerToleranceSquared",re.EPSILON1),W(this,"squaredXOverSquaredZ",void 0),et(e>=0),et(r>=0),et(n>=0),this.radii=new B(e,r,n),this.radiiSquared=new B(e*e,r*r,n*n),this.radiiToTheFourth=new B(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new B(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new B(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=Ia,i=b1,[,,o]=e;this.geodeticSurfaceNormalCartographic(e,n),i.copy(this.radiiSquared).scale(n);let s=Math.sqrt(n.dot(i));return i.scale(1/s),n.scale(o),i.add(n),i.to(r)}cartesianToCartographic(e,r=[0,0,0]){Sn.from(e);let n=this.scaleToGeodeticSurface(Sn,bt);if(!n)return;let i=this.geodeticSurfaceNormal(n,Ia),o=M1;o.copy(Sn).subtract(n);let s=Math.atan2(i.y,i.x),a=Math.asin(i.z),f=Math.sign(ke.dot(o,Sn))*ke.length(o);return Ta([s,a,f],r)}eastNorthUpToFixedFrame(e,r=new ut){return $i(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,i,o=new ut){return $i(this,e,r,n,i,o)}geocentricSurfaceNormal(e,r=[0,0,0]){return En.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Ma(e),i=n[0],o=n[1],s=Math.cos(o);return En.set(s*Math.cos(i),s*Math.sin(i),Math.sin(o)).normalize(),En.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return En.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return va(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){bt.from(e);let n=bt.x,i=bt.y,o=bt.z,s=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+i*i*s.y+o*o*s.z);return bt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return bt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return bt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){et(dt(this.radii.x,this.radii.y,re.EPSILON15)),et(this.radii.z>0),bt.from(e);let i=bt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return bt.set(0,0,i).to(n)}};W(gt,"WGS84",new gt(6378137,6378137,Xt));var Da="4.3.0-alpha.2";var T1=globalThis.loaders?.parseImageNode,to=typeof Image<"u",eo=typeof ImageBitmap<"u",R1=Boolean(T1),ro=xt?!0:R1;function Oa(t){switch(t){case"auto":return eo||to||ro;case"imagebitmap":return eo;case"image":return to;case"data":return ro;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Ba(){if(eo)return"imagebitmap";if(to)return"image";if(ro)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function C1(t){let e=v1(t);if(!e)throw new Error("Not an image");return e}function Pa(t){switch(C1(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 v1(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 I1=/^data:image\/svg\+xml/,D1=/\.svg((\?|#).*)?$/;function yn(t){return t&&(I1.test(t)||D1.test(t))}function La(t,e){if(yn(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return no(t,e)}function no(t,e){if(yn(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function wn(t,e,r){let n=La(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await O1(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function O1(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,i)=>{try{r.onload=()=>n(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}var B1={},Na=!0;async function ka(t,e,r){let n;yn(r)?n=await wn(t,e,r):n=no(t,r);let i=e&&e.imagebitmap;return await P1(n,i)}async function P1(t,e=null){if((L1(e)||!Na)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Na=!1}return await createImageBitmap(t)}function L1(t){for(let e in t||B1)return!1;return!0}function Fa(t){return!U1(t,"ftyp",4)||!(t[8]&96)?null:N1(t)}function N1(t){switch(k1(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function k1(t,e,r){return String.fromCharCode(...t.slice(e,r))}function F1(t){return[...t].map(e=>e.charCodeAt(0))}function U1(t,e,r=0){let n=F1(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var Pt=!1,pr=!0;function bn(t){let e=mr(t);return G1(e)||V1(e)||H1(e)||X1(e)||z1(e)}function z1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Fa(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function G1(t){let e=mr(t);return e.byteLength>=24&&e.getUint32(0,Pt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Pt),height:e.getUint32(20,Pt)}:null}function H1(t){let e=mr(t);return e.byteLength>=10&&e.getUint32(0,Pt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,pr),height:e.getUint16(8,pr)}:null}function X1(t){let e=mr(t);return e.byteLength>=14&&e.getUint16(0,Pt)===16973&&e.getUint32(2,pr)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pr),height:e.getUint32(22,pr)}:null}function V1(t){let e=mr(t);if(!(e.byteLength>=3&&e.getUint16(0,Pt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=W1(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Pt);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Pt),width:e.getUint16(o+7,Pt)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Pt)}return null}function W1(){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 mr(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 Ua(t,e){let{mimeType:r}=bn(t)||{},n=globalThis.loaders?.parseImageNode;return Yt(n),await n(t,r)}async function za(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=q1(i),a;switch(s){case"imagebitmap":a=await ka(t,e,o);break;case"image":a=await wn(t,e,o);break;case"data":a=await Ua(t,e);break;default:Yt(!1)}return i==="data"&&(a=Pa(a)),a}function q1(t){switch(t){case"auto":case"data":return Ba();default:return Oa(t),t}}var Z1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Q1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],K1={image:{type:"auto",decode:!0}},Mn={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Da,mimeTypes:Q1,extensions:Z1,parse:za,tests:[t=>Boolean(bn(new DataView(t)))],options:K1};var Ga="4.3.0-alpha.2";var Ha={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ga,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}}};function Xa(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 io(t){let e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],u=a[c+1],d=a[c+2];e=l<e?l:e,r=u<r?u:r,n=d<n?d:n,i=l>i?l:i,o=u>o?u:o,s=d>s?d:s}return[[e,r,n],[i,o,s]]}function oo(t,e,r){let n=Xa(e.value),i=r||Va(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Va(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=Za(e.metadata),i=[],o=j1(e.attributes);for(let s in t){let a=t[s],f=Wa(s,a,o[s]);i.push(f)}if(r){let s=Wa("indices",r);i.push(s)}return{fields:i,metadata:n}}function j1(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function Wa(t,e,r){let n=r?Za(r.metadata):void 0;return oo(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 Qa={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Y1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},J1=4,_r=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 i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let d=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(o,i,r),f=this._getMeshData(o,a,r),c=io(f.attributes),l=qa(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(e,r,n){let i=this._getTopLevelMetadata(e),o=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:i,attributes:o}}_getDracoAttributes(e,r){let n={};for(let i=0;i<e.num_attributes();i++){let o=this.decoder.GetAttribute(e,i),s=this._getAttributeMetadata(e,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(o,r);f&&(n[o.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let i=this._getMeshAttributes(r,e,n);if(!i.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:i,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(e,r,n){let i={};for(let o of Object.values(e.attributes)){let s=this._deduceAttributeName(o,n);o.name=s;let a=this._getAttributeValues(r,o);if(a){let{value:f,size:c}=a;i[s]={value:f,size:c,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}}return i}_getTriangleListIndices(e){let n=e.num_faces()*3,i=n*J1,o=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),ed(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=Y1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let i=r.num_components,s=e.num_points()*i,a=s*n.BYTES_PER_ELEMENT,f=$1(this.draco,n),c,l=this.draco._malloc(a);try{let u=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,u,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,s).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=e.attribute_type;for(let s in Qa)if(this.draco[s]===i)return Qa[s];let o=r.attributeNameEntry||"name";return e.metadata[o]?e.metadata[o].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 i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(e,i);r[o]=this._getDracoMetadataField(e,o)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let i=td(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:new Float32Array([1,2,3]).map(a=>s.min_value(a))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.decoder[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}};function $1(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 td(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function ed(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var rd="1.5.6",nd="1.4.1",so=`https://www.gstatic.com/draco/versioned/decoders/${rd}`,lt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},ao={[lt.DECODER]:`${so}/${lt.DECODER}`,[lt.DECODER_WASM]:`${so}/${lt.DECODER_WASM}`,[lt.FALLBACK_DECODER]:`${so}/${lt.FALLBACK_DECODER}`,[lt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${nd}/javascript/${lt.ENCODER}`},co;async function Ka(t){let e=t.modules||{};return e.draco3d?co||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):co||=id(t),await co}async function id(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await Dt(ao[lt.FALLBACK_DECODER],"draco",t,lt.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await Dt(ao[lt.DECODER],"draco",t,lt.DECODER),await Dt(ao[lt.DECODER_WASM],"draco",t,lt.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await od(e,r)}function od(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:i=>n({draco:i})})})}var ja={...Ha,parse:sd};async function sd(t,e){let{draco:r}=await Ka(e),n=new _r(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var Tn="4.3.0-alpha.2";var Rn={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Ya;async function lo(t){nr(t.modules);let e=mi("basis");return e||(Ya||=ad(t),await Ya)}async function ad(t){let e=null,r=null;return[e,r]=await Promise.all([await Dt(Rn.TRANSCODER,"textures",t),await Dt(Rn.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await cd(e,r)}function cd(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(i=>{let{BasisFile:o,initializeBasis:s}=i;s(),n({BasisFile:o})})})}var fo;async function ho(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(fo=fo||fd(t),await fo)}async function fd(t){let e=null,r=null;return[e,r]=await Promise.all([await Dt(Rn.ENCODER,"textures",t),await Dt(Rn.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await ld(e,r)}function ld(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(i=>{let{BasisFile:o,KTX2File:s,initializeBasis:a,BasisEncoder:f}=i;a(),n({BasisFile:o,KTX2File:s,BasisEncoder:f})})})}var w={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 hd=["","WEBKIT_","MOZ_"],Ja={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"},Cn=null;function xr(t){if(!Cn){t=t||dd()||void 0,Cn=new Set;for(let e of hd)for(let r in Ja)if(t&&t.getExtension(`${e}${r}`)){let n=Ja[r];Cn.add(n)}}return Cn}function dd(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var PA=new Uint8Array([0]),st=[171,75,84,88,32,50,48,187,13,10,26,10],uo,po,mo,vn,$a,_o,tc,ec;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(uo||(uo={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(po||(po={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(mo||(mo={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(vn||(vn={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}($a||($a={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(_o||(_o={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(tc||(tc={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(ec||(ec={}));var xo=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=uo.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:po.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:mo.UNSPECIFIED,colorPrimaries:vn.SRGB,transferFunction:vn.SRGB,flags:_o.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}},me=class{constructor(e,r,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+r,n),this._littleEndian=i,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)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,r=0){let n=this._offset,i=0;for(;this._dataView.getUint8(this._offset)!==r&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}};function rc(t){return typeof TextDecoder<"u"?new TextDecoder().decode(t):Buffer.from(t).toString("utf8")}function nc(t){let e=new Uint8Array(t.buffer,t.byteOffset,st.length);if(e[0]!==st[0]||e[1]!==st[1]||e[2]!==st[2]||e[3]!==st[3]||e[4]!==st[4]||e[5]!==st[5]||e[6]!==st[6]||e[7]!==st[7]||e[8]!==st[8]||e[9]!==st[9]||e[10]!==st[10]||e[11]!==st[11])throw new Error("Missing KTX 2.0 identifier.");let r=new xo,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new me(t,st.length,n,!0);r.vkFormat=i._nextUint32(),r.typeSize=i._nextUint32(),r.pixelWidth=i._nextUint32(),r.pixelHeight=i._nextUint32(),r.pixelDepth=i._nextUint32(),r.layerCount=i._nextUint32(),r.faceCount=i._nextUint32();let o=i._nextUint32();r.supercompressionScheme=i._nextUint32();let s=i._nextUint32(),a=i._nextUint32(),f=i._nextUint32(),c=i._nextUint32(),l=i._nextUint64(),u=i._nextUint64(),d=new me(t,st.length+n,3*o*8,!0);for(let G=0;G<o;G++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let h=new me(t,s,a,!0),m={vendorId:h._skip(4)._nextUint16(),descriptorType:h._nextUint16(),versionNumber:h._nextUint16(),descriptorBlockSize:h._nextUint16(),colorModel:h._nextUint8(),colorPrimaries:h._nextUint8(),transferFunction:h._nextUint8(),flags:h._nextUint8(),texelBlockDimension:{x:h._nextUint8()+1,y:h._nextUint8()+1,z:h._nextUint8()+1,w:h._nextUint8()+1},bytesPlane:[h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8()],samples:[]},x=(m.descriptorBlockSize/4-6)/4;for(let G=0;G<x;G++)m.samples[G]={bitOffset:h._nextUint16(),bitLength:h._nextUint8(),channelID:h._nextUint8(),samplePosition:[h._nextUint8(),h._nextUint8(),h._nextUint8(),h._nextUint8()],sampleLower:h._nextUint32(),sampleUpper:h._nextUint32()};r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(m);let p=new me(t,f,c,!0);for(;p._offset<c;){let G=p._nextUint32(),it=p._scan(G),q=rc(it),li=p._scan(G-it.byteLength);r.keyValue[q]=q.match(/^ktx/i)?rc(li):li,G%4&&p._skip(4-G%4)}if(u<=0)return r;let S=new me(t,l,u,!0),b=S._nextUint16(),D=S._nextUint16(),M=S._nextUint32(),y=S._nextUint32(),I=S._nextUint32(),O=S._nextUint32(),P=[];for(let G=0;G<o;G++)P.push({imageFlags:S._nextUint32(),rgbSliceByteOffset:S._nextUint32(),rgbSliceByteLength:S._nextUint32(),alphaSliceByteOffset:S._nextUint32(),alphaSliceByteLength:S._nextUint32()});let g=l+S._offset,_=g+M,A=_+y,E=A+I,F=new Uint8Array(t.buffer,t.byteOffset+g,M),k=new Uint8Array(t.buffer,t.byteOffset+_,y),U=new Uint8Array(t.buffer,t.byteOffset+A,I),L=new Uint8Array(t.buffer,t.byteOffset+E,O);return r.globalData={endpointCount:b,selectorCount:D,imageDescs:P,endpointsData:F,selectorsData:k,tablesData:U,extendedData:L},r}function Xe(t,e){let r=new Array(e.mipMapLevels),n=e.width,i=e.height,o=0;for(let s=0;s<e.mipMapLevels;++s){let a=pd(e,n,i,t,s),f=ud(t,s,o,a);r[s]={compressed:!0,format:e.internalFormat,data:f,width:n,height:i,levelSize:a},n=Math.max(1,n>>1),i=Math.max(1,i>>1),o+=a}return r}function ud(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function pd(t,e,r,n,i){return Array.isArray(n)?t.sizeFunction(n[i]):t.sizeFunction(e,r)}var md={131:w.COMPRESSED_RGB_S3TC_DXT1_EXT,132:w.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:w.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:w.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:w.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:w.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:w.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:w.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:w.COMPRESSED_RED_RGTC1_EXT,140:w.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:w.COMPRESSED_RED_GREEN_RGTC2_EXT,142:w.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:w.COMPRESSED_RGB8_ETC2,148:w.COMPRESSED_SRGB8_ETC2,149:w.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:w.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:w.COMPRESSED_RGBA8_ETC2_EAC,152:w.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:w.COMPRESSED_R11_EAC,154:w.COMPRESSED_SIGNED_R11_EAC,155:w.COMPRESSED_RG11_EAC,156:w.COMPRESSED_SIGNED_RG11_EAC,157:w.COMPRESSED_RGBA_ASTC_4x4_KHR,158:w.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:w.COMPRESSED_RGBA_ASTC_5x4_KHR,160:w.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:w.COMPRESSED_RGBA_ASTC_5x5_KHR,162:w.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:w.COMPRESSED_RGBA_ASTC_6x5_KHR,164:w.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:w.COMPRESSED_RGBA_ASTC_6x6_KHR,166:w.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:w.COMPRESSED_RGBA_ASTC_8x5_KHR,168:w.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:w.COMPRESSED_RGBA_ASTC_8x6_KHR,170:w.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:w.COMPRESSED_RGBA_ASTC_8x8_KHR,172:w.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:w.COMPRESSED_RGBA_ASTC_10x5_KHR,174:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:w.COMPRESSED_RGBA_ASTC_10x6_KHR,176:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:w.COMPRESSED_RGBA_ASTC_10x8_KHR,178:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:w.COMPRESSED_RGBA_ASTC_10x10_KHR,180:w.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:w.COMPRESSED_RGBA_ASTC_12x10_KHR,182:w.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:w.COMPRESSED_RGBA_ASTC_12x12_KHR,184:w.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:w.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:w.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:w.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:w.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:w.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:w.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:w.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:w.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:w.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:w.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:w.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:w.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:w.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:w.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:w.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:w.COMPRESSED_RGBA_ASTC_12x12_KHR};function ic(t){return md[t]}var pt=[171,75,84,88,32,50,48,187,13,10,26,10];function In(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=nc(e),n=Math.max(1,r.levels.length),i=r.pixelWidth,o=r.pixelHeight,s=ic(r.vkFormat);return Xe(r.levels,{mipMapLevels:n,width:i,height:o,sizeFunction:a=>a.uncompressedByteLength,internalFormat:s})}var _d={etc1:{basisFormat:0,compressed:!0,format:w.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:w.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:w.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:w.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:w.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:w.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 gr(t,e){if(e.basis.containerFormat==="auto"){if(In(t)){let n=await ho(e);return sc(n.KTX2File,t,e)}let{BasisFile:r}=await lo(e);return go(r,t,e)}switch(e.basis.module){case"encoder":let r=await ho(e);switch(e.basis.containerFormat){case"ktx2":return sc(r.KTX2File,t,e);case"basis":default:return go(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await lo(e);return go(n,t,e)}}function go(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),o=[];for(let s=0;s<i;s++){let a=n.getNumLevels(s),f=[];for(let c=0;c<a;c++)f.push(xd(n,s,c,r));o.push(f)}return o}finally{n.close(),n.delete()}}function xd(t,e,r,n){let i=t.getImageWidth(e,r),o=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ac(n,s),l=t.getImageTranscodedSizeInBytes(e,r,c),u=new Uint8Array(l);if(!t.transcodeImage(u,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:u,compressed:a,format:f,hasAlpha:s}}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 i=n.getLevels(),o=[];for(let s=0;s<i;s++){o.push(gd(n,s,r));break}return[o]}finally{n.close(),n.delete()}}function gd(t,e,r){let{alphaFlag:n,height:i,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:f}=ac(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:o,height:i,data:l,compressed:s,levelSize:c,hasAlpha:n,format:a}}function ac(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(),_d[r]}function Dn(){let t=xr();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 cc={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Tn,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"}}},Ar={...cc,parse:gr};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},Ad={DXT1:w.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:w.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:w.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":w.COMPRESSED_RGB_ATC_WEBGL,ATCA:w.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:w.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},Ed=hc,Sd=On,yd=On,wd={DXT1:hc,DXT3:On,DXT5:On,"ATC ":Ed,ATCA:Sd,ATCI:yd};function fc(t){return new Uint32Array(t,0,mt.HEADER_LENGTH)[mt.MAGIC_NUMBER_INDEX]===mt.MAGIC_NUMBER}function lc(t){let e=new Int32Array(t,0,mt.HEADER_LENGTH),r=e[mt.HEADER_PF_FOURCC_INDEX];Yt(Boolean(e[mt.HEADER_PF_FLAGS_INDEX]&mt.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=bd(r),i=Ad[n],o=wd[n];Yt(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;e[mt.HEADER_FLAGS_INDEX]&mt.DDSD_MIPMAPCOUNT&&(s=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:s,width:a,height:f,sizeFunction:o,internalFormat:i})}function hc(t,e){return(t+3>>2)*(e+3>>2)*8}function On(t,e){return(t+3>>2)*(e+3>>2)*16}function bd(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var At={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},Md={0:[w.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[w.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[w.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[w.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[w.COMPRESSED_RGB_ETC1_WEBGL],7:[w.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[w.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[w.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[w.COMPRESSED_RGB8_ETC2],23:[w.COMPRESSED_RGBA8_ETC2_EAC],24:[w.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[w.COMPRESSED_R11_EAC],26:[w.COMPRESSED_RG11_EAC],27:[w.COMPRESSED_RGBA_ASTC_4X4_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[w.COMPRESSED_RGBA_ASTC_5X4_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[w.COMPRESSED_RGBA_ASTC_5X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[w.COMPRESSED_RGBA_ASTC_6X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[w.COMPRESSED_RGBA_ASTC_6X6_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[w.COMPRESSED_RGBA_ASTC_8X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[w.COMPRESSED_RGBA_ASTC_8X6_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[w.COMPRESSED_RGBA_ASTC_8X8_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[w.COMPRESSED_RGBA_ASTC_10X5_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[w.COMPRESSED_RGBA_ASTC_10X6_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[w.COMPRESSED_RGBA_ASTC_10X8_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[w.COMPRESSED_RGBA_ASTC_10X10_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[w.COMPRESSED_RGBA_ASTC_12X10_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[w.COMPRESSED_RGBA_ASTC_12X12_KHR,w.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},Td={0:dc,1:dc,2:uc,3:uc,6:Er,7:Er,9:Sr,11:Sr,22:Er,23:Sr,24:Er,25:Er,26:Sr,27:Sr,28:Rd,29:Cd,30:vd,31:Id,32:Dd,33:Od,34:Bd,35:Pd,36:Ld,37:Nd,38:kd,39:Fd,40:Ud};function pc(t){let r=new Uint32Array(t,0,At.HEADER_LENGTH)[At.MAGIC_NUMBER_INDEX];return r===At.MAGIC_NUMBER||r===At.MAGIC_NUMBER_EXTRA}function mc(t){let e=new Uint32Array(t,0,At.HEADER_LENGTH),r=e[At.PIXEL_FORMAT_INDEX],n=e[At.COLOUR_SPACE_INDEX],i=Md[r]||[],o=i.length>1&&n?i[1]:i[0],s=Td[r],a=e[At.MIPMAPCOUNT_INDEX],f=e[At.WIDTH_INDEX],c=e[At.HEIGHT_INDEX],l=At.HEADER_SIZE+e[At.METADATA_SIZE_INDEX],u=new Uint8Array(t,l);return Xe(u,{mipMapLevels:a,width:f,height:c,sizeFunction:s,internalFormat:o})}function dc(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function uc(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function Er(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function Sr(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function Rd(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function Cd(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function vd(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function Id(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function Dd(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function Od(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function Bd(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function Pd(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function Ld(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function Nd(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function kd(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function Fd(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function Ud(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}function _c(t){if(In(t))return oc(t);if(fc(t))return lc(t);if(pc(t))return mc(t);throw new Error("Texture container format not recognized")}var xc={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:Tn,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}}},Bn={...xc,parse:async(t,e)=>e?.["compressed-texture"]?.useBasis?(e.basis={format:{alpha:"BC3",noAlpha:"BC1"},...e.basis,containerFormat:"ktx2",module:"encoder"},(await gr(t,e))[0]):_c(t)};var yr;(function(t){t.vertexCount="vertexCount",t.featureCount="featureCount"})(yr||(yr={}));function Pn(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 Lt(t,e=null){return e?`${t}?token=${e}`:t}function gc(t,e){let{attributeData:r=[]}=e,n=[];for(let i=0;i<r.length;i++){let o=r[i].href.replace("./","");n.push(`${t}/${o}`)}return n}function Ac(t,e,r){let n=[],{attributeStorageInfo:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o].key;n.push(`${e}/nodes/${r}/attributes/${s}/0`)}return n}var Ln=new B([0,0,0]);function zd(t){switch(t){case"ktx-etc2":case"dds":return Bn;case"ktx2":return Ar;case"jpg":case"png":default:return Mn}}var Gd="i3s-attribute-type";async function wc(t,e,r,n,i){let o={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ut,coordinateSystem:0,byteLength:0,texture:null};if(e.textureUrl){let s=Lt(e.textureUrl,n?.i3s?.token),a=zd(e.textureFormat),l=await(await(i?.fetch||fetch)(s)).arrayBuffer();if(n?.i3s.decodeTextures){if(a===Mn){let u={...e.textureLoaderOptions,image:{type:"data"}};try{let d=await di(l,[],u,i);o.texture=d}catch{let h=await(0,wr.parse)(l,a,u,i);o.texture=h}}else if(a===Bn||a===Ar){let u=await(0,wr.load)(l,a,e.textureLoaderOptions);a===Ar&&(u=u[0]),o.texture={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u}}}else o.texture=l}return o.material=jd(e.materialDefinition,o.texture),o.material&&(o.texture=null),await Hd(t,o,e,r,n)}async function Hd(t,e,r,n,i){let o=t.byteLength,s,a,f=0,c=0,l;if(r.isDracoGeometry){let u=await(0,wr.parse)(t,ja,{draco:{attributeNameEntry:Gd}});a=u.header.vertexCount,l=u.indices?.value;let{POSITION:d,NORMAL:h,COLOR_0:m,TEXCOORD_0:x,["feature-index"]:p,["uv-region"]:S}=u.attributes;s={position:d,normal:h,color:m,uv0:x,uvRegion:S,id:p},Xd(s,u);let b=tu(p);b&&$d(s,b)}else{let{vertexAttributes:u,ordering:d,featureAttributes:h,featureAttributeOrder:m}=n.store.defaultGeometrySchema,x=Wd(t,n);f=x.byteOffset,a=x.vertexCount,c=x.featureCount;let{attributes:p,byteOffset:S}=Sc(t,f,u,a,d),{attributes:b}=Sc(t,S,h,c,m);Jd(b),s=Vd(p,b)}if(!i?.i3s?.coordinateSystem||i.i3s.coordinateSystem===Bt.METER_OFFSETS){let u=Zd(s.position,r);e.modelMatrix=u.invert(),e.coordinateSystem=Bt.METER_OFFSETS}else e.modelMatrix=Kd(s.position),e.coordinateSystem=Bt.LNGLAT_OFFSETS;e.attributes={positions:s.position,normals:s.normal,colors:Ec(s.color),texCoords:s.uv0,uvRegions:Ec(s.uvRegion||s.region)},e.indices=l||null,s.id&&s.id.value&&(e.featureIds=s.id.value);for(let u in e.attributes)e.attributes[u]||delete e.attributes[u];return e.vertexCount=a,e.byteLength=o,e}function Xd(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 Vd(t,e){return{...t,...e}}function Ec(t){return t&&(t.normalized=!0,t)}function Wd(t,e){let r=0,n=0,i=0;for(let{property:o,type:s}of e.store.defaultGeometrySchema.header){let a=Yi(s);switch(o){case yr.vertexCount.toString():n=new a(t,0,4)[0],r+=Ge(s);break;case yr.featureCount.toString():i=new a(t,4,4)[0],r+=Ge(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function Sc(t,e,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:f}=r[s];if(e+n*f*Ge(a)<=t.byteLength){let c=t.slice(e),l;if(a==="UInt64")l=qd(c,n*f,Ge(a));else{let u=Yi(a);l=new u(c,0,n*f)}switch(o[s]={value:l,type:Ea[a],size:f},s){case"color":o.color.normalized=!0;break;case"position":case"region":case"normal":default:}e=e+n*f*Ge(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:e}}function qd(t,e,r){let n=[],i=new DataView(t),o=0;for(let s=0;s<e;s++){let a=i.getUint32(o,!0),f=i.getUint32(o+4,!0),c=a+2**32*f;n.push(c),o+=r}return new Uint32Array(n)}function Zd(t,e){let r=e.mbs,n=t.value,i=t.metadata,o=new ut,s=new B(r[0],r[1],r[2]),a=new B;return gt.WGS84.cartographicToCartesian(s,a),gt.WGS84.eastNorthUpToFixedFrame(a,o),t.value=Qd(n,i,s),o}function Qd(t,e={},r){let n=new Float64Array(t.length),i=e["i3s-scale_x"]&&e["i3s-scale_x"].double||1,o=e["i3s-scale_y"]&&e["i3s-scale_y"].double||1;for(let s=0;s<n.length;s+=3)n[s]=t[s]*i+r.x,n[s+1]=t[s+1]*o+r.y,n[s+2]=t[s+2]+r.z;for(let s=0;s<n.length;s+=3)gt.WGS84.cartographicToCartesian(n.subarray(s,s+3),Ln),n[s]=Ln.x,n[s+1]=Ln.y,n[s+2]=Ln.z;return n}function Kd(t){let e=t.metadata,r=e?.["i3s-scale_x"]?.double||1,n=e?.["i3s-scale_y"]?.double||1,i=new ut;return i[0]=r,i[5]=n,i}function jd(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=yc(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=yc(r.pbrMetallicRoughness.baseColorFactor)),e&&Yd(r,e),r}function yc(t){let e=[...t];for(let r=0;r<t.length;r++)e[r]=t[r]/255;return e}function Yd(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 Jd(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,i=r.value,o=i[i.length-1]+1,s=new Uint32Array(o*3),a=0,f=0;for(let c=1;c<i.length;c+=2){let l=Number(n[a]),u=i[c],d=i[c-1],h=u-d+1,m=f+h*3;s.fill(l,f,m),a++,f=m}t.id.value=s}function $d(t,e){let r=t.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=e[r[i]];t.id.value=n}function tu(t){return t?.metadata?.["i3s-feature-ids"]?.intArray}var eu="4.3.0-alpha.2",Nn={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:eu,mimeTypes:["application/octet-stream"],parse:ru,extensions:["bin"],options:{"i3s-content":{}}};async function ru(t,e,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=e?.i3s||{},a=i||n,f=s||o;return!a||!f?null:await wc(t,a,f,e,r)}var rt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var LE=new B,NE=new B;var br=new B,bc=new B,ne=class{constructor(e=[0,0,0],r=0){W(this,"center",void 0),W(this,"radius",void 0),this.radius=-0,this.center=new B,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=br.from(r),this.center=new B().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,i=e.center,o=e.radius,s=br.copy(i).subtract(r),a=s.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return e.clone();let f=(n+a+o)*.5;return bc.copy(s).scale((-n+f)/a).add(r),this.center.copy(bc),this.radius=f,this}expand(e){let n=br.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=_n.getScaling(br,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=br.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,o=e.normal.dot(r)+e.distance;return o<-n?rt.OUTSIDE:o<n?rt.INTERSECTING:rt.INSIDE}};var nu=new B,iu=new B,kn=new B,Fn=new B,Un=new B,ou=new B,su=new B,Vt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},ie=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){W(this,"center",void 0),W(this,"halfAxes",void 0),this.center=new B().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 B(e).len(),new B(r).len(),new B(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new B(e).normalize(),o=new B(r).normalize(),s=new B(n).normalize();return new ze().fromMatrix3(new J([...i,...o,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let i=new ze(n),o=new J().fromQuaternion(i);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new B().from(e),this.halfAxes=o,this}clone(){return new ie(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,kn),i=r.getColumn(1,Fn),o=r.getColumn(2,Un),s=nu.copy(n).add(i).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,i=this.halfAxes,o=n.x,s=n.y,a=n.z,f=Math.abs(o*i[Vt.COLUMN0ROW0]+s*i[Vt.COLUMN0ROW1]+a*i[Vt.COLUMN0ROW2])+Math.abs(o*i[Vt.COLUMN1ROW0]+s*i[Vt.COLUMN1ROW1]+a*i[Vt.COLUMN1ROW2])+Math.abs(o*i[Vt.COLUMN2ROW0]+s*i[Vt.COLUMN2ROW1]+a*i[Vt.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?rt.OUTSIDE:c>=f?rt.INSIDE:rt.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=iu.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,kn),o=n.getColumn(1,Fn),s=n.getColumn(2,Un),a=i.magnitude(),f=o.magnitude(),c=s.magnitude();i.normalize(),o.normalize(),s.normalize();let l=0,u;return u=Math.abs(r.dot(i))-a,u>0&&(l+=u*u),u=Math.abs(r.dot(o))-f,u>0&&(l+=u*u),u=Math.abs(r.dot(s))-c,u>0&&(l+=u*u),l}computePlaneDistances(e,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,f=a.getColumn(0,kn),c=a.getColumn(1,Fn),l=a.getColumn(2,Un),u=ou.copy(f).add(c).add(l).add(s),d=su.copy(u).subtract(e),h=r.dot(d);return i=Math.min(h,i),o=Math.max(h,o),u.copy(s).add(f).add(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),u.copy(s).add(f).subtract(c).add(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),u.copy(s).add(f).subtract(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).add(c).add(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).add(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).subtract(c).add(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),s.copy(u).subtract(f).subtract(c).subtract(l),d.copy(u).subtract(e),h=r.dot(d),i=Math.min(h,i),o=Math.max(h,o),n[0]=i,n[1]=o,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,kn);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Fn);n.transformAsPoint(e);let i=this.halfAxes.getColumn(2,Un);return i.transformAsPoint(e),this.halfAxes=new J([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var Mc=new B,Tc=new B,Wt=class{constructor(e=[0,0,1],r=0){W(this,"normal",void 0),W(this,"distance",void 0),this.normal=new B,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,i){return this.normal.set(e,r,n),et(dt(this.normal.len(),1)),this.distance=i,this}clone(){return new Wt(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=Tc.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),i=this.getPointDistance(n),o=Tc.copy(this.normal).scale(i);return n.subtract(o).to(r)}};var Rc=[new B([1,0,0]),new B([0,1,0]),new B([0,0,1])],Cc=new B,au=new B,Et=class{constructor(e=[]){W(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Rc.length;let r=e.center,n=e.radius,i=0;for(let o of Rc){let s=this.planes[i],a=this.planes[i+1];s||(s=this.planes[i]=new Wt),a||(a=this.planes[i+1]=new Wt);let f=Cc.copy(o).scale(-n).add(r);s.fromPointNormal(f,o);let c=Cc.copy(o).scale(n).add(r),l=au.copy(o).negate();a.fromPointNormal(c,l),i+=2}return this}computeVisibility(e){let r=rt.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case rt.OUTSIDE:return rt.OUTSIDE;case rt.INTERSECTING:r=rt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(et(Number.isFinite(r),"parentPlaneMask is required."),r===Et.MASK_OUTSIDE||r===Et.MASK_INSIDE)return r;let n=Et.MASK_INSIDE,i=this.planes;for(let o=0;o<this.planes.length;++o){let s=o<31?1<<o:0;if(o<31&&!(r&s))continue;let a=i[o],f=e.intersectPlane(a);if(f===rt.OUTSIDE)return Et.MASK_OUTSIDE;f===rt.INTERSECTING&&(n|=s)}return n}};W(Et,"MASK_OUTSIDE",4294967295);W(Et,"MASK_INSIDE",0);W(Et,"MASK_INDETERMINATE",2147483647);var oS=new B,sS=new B,aS=new B,cS=new B,fS=new B;var _S=new B,xS=new B,gS=new B,AS=new B,ES=new B,SS=new B,yS=new B,wS=new B,bS=new B,MS=new B,TS=new B,RS=new B;var IS=new J,DS=new J,OS=new J,BS=new J,PS=new J;var zS=new B,GS=new B,HS=new B,XS=new B,VS=new B,WS=new J,qS={diagonal:new J,unitary:new J};var Ic=Ct(Ht(),1);var Mr;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Mr||(Mr={}));var Tr;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Tr||(Tr={}));var Rr;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(Rr||(Rr={}));var Ao;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(Ao||(Ao={}));var vc=Ct(Ht(),1);var hu="4.3.0-alpha.2",zn={dataType:null,batchType:null,name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:hu,mimeTypes:["application/json"],parse:du,extensions:["json"],options:{i3s:{}}};async function du(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 i=Lt(`${this.url}/nodepages/${r}`,this.options.i3s?.token);this.pendingNodePages[r]={status:"Pending",promise:(0,vc.load)(i,zn,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=[],i=[];for(let h of r.children||[])i.push(this.getNodeById(h));let o=await Promise.all(i);for(let h of o)n.push({id:h.index.toString(),obb:h.obb});let s,a,f,c="jpg",l=[],u=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:m}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};s=h,u=m;let{textureData:x,materialDefinition:p}=this.getInformationFromMaterial(r.mesh.material);f=p,c=x.format||c,x.name&&(a=`${this.url}/nodes/${r.mesh.material.resource}/textures/${x.name}`),this.tileset.attributeStorageInfo&&(l=Ac(this.tileset,this.url,r.mesh.attribute.resource))}let d=this.getLodSelection(r);return Eo({id:e.toString(),lodSelection:d,obb:r.obb,contentUrl:s,textureUrl:a,attributeUrls:l,materialDefinition:f,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:u})}getContentUrl(e){let r=null,n=this.tileset.geometryDefinitions[e.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(o=>o.compressedAttributes&&o.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(o=>!o.compressedAttributes)),i!==-1){let o=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${e.resource}/geometries/${i}`,isDracoGeometry:o}}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 i=n?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;typeof i=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[i]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(e){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=e.textureSetDefinitions||[];for(let i of n){let o=i&&i.formats||[],s=null;for(let a of r){let f=o.find(c=>c.format===a);if(f){s=f;break}}s&&s.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Dn(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(s)}}getSupportedTextureFormats(){let e=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=xr();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 Dc(t,e){let r=e.url||"",n;t.geometryData&&(n=`${r}/${t.geometryData[0].href}`);let i;t.textureData&&(i=`${r}/${t.textureData[0].href}`);let o;t.attributeData&&(o=gc(r,t));let s=t.children||[];return Eo({...t,children:s,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:o,isDracoGeometry:!1})}function Eo(t){let e={},r=[0,0,0,1];if(t.mbs)r=t.mbs,e.sphere=[...gt.WGS84.cartographicToCartesian(t.mbs.slice(0,3)),t.mbs[3]];else if(t.obb){e.box=[...gt.WGS84.cartographicToCartesian(t.obb.center),...t.obb.halfSize,...t.obb.quaternion];let f=new ie().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,i=t.lodSelection?.[0].maxError,o=Tr.MESH,s=Mr.REPLACE;return{...t,mbs:r,boundingVolume:e,lodMetricType:n,lodMetricValue:i,type:o,refine:s}}async function Oc(t,e,r){let n=Pn(r.url||""),i,o;if(t.nodePages)i=new Cr(t,n,e),o=await i.formTileFromNodePages(0);else{let s=e.i3s,a=Lt(`${n}/nodes/root`,s.token);o=await(0,Ic.load)(a,vr,{...e,i3s:{...e.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...t,loader:vr,url:n,basePath:n,type:Rr.I3S,nodePagesTile:i,root:o,lodMetricType:o.lodMetricType,lodMetricValue:o.lodMetricValue}}var uu="4.3.0-alpha.2",pu=/layers\/[0-9]+$/,mu=/\.slpk$/,_u=/nodes\/([0-9-]+|root)$/,xu="504b0304",gu="PointCloud",vr={dataType:null,batchType:null,name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:uu,mimeTypes:["application/octet-stream"],parse:Au,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:Bt.METER_OFFSETS}}};async function Au(t,e={},r){let n=r.url;if(e.i3s=e.i3s||{},wu(t)===xu)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let o=Pn(n),s;e.i3s.isTileset==="auto"?s=pu.test(o)||mu.test(o):s=e.i3s.isTileset;let a;return e.isTileHeader==="auto"?a=_u.test(o):a=e.i3s.isTileHeader,s?t=await Su(t,e,r):a?t=await yu(t,r):t=await Eu(t,e),t}async function Eu(t,e){return await(0,Bc.parse)(t,Nn,e)}async function Su(t,e,r){let n=JSON.parse(new TextDecoder().decode(t));if(n?.layerType===gu)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await Oc(n,e,r)}async function yu(t,e){return t=JSON.parse(new TextDecoder().decode(t)),Dc(t,e)}function wu(t){return t instanceof ArrayBuffer?[...new Uint8Array(t,0,4)].map(e=>e.toString(16).padStart(2,"0")).join(""):null}var Ir=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,i=t.length-4n;do{let o=i;i-=BigInt(1024),i=i>=0n?i:0n;let s=new Uint8Array(await t.slice(i,o));for(let a=s.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=s[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&i>0n);return i+BigInt(n)};var Pc=new Uint8Array([80,75,5,6]),Lc=new Uint8Array([80,75,6,7]),Nc=new Uint8Array([80,75,6,6]),bu=8n;var Mu=12n,Tu=16n;var Ru=8n,Cu=24n;var vu=40n,Iu=48n;var kc=async t=>{let e=await Ir(t,Pc),r=BigInt(await t.getUint16(e+bu)),n=BigInt(await t.getUint32(e+Mu)),i=BigInt(await t.getUint32(e+Tu)),o=e-20n,s=0n,a=await t.slice(o,o+4n);if($t(a,Lc)){s=await t.getBigUint64(o+Ru);let f=await t.slice(s,s+4n);if(!$t(f,Nc.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(s+Cu),n=await t.getBigUint64(s+vu),i=await t.getBigUint64(s+Iu)}else o=0n;return{cdRecordsNumber:r,cdStartOffset:i,cdByteSize:n,offsets:{zip64EoCDOffset:s,zip64EoCDLocatorOffset:o,zipEoCDOffset:e}}};var Ly=[{offset:0,size:4,default:new DataView(Pc.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 Ny=[{offset:0,size:4,default:new DataView(Lc.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],ky=[{offset:0,size:4,default:new DataView(Nc.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 Du=20,Ou=24,Bu=28,Pu=30,Lu=32,Nu=42,Gn=46n,Or=new Uint8Array([80,75,1,2]),Dr=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+Gn)),n=r.buffer.slice(0,4);if(!$t(n,Or.buffer))return null;let i=BigInt(r.getUint32(Du,!0)),o=BigInt(r.getUint32(Ou,!0)),s=r.getUint16(Pu,!0),a=BigInt(r.getUint16(Lu,!0)),f=r.getUint16(Bu,!0),c=await e.slice(t+Gn,t+Gn+BigInt(f+s)),l=c.slice(0,f),u=new TextDecoder().decode(l),d=t+Gn+BigInt(f),h=r.getUint32(Nu,!0),m=BigInt(h),x=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:o,compressedSize:i,localHeaderOffset:m,startDisk:a},S=ku(p,x);return{...p,...S,extraFieldLength:s,fileNameLength:f,fileName:u,extraOffset:d}};async function*Ve(t){let{cdStartOffset:e,cdByteSize:r}=await kc(t),n=new de(new DataView(await t.slice(e,e+r))),i=await Dr(0n,n);for(;i;)yield i,i=await Dr(i.extraOffset+BigInt(i.extraFieldLength),n)}var Fc=(...t)=>t[0]+t[1]*16,ku=(t,e)=>{let r=Fu(t),n={};if(r.length>0){let i=r.reduce((a,f)=>a+f.length,0),o=new Uint8Array(e.buffer).findIndex((a,f,c)=>Fc(c[f],c[f+1])===1&&Fc(c[f+2],c[f+3])===i),s=0;for(let a of r){let f=s;n[a.name]=e.getBigUint64(o+4+f,!0),s=f+a.length}}return n},Fu=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 Gy=[{offset:0,size:4,default:new DataView(Or.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 Uu=8,zu=18,Gu=22,Hu=26,Xu=28,Hn=30n,So=new Uint8Array([80,75,3,4]),_e=async(t,e)=>{let r=new DataView(await e.slice(t,t+Hn)),n=r.buffer.slice(0,4);if(!$t(n,So))return null;let i=r.getUint16(Hu,!0),o=r.getUint16(Xu,!0),s=await e.slice(t+Hn,t+Hn+BigInt(i+o)),a=s.slice(0,i),f=new DataView(s.slice(i,s.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+Hn+BigInt(i+o),u=r.getUint16(Uu,!0),d=BigInt(r.getUint32(zu,!0)),h=BigInt(r.getUint32(Gu,!0)),m=4;return h===BigInt(4294967295)&&(h=f.getBigUint64(m,!0),m+=8),d===BigInt(4294967295)&&(d=f.getBigUint64(m,!0),m+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(m,!0)),{fileNameLength:i,fileName:c,extraFieldLength:o,fileDataOffset:l,compressedSize:d,compressionMethod:u}};var Vy=[{offset:0,size:4,default:new DataView(So.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 Xn=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let s of e)n.push(s),yield s;let i=await this.concatenate(n),o=await this.hash(i,r);this.options.crypto?.onEnd?.({hash:o})}async concatenate(e){return await ir(e)}};function Uc(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 i=0;i<n.length;i++)typeof n[i]>"u"?e+="=":e+=Vu(n[i])}return e}function Vu(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 zc(t,e){switch(e){case"hex":return t;case"base64":return Wu(t);default:throw new Error(e)}}function Wu(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Uc(r)||""}var Hc=typeof atob=="function"?atob:typeof Buffer=="function"?Ju:Vc,qu=Hc("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="),yo=WebAssembly&&Hc!==Vc?Yu(qu).buffer:!1,Nt=$u(),wo=240*16*16,Xc=Math.floor(wo*16*1.066666667),Zu=268435456-65536,Gc="Parameter must be Buffer, ArrayBuffer or Uint8Array",Qu="Parameter exceeds max size of 255.9 Mbytes";yo||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function bo(t){var e,r,n,i,o,s,a,f,c,l;let u=ju(),d=Ku(),h={},m=new Date().getTime();return h.then=function(b){return a=b,p(),h},h.catch=function(b){return f=b,h},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?s=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?s=t.constructor===ArrayBuffer?new Uint8Array(t):t:S(new TypeError(Gc)):S(new TypeError(Gc)),s&&(o=s.length,yo&&o>Xc?o>Zu?S(new Error(Qu)):(e=new WebAssembly.Memory({initial:o>32e6?o>64e6?o>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),i={mem:e,log:console.log},n={imports:i},WebAssembly.instantiate(yo,n).then(x)):p(u(s))),h;function x(b){p(d(s,b.instance.exports,r))}function p(b){var D=Boolean(b)?b:c;Boolean(b)&&(l=new Date().getTime()),typeof a=="function"?Boolean(D)&&(a(D,l-m),a=f=null):Boolean(b)&&(c=b)}function S(b){typeof f=="function"&&f(b)}}function Ku(){var t,e,r,n,i,o,s,a,f,c,l,u,d,h=function(m){var x,p,S,b,D,M,y,I,O,P,g,_,A,E,F,k,U,L,G,it,q,li,b_=new Date().getTime(),jl=0,T=1732584193,R=-271733879,C=-1732584194,v=271733878,j=0,rr=m.length*8,$r;for($r=Yl(m,d),d[rr>>>5]|=128<<rr%32,d[(rr+64>>>9<<4)+14]=rr,$r=(rr+64>>>9<<4)+15,q=d;j<$r;)$r>j+Xc?(n(T),o(R),a(C),c(v),e(wo),j=j+wo*16,T=r(),R=i(),C=s(),v=f(),jl++):(U=T,L=R,G=C,it=v,x=q[j+0]>>>0,p=q[j+1]>>>0,S=q[j+2]>>>0,b=q[j+3]>>>0,D=q[j+4]>>>0,M=q[j+5]>>>0,y=q[j+6]>>>0,I=q[j+7]>>>0,O=q[j+8]>>>0,P=q[j+9]>>>0,g=q[j+10]>>>0,_=q[j+11]>>>0,A=q[j+12]>>>0,E=q[j+13]>>>0,F=q[j+14]>>>0,k=q[j+15]>>>0,T=N(7,25,T+(R&C|~R&v)+x-680876936)+R,v=N(12,20,v+(T&R|~T&C)+p-389564586)+T,C=N(17,15,C+(v&T|~v&R)+S+606105819)+v,R=N(22,10,R+(C&v|~C&T)+b-1044525330)+C,T=N(7,25,T+(R&C|~R&v)+D-176418897)+R,v=N(12,20,v+(T&R|~T&C)+M+1200080426)+T,C=N(17,15,C+(v&T|~v&R)+y-1473231341)+v,R=N(22,10,R+(C&v|~C&T)+I-45705983)+C,T=N(7,25,T+(R&C|~R&v)+O+1770035416)+R,v=N(12,20,v+(T&R|~T&C)+P-1958414417)+T,C=N(17,15,C+(v&T|~v&R)+g-42063)+v,R=N(22,10,R+(C&v|~C&T)+_-1990404162)+C,T=N(7,25,T+(R&C|~R&v)+A+1804603682)+R,v=N(12,20,v+(T&R|~T&C)+E-40341101)+T,C=N(17,15,C+(v&T|~v&R)+F-1502002290)+v,R=N(22,10,R+(C&v|~C&T)+k+1236535329)+C,T=N(5,27,T+(R&v|C&~v)+p-165796510)+R,v=N(9,23,v+(T&C|R&~C)+y-1069501632)+T,C=N(14,18,C+(v&R|T&~R)+_+643717713)+v,R=N(20,12,R+(C&T|v&~T)+x-373897302)+C,T=N(5,27,T+(R&v|C&~v)+M-701558691)+R,v=N(9,23,v+(T&C|R&~C)+g+38016083)+T,C=N(14,18,C+(v&R|T&~R)+k-660478335)+v,R=N(20,12,R+(C&T|v&~T)+D-405537848)+C,T=N(5,27,T+(R&v|C&~v)+P+568446438)+R,v=N(9,23,v+(T&C|R&~C)+F-1019803690)+T,C=N(14,18,C+(v&R|T&~R)+b-187363961)+v,R=N(20,12,R+(C&T|v&~T)+O+1163531501)+C,T=N(5,27,T+(R&v|C&~v)+E-1444681467)+R,v=N(9,23,v+(T&C|R&~C)+S-51403784)+T,C=N(14,18,C+(v&R|T&~R)+I+1735328473)+v,R=N(20,12,R+(C&T|v&~T)+A-1926607734)+C,T=N(4,28,T+(R^C^v)+M-378558)+R,v=N(11,21,v+(T^R^C)+O-2022574463)+T,C=N(16,16,C+(v^T^R)+_+1839030562)+v,R=N(23,9,R+(C^v^T)+F-35309556)+C,T=N(4,28,T+(R^C^v)+p-1530992060)+R,v=N(11,21,v+(T^R^C)+D+1272893353)+T,C=N(16,16,C+(v^T^R)+I-155497632)+v,R=N(23,9,R+(C^v^T)+g-1094730640)+C,T=N(4,28,T+(R^C^v)+E+681279174)+R,v=N(11,21,v+(T^R^C)+x-358537222)+T,C=N(16,16,C+(v^T^R)+b-722521979)+v,R=N(23,9,R+(C^v^T)+y+76029189)+C,T=N(4,28,T+(R^C^v)+P-640364487)+R,v=N(11,21,v+(T^R^C)+A-421815835)+T,C=N(16,16,C+(v^T^R)+k+530742520)+v,R=N(23,9,R+(C^v^T)+S-995338651)+C,T=N(6,26,T+(C^(R|~v))+x-198630844)+R,v=N(10,22,v+(R^(T|~C))+I+1126891415)+T,C=N(15,17,C+(T^(v|~R))+F-1416354905)+v,R=N(21,11,R+(v^(C|~T))+M-57434055)+C,T=N(6,26,T+(C^(R|~v))+A+1700485571)+R,v=N(10,22,v+(R^(T|~C))+b-1894986606)+T,C=N(15,17,C+(T^(v|~R))+g-1051523)+v,R=N(21,11,R+(v^(C|~T))+p-2054922799)+C,T=N(6,26,T+(C^(R|~v))+O+1873313359)+R,v=N(10,22,v+(R^(T|~C))+k-30611744)+T,C=N(15,17,C+(T^(v|~R))+y-1560198380)+v,R=N(21,11,R+(v^(C|~T))+E+1309151649)+C,T=N(6,26,T+(C^(R|~v))+D-145523070)+R,v=N(10,22,v+(R^(T|~C))+_-1120210379)+T,C=N(15,17,C+(T^(v|~R))+S+718787259)+v,R=N(21,11,R+(v^(C|~T))+P-343485551)+C,j=j+16,T=T+U>>>0,R=R+L>>>0,C=C+G>>>0,v=v+it>>>0);return Nt.endian([T,R,C,v]);function N(ot,tn,Rt){return Rt<<ot|Rt>>>tn}function Yl(ot,tn){for(var Rt=-1,hi=Math.floor((ot.length-1)/4),ft=0,cs,fs,ls,hs;hi-8>Rt++;)ft=Rt<<2,tn[Rt]=ot[ft+0]|ot[ft+1]<<8|ot[ft+2]<<16|ot[ft+3]<<24;for(Rt--;hi>Rt++;)ft=Rt<<2,cs=typeof ot[ft+0]>"u"?0:ot[ft+0],fs=typeof ot[ft+1]>"u"?0:ot[ft+1],ls=typeof ot[ft+2]>"u"?0:ot[ft+2],hs=typeof ot[ft+3]>"u"?0:ot[ft+3],tn[Rt]=cs|fs<<8|ls<<16|hs<<24;return hi+1}};return function(m,x,p,S){var b;return e=x.loops,t=x.loop,r=x.getA,i=x.getB,s=x.getC,f=x.getD,l=x.getX,n=x.setA,o=x.setB,a=x.setC,c=x.setD,u=x.setX,d=p,b=Nt.wordsToBytes(h(m)),S&&S.asBytes?b:Nt.bytesconvertNumberToHex(b)}}function ju(){var t=function(e,r){var n,i,o,s,a,f,c,l,u,d,h,m,x,p,S,b,D,M,y,I,O,P=new Date().getTime(),g=1732584193,_=-271733879,A=-1732584194,E=271733878,F=e.length*8;O=Nt.bytesToWords(e);for(var k=0;k<O.length;k++)O[k]=(O[k]<<8|O[k]>>>24)&16711935|(O[k]<<24|O[k]>>>8)&4278255360;O[F>>>5]|=128<<F%32,O[(F+64>>>9<<4)+14]=F;for(var U=0;U<O.length;U+=16)D=g,M=_,y=A,I=E,n=O[U+0]>>>0,i=O[U+1]>>>0,o=O[U+2]>>>0,s=O[U+3]>>>0,a=O[U+4]>>>0,f=O[U+5]>>>0,c=O[U+6]>>>0,l=O[U+7]>>>0,u=O[U+8]>>>0,d=O[U+9]>>>0,h=O[U+10]>>>0,m=O[U+11]>>>0,x=O[U+12]>>>0,p=O[U+13]>>>0,S=O[U+14]>>>0,b=O[U+15]>>>0,g=L(7,25,g+(_&A|~_&E)+n-680876936)+_,E=L(12,20,E+(g&_|~g&A)+i-389564586)+g,A=L(17,15,A+(E&g|~E&_)+o+606105819)+E,_=L(22,10,_+(A&E|~A&g)+s-1044525330)+A,g=L(7,25,g+(_&A|~_&E)+a-176418897)+_,E=L(12,20,E+(g&_|~g&A)+f+1200080426)+g,A=L(17,15,A+(E&g|~E&_)+c-1473231341)+E,_=L(22,10,_+(A&E|~A&g)+l-45705983)+A,g=L(7,25,g+(_&A|~_&E)+u+1770035416)+_,E=L(12,20,E+(g&_|~g&A)+d-1958414417)+g,A=L(17,15,A+(E&g|~E&_)+h-42063)+E,_=L(22,10,_+(A&E|~A&g)+m-1990404162)+A,g=L(7,25,g+(_&A|~_&E)+x+1804603682)+_,E=L(12,20,E+(g&_|~g&A)+p-40341101)+g,A=L(17,15,A+(E&g|~E&_)+S-1502002290)+E,_=L(22,10,_+(A&E|~A&g)+b+1236535329)+A,g=L(5,27,g+(_&E|A&~E)+i-165796510)+_,E=L(9,23,E+(g&A|_&~A)+c-1069501632)+g,A=L(14,18,A+(E&_|g&~_)+m+643717713)+E,_=L(20,12,_+(A&g|E&~g)+n-373897302)+A,g=L(5,27,g+(_&E|A&~E)+f-701558691)+_,E=L(9,23,E+(g&A|_&~A)+h+38016083)+g,A=L(14,18,A+(E&_|g&~_)+b-660478335)+E,_=L(20,12,_+(A&g|E&~g)+a-405537848)+A,g=L(5,27,g+(_&E|A&~E)+d+568446438)+_,E=L(9,23,E+(g&A|_&~A)+S-1019803690)+g,A=L(14,18,A+(E&_|g&~_)+s-187363961)+E,_=L(20,12,_+(A&g|E&~g)+u+1163531501)+A,g=L(5,27,g+(_&E|A&~E)+p-1444681467)+_,E=L(9,23,E+(g&A|_&~A)+o-51403784)+g,A=L(14,18,A+(E&_|g&~_)+l+1735328473)+E,_=L(20,12,_+(A&g|E&~g)+x-1926607734)+A,g=L(4,28,g+(_^A^E)+f-378558)+_,E=L(11,21,E+(g^_^A)+u-2022574463)+g,A=L(16,16,A+(E^g^_)+m+1839030562)+E,_=L(23,9,_+(A^E^g)+S-35309556)+A,g=L(4,28,g+(_^A^E)+i-1530992060)+_,E=L(11,21,E+(g^_^A)+a+1272893353)+g,A=L(16,16,A+(E^g^_)+l-155497632)+E,_=L(23,9,_+(A^E^g)+h-1094730640)+A,g=L(4,28,g+(_^A^E)+p+681279174)+_,E=L(11,21,E+(g^_^A)+n-358537222)+g,A=L(16,16,A+(E^g^_)+s-722521979)+E,_=L(23,9,_+(A^E^g)+c+76029189)+A,g=L(4,28,g+(_^A^E)+d-640364487)+_,E=L(11,21,E+(g^_^A)+x-421815835)+g,A=L(16,16,A+(E^g^_)+b+530742520)+E,_=L(23,9,_+(A^E^g)+o-995338651)+A,g=L(6,26,g+(A^(_|~E))+n-198630844)+_,E=L(10,22,E+(_^(g|~A))+l+1126891415)+g,A=L(15,17,A+(g^(E|~_))+S-1416354905)+E,_=L(21,11,_+(E^(A|~g))+f-57434055)+A,g=L(6,26,g+(A^(_|~E))+x+1700485571)+_,E=L(10,22,E+(_^(g|~A))+s-1894986606)+g,A=L(15,17,A+(g^(E|~_))+h-1051523)+E,_=L(21,11,_+(E^(A|~g))+i-2054922799)+A,g=L(6,26,g+(A^(_|~E))+u+1873313359)+_,E=L(10,22,E+(_^(g|~A))+b-30611744)+g,A=L(15,17,A+(g^(E|~_))+c-1560198380)+E,_=L(21,11,_+(E^(A|~g))+p+1309151649)+A,g=L(6,26,g+(A^(_|~E))+a-145523070)+_,E=L(10,22,E+(_^(g|~A))+m-1120210379)+g,A=L(15,17,A+(g^(E|~_))+o+718787259)+E,_=L(21,11,_+(E^(A|~g))+d-343485551)+A,g=g+D>>>0,_=_+M>>>0,A=A+y>>>0,E=E+I>>>0;return Nt.endian([g,_,A,E]);function L(G,it,q){return q<<G|q>>>it}};return function(e,r){var n=Nt.wordsToBytes(t(e,r)),i=r&&r.asBytes?n:Nt.bytesconvertNumberToHex(n);return i}}function Yu(t){var e,r,n,i=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>i++;)n[i]=t.charCodeAt(i);return n}function Ju(t){return Buffer.from(t,"base64").toString("binary")}function Vc(t){return t}function $u(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return Nt.rotl(e,8)&16711935|Nt.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=Nt.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,i=0;n<e.length;n++,i+=8)r[i>>>5]|=e[n]<<24-i%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 Xn{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let i=await new Promise((o,s)=>bo(e).then(o).catch(s));return zc(i,r)}};var Vn=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){nr(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 ir(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var Te=Ct(Ol(),1),jt=Ct(Bl(),1);var Re=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 Oe(jt.default.gzip)(e):await Oe(jt.default.deflate)(e);return De(r)}return this.compressSync(e)}async decompress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Oe(jt.default.gunzip)(e):await Oe(jt.default.inflate)(e);return De(r)}return this.decompressSync(e)}compressSync(e){if(!xt&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?jt.default.gzipSync(e):jt.default.deflateSync(e);return De(o)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?Te.default.deflateRaw:Te.default.deflate)(n,r).buffer}decompressSync(e){if(!xt&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?jt.default.gunzipSync(e):jt.default.inflateSync(e);return De(o)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?Te.default.inflateRaw:Te.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new Te.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new Te.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 s of r){let a=new Uint8Array(s);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=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 Kr=class extends Re{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(e){super({...e,deflate:{...e?.gzip,gzip:!0}})}};var qm={0:async t=>t,8:async t=>await new Re({raw:!0}).decompress(t)},ai=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!xt)this.fileProvider=new sr(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):xi(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=Ve(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 i=await this.getCDFileHeader(e),o=await _e(i.localHeaderOffset,this.fileProvider);if(!o)throw new Error("Local file header has not been found in the zip archive`");let s=qm[o.compressionMethod.toString()];if(!s)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(o.fileDataOffset,o.fileDataOffset+o.compressedSize);r=await s(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=Ve(this.fileProvider),n=null;for await(let i of r)if(i.fileName===e){n=i;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 ai(this.fileProvider).fetch(e)).arrayBuffer()}};function os(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let i=e.getBigUint64(n+16,!0),o=Zm(t,n,16);r[o]=i}return r}function Zm(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function ss(t){let e=Ve(t);return Qm(e)}async function Qm(t){let e=new xe,r=new TextEncoder,n={};for await(let i of t){let o=i.fileName.split("\\").join("/").toLocaleLowerCase(),s=r.encode(o).buffer,a=await e.hash(s,"hex");n[a]=i.localHeaderOffset}return n}var Km=[{test:/^$/,extensions:["3dSceneLayer.json.gz"]},{test:/^nodepages\/\d+$/,extensions:[".json.gz"]},{test:/^nodes\/(\d+|root)$/,extensions:["/3dNodeIndexDocument.json.gz"]},{test:/^nodes\/\d+\/textures\/.+$/,extensions:[".jpg",".png",".bin.dds.gz",".ktx"]},{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+$/,extensions:[".json.gz"]},{test:/^nodes\/\d+\/shared$/,extensions:["/sharedResource.json.gz"]}],er=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=Km.find(i=>i.test.test(e))?.extensions;if(n){let i;for(let o of n)if(i=await this.getDataByPath(`${e}${o}`),i)break;if(i)return i}}if(r==="raw"){let n=await this.getDataByPath(`${e}.gz`);if(n)return n;let i=await this.getFileBytes(e);if(i)return i}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 Kr().decompress(r):r}async getFileBytes(e){let r;if(this.hashTable){let n=this._textEncoder.encode(e),i=await this._md5Hash.hash(n.buffer,"hex"),o=this.hashTable[i];if(o===void 0)return;let s=await _e(o,this.fileProvider);if(!s)return;r=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize)}else try{r=await this.getFileWithoutHash(e)}catch{r=void 0}return r}};async function ci(t,e,r){let n=await Ir(t,Or),i=await Dr(n,t),o;if(i?.fileName!=="@specialIndexFileHASH128@")o=await ss(t),e?.("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await _e(i.localHeaderOffset,t);if(!s)throw new Error("corrupted SLPK");let a=s.fileDataOffset,f=await t.slice(a,a+s.compressedSize);o=os(f)}return new er(t,o,r)}var jm="4.3.0-alpha.2",Pl={dataType:null,batchType:null,name:"I3S SLPK (Scene Layer Package)",id:"slpk",module:"i3s",version:jm,mimeTypes:["application/octet-stream"],extensions:["slpk"],options:{},parse:async(t,e={})=>(await ci(new de(new DataView(t)))).getFile(e.slpk?.path??"",e.slpk?.pathMode)};var Fl=Ct(Ht(),1);function Nl(t,e){let{attributeName:r,attributeType:n}=e;return r?{[r]:n?Ym(n,t):null}:{}}function Ym(t,e){switch(t){case Sa:return t_(e);case ya:return Ll(e);case wa:return $m(e);case ba:return Jm(e);default:return Ll(e)}}function Ll(t){return new Uint32Array(t,4)}function Jm(t){return new Int16Array(t,4)}function $m(t){return new Float64Array(t,8)}function t_(t){let i=[];try{let o=new DataView(t,0,4).getUint32(0,!0),s=new Uint32Array(t,8,o),a=8+o*4;for(let f of s){let c=new TextDecoder("utf-8"),l=new Uint8Array(t,a,f);i.push(c.decode(l)),a+=f}}catch(o){console.error("Parse string attribute error: ",o.message)}return i}var e_="4.3.0-alpha.2",kl="",r_="rejected",jr={dataType:null,batchType:null,name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:e_,mimeTypes:["application/binary"],parse:async(t,e)=>Nl(t,e),extensions:["bin"],options:{},binary:!0};async function Ul(t,e,r={}){let{attributeStorageInfo:n,attributeUrls:i,tilesetFields:o}=n_(t);if(!n||!i||e<0)return null;let s=[],a=[];for(let f=0;f<n.length;f++){let c=Lt(i[f],r.i3s?.token),l=n[f].name,u=as(n[f]),d={...r,attributeName:l,attributeType:u},h=(0,Fl.load)(c,jr,d);a.push(h)}try{s=await Promise.allSettled(a)}catch{}return s.length?o_(s,n,e,o):null}function n_(t){let e=t.tileset?.tileset?.attributeStorageInfo,r=t.header?.attributeUrls,n=t.tileset?.tileset?.fields||[];return{attributeStorageInfo:e,attributeUrls:r,tilesetFields:n}}function as(t){return t.hasOwnProperty("objectIds")?"Oid32":t.hasOwnProperty("attributeValues")?t.attributeValues.valueType:""}function i_(t){return t.find(r=>r.name.includes("OBJECTID"))?.name}function o_(t,e,r,n){let i=i_(e),o=t.find(a=>a.value[i]);if(!o)return null;let s=o.value[i].indexOf(r);return s<0?null:s_(t,s,e,n)}function s_(t,e,r,n){let i={};for(let o=0;o<r.length;o++){let s=r[o].name,a=a_(s,n),f=c_(t,o,s);i[s]=f_(f,e,a)}return i}function a_(t,e){return e.find(n=>n.name===t||n.alias===t)?.domain?.codedValues||[]}function c_(t,e,r){let n=t[e];return n.status===r_?null:n.value[r]}function f_(t,e,r){let n=kl;return t&&e in t&&(n=String(t[e]).replace(/\u0000|NaN/g,"").trim()),r.length&&(n=r.find(o=>o.code===Number(n))?.name||kl),n}var l_="3DObject";async function zl(t,e){let r=JSON.parse(new TextDecoder().decode(t)),{sublayers:n}=r;return{header:r,sublayers:Gl(n,e)}}function Gl(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],{id:o,layerType:s,visibility:a=!0,...f}=i;if(s===l_){let c=`${e}/sublayers/${o}`;r.push({url:c,id:o,layerType:s,visibility:a,...f})}i?.sublayers?.length&&(r=[...r,...Gl(i.sublayers,e)])}return r}var h_="4.3.0-alpha.2",Hl={dataType:null,batchType:null,name:"I3S Building Scene Layer",id:"i3s-building-scene-layer",module:"i3s",version:h_,mimeTypes:["application/json"],parse:d_,extensions:["json"],options:{}};async function d_(t,e,r){if(!r?.url)throw new Error("Url is not provided");return zl(t,r.url)}var fi=Ct(Ht(),1),u_=4326,p_="ArcGISSceneServiceLayer",m_="BuildingSceneLayer",__="IntegratedMeshLayer",Xl="GroupLayer",x_=[p_,__,m_,Xl],g_="NO_AVAILABLE_SUPPORTED_LAYERS_ERROR",A_="NOT_SUPPORTED_CRS_ERROR",Yr=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:i}=await Wl(r,!0);if(!n.length)throw new Yr(g_,i);return{header:e,layers:n,unsupportedLayers:i}}async function Wl(t,e){let r=[],n=[];for(let i=0;i<t.length;i++){let o=t[i];if(x_.includes(o.layerType)?(e&&o.layerType!==Xl&&(await E_(o),e=!1),r.push(o)):n.push(o),o.layers?.length){let{layers:a,unsupportedLayers:f}=await Wl(o.layers,e);o.layers=a,n=[...n,...f]}}return{layers:r,unsupportedLayers:n}}async function E_(t){try{if((await(0,fi.load)(t.url,fi.JSONLoader))?.spatialReference?.wkid!==u_)throw new Error(A_)}catch(e){throw e}}var S_="4.3.0-alpha.2",ql={dataType:null,batchType:null,name:"ArcGIS Web Scene Loader",id:"arcgis-web-scene",module:"i3s",version:S_,mimeTypes:["application/json"],parse:y_,extensions:["json"],options:{}};async function y_(t){return Vl(t)}var Ql=Ct(Ht(),1);async function Kl(t,e,r,n,i,o,s){if(!o)return t;let a={...t,value:new Uint8Array(t.value)},f=n.find(({name:h})=>h===o?.attributeName);if(!f||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(f.type))return t;let c=await Zl(f.name,r,i,s);if(!c)return t;let l=n.find(({type:h})=>h==="esriFieldTypeOID");if(!l)return t;let u=await Zl(l.name,r,i,s);if(!u)return t;let d={};for(let h=0;h<u[l.name].length;h++)d[u[l.name][h]]=w_(c[f.name][h],o);for(let h=0;h<e.length;h++){let m=d[e[h]];m&&(o.mode==="multiply"?m.forEach((x,p)=>{a.value[h*4+p]=a.value[h*4+p]*x/255}):a.value.set(m,h*4))}return a}function w_(t,e){if(!e)return[255,255,255,255];let{minValue:r,maxValue:n,minColor:i,maxColor:o}=e,s=(t-r)/(n-r),a=[255,255,255,255];for(let f=0;f<i.length;f++)a[f]=Math.round((o[f]-i[f])*s+i[f]);return a}async function Zl(t,e,r,n){let i=r.findIndex(({name:f})=>t===f);if(i===-1)return null;let o=Lt(e[i],n),s=as(r[i]);return await(0,Ql.load)(o,jr,{attributeName:t,attributeType:s})}return n0(Jr);})();
8
8
  return __exports__;
9
9
  });