@loaders.gl/tile-converter 4.0.5 → 4.0.6
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/converter.min.cjs +2 -2
- package/dist/deps-installer/deps-installer.js +1 -1
- package/dist/deps-installer/deps-installer.js.map +1 -1
- package/dist/lib/utils/statistic-utills.d.ts +23 -6
- package/dist/pgm-loader.js +1 -1
- package/dist/pgm-loader.js.map +1 -1
- package/package.json +14 -14
- package/dist/lib/utils/statistic-utills.d.js +0 -2
- package/dist/lib/utils/statistic-utills.d.js.map +0 -1
package/dist/converter.min.cjs
CHANGED
|
@@ -170,13 +170,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);return new zi(e,t).found}f
|
|
|
170
170
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof zi))return new zi(e,t);if(HLt(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}zi.prototype._finish=function(){if(N3e.ok(this instanceof zi),this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t)try{i=e._makeAbs(i);var a=zLt.realpathSync(i,e.realpathCache);n[a]=!0}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=!0;else throw o}})}u0.finish(this)};zi.prototype._process=function(e,t,r){N3e.ok(this instanceof zi);for(var n=0;typeof e[n]=="string";)n++;var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var a=e.slice(n),o;i===null?o=".":((RF(i)||RF(e.map(function(c){return typeof c=="string"?c:"[*]"}).join("/")))&&(!i||!RF(i))&&(i="/"+i),o=i);var s=this._makeAbs(o);if(!WLt(this,o)){var u=a[0]===q3e.GLOBSTAR;u?this._processGlobStar(i,o,s,a,t,r):this._processReaddir(i,o,s,a,t,r)}};zi.prototype._processReaddir=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){for(var s=n[0],u=!!this.minimatch.negate,c=s._glob,l=this.dot||c.charAt(0)===".",f=[],p=0;p<o.length;p++){var h=o[p];if(h.charAt(0)!=="."||l){var d;u&&!e?d=!h.match(s):d=h.match(s),d&&f.push(h)}}var b=f.length;if(b!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var p=0;p<b;p++){var h=f[p];e&&(e.slice(-1)!=="/"?h=e+"/"+h:h=e+h),h.charAt(0)==="/"&&!this.nomount&&(h=JG.join(this.root,h)),this._emitMatch(i,h)}return}n.shift();for(var p=0;p<b;p++){var h=f[p],g;e?g=[e,h]:g=[h],this._process(g.concat(n),i,a)}}}};zi.prototype._emitMatch=function(e,t){if(!VLt(this,t)){var r=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}};zi.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,r,n;try{r=this.fs.lstatSync(e)}catch(a){if(a.code==="ENOENT")return null}var i=r&&r.isSymbolicLink();return this.symlinks[e]=i,!i&&r&&!r.isDirectory()?this.cache[e]="FILE":t=this._readdir(e,!1),t};zi.prototype._readdir=function(e,t){var r;if(t&&!XG(this.symlinks,e))return this._readdirInGlobStar(e);if(XG(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){return this._readdirError(e,i),null}};zi.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var n=t[r];e==="/"?n=e+n:n=e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,t};zi.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=t.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t);break}};zi.prototype._processGlobStar=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){var s=n.slice(1),u=e?[e]:[],c=u.concat(s);this._process(c,i,!1);var l=o.length,f=this.symlinks[r];if(!(f&&a))for(var p=0;p<l;p++){var h=o[p];if(!(h.charAt(0)==="."&&!this.dot)){var d=u.concat(o[p],s);this._process(d,i,!0);var b=u.concat(o[p],n);this._process(b,i,!0)}}}};zi.prototype._processSimple=function(e,t){var r=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),!!r){if(e&&RF(e)&&!this.nomount){var n=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=JG.join(this.root,e):(e=JG.resolve(this.root,e),n&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}};zi.prototype._stat=function(e){var t=this._makeAbs(e),r=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&XG(this.cache,t)){var o=this.cache[t];if(Array.isArray(o)&&(o="DIR"),!r||o==="DIR")return o;if(r&&o==="FILE")return!1}var n,i=this.statCache[t];if(!i){var a;try{a=this.fs.lstatSync(t)}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return this.statCache[t]=!1,!1}if(a&&a.isSymbolicLink())try{i=this.fs.statSync(t)}catch{i=a}else i=a}this.statCache[t]=i;var o=!0;return i&&(o=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,r&&o==="FILE"?!1:o};zi.prototype._mark=function(e){return u0.mark(this,e)};zi.prototype._makeAbs=function(e){return u0.makeAbs(this,e)}});var ZG=v((o3r,W3e)=>{W3e.exports=H3e;function H3e(e,t){if(e&&t)return H3e(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=e.apply(this,n),o=n[n.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(s){a[s]=o[s]}),a}}});var LF=v((s3r,ez)=>{var V3e=ZG();ez.exports=V3e(jF);ez.exports.strict=V3e(K3e);jF.proto=jF(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return jF(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return K3e(this)},configurable:!0})});function jF(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function K3e(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var Y3e=v((u3r,$3e)=>{var KLt=ZG(),y2=Object.create(null),$Lt=LF();$3e.exports=KLt(YLt);function YLt(e,t){return y2[e]?(y2[e].push(t),null):(y2[e]=[t],JLt(e))}function JLt(e){return $Lt(function t(){var r=y2[e],n=r.length,i=XLt(arguments);try{for(var a=0;a<n;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick(function(){t.apply(null,i)})):delete y2[e]}})}function XLt(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}});var QG=v((f3r,X3e)=>{X3e.exports=c0;var QLt=GG(),J3e=OF(),c3r=J3e.Minimatch,ZLt=tr(),eMt=require("events").EventEmitter,tz=require("path"),rz=require("assert"),x2=PF(),iz=z3e(),l0=YG(),tMt=l0.setopts,nz=l0.ownProp,az=Y3e(),l3r=require("util"),rMt=l0.childrenIgnored,nMt=l0.isIgnored,iMt=LF();function c0(e,t,r){if(typeof t=="function"&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return iz(e,t)}return new on(e,t,r)}c0.sync=iz;var aMt=c0.GlobSync=iz.GlobSync;c0.glob=c0;function oMt(e,t){if(t===null||typeof t!="object")return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}c0.hasMagic=function(e,t){var r=oMt({},t);r.noprocess=!0;var n=new on(e,r),i=n.minimatch.set;if(!e)return!1;if(i.length>1)return!0;for(var a=0;a<i[0].length;a++)if(typeof i[0][a]!="string")return!0;return!1};c0.Glob=on;ZLt(on,eMt);function on(e,t,r){if(typeof t=="function"&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new aMt(e,t)}if(!(this instanceof on))return new on(e,t,r);tMt(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof r=="function"&&(r=iMt(r),this.on("error",r),this.on("end",function(u){r(null,u)}));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(n===0)return s();for(var a=!0,o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1,s);a=!1;function s(){--i._processing,i._processing<=0&&(a?process.nextTick(function(){i._finish()}):i._finish())}}on.prototype._finish=function(){if(rz(this instanceof on),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();l0.finish(this),this.emit("end",this.found)}};on.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var e=this.matches.length;if(e===0)return this._finish();for(var t=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){--e===0&&t._finish()}};on.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r),i=this,a=n.length;if(a===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(s,u){s=i._makeAbs(s),QLt.realpath(s,i.realpathCache,function(c,l){c?c.syscall==="stat"?o[s]=!0:i.emit("error",c):o[l]=!0,--a===0&&(i.matches[e]=o,t())})})};on.prototype._mark=function(e){return l0.mark(this,e)};on.prototype._makeAbs=function(e){return l0.makeAbs(this,e)};on.prototype.abort=function(){this.aborted=!0,this.emit("abort")};on.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};on.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}};on.prototype._process=function(e,t,r,n){if(rz(this instanceof on),rz(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([e,t,r,n]);return}for(var i=0;typeof e[i]=="string";)i++;var a;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:a=null;break;default:a=e.slice(0,i).join("/");break}var o=e.slice(i),s;a===null?s=".":((x2(a)||x2(e.map(function(l){return typeof l=="string"?l:"[*]"}).join("/")))&&(!a||!x2(a))&&(a="/"+a),s=a);var u=this._makeAbs(s);if(rMt(this,s))return n();var c=o[0]===J3e.GLOBSTAR;c?this._processGlobStar(a,s,u,o,t,r,n):this._processReaddir(a,s,u,o,t,r,n)}};on.prototype._processReaddir=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){return s._processReaddir2(e,t,r,n,i,a,c,o)})};on.prototype._processReaddir2=function(e,t,r,n,i,a,o,s){if(!o)return s();for(var u=n[0],c=!!this.minimatch.negate,l=u._glob,f=this.dot||l.charAt(0)===".",p=[],h=0;h<o.length;h++){var d=o[h];if(d.charAt(0)!=="."||f){var b;c&&!e?b=!d.match(u):b=d.match(u),b&&p.push(d)}}var g=p.length;if(g===0)return s();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var h=0;h<g;h++){var d=p[h];e&&(e!=="/"?d=e+"/"+d:d=e+d),d.charAt(0)==="/"&&!this.nomount&&(d=tz.join(this.root,d)),this._emitMatch(i,d)}return s()}n.shift();for(var h=0;h<g;h++){var d=p[h],x;e&&(e!=="/"?d=e+"/"+d:d=e+d),this._process([d].concat(n),i,a,s)}s()};on.prototype._emitMatch=function(e,t){if(!this.aborted&&!nMt(this,t)){if(this.paused){this._emitQueue.push([e,t]);return}var r=x2(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=!0;var i=this.statCache[r];i&&this.emit("stat",t,i),this.emit("match",t)}}};on.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,!1,t);var r="lstat\0"+e,n=this,i=az(r,a);i&&n.fs.lstat(e,i);function a(o,s){if(o&&o.code==="ENOENT")return t();var u=s&&s.isSymbolicLink();n.symlinks[e]=u,!u&&s&&!s.isDirectory()?(n.cache[e]="FILE",t()):n._readdir(e,!1,t)}};on.prototype._readdir=function(e,t,r){if(!this.aborted&&(r=az("readdir\0"+e+"\0"+t,r),!!r)){if(t&&!nz(this.symlinks,e))return this._readdirInGlobStar(e,r);if(nz(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,sMt(this,e,r))}};function sMt(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}on.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];e==="/"?i=e+i:i=e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}};on.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t);break}return r()}};on.prototype._processGlobStar=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){s._processGlobStar2(e,t,r,n,i,a,c,o)})};on.prototype._processGlobStar2=function(e,t,r,n,i,a,o,s){if(!o)return s();var u=n.slice(1),c=e?[e]:[],l=c.concat(u);this._process(l,i,!1,s);var f=this.symlinks[r],p=o.length;if(f&&a)return s();for(var h=0;h<p;h++){var d=o[h];if(!(d.charAt(0)==="."&&!this.dot)){var b=c.concat(o[h],u);this._process(b,i,!0,s);var g=c.concat(o[h],n);this._process(g,i,!0,s)}}s()};on.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,a){n._processSimple2(e,t,i,a,r)})};on.prototype._processSimple2=function(e,t,r,n,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!n)return i();if(e&&x2(e)&&!this.nomount){var a=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=tz.join(this.root,e):(e=tz.resolve(this.root,e),a&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()};on.prototype._stat=function(e,t){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&nz(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var a,o=this.statCache[r];if(o!==void 0){if(o===!1)return t(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&s==="FILE"?t():t(null,s,o)}var u=this,c=az("stat\0"+r,l);c&&u.fs.lstat(r,c);function l(f,p){if(p&&p.isSymbolicLink())return u.fs.stat(r,function(h,d){h?u._stat2(e,r,null,p,t):u._stat2(e,r,h,d,t)});u._stat2(e,r,f,p,t)}};on.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return this.statCache[t]=!1,i();var a=e.slice(-1)==="/";if(this.statCache[t]=n,t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,a&&o==="FILE"?i():i(null,o,n)}});var tCe=v((p3r,eCe)=>{var Z3e=wG(),Tb=require("path"),oz=M6e(),uMt=J6e(),cMt=c3e(),lMt=h3e(),fMt=QG(),f0=eCe.exports={},Q3e=/[\/\\]/g,pMt=function(e,t){var r=[];return oz(e).forEach(function(n){var i=n.indexOf("!")===0;i&&(n=n.slice(1));var a=t(n);i?r=uMt(r,a):r=cMt(r,a)}),r};f0.exists=function(){var e=Tb.join.apply(Tb,arguments);return Z3e.existsSync(e)};f0.expand=function(...e){var t=lMt(e[0])?e.shift():{},r=Array.isArray(e[0])?e[0]:e;if(r.length===0)return[];var n=pMt(r,function(i){return fMt.sync(i,t)});return t.filter&&(n=n.filter(function(i){i=Tb.join(t.cwd||"",i);try{return typeof t.filter=="function"?t.filter(i):Z3e.statSync(i)[t.filter]()}catch{return!1}})),n};f0.expandMapping=function(e,t,r){r=Object.assign({rename:function(a,o){return Tb.join(a||"",o)}},r);var n=[],i={};return f0.expand(r,e).forEach(function(a){var o=a;r.flatten&&(o=Tb.basename(o)),r.ext&&(o=o.replace(/(\.[^\/]*)?$/,r.ext));var s=r.rename(t,o,r);r.cwd&&(a=Tb.join(r.cwd,a)),s=s.replace(Q3e,"/"),a=a.replace(Q3e,"/"),i[s]?i[s].src.push(a):(n.push({src:[a],dest:s}),i[s]=n[n.length-1])}),n};f0.normalizeFilesArray=function(e){var t=[];return e.forEach(function(r){var n;("src"in r||"dest"in r)&&t.push(r)}),t.length===0?[]:(t=_(t).chain().forEach(function(r){!("src"in r)||!r.src||(Array.isArray(r.src)?r.src=oz(r.src):r.src=[r.src])}).map(function(r){var n=Object.assign({},r);if(delete n.src,delete n.dest,r.expand)return f0.expandMapping(r.src,r.dest,n).map(function(a){var o=Object.assign({},r);return o.orig=Object.assign({},r),o.src=a.src,o.dest=a.dest,["expand","cwd","flatten","rename","ext"].forEach(function(s){delete o[s]}),o});var i=Object.assign({},r);return i.orig=Object.assign({},r),"src"in i&&Object.defineProperty(i,"src",{enumerable:!0,get:function a(){var o;return"result"in a||(o=r.src,o=Array.isArray(o)?oz(o):[o],a.result=f0.expand(n,o)),a.result}}),"dest"in i&&(i.dest=r.dest),i}).flatten().value(),t)}});var Cb=v((d3r,iCe)=>{var sz=wG(),rCe=require("path"),h3r=require("util"),hMt=E6e(),nCe=EG(),dMt=O6e(),mMt=require("stream").Stream,gMt=O_().PassThrough,No=iCe.exports={};No.file=tCe();No.collectStream=function(e,t){var r=[],n=0;e.on("error",t),e.on("data",function(i){r.push(i),n+=i.length}),e.on("end",function(){var i=new Buffer(n),a=0;r.forEach(function(o){o.copy(i,a),a+=o.length}),t(null,i)})};No.dateify=function(e){return e=e||new Date,e instanceof Date?e=e:typeof e=="string"?e=new Date(e):e=new Date,e};No.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},dMt(...n)};No.isStream=function(e){return e instanceof mMt};No.lazyReadStream=function(e){return new hMt.Readable(function(){return sz.createReadStream(e)})};No.normalizeInputSource=function(e){if(e===null)return new Buffer(0);if(typeof e=="string")return new Buffer(e);if(No.isStream(e)&&!e._readableState){var t=new gMt;return e.pipe(t),t}return e};No.sanitizePath=function(e){return nCe(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};No.trailingSlashIt=function(e){return e.slice(-1)!=="/"?e+"/":e};No.unixifyPath=function(e){return nCe(e,!1).replace(/^\w+:/,"")};No.walkdir=function(e,t,r){var n=[];typeof t=="function"&&(r=t,t=e),sz.readdir(e,function(i,a){var o=0,s,u;if(i)return r(i);(function c(){if(s=a[o++],!s)return r(null,n);u=rCe.join(e,s),sz.stat(u,function(l,f){n.push({path:u,relative:rCe.relative(t,u).replace(/\\/g,"/"),stats:f}),f&&f.isDirectory()?No.walkdir(u,t,function(p,h){h.forEach(function(d){n.push(d)}),c()}):c()})})()})}});var uCe=v((oCe,sCe)=>{var vMt=require("util"),bMt={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function aCe(e,t){Error.captureStackTrace(this,this.constructor),this.message=bMt[e]||e,this.code=e,this.data=t}vMt.inherits(aCe,Error);oCe=sCe.exports=aCe});var uz=v((m3r,cCe)=>{cCe.exports=require("stream")});var mCe=v((g3r,dCe)=>{"use strict";function lCe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fCe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lCe(Object(r),!0).forEach(function(n){yMt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yMt(e,t,r){return t=hCe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xMt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hCe(n.key),n)}}function _Mt(e,t,r){return t&&pCe(e.prototype,t),r&&pCe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hCe(e){var t=wMt(e,"string");return typeof t=="symbol"?t:String(t)}function wMt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EMt=require("buffer"),MF=EMt.Buffer,AMt=require("util"),cz=AMt.inspect,SMt=cz&&cz.custom||"inspect";function TMt(e,t,r){MF.prototype.copy.call(e,t,r)}dCe.exports=function(){function e(){xMt(this,e),this.head=null,this.tail=null,this.length=0}return _Mt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return MF.alloc(0);for(var n=MF.allocUnsafe(r>>>0),i=this.head,a=0;i;)TMt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=MF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:SMt,value:function(r,n){return cz(this,fCe(fCe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var fz=v((v3r,vCe)=>{"use strict";function CMt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(lz,this,e)):process.nextTick(lz,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(qF,r):(r._writableState.errorEmitted=!0,process.nextTick(gCe,r,a)):process.nextTick(gCe,r,a):t?(process.nextTick(qF,r),t(a)):process.nextTick(qF,r)}),this)}function gCe(e,t){lz(e,t),qF(e)}function qF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function DMt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function lz(e,t){e.emit("error",t)}function FMt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}vCe.exports={destroy:CMt,undestroy:DMt,errorOrDestroy:FMt}});var Vp=v((b3r,xCe)=>{"use strict";var yCe={};function Cs(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,yCe[e]=i}function bCe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function kMt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function BMt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function OMt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Cs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Cs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&kMt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(BMt(e," argument"))i=`The ${e} ${n} ${bCe(t,"type")}`;else{let a=OMt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${bCe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Cs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Cs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Cs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Cs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Cs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Cs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Cs("ERR_STREAM_WRITE_AFTER_END","write after end");Cs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Cs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Cs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");xCe.exports.codes=yCe});var pz=v((y3r,_Ce)=>{"use strict";var IMt=Vp().codes.ERR_INVALID_OPT_VALUE;function PMt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function RMt(e,t,r,n){var i=PMt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new IMt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}_Ce.exports={getHighWaterMark:RMt}});var mz=v((x3r,CCe)=>{"use strict";CCe.exports=oi;function ECe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){u7t(t,e)}}var Db;oi.WritableState=w2;var jMt={deprecate:pd()},ACe=uz(),UF=require("buffer").Buffer,LMt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function MMt(e){return UF.from(e)}function qMt(e){return UF.isBuffer(e)||e instanceof LMt}var dz=fz(),NMt=pz(),UMt=NMt.getHighWaterMark,Kp=Vp().codes,GMt=Kp.ERR_INVALID_ARG_TYPE,zMt=Kp.ERR_METHOD_NOT_IMPLEMENTED,HMt=Kp.ERR_MULTIPLE_CALLBACK,WMt=Kp.ERR_STREAM_CANNOT_PIPE,VMt=Kp.ERR_STREAM_DESTROYED,KMt=Kp.ERR_STREAM_NULL_VALUES,$Mt=Kp.ERR_STREAM_WRITE_AFTER_END,YMt=Kp.ERR_UNKNOWN_ENCODING,Fb=dz.errorOrDestroy;tr()(oi,ACe);function JMt(){}function w2(e,t,r){Db=Db||p0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Db),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=UMt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){n7t(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new ECe(this)}w2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(w2.prototype,"buffer",{get:jMt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var NF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(NF=Function.prototype[Symbol.hasInstance],Object.defineProperty(oi,Symbol.hasInstance,{value:function(t){return NF.call(this,t)?!0:this!==oi?!1:t&&t._writableState instanceof w2}})):NF=function(t){return t instanceof this};function oi(e){Db=Db||p0();var t=this instanceof Db;if(!t&&!NF.call(oi,this))return new oi(e);this._writableState=new w2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),ACe.call(this)}oi.prototype.pipe=function(){Fb(this,new WMt)};function XMt(e,t){var r=new $Mt;Fb(e,r),process.nextTick(t,r)}function QMt(e,t,r,n){var i;return r===null?i=new KMt:typeof r!="string"&&!t.objectMode&&(i=new GMt("chunk",["string","Buffer"],r)),i?(Fb(e,i),process.nextTick(n,i),!1):!0}oi.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&qMt(e);return a&&!UF.isBuffer(e)&&(e=MMt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=JMt),n.ending?XMt(this,r):(a||QMt(this,n,e,r))&&(n.pendingcb++,i=e7t(this,n,a,e,t,r)),i};oi.prototype.cork=function(){this._writableState.corked++};oi.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&SCe(this,e))};oi.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new YMt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(oi.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ZMt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=UF.from(t,r)),t}Object.defineProperty(oi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function e7t(e,t,r,n,i,a){if(!r){var o=ZMt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else hz(e,t,!1,s,n,i,a);return u}function hz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new VMt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function t7t(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(_2,e,t),e._writableState.errorEmitted=!0,Fb(e,n)):(i(n),e._writableState.errorEmitted=!0,Fb(e,n),_2(e,t))}function r7t(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function n7t(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new HMt;if(r7t(r),t)t7t(e,r,n,t,i);else{var a=TCe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&SCe(e,r),n?process.nextTick(wCe,e,r,a,i):wCe(e,r,a,i)}}function wCe(e,t,r,n){r||i7t(e,t),t.pendingcb--,n(),_2(e,t)}function i7t(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function SCe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,hz(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new ECe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(hz(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}oi.prototype._write=function(e,t,r){r(new zMt("_write()"))};oi.prototype._writev=null;oi.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||s7t(this,n,r),this};Object.defineProperty(oi.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function TCe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function a7t(e,t){e._final(function(r){t.pendingcb--,r&&Fb(e,r),t.prefinished=!0,e.emit("prefinish"),_2(e,t)})}function o7t(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(a7t,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function _2(e,t){var r=TCe(t);if(r&&(o7t(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function s7t(e,t,r){t.ending=!0,_2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function u7t(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(oi.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});oi.prototype.destroy=dz.destroy;oi.prototype._undestroy=dz.undestroy;oi.prototype._destroy=function(e,t){t(e)}});var p0=v((_3r,FCe)=>{"use strict";var c7t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};FCe.exports=Ic;var DCe=bz(),vz=mz();tr()(Ic,DCe);for(gz=c7t(vz.prototype),GF=0;GF<gz.length;GF++)zF=gz[GF],Ic.prototype[zF]||(Ic.prototype[zF]=vz.prototype[zF]);var gz,zF,GF;function Ic(e){if(!(this instanceof Ic))return new Ic(e);DCe.call(this,e),vz.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l7t)))}Object.defineProperty(Ic.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ic.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ic.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l7t(){this._writableState.ended||process.nextTick(f7t,this)}function f7t(e){e.end()}Object.defineProperty(Ic.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var _z=v(BCe=>{"use strict";var xz=Gs().Buffer,kCe=xz.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function p7t(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function h7t(e){var t=p7t(e);if(typeof t!="string"&&(xz.isEncoding===kCe||!kCe(e)))throw new Error("Unknown encoding: "+e);return t||e}BCe.StringDecoder=E2;function E2(e){this.encoding=h7t(e);var t;switch(this.encoding){case"utf16le":this.text=y7t,this.end=x7t,t=4;break;case"utf8":this.fillLast=g7t,t=4;break;case"base64":this.text=_7t,this.end=w7t,t=3;break;default:this.write=E7t,this.end=A7t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=xz.allocUnsafe(t)}E2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};E2.prototype.end=b7t;E2.prototype.text=v7t;E2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function yz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function d7t(e,t,r){var n=t.length-1;if(n<r)return 0;var i=yz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=yz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=yz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function m7t(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function g7t(e){var t=this.lastTotal-this.lastNeed,r=m7t(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function v7t(e,t){var r=d7t(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function b7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function y7t(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function x7t(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function _7t(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function w7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function E7t(e){return e.toString(this.encoding)}function A7t(e){return e&&e.length?this.write(e):""}});var HF=v((E3r,PCe)=>{"use strict";var OCe=Vp().codes.ERR_STREAM_PREMATURE_CLOSE;function S7t(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function T7t(){}function C7t(e){return e.setHeader&&typeof e.abort=="function"}function ICe(e,t,r){if(typeof t=="function")return ICe(e,null,t);t||(t={}),r=S7t(r||T7t);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new OCe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new OCe),r.call(e,d)},p=function(){e.req.on("finish",s)};return C7t(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",p),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}PCe.exports=ICe});var jCe=v((A3r,RCe)=>{"use strict";var WF;function $p(e,t,r){return t=D7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D7t(e){var t=F7t(e,"string");return typeof t=="symbol"?t:String(t)}function F7t(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var k7t=HF(),Yp=Symbol("lastResolve"),h0=Symbol("lastReject"),A2=Symbol("error"),VF=Symbol("ended"),d0=Symbol("lastPromise"),wz=Symbol("handlePromise"),m0=Symbol("stream");function Jp(e,t){return{value:e,done:t}}function B7t(e){var t=e[Yp];if(t!==null){var r=e[m0].read();r!==null&&(e[d0]=null,e[Yp]=null,e[h0]=null,t(Jp(r,!1)))}}function O7t(e){process.nextTick(B7t,e)}function I7t(e,t){return function(r,n){e.then(function(){if(t[VF]){r(Jp(void 0,!0));return}t[wz](r,n)},n)}}var P7t=Object.getPrototypeOf(function(){}),R7t=Object.setPrototypeOf((WF={get stream(){return this[m0]},next:function(){var t=this,r=this[A2];if(r!==null)return Promise.reject(r);if(this[VF])return Promise.resolve(Jp(void 0,!0));if(this[m0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[A2]?s(t[A2]):o(Jp(void 0,!0))})});var n=this[d0],i;if(n)i=new Promise(I7t(n,this));else{var a=this[m0].read();if(a!==null)return Promise.resolve(Jp(a,!1));i=new Promise(this[wz])}return this[d0]=i,i}},$p(WF,Symbol.asyncIterator,function(){return this}),$p(WF,"return",function(){var t=this;return new Promise(function(r,n){t[m0].destroy(null,function(i){if(i){n(i);return}r(Jp(void 0,!0))})})}),WF),P7t),j7t=function(t){var r,n=Object.create(R7t,(r={},$p(r,m0,{value:t,writable:!0}),$p(r,Yp,{value:null,writable:!0}),$p(r,h0,{value:null,writable:!0}),$p(r,A2,{value:null,writable:!0}),$p(r,VF,{value:t._readableState.endEmitted,writable:!0}),$p(r,wz,{value:function(a,o){var s=n[m0].read();s?(n[d0]=null,n[Yp]=null,n[h0]=null,a(Jp(s,!1))):(n[Yp]=a,n[h0]=o)},writable:!0}),r));return n[d0]=null,k7t(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[h0];a!==null&&(n[d0]=null,n[Yp]=null,n[h0]=null,a(i)),n[A2]=i;return}var o=n[Yp];o!==null&&(n[d0]=null,n[Yp]=null,n[h0]=null,o(Jp(void 0,!0))),n[VF]=!0}),t.on("readable",O7t.bind(null,n)),n};RCe.exports=j7t});var NCe=v((S3r,qCe)=>{"use strict";function LCe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function L7t(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){LCe(a,n,i,o,s,"next",u)}function s(u){LCe(a,n,i,o,s,"throw",u)}o(void 0)})}}function MCe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function M7t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MCe(Object(r),!0).forEach(function(n){q7t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function q7t(e,t,r){return t=N7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N7t(e){var t=U7t(e,"string");return typeof t=="symbol"?t:String(t)}function U7t(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var G7t=Vp().codes.ERR_INVALID_ARG_TYPE;function z7t(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new G7t("iterable",["Iterable"],t);var i=new e(M7t({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=L7t(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}qCe.exports=z7t});var bz=v((C3r,JCe)=>{"use strict";JCe.exports=Nr;var kb;Nr.ReadableState=HCe;var T3r=require("events").EventEmitter,zCe=function(t,r){return t.listeners(r).length},T2=uz(),KF=require("buffer").Buffer,H7t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function W7t(e){return KF.from(e)}function V7t(e){return KF.isBuffer(e)||e instanceof H7t}var Ez=require("util"),gr;Ez&&Ez.debuglog?gr=Ez.debuglog("stream"):gr=function(){};var K7t=mCe(),kz=fz(),$7t=pz(),Y7t=$7t.getHighWaterMark,$F=Vp().codes,J7t=$F.ERR_INVALID_ARG_TYPE,X7t=$F.ERR_STREAM_PUSH_AFTER_EOF,Q7t=$F.ERR_METHOD_NOT_IMPLEMENTED,Z7t=$F.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Bb,Az,Sz;tr()(Nr,T2);var S2=kz.errorOrDestroy,Tz=["error","close","destroy","pause","resume"];function eqt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function HCe(e,t,r){kb=kb||p0(),e=e||{},typeof r!="boolean"&&(r=t instanceof kb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Y7t(this,e,"readableHighWaterMark",r),this.buffer=new K7t,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Bb||(Bb=_z().StringDecoder),this.decoder=new Bb(e.encoding),this.encoding=e.encoding)}function Nr(e){if(kb=kb||p0(),!(this instanceof Nr))return new Nr(e);var t=this instanceof kb;this._readableState=new HCe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),T2.call(this)}Object.defineProperty(Nr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Nr.prototype.destroy=kz.destroy;Nr.prototype._undestroy=kz.undestroy;Nr.prototype._destroy=function(e,t){t(e)};Nr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=KF.from(e,t),t=""),n=!0),WCe(this,e,t,!1,n)};Nr.prototype.unshift=function(e){return WCe(this,e,null,!0,!1)};function WCe(e,t,r,n,i){gr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,nqt(e,a);else{var o;if(i||(o=tqt(a,t)),o)S2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==KF.prototype&&(t=W7t(t)),n)a.endEmitted?S2(e,new Z7t):Cz(e,a,t,!0);else if(a.ended)S2(e,new X7t);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Cz(e,a,t,!1):Fz(e,a)):Cz(e,a,t,!1)}else n||(a.reading=!1,Fz(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Cz(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&YF(e)),Fz(e,t)}function tqt(e,t){var r;return!V7t(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new J7t("chunk",["string","Buffer","Uint8Array"],t)),r}Nr.prototype.isPaused=function(){return this._readableState.flowing===!1};Nr.prototype.setEncoding=function(e){Bb||(Bb=_z().StringDecoder);var t=new Bb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var UCe=1073741824;function rqt(e){return e>=UCe?e=UCe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function GCe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=rqt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Nr.prototype.read=function(e){gr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return gr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Dz(this):YF(this),null;if(e=GCe(e,t),e===0&&t.ended)return t.length===0&&Dz(this),null;var n=t.needReadable;gr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,gr("length less than watermark",n)),t.ended||t.reading?(n=!1,gr("reading or ended",n)):n&&(gr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=GCe(r,t)));var i;return e>0?i=$Ce(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Dz(this)),i!==null&&this.emit("data",i),i};function nqt(e,t){if(gr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?YF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,VCe(e)))}}function YF(e){var t=e._readableState;gr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(gr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(VCe,e))}function VCe(e){var t=e._readableState;gr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Bz(e)}function Fz(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(iqt,e,t))}function iqt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(gr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Nr.prototype._read=function(e){S2(this,new Q7t("_read()"))};Nr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,gr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){gr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){gr("onend"),e.end()}var u=aqt(r);e.on("drain",u);var c=!1;function l(){gr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){gr("ondata");var x=e.write(g);gr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&YCe(n.pipes,e)!==-1)&&!c&&(gr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){gr("onerror",g),b(),e.removeListener("error",p),zCe(e,"error")===0&&S2(e,g)}eqt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){gr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){gr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(gr("pipe resume"),r.resume()),e};function aqt(e){return function(){var r=e._readableState;gr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&zCe(e,"data")&&(r.flowing=!0,Bz(e))}}Nr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=YCe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Nr.prototype.on=function(e,t){var r=T2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,gr("on readable",n.length,n.reading),n.length?YF(this):n.reading||process.nextTick(oqt,this)),r};Nr.prototype.addListener=Nr.prototype.on;Nr.prototype.removeListener=function(e,t){var r=T2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(KCe,this),r};Nr.prototype.removeAllListeners=function(e){var t=T2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(KCe,this),t};function KCe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function oqt(e){gr("readable nexttick read 0"),e.read(0)}Nr.prototype.resume=function(){var e=this._readableState;return e.flowing||(gr("resume"),e.flowing=!e.readableListening,sqt(this,e)),e.paused=!1,this};function sqt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(uqt,e,t))}function uqt(e,t){gr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Bz(e),t.flowing&&!t.reading&&e.read(0)}Nr.prototype.pause=function(){return gr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(gr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Bz(e){var t=e._readableState;for(gr("flow",t.flowing);t.flowing&&e.read()!==null;);}Nr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(gr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(gr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<Tz.length;a++)e.on(Tz[a],this.emit.bind(this,Tz[a]));return this._read=function(o){gr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Nr.prototype[Symbol.asyncIterator]=function(){return Az===void 0&&(Az=jCe()),Az(this)});Object.defineProperty(Nr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Nr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Nr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Nr._fromList=$Ce;Object.defineProperty(Nr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $Ce(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function Dz(e){var t=e._readableState;gr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(cqt,t,e))}function cqt(e,t){if(gr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Nr.from=function(e,t){return Sz===void 0&&(Sz=NCe()),Sz(Nr,e,t)});function YCe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var Oz=v((D3r,QCe)=>{"use strict";QCe.exports=Kl;var JF=Vp().codes,lqt=JF.ERR_METHOD_NOT_IMPLEMENTED,fqt=JF.ERR_MULTIPLE_CALLBACK,pqt=JF.ERR_TRANSFORM_ALREADY_TRANSFORMING,hqt=JF.ERR_TRANSFORM_WITH_LENGTH_0,XF=p0();tr()(Kl,XF);function dqt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new fqt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Kl(e){if(!(this instanceof Kl))return new Kl(e);XF.call(this,e),this._transformState={afterTransform:dqt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",mqt)}function mqt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){XCe(e,t,r)}):XCe(this,null,null)}Kl.prototype.push=function(e,t){return this._transformState.needTransform=!1,XF.prototype.push.call(this,e,t)};Kl.prototype._transform=function(e,t,r){r(new lqt("_transform()"))};Kl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Kl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Kl.prototype._destroy=function(e,t){XF.prototype._destroy.call(this,e,function(r){t(r)})};function XCe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new hqt;if(e._transformState.transforming)throw new pqt;return e.push(null)}});var t8e=v((F3r,e8e)=>{"use strict";e8e.exports=C2;var ZCe=Oz();tr()(C2,ZCe);function C2(e){if(!(this instanceof C2))return new C2(e);ZCe.call(this,e)}C2.prototype._transform=function(e,t,r){r(null,e)}});var o8e=v((k3r,a8e)=>{"use strict";var Iz;function gqt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i8e=Vp().codes,vqt=i8e.ERR_MISSING_ARGS,bqt=i8e.ERR_STREAM_DESTROYED;function r8e(e){if(e)throw e}function yqt(e){return e.setHeader&&typeof e.abort=="function"}function xqt(e,t,r,n){n=gqt(n);var i=!1;e.on("close",function(){i=!0}),Iz===void 0&&(Iz=HF()),Iz(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,yqt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new bqt("pipe"))}}}function n8e(e){e()}function _qt(e,t){return e.pipe(t)}function wqt(e){return!e.length||typeof e[e.length-1]!="function"?r8e:e.pop()}function Eqt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=wqt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new vqt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return xqt(o,u,c,function(l){i||(i=l),l&&a.forEach(n8e),!u&&(a.forEach(n8e),n(i))})});return t.reduce(_qt)}a8e.exports=Eqt});var Pz=v((Ds,F2)=>{var D2=require("stream");process.env.READABLE_STREAM==="disable"&&D2?(F2.exports=D2.Readable,Object.assign(F2.exports,D2),F2.exports.Stream=D2):(Ds=F2.exports=bz(),Ds.Stream=D2||Ds,Ds.Readable=Ds,Ds.Writable=mz(),Ds.Duplex=p0(),Ds.Transform=Oz(),Ds.PassThrough=t8e(),Ds.finished=HF(),Ds.pipeline=o8e())});var f8e=v((B3r,l8e)=>{var Lz=require("fs"),u8e=a6e(),s8e=s6e(),Rz=require("path"),Pc=Cb(),Aqt=require("util").inherits,si=uCe(),c8e=Pz().Transform,jz=process.platform==="win32",Jr=function(e,t){if(!(this instanceof Jr))return new Jr(e,t);typeof e!="string"&&(t=e,e="zip"),t=this.options=Pc.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),c8e.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=s8e.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=s8e.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};Aqt(Jr,c8e);Jr.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()};Jr.prototype._append=function(e,t){t=t||{};var r={source:null,filepath:e};t.name||(t.name=e),t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof Lz.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)};Jr.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)};Jr.prototype._maybeFinalize=function(){return this._state.finalizing||this._state.finalized||this._state.aborted?!1:this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()?(this._finalize(),!0):!1};Jr.prototype._moduleAppend=function(e,t,r){if(this._state.aborted){r();return}this._module.append(e,t,function(n){if(this._task=null,this._state.aborted){this._shutdown();return}if(n){this.emit("error",n),setImmediate(r);return}this.emit("entry",t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(r)}.bind(this))};Jr.prototype._moduleFinalize=function(){typeof this._module.finalize=="function"?this._module.finalize():typeof this._module.end=="function"?this._module.end():this.emit("error",new si("NOENDMETHOD"))};Jr.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0};Jr.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]};Jr.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1};Jr.prototype._normalizeEntryData=function(e,t){e=Pc.defaults(e,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&e.stats===!1&&(e.stats=t);var r=e.type==="directory";return e.name&&(typeof e.prefix=="string"&&e.prefix!==""&&(e.name=e.prefix+"/"+e.name,e.prefix=null),e.name=Pc.sanitizePath(e.name),e.type!=="symlink"&&e.name.slice(-1)==="/"?(r=!0,e.type="directory"):r&&(e.name+="/")),typeof e.mode=="number"?jz?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(jz?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,jz&&r&&(e.mode=493)):e.mode===null&&(e.mode=r?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=Pc.dateify(e.date),e};Jr.prototype._onModuleError=function(e){this.emit("error",e)};Jr.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()};Jr.prototype._onQueueTask=function(e,t){var r=()=>{e.data.callback&&e.data.callback(),t()};if(this._state.finalizing||this._state.finalized||this._state.aborted){r();return}this._task=e,this._moduleAppend(e.source,e.data,r)};Jr.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}Lz.lstat(e.filepath,function(r,n){if(this._state.aborted){setImmediate(t);return}if(r){this._entriesCount--,this.emit("warning",r),setImmediate(t);return}e=this._updateQueueTaskWithStats(e,n),e&&(n.size&&(this._fsEntriesTotalBytes+=n.size),this._queue.push(e)),setImmediate(t)}.bind(this))};Jr.prototype._shutdown=function(){this._moduleUnpipe(),this.end()};Jr.prototype._transform=function(e,t,r){e&&(this._pointer+=e.length),r(null,e)};Jr.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type="file",e.data.sourceType="stream",e.source=Pc.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=Pc.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=Pc.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports("symlink")){var r=Lz.readlinkSync(e.filepath),n=Rz.dirname(e.filepath);e.data.type="symlink",e.data.linkname=Rz.relative(n,Rz.resolve(n,r)),e.data.sourceType="buffer",e.source=Buffer.concat([])}else return t.isDirectory()?this.emit("warning",new si("DIRECTORYNOTSUPPORTED",e.data)):t.isSymbolicLink()?this.emit("warning",new si("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new si("ENTRYNOTSUPPORTED",e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e};Jr.prototype.abort=function(){return this._state.aborted||this._state.finalized?this:(this._abort(),this)};Jr.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit("error",new si("QUEUECLOSED")),this;if(t=this._normalizeEntryData(t),typeof t.name!="string"||t.name.length===0)return this.emit("error",new si("ENTRYNAMEREQUIRED")),this;if(t.type==="directory"&&!this._moduleSupports("directory"))return this.emit("error",new si("DIRECTORYNOTSUPPORTED",{name:t.name})),this;if(e=Pc.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else if(Pc.isStream(e))t.sourceType="stream";else return this.emit("error",new si("INPUTSTEAMBUFFERREQUIRED",{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this};Jr.prototype.directory=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new si("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new si("DIRECTORYDIRPATHREQUIRED")),this;this._pending++,t===!1?t="":typeof t!="string"&&(t=e);var n=!1;typeof r=="function"?(n=r,r={}):typeof r!="object"&&(r={});var i={stat:!0,dot:!0};function a(){this._pending--,this._maybeFinalize()}function o(c){this.emit("error",c)}function s(c){u.pause();var l=!1,f=Object.assign({},r);f.name=c.relative,f.prefix=t,f.stats=c.stat,f.callback=u.resume.bind(u);try{if(n){if(f=n(f),f===!1)l=!0;else if(typeof f!="object")throw new si("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:e})}}catch(p){this.emit("error",p);return}if(l){u.resume();return}this._append(c.absolute,f)}var u=u8e(e,i);return u.on("error",o.bind(this)),u.on("match",s.bind(this)),u.on("end",a.bind(this)),this};Jr.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit("error",new si("QUEUECLOSED")),this):typeof e!="string"||e.length===0?(this.emit("error",new si("FILEFILEPATHREQUIRED")),this):(this._append(e,t),this)};Jr.prototype.glob=function(e,t,r){this._pending++,t=Pc.defaults(t,{stat:!0,pattern:e});function n(){this._pending--,this._maybeFinalize()}function i(s){this.emit("error",s)}function a(s){o.pause();var u=Object.assign({},r);u.callback=o.resume.bind(o),u.stats=s.stat,u.name=s.relative,this._append(s.absolute,u)}var o=u8e(t.cwd||".",t);return o.on("error",i.bind(this)),o.on("match",a.bind(this)),o.on("end",n.bind(this)),this};Jr.prototype.finalize=function(){if(this._state.aborted){var e=new si("ABORTED");return this.emit("error",e),Promise.reject(e)}if(this._state.finalize){var t=new si("FINALIZING");return this.emit("error",t),Promise.reject(t)}this._state.finalize=!0,this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var r=this;return new Promise(function(n,i){var a;r._module.on("end",function(){a||n()}),r._module.on("error",function(o){a=!0,i(o)})})};Jr.prototype.setFormat=function(e){return this._format?(this.emit("error",new si("FORMATSET")),this):(this._format=e,this)};Jr.prototype.setModule=function(e){return this._state.aborted?(this.emit("error",new si("ABORTED")),this):this._state.module?(this.emit("error",new si("MODULESET")),this):(this._module=e,this._modulePipe(),this)};Jr.prototype.symlink=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new si("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new si("SYMLINKFILEPATHREQUIRED")),this;if(typeof t!="string"||t.length===0)return this.emit("error",new si("SYMLINKTARGETREQUIRED",{filepath:e})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new si("SYMLINKNOTSUPPORTED",{filepath:e})),this;var n={};return n.type="symlink",n.name=e.replace(/\\/g,"/"),n.linkname=t.replace(/\\/g,"/"),n.sourceType="buffer",typeof r=="number"&&(n.mode=r),this._entriesCount++,this._queue.push({data:n,source:Buffer.concat([])}),this};Jr.prototype.pointer=function(){return this._pointer};Jr.prototype.use=function(e){return this._streams.push(e),this};l8e.exports=Jr});var ZF=v((O3r,p8e)=>{var QF=p8e.exports=function(){};QF.prototype.getName=function(){};QF.prototype.getSize=function(){};QF.prototype.getLastModifiedDate=function(){};QF.prototype.isDirectory=function(){}});var e4=v((I3r,h8e)=>{var Fs=h8e.exports={};Fs.dateToDos=function(e,t){t=t||!1;var r=t?e.getFullYear():e.getUTCFullYear();if(r<1980)return 2162688;if(r>=2044)return 2141175677;var n={year:r,month:t?e.getMonth():e.getUTCMonth(),date:t?e.getDate():e.getUTCDate(),hours:t?e.getHours():e.getUTCHours(),minutes:t?e.getMinutes():e.getUTCMinutes(),seconds:t?e.getSeconds():e.getUTCSeconds()};return n.year-1980<<25|n.month+1<<21|n.date<<16|n.hours<<11|n.minutes<<5|n.seconds/2};Fs.dosToDate=function(e){return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)};Fs.fromDosTime=function(e){return Fs.dosToDate(e.readUInt32LE(0))};Fs.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t};Fs.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t};Fs.getShortBytesValue=function(e,t){return e.readUInt16LE(t)};Fs.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t};Fs.getLongBytesValue=function(e,t){return e.readUInt32LE(t)};Fs.toDosTime=function(e){return Fs.getLongBytes(Fs.dateToDos(e))}});var Mz=v((P3r,y8e)=>{var d8e=e4(),m8e=1<<3,g8e=1<<0,Sqt=1<<2,Tqt=1<<1,v8e=1<<6,b8e=1<<11,Ca=y8e.exports=function(){return this instanceof Ca?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new Ca};Ca.prototype.encode=function(){return d8e.getShortBytes((this.descriptor?m8e:0)|(this.utf8?b8e:0)|(this.encryption?g8e:0)|(this.strongEncryption?v8e:0))};Ca.prototype.parse=function(e,t){var r=d8e.getShortBytesValue(e,t),n=new Ca;return n.useDataDescriptor((r&m8e)!==0),n.useUTF8ForNames((r&b8e)!==0),n.useStrongEncryption((r&v8e)!==0),n.useEncryption((r&g8e)!==0),n.setSlidingDictionarySize(r&Tqt?8192:4096),n.setNumberOfShannonFanoTrees(r&Sqt?3:2),n};Ca.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e};Ca.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};Ca.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e};Ca.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};Ca.prototype.useDataDescriptor=function(e){this.descriptor=e};Ca.prototype.usesDataDescriptor=function(){return this.descriptor};Ca.prototype.useEncryption=function(e){this.encryption=e};Ca.prototype.usesEncryption=function(){return this.encryption};Ca.prototype.useStrongEncryption=function(e){this.strongEncryption=e};Ca.prototype.usesStrongEncryption=function(){return this.strongEncryption};Ca.prototype.useUTF8ForNames=function(e){this.utf8=e};Ca.prototype.usesUTF8ForNames=function(){return this.utf8}});var _8e=v((R3r,x8e)=>{x8e.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}});var qz=v((j3r,w8e)=>{w8e.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}});var Nz=v((L3r,C8e)=>{var Cqt=require("util").inherits,Dqt=EG(),A8e=ZF(),S8e=Mz(),E8e=_8e(),Za=qz(),T8e=e4(),vr=C8e.exports=function(e){if(!(this instanceof vr))return new vr(e);A8e.call(this),this.platform=Za.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new S8e,this.crc=0,this.time=-1,this.minver=Za.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};Cqt(vr,A8e);vr.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};vr.prototype.getComment=function(){return this.comment!==null?this.comment:""};vr.prototype.getCompressedSize=function(){return this.csize};vr.prototype.getCrc=function(){return this.crc};vr.prototype.getExternalAttributes=function(){return this.exattr};vr.prototype.getExtra=function(){return this.extra!==null?this.extra:Za.EMPTY};vr.prototype.getGeneralPurposeBit=function(){return this.gpb};vr.prototype.getInternalAttributes=function(){return this.inattr};vr.prototype.getLastModifiedDate=function(){return this.getTime()};vr.prototype.getLocalFileDataExtra=function(){return this.getExtra()};vr.prototype.getMethod=function(){return this.method};vr.prototype.getName=function(){return this.name};vr.prototype.getPlatform=function(){return this.platform};vr.prototype.getSize=function(){return this.size};vr.prototype.getTime=function(){return this.time!==-1?T8e.dosToDate(this.time):-1};vr.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};vr.prototype.getUnixMode=function(){return this.platform!==Za.PLATFORM_UNIX?0:this.getExternalAttributes()>>Za.SHORT_SHIFT&Za.SHORT_MASK};vr.prototype.getVersionNeededToExtract=function(){return this.minver};vr.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e};vr.prototype.setCompressedSize=function(e){if(e<0)throw new Error("invalid entry compressed size");this.csize=e};vr.prototype.setCrc=function(e){if(e<0)throw new Error("invalid entry crc32");this.crc=e};vr.prototype.setExternalAttributes=function(e){this.exattr=e>>>0};vr.prototype.setExtra=function(e){this.extra=e};vr.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof S8e))throw new Error("invalid entry GeneralPurposeBit");this.gpb=e};vr.prototype.setInternalAttributes=function(e){this.inattr=e};vr.prototype.setMethod=function(e){if(e<0)throw new Error("invalid entry compression method");this.method=e};vr.prototype.setName=function(e,t=!1){e=Dqt(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,""),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e};vr.prototype.setPlatform=function(e){this.platform=e};vr.prototype.setSize=function(e){if(e<0)throw new Error("invalid entry size");this.size=e};vr.prototype.setTime=function(e,t){if(!(e instanceof Date))throw new Error("invalid entry time");this.time=T8e.dateToDos(e,t)};vr.prototype.setUnixMode=function(e){e|=this.isDirectory()?Za.S_IFDIR:Za.S_IFREG;var t=0;t|=e<<Za.SHORT_SHIFT|(this.isDirectory()?Za.S_DOS_D:Za.S_DOS_A),this.setExternalAttributes(t),this.mode=e&Za.MODE_MASK,this.platform=Za.PLATFORM_UNIX};vr.prototype.setVersionNeededToExtract=function(e){this.minver=e};vr.prototype.isDirectory=function(){return this.getName().slice(-1)==="/"};vr.prototype.isUnixSymlink=function(){return(this.getUnixMode()&E8e.FILE_TYPE_FLAG)===E8e.LINK_FLAG};vr.prototype.isZip64=function(){return this.csize>Za.ZIP64_MAGIC||this.size>Za.ZIP64_MAGIC}});var Uz=v((M3r,D8e)=>{D8e.exports=require("stream")});var P8e=v((q3r,I8e)=>{"use strict";function F8e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function k8e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?F8e(Object(r),!0).forEach(function(n){Fqt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fqt(e,t,r){return t=O8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kqt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B8e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O8e(n.key),n)}}function Bqt(e,t,r){return t&&B8e(e.prototype,t),r&&B8e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function O8e(e){var t=Oqt(e,"string");return typeof t=="symbol"?t:String(t)}function Oqt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iqt=require("buffer"),t4=Iqt.Buffer,Pqt=require("util"),Gz=Pqt.inspect,Rqt=Gz&&Gz.custom||"inspect";function jqt(e,t,r){t4.prototype.copy.call(e,t,r)}I8e.exports=function(){function e(){kqt(this,e),this.head=null,this.tail=null,this.length=0}return Bqt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return t4.alloc(0);for(var n=t4.allocUnsafe(r>>>0),i=this.head,a=0;i;)jqt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=t4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:Rqt,value:function(r,n){return Gz(this,k8e(k8e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var Hz=v((N3r,j8e)=>{"use strict";function Lqt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(zz,this,e)):process.nextTick(zz,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(r4,r):(r._writableState.errorEmitted=!0,process.nextTick(R8e,r,a)):process.nextTick(R8e,r,a):t?(process.nextTick(r4,r),t(a)):process.nextTick(r4,r)}),this)}function R8e(e,t){zz(e,t),r4(e)}function r4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Mqt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function zz(e,t){e.emit("error",t)}function qqt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}j8e.exports={destroy:Lqt,undestroy:Mqt,errorOrDestroy:qqt}});var Xp=v((U3r,q8e)=>{"use strict";var M8e={};function ks(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,M8e[e]=i}function L8e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function Nqt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Uqt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Gqt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}ks("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);ks("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Nqt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(Uqt(e," argument"))i=`The ${e} ${n} ${L8e(t,"type")}`;else{let a=Gqt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${L8e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);ks("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ks("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});ks("ERR_STREAM_PREMATURE_CLOSE","Premature close");ks("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});ks("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ks("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ks("ERR_STREAM_WRITE_AFTER_END","write after end");ks("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ks("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);ks("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");q8e.exports.codes=M8e});var Wz=v((G3r,N8e)=>{"use strict";var zqt=Xp().codes.ERR_INVALID_OPT_VALUE;function Hqt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Wqt(e,t,r,n){var i=Hqt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new zqt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}N8e.exports={getHighWaterMark:Wqt}});var $z=v((z3r,V8e)=>{"use strict";V8e.exports=ui;function G8e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){bNt(t,e)}}var Ob;ui.WritableState=B2;var Vqt={deprecate:pd()},z8e=Uz(),i4=require("buffer").Buffer,Kqt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $qt(e){return i4.from(e)}function Yqt(e){return i4.isBuffer(e)||e instanceof Kqt}var Kz=Hz(),Jqt=Wz(),Xqt=Jqt.getHighWaterMark,Qp=Xp().codes,Qqt=Qp.ERR_INVALID_ARG_TYPE,Zqt=Qp.ERR_METHOD_NOT_IMPLEMENTED,eNt=Qp.ERR_MULTIPLE_CALLBACK,tNt=Qp.ERR_STREAM_CANNOT_PIPE,rNt=Qp.ERR_STREAM_DESTROYED,nNt=Qp.ERR_STREAM_NULL_VALUES,iNt=Qp.ERR_STREAM_WRITE_AFTER_END,aNt=Qp.ERR_UNKNOWN_ENCODING,Ib=Kz.errorOrDestroy;tr()(ui,z8e);function oNt(){}function B2(e,t,r){Ob=Ob||g0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Ob),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Xqt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){hNt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new G8e(this)}B2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(B2.prototype,"buffer",{get:Vqt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var n4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(n4=Function.prototype[Symbol.hasInstance],Object.defineProperty(ui,Symbol.hasInstance,{value:function(t){return n4.call(this,t)?!0:this!==ui?!1:t&&t._writableState instanceof B2}})):n4=function(t){return t instanceof this};function ui(e){Ob=Ob||g0();var t=this instanceof Ob;if(!t&&!n4.call(ui,this))return new ui(e);this._writableState=new B2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),z8e.call(this)}ui.prototype.pipe=function(){Ib(this,new tNt)};function sNt(e,t){var r=new iNt;Ib(e,r),process.nextTick(t,r)}function uNt(e,t,r,n){var i;return r===null?i=new nNt:typeof r!="string"&&!t.objectMode&&(i=new Qqt("chunk",["string","Buffer"],r)),i?(Ib(e,i),process.nextTick(n,i),!1):!0}ui.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&Yqt(e);return a&&!i4.isBuffer(e)&&(e=$qt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=oNt),n.ending?sNt(this,r):(a||uNt(this,n,e,r))&&(n.pendingcb++,i=lNt(this,n,a,e,t,r)),i};ui.prototype.cork=function(){this._writableState.corked++};ui.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&H8e(this,e))};ui.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new aNt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ui.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function cNt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=i4.from(t,r)),t}Object.defineProperty(ui.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function lNt(e,t,r,n,i,a){if(!r){var o=cNt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Vz(e,t,!1,s,n,i,a);return u}function Vz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new rNt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function fNt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(k2,e,t),e._writableState.errorEmitted=!0,Ib(e,n)):(i(n),e._writableState.errorEmitted=!0,Ib(e,n),k2(e,t))}function pNt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function hNt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new eNt;if(pNt(r),t)fNt(e,r,n,t,i);else{var a=W8e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&H8e(e,r),n?process.nextTick(U8e,e,r,a,i):U8e(e,r,a,i)}}function U8e(e,t,r,n){r||dNt(e,t),t.pendingcb--,n(),k2(e,t)}function dNt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function H8e(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,Vz(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new G8e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(Vz(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ui.prototype._write=function(e,t,r){r(new Zqt("_write()"))};ui.prototype._writev=null;ui.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||vNt(this,n,r),this};Object.defineProperty(ui.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function W8e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function mNt(e,t){e._final(function(r){t.pendingcb--,r&&Ib(e,r),t.prefinished=!0,e.emit("prefinish"),k2(e,t)})}function gNt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(mNt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function k2(e,t){var r=W8e(t);if(r&&(gNt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function vNt(e,t,r){t.ending=!0,k2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function bNt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ui.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ui.prototype.destroy=Kz.destroy;ui.prototype._undestroy=Kz.undestroy;ui.prototype._destroy=function(e,t){t(e)}});var g0=v((H3r,$8e)=>{"use strict";var yNt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};$8e.exports=Rc;var K8e=Xz(),Jz=$z();tr()(Rc,K8e);for(Yz=yNt(Jz.prototype),a4=0;a4<Yz.length;a4++)o4=Yz[a4],Rc.prototype[o4]||(Rc.prototype[o4]=Jz.prototype[o4]);var Yz,o4,a4;function Rc(e){if(!(this instanceof Rc))return new Rc(e);K8e.call(this,e),Jz.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",xNt)))}Object.defineProperty(Rc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Rc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Rc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function xNt(){this._writableState.ended||process.nextTick(_Nt,this)}function _Nt(e){e.end()}Object.defineProperty(Rc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var eH=v(J8e=>{"use strict";var Zz=Gs().Buffer,Y8e=Zz.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function wNt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function ENt(e){var t=wNt(e);if(typeof t!="string"&&(Zz.isEncoding===Y8e||!Y8e(e)))throw new Error("Unknown encoding: "+e);return t||e}J8e.StringDecoder=O2;function O2(e){this.encoding=ENt(e);var t;switch(this.encoding){case"utf16le":this.text=FNt,this.end=kNt,t=4;break;case"utf8":this.fillLast=TNt,t=4;break;case"base64":this.text=BNt,this.end=ONt,t=3;break;default:this.write=INt,this.end=PNt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Zz.allocUnsafe(t)}O2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};O2.prototype.end=DNt;O2.prototype.text=CNt;O2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Qz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function ANt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Qz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Qz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Qz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function SNt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function TNt(e){var t=this.lastTotal-this.lastNeed,r=SNt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function CNt(e,t){var r=ANt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function DNt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function FNt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function kNt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function BNt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function ONt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function INt(e){return e.toString(this.encoding)}function PNt(e){return e&&e.length?this.write(e):""}});var s4=v((V3r,Z8e)=>{"use strict";var X8e=Xp().codes.ERR_STREAM_PREMATURE_CLOSE;function RNt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function jNt(){}function LNt(e){return e.setHeader&&typeof e.abort=="function"}function Q8e(e,t,r){if(typeof t=="function")return Q8e(e,null,t);t||(t={}),r=RNt(r||jNt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new X8e),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new X8e),r.call(e,d)},p=function(){e.req.on("finish",s)};return LNt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",p),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}Z8e.exports=Q8e});var tDe=v((K3r,eDe)=>{"use strict";var u4;function Zp(e,t,r){return t=MNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MNt(e){var t=qNt(e,"string");return typeof t=="symbol"?t:String(t)}function qNt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NNt=s4(),eh=Symbol("lastResolve"),v0=Symbol("lastReject"),I2=Symbol("error"),c4=Symbol("ended"),b0=Symbol("lastPromise"),tH=Symbol("handlePromise"),y0=Symbol("stream");function th(e,t){return{value:e,done:t}}function UNt(e){var t=e[eh];if(t!==null){var r=e[y0].read();r!==null&&(e[b0]=null,e[eh]=null,e[v0]=null,t(th(r,!1)))}}function GNt(e){process.nextTick(UNt,e)}function zNt(e,t){return function(r,n){e.then(function(){if(t[c4]){r(th(void 0,!0));return}t[tH](r,n)},n)}}var HNt=Object.getPrototypeOf(function(){}),WNt=Object.setPrototypeOf((u4={get stream(){return this[y0]},next:function(){var t=this,r=this[I2];if(r!==null)return Promise.reject(r);if(this[c4])return Promise.resolve(th(void 0,!0));if(this[y0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[I2]?s(t[I2]):o(th(void 0,!0))})});var n=this[b0],i;if(n)i=new Promise(zNt(n,this));else{var a=this[y0].read();if(a!==null)return Promise.resolve(th(a,!1));i=new Promise(this[tH])}return this[b0]=i,i}},Zp(u4,Symbol.asyncIterator,function(){return this}),Zp(u4,"return",function(){var t=this;return new Promise(function(r,n){t[y0].destroy(null,function(i){if(i){n(i);return}r(th(void 0,!0))})})}),u4),HNt),VNt=function(t){var r,n=Object.create(WNt,(r={},Zp(r,y0,{value:t,writable:!0}),Zp(r,eh,{value:null,writable:!0}),Zp(r,v0,{value:null,writable:!0}),Zp(r,I2,{value:null,writable:!0}),Zp(r,c4,{value:t._readableState.endEmitted,writable:!0}),Zp(r,tH,{value:function(a,o){var s=n[y0].read();s?(n[b0]=null,n[eh]=null,n[v0]=null,a(th(s,!1))):(n[eh]=a,n[v0]=o)},writable:!0}),r));return n[b0]=null,NNt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[v0];a!==null&&(n[b0]=null,n[eh]=null,n[v0]=null,a(i)),n[I2]=i;return}var o=n[eh];o!==null&&(n[b0]=null,n[eh]=null,n[v0]=null,o(th(void 0,!0))),n[c4]=!0}),t.on("readable",GNt.bind(null,n)),n};eDe.exports=VNt});var aDe=v(($3r,iDe)=>{"use strict";function rDe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function KNt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){rDe(a,n,i,o,s,"next",u)}function s(u){rDe(a,n,i,o,s,"throw",u)}o(void 0)})}}function nDe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $Nt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nDe(Object(r),!0).forEach(function(n){YNt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nDe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YNt(e,t,r){return t=JNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JNt(e){var t=XNt(e,"string");return typeof t=="symbol"?t:String(t)}function XNt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QNt=Xp().codes.ERR_INVALID_ARG_TYPE;function ZNt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new QNt("iterable",["Iterable"],t);var i=new e($Nt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=KNt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}iDe.exports=ZNt});var Xz=v((J3r,mDe)=>{"use strict";mDe.exports=Ur;var Pb;Ur.ReadableState=cDe;var Y3r=require("events").EventEmitter,uDe=function(t,r){return t.listeners(r).length},R2=Uz(),l4=require("buffer").Buffer,eUt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tUt(e){return l4.from(e)}function rUt(e){return l4.isBuffer(e)||e instanceof eUt}var rH=require("util"),br;rH&&rH.debuglog?br=rH.debuglog("stream"):br=function(){};var nUt=P8e(),cH=Hz(),iUt=Wz(),aUt=iUt.getHighWaterMark,f4=Xp().codes,oUt=f4.ERR_INVALID_ARG_TYPE,sUt=f4.ERR_STREAM_PUSH_AFTER_EOF,uUt=f4.ERR_METHOD_NOT_IMPLEMENTED,cUt=f4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Rb,nH,iH;tr()(Ur,R2);var P2=cH.errorOrDestroy,aH=["error","close","destroy","pause","resume"];function lUt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function cDe(e,t,r){Pb=Pb||g0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Pb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=aUt(this,e,"readableHighWaterMark",r),this.buffer=new nUt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Rb||(Rb=eH().StringDecoder),this.decoder=new Rb(e.encoding),this.encoding=e.encoding)}function Ur(e){if(Pb=Pb||g0(),!(this instanceof Ur))return new Ur(e);var t=this instanceof Pb;this._readableState=new cDe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),R2.call(this)}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Ur.prototype.destroy=cH.destroy;Ur.prototype._undestroy=cH.undestroy;Ur.prototype._destroy=function(e,t){t(e)};Ur.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=l4.from(e,t),t=""),n=!0),lDe(this,e,t,!1,n)};Ur.prototype.unshift=function(e){return lDe(this,e,null,!0,!1)};function lDe(e,t,r,n,i){br("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,hUt(e,a);else{var o;if(i||(o=fUt(a,t)),o)P2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==l4.prototype&&(t=tUt(t)),n)a.endEmitted?P2(e,new cUt):oH(e,a,t,!0);else if(a.ended)P2(e,new sUt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?oH(e,a,t,!1):uH(e,a)):oH(e,a,t,!1)}else n||(a.reading=!1,uH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function oH(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&p4(e)),uH(e,t)}function fUt(e,t){var r;return!rUt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new oUt("chunk",["string","Buffer","Uint8Array"],t)),r}Ur.prototype.isPaused=function(){return this._readableState.flowing===!1};Ur.prototype.setEncoding=function(e){Rb||(Rb=eH().StringDecoder);var t=new Rb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var oDe=1073741824;function pUt(e){return e>=oDe?e=oDe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function sDe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=pUt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Ur.prototype.read=function(e){br("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return br("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?sH(this):p4(this),null;if(e=sDe(e,t),e===0&&t.ended)return t.length===0&&sH(this),null;var n=t.needReadable;br("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,br("length less than watermark",n)),t.ended||t.reading?(n=!1,br("reading or ended",n)):n&&(br("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=sDe(r,t)));var i;return e>0?i=hDe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&sH(this)),i!==null&&this.emit("data",i),i};function hUt(e,t){if(br("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?p4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,fDe(e)))}}function p4(e){var t=e._readableState;br("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(br("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(fDe,e))}function fDe(e){var t=e._readableState;br("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,lH(e)}function uH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(dUt,e,t))}function dUt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(br("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Ur.prototype._read=function(e){P2(this,new uUt("_read()"))};Ur.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,br("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){br("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){br("onend"),e.end()}var u=mUt(r);e.on("drain",u);var c=!1;function l(){br("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){br("ondata");var x=e.write(g);br("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&dDe(n.pipes,e)!==-1)&&!c&&(br("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){br("onerror",g),b(),e.removeListener("error",p),uDe(e,"error")===0&&P2(e,g)}lUt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){br("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){br("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(br("pipe resume"),r.resume()),e};function mUt(e){return function(){var r=e._readableState;br("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&uDe(e,"data")&&(r.flowing=!0,lH(e))}}Ur.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=dDe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Ur.prototype.on=function(e,t){var r=R2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,br("on readable",n.length,n.reading),n.length?p4(this):n.reading||process.nextTick(gUt,this)),r};Ur.prototype.addListener=Ur.prototype.on;Ur.prototype.removeListener=function(e,t){var r=R2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(pDe,this),r};Ur.prototype.removeAllListeners=function(e){var t=R2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(pDe,this),t};function pDe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function gUt(e){br("readable nexttick read 0"),e.read(0)}Ur.prototype.resume=function(){var e=this._readableState;return e.flowing||(br("resume"),e.flowing=!e.readableListening,vUt(this,e)),e.paused=!1,this};function vUt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(bUt,e,t))}function bUt(e,t){br("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),lH(e),t.flowing&&!t.reading&&e.read(0)}Ur.prototype.pause=function(){return br("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(br("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function lH(e){var t=e._readableState;for(br("flow",t.flowing);t.flowing&&e.read()!==null;);}Ur.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(br("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(br("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<aH.length;a++)e.on(aH[a],this.emit.bind(this,aH[a]));return this._read=function(o){br("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Ur.prototype[Symbol.asyncIterator]=function(){return nH===void 0&&(nH=tDe()),nH(this)});Object.defineProperty(Ur.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ur.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ur.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Ur._fromList=hDe;Object.defineProperty(Ur.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function hDe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function sH(e){var t=e._readableState;br("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(yUt,t,e))}function yUt(e,t){if(br("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Ur.from=function(e,t){return iH===void 0&&(iH=aDe()),iH(Ur,e,t)});function dDe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var fH=v((X3r,vDe)=>{"use strict";vDe.exports=$l;var h4=Xp().codes,xUt=h4.ERR_METHOD_NOT_IMPLEMENTED,_Ut=h4.ERR_MULTIPLE_CALLBACK,wUt=h4.ERR_TRANSFORM_ALREADY_TRANSFORMING,EUt=h4.ERR_TRANSFORM_WITH_LENGTH_0,d4=g0();tr()($l,d4);function AUt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new _Ut);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function $l(e){if(!(this instanceof $l))return new $l(e);d4.call(this,e),this._transformState={afterTransform:AUt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",SUt)}function SUt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){gDe(e,t,r)}):gDe(this,null,null)}$l.prototype.push=function(e,t){return this._transformState.needTransform=!1,d4.prototype.push.call(this,e,t)};$l.prototype._transform=function(e,t,r){r(new xUt("_transform()"))};$l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};$l.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};$l.prototype._destroy=function(e,t){d4.prototype._destroy.call(this,e,function(r){t(r)})};function gDe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new EUt;if(e._transformState.transforming)throw new wUt;return e.push(null)}});var xDe=v((Q3r,yDe)=>{"use strict";yDe.exports=j2;var bDe=fH();tr()(j2,bDe);function j2(e){if(!(this instanceof j2))return new j2(e);bDe.call(this,e)}j2.prototype._transform=function(e,t,r){r(null,e)}});var SDe=v((Z3r,ADe)=>{"use strict";var pH;function TUt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var EDe=Xp().codes,CUt=EDe.ERR_MISSING_ARGS,DUt=EDe.ERR_STREAM_DESTROYED;function _De(e){if(e)throw e}function FUt(e){return e.setHeader&&typeof e.abort=="function"}function kUt(e,t,r,n){n=TUt(n);var i=!1;e.on("close",function(){i=!0}),pH===void 0&&(pH=s4()),pH(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,FUt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new DUt("pipe"))}}}function wDe(e){e()}function BUt(e,t){return e.pipe(t)}function OUt(e){return!e.length||typeof e[e.length-1]!="function"?_De:e.pop()}function IUt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=OUt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new CUt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return kUt(o,u,c,function(l){i||(i=l),l&&a.forEach(wDe),!u&&(a.forEach(wDe),n(i))})});return t.reduce(BUt)}ADe.exports=IUt});var hH=v((Bs,M2)=>{var L2=require("stream");process.env.READABLE_STREAM==="disable"&&L2?(M2.exports=L2.Readable,Object.assign(M2.exports,L2),M2.exports.Stream=L2):(Bs=M2.exports=Xz(),Bs.Stream=L2||Bs,Bs.Readable=Bs,Bs.Writable=$z(),Bs.Duplex=g0(),Bs.Transform=fH(),Bs.PassThrough=xDe(),Bs.finished=s4(),Bs.pipeline=SDe())});var mH=v((eCr,TDe)=>{var PUt=require("stream").Stream,RUt=hH().PassThrough,dH=TDe.exports={};dH.isStream=function(e){return e instanceof PUt};dH.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e=="string")return Buffer.from(e);if(dH.isStream(e)&&!e._readableState){var t=new RUt;return e.pipe(t),t}return e}});var vH=v((tCr,DDe)=>{var jUt=require("util").inherits,gH=hH().Transform,LUt=ZF(),CDe=mH(),Uo=DDe.exports=function(e){if(!(this instanceof Uo))return new Uo(e);gH.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};jUt(Uo,gH);Uo.prototype._appendBuffer=function(e,t,r){};Uo.prototype._appendStream=function(e,t,r){};Uo.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)};Uo.prototype._finish=function(e){};Uo.prototype._normalizeEntry=function(e){};Uo.prototype._transform=function(e,t,r){r(null,e)};Uo.prototype.entry=function(e,t,r){if(t=t||null,typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),!(e instanceof LUt)){r(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){r(new Error("unacceptable entry after finish"));return}if(this._archive.processing){r(new Error("already processing an entry"));return}if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=CDe.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else if(CDe.isStream(t))this._appendStream(e,t,r);else{this._archive.processing=!1,r(new Error("input source must be valid Stream or Buffer instance"));return}return this};Uo.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()};Uo.prototype.getBytesWritten=function(){return this.offset};Uo.prototype.write=function(e,t){return e&&(this.offset+=e.length),gH.prototype.write.call(this,e,t)}});var _H=v((rCr,kDe)=>{var rh=require("buffer").Buffer,bH=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(bH=new Int32Array(bH));function FDe(e){if(rh.isBuffer(e))return e;var t=typeof rh.alloc=="function"&&typeof rh.from=="function";if(typeof e=="number")return t?rh.alloc(e):new rh(e);if(typeof e=="string")return t?rh.from(e):new rh(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function MUt(e){var t=FDe(4);return t.writeInt32BE(e,0),t}function yH(e,t){e=FDe(e),rh.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,n=0;n<e.length;n++)r=bH[(r^e[n])&255]^r>>>8;return r^-1}function xH(){return MUt(yH.apply(null,arguments))}xH.signed=function(){return yH.apply(null,arguments)};xH.unsigned=function(){return yH.apply(null,arguments)>>>0};kDe.exports=xH});var wH=v((nCr,BDe)=>{BDe.exports=require("stream")});var LDe=v((iCr,jDe)=>{"use strict";function ODe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function IDe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ODe(Object(r),!0).forEach(function(n){qUt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ODe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qUt(e,t,r){return t=RDe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PDe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RDe(n.key),n)}}function UUt(e,t,r){return t&&PDe(e.prototype,t),r&&PDe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function RDe(e){var t=GUt(e,"string");return typeof t=="symbol"?t:String(t)}function GUt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zUt=require("buffer"),m4=zUt.Buffer,HUt=require("util"),EH=HUt.inspect,WUt=EH&&EH.custom||"inspect";function VUt(e,t,r){m4.prototype.copy.call(e,t,r)}jDe.exports=function(){function e(){NUt(this,e),this.head=null,this.tail=null,this.length=0}return UUt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return m4.alloc(0);for(var n=m4.allocUnsafe(r>>>0),i=this.head,a=0;i;)VUt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=m4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:WUt,value:function(r,n){return EH(this,IDe(IDe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var SH=v((aCr,qDe)=>{"use strict";function KUt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(AH,this,e)):process.nextTick(AH,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(g4,r):(r._writableState.errorEmitted=!0,process.nextTick(MDe,r,a)):process.nextTick(MDe,r,a):t?(process.nextTick(g4,r),t(a)):process.nextTick(g4,r)}),this)}function MDe(e,t){AH(e,t),g4(e)}function g4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function $Ut(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function AH(e,t){e.emit("error",t)}function YUt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}qDe.exports={destroy:KUt,undestroy:$Ut,errorOrDestroy:YUt}});var nh=v((oCr,GDe)=>{"use strict";var UDe={};function Os(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,UDe[e]=i}function NDe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function JUt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function XUt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function QUt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Os("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Os("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&JUt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(XUt(e," argument"))i=`The ${e} ${n} ${NDe(t,"type")}`;else{let a=QUt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${NDe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Os("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Os("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Os("ERR_STREAM_PREMATURE_CLOSE","Premature close");Os("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Os("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Os("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Os("ERR_STREAM_WRITE_AFTER_END","write after end");Os("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Os("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Os("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");GDe.exports.codes=UDe});var TH=v((sCr,zDe)=>{"use strict";var ZUt=nh().codes.ERR_INVALID_OPT_VALUE;function eGt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function tGt(e,t,r,n){var i=eGt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new ZUt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}zDe.exports={getHighWaterMark:tGt}});var FH=v((uCr,YDe)=>{"use strict";YDe.exports=ci;function WDe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){DGt(t,e)}}var jb;ci.WritableState=N2;var rGt={deprecate:pd()},VDe=wH(),b4=require("buffer").Buffer,nGt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function iGt(e){return b4.from(e)}function aGt(e){return b4.isBuffer(e)||e instanceof nGt}var DH=SH(),oGt=TH(),sGt=oGt.getHighWaterMark,ih=nh().codes,uGt=ih.ERR_INVALID_ARG_TYPE,cGt=ih.ERR_METHOD_NOT_IMPLEMENTED,lGt=ih.ERR_MULTIPLE_CALLBACK,fGt=ih.ERR_STREAM_CANNOT_PIPE,pGt=ih.ERR_STREAM_DESTROYED,hGt=ih.ERR_STREAM_NULL_VALUES,dGt=ih.ERR_STREAM_WRITE_AFTER_END,mGt=ih.ERR_UNKNOWN_ENCODING,Lb=DH.errorOrDestroy;tr()(ci,VDe);function gGt(){}function N2(e,t,r){jb=jb||x0(),e=e||{},typeof r!="boolean"&&(r=t instanceof jb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=sGt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){EGt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new WDe(this)}N2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(N2.prototype,"buffer",{get:rGt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var v4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(v4=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return v4.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof N2}})):v4=function(t){return t instanceof this};function ci(e){jb=jb||x0();var t=this instanceof jb;if(!t&&!v4.call(ci,this))return new ci(e);this._writableState=new N2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),VDe.call(this)}ci.prototype.pipe=function(){Lb(this,new fGt)};function vGt(e,t){var r=new dGt;Lb(e,r),process.nextTick(t,r)}function bGt(e,t,r,n){var i;return r===null?i=new hGt:typeof r!="string"&&!t.objectMode&&(i=new uGt("chunk",["string","Buffer"],r)),i?(Lb(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&aGt(e);return a&&!b4.isBuffer(e)&&(e=iGt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=gGt),n.ending?vGt(this,r):(a||bGt(this,n,e,r))&&(n.pendingcb++,i=xGt(this,n,a,e,t,r)),i};ci.prototype.cork=function(){this._writableState.corked++};ci.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&KDe(this,e))};ci.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new mGt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function yGt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=b4.from(t,r)),t}Object.defineProperty(ci.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function xGt(e,t,r,n,i,a){if(!r){var o=yGt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else CH(e,t,!1,s,n,i,a);return u}function CH(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new pGt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function _Gt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(q2,e,t),e._writableState.errorEmitted=!0,Lb(e,n)):(i(n),e._writableState.errorEmitted=!0,Lb(e,n),q2(e,t))}function wGt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function EGt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new lGt;if(wGt(r),t)_Gt(e,r,n,t,i);else{var a=$De(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&KDe(e,r),n?process.nextTick(HDe,e,r,a,i):HDe(e,r,a,i)}}function HDe(e,t,r,n){r||AGt(e,t),t.pendingcb--,n(),q2(e,t)}function AGt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function KDe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,CH(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new WDe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(CH(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ci.prototype._write=function(e,t,r){r(new cGt("_write()"))};ci.prototype._writev=null;ci.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||CGt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function $De(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function SGt(e,t){e._final(function(r){t.pendingcb--,r&&Lb(e,r),t.prefinished=!0,e.emit("prefinish"),q2(e,t)})}function TGt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(SGt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function q2(e,t){var r=$De(t);if(r&&(TGt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function CGt(e,t,r){t.ending=!0,q2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function DGt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ci.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ci.prototype.destroy=DH.destroy;ci.prototype._undestroy=DH.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var x0=v((cCr,XDe)=>{"use strict";var FGt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};XDe.exports=jc;var JDe=OH(),BH=FH();tr()(jc,JDe);for(kH=FGt(BH.prototype),y4=0;y4<kH.length;y4++)x4=kH[y4],jc.prototype[x4]||(jc.prototype[x4]=BH.prototype[x4]);var kH,x4,y4;function jc(e){if(!(this instanceof jc))return new jc(e);JDe.call(this,e),BH.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",kGt)))}Object.defineProperty(jc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(jc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(jc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function kGt(){this._writableState.ended||process.nextTick(BGt,this)}function BGt(e){e.end()}Object.defineProperty(jc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var RH=v(ZDe=>{"use strict";var PH=Gs().Buffer,QDe=PH.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function OGt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function IGt(e){var t=OGt(e);if(typeof t!="string"&&(PH.isEncoding===QDe||!QDe(e)))throw new Error("Unknown encoding: "+e);return t||e}ZDe.StringDecoder=U2;function U2(e){this.encoding=IGt(e);var t;switch(this.encoding){case"utf16le":this.text=qGt,this.end=NGt,t=4;break;case"utf8":this.fillLast=jGt,t=4;break;case"base64":this.text=UGt,this.end=GGt,t=3;break;default:this.write=zGt,this.end=HGt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=PH.allocUnsafe(t)}U2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};U2.prototype.end=MGt;U2.prototype.text=LGt;U2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function IH(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function PGt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=IH(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=IH(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=IH(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function RGt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function jGt(e){var t=this.lastTotal-this.lastNeed,r=RGt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function LGt(e,t){var r=PGt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function MGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function qGt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function NGt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function UGt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function GGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function zGt(e){return e.toString(this.encoding)}function HGt(e){return e&&e.length?this.write(e):""}});var _4=v((fCr,rFe)=>{"use strict";var eFe=nh().codes.ERR_STREAM_PREMATURE_CLOSE;function WGt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function VGt(){}function KGt(e){return e.setHeader&&typeof e.abort=="function"}function tFe(e,t,r){if(typeof t=="function")return tFe(e,null,t);t||(t={}),r=WGt(r||VGt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new eFe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new eFe),r.call(e,d)},p=function(){e.req.on("finish",s)};return KGt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",p),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}rFe.exports=tFe});var iFe=v((pCr,nFe)=>{"use strict";var w4;function ah(e,t,r){return t=$Gt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Gt(e){var t=YGt(e,"string");return typeof t=="symbol"?t:String(t)}function YGt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JGt=_4(),oh=Symbol("lastResolve"),_0=Symbol("lastReject"),G2=Symbol("error"),E4=Symbol("ended"),w0=Symbol("lastPromise"),jH=Symbol("handlePromise"),E0=Symbol("stream");function sh(e,t){return{value:e,done:t}}function XGt(e){var t=e[oh];if(t!==null){var r=e[E0].read();r!==null&&(e[w0]=null,e[oh]=null,e[_0]=null,t(sh(r,!1)))}}function QGt(e){process.nextTick(XGt,e)}function ZGt(e,t){return function(r,n){e.then(function(){if(t[E4]){r(sh(void 0,!0));return}t[jH](r,n)},n)}}var ezt=Object.getPrototypeOf(function(){}),tzt=Object.setPrototypeOf((w4={get stream(){return this[E0]},next:function(){var t=this,r=this[G2];if(r!==null)return Promise.reject(r);if(this[E4])return Promise.resolve(sh(void 0,!0));if(this[E0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[G2]?s(t[G2]):o(sh(void 0,!0))})});var n=this[w0],i;if(n)i=new Promise(ZGt(n,this));else{var a=this[E0].read();if(a!==null)return Promise.resolve(sh(a,!1));i=new Promise(this[jH])}return this[w0]=i,i}},ah(w4,Symbol.asyncIterator,function(){return this}),ah(w4,"return",function(){var t=this;return new Promise(function(r,n){t[E0].destroy(null,function(i){if(i){n(i);return}r(sh(void 0,!0))})})}),w4),ezt),rzt=function(t){var r,n=Object.create(tzt,(r={},ah(r,E0,{value:t,writable:!0}),ah(r,oh,{value:null,writable:!0}),ah(r,_0,{value:null,writable:!0}),ah(r,G2,{value:null,writable:!0}),ah(r,E4,{value:t._readableState.endEmitted,writable:!0}),ah(r,jH,{value:function(a,o){var s=n[E0].read();s?(n[w0]=null,n[oh]=null,n[_0]=null,a(sh(s,!1))):(n[oh]=a,n[_0]=o)},writable:!0}),r));return n[w0]=null,JGt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[_0];a!==null&&(n[w0]=null,n[oh]=null,n[_0]=null,a(i)),n[G2]=i;return}var o=n[oh];o!==null&&(n[w0]=null,n[oh]=null,n[_0]=null,o(sh(void 0,!0))),n[E4]=!0}),t.on("readable",QGt.bind(null,n)),n};nFe.exports=rzt});var uFe=v((hCr,sFe)=>{"use strict";function aFe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function nzt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){aFe(a,n,i,o,s,"next",u)}function s(u){aFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function oFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function izt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oFe(Object(r),!0).forEach(function(n){azt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function azt(e,t,r){return t=ozt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ozt(e){var t=szt(e,"string");return typeof t=="symbol"?t:String(t)}function szt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uzt=nh().codes.ERR_INVALID_ARG_TYPE;function czt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new uzt("iterable",["Iterable"],t);var i=new e(izt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=nzt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}sFe.exports=czt});var OH=v((mCr,bFe)=>{"use strict";bFe.exports=Gr;var Mb;Gr.ReadableState=pFe;var dCr=require("events").EventEmitter,fFe=function(t,r){return t.listeners(r).length},H2=wH(),A4=require("buffer").Buffer,lzt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fzt(e){return A4.from(e)}function pzt(e){return A4.isBuffer(e)||e instanceof lzt}var LH=require("util"),yr;LH&&LH.debuglog?yr=LH.debuglog("stream"):yr=function(){};var hzt=LDe(),HH=SH(),dzt=TH(),mzt=dzt.getHighWaterMark,S4=nh().codes,gzt=S4.ERR_INVALID_ARG_TYPE,vzt=S4.ERR_STREAM_PUSH_AFTER_EOF,bzt=S4.ERR_METHOD_NOT_IMPLEMENTED,yzt=S4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,qb,MH,qH;tr()(Gr,H2);var z2=HH.errorOrDestroy,NH=["error","close","destroy","pause","resume"];function xzt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function pFe(e,t,r){Mb=Mb||x0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Mb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=mzt(this,e,"readableHighWaterMark",r),this.buffer=new hzt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(qb||(qb=RH().StringDecoder),this.decoder=new qb(e.encoding),this.encoding=e.encoding)}function Gr(e){if(Mb=Mb||x0(),!(this instanceof Gr))return new Gr(e);var t=this instanceof Mb;this._readableState=new pFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),H2.call(this)}Object.defineProperty(Gr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Gr.prototype.destroy=HH.destroy;Gr.prototype._undestroy=HH.undestroy;Gr.prototype._destroy=function(e,t){t(e)};Gr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=A4.from(e,t),t=""),n=!0),hFe(this,e,t,!1,n)};Gr.prototype.unshift=function(e){return hFe(this,e,null,!0,!1)};function hFe(e,t,r,n,i){yr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Ezt(e,a);else{var o;if(i||(o=_zt(a,t)),o)z2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==A4.prototype&&(t=fzt(t)),n)a.endEmitted?z2(e,new yzt):UH(e,a,t,!0);else if(a.ended)z2(e,new vzt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?UH(e,a,t,!1):zH(e,a)):UH(e,a,t,!1)}else n||(a.reading=!1,zH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function UH(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T4(e)),zH(e,t)}function _zt(e,t){var r;return!pzt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new gzt("chunk",["string","Buffer","Uint8Array"],t)),r}Gr.prototype.isPaused=function(){return this._readableState.flowing===!1};Gr.prototype.setEncoding=function(e){qb||(qb=RH().StringDecoder);var t=new qb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var cFe=1073741824;function wzt(e){return e>=cFe?e=cFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function lFe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=wzt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Gr.prototype.read=function(e){yr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return yr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?GH(this):T4(this),null;if(e=lFe(e,t),e===0&&t.ended)return t.length===0&&GH(this),null;var n=t.needReadable;yr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,yr("length less than watermark",n)),t.ended||t.reading?(n=!1,yr("reading or ended",n)):n&&(yr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=lFe(r,t)));var i;return e>0?i=gFe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&GH(this)),i!==null&&this.emit("data",i),i};function Ezt(e,t){if(yr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,dFe(e)))}}function T4(e){var t=e._readableState;yr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(yr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(dFe,e))}function dFe(e){var t=e._readableState;yr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,WH(e)}function zH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Azt,e,t))}function Azt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(yr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Gr.prototype._read=function(e){z2(this,new bzt("_read()"))};Gr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,yr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){yr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){yr("onend"),e.end()}var u=Szt(r);e.on("drain",u);var c=!1;function l(){yr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){yr("ondata");var x=e.write(g);yr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&vFe(n.pipes,e)!==-1)&&!c&&(yr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){yr("onerror",g),b(),e.removeListener("error",p),fFe(e,"error")===0&&z2(e,g)}xzt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){yr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){yr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(yr("pipe resume"),r.resume()),e};function Szt(e){return function(){var r=e._readableState;yr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&fFe(e,"data")&&(r.flowing=!0,WH(e))}}Gr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=vFe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Gr.prototype.on=function(e,t){var r=H2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,yr("on readable",n.length,n.reading),n.length?T4(this):n.reading||process.nextTick(Tzt,this)),r};Gr.prototype.addListener=Gr.prototype.on;Gr.prototype.removeListener=function(e,t){var r=H2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(mFe,this),r};Gr.prototype.removeAllListeners=function(e){var t=H2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(mFe,this),t};function mFe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Tzt(e){yr("readable nexttick read 0"),e.read(0)}Gr.prototype.resume=function(){var e=this._readableState;return e.flowing||(yr("resume"),e.flowing=!e.readableListening,Czt(this,e)),e.paused=!1,this};function Czt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Dzt,e,t))}function Dzt(e,t){yr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),WH(e),t.flowing&&!t.reading&&e.read(0)}Gr.prototype.pause=function(){return yr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(yr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function WH(e){var t=e._readableState;for(yr("flow",t.flowing);t.flowing&&e.read()!==null;);}Gr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(yr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(yr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<NH.length;a++)e.on(NH[a],this.emit.bind(this,NH[a]));return this._read=function(o){yr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Gr.prototype[Symbol.asyncIterator]=function(){return MH===void 0&&(MH=iFe()),MH(this)});Object.defineProperty(Gr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Gr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Gr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Gr._fromList=gFe;Object.defineProperty(Gr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function gFe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function GH(e){var t=e._readableState;yr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Fzt,t,e))}function Fzt(e,t){if(yr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Gr.from=function(e,t){return qH===void 0&&(qH=uFe()),qH(Gr,e,t)});function vFe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var VH=v((gCr,xFe)=>{"use strict";xFe.exports=Yl;var C4=nh().codes,kzt=C4.ERR_METHOD_NOT_IMPLEMENTED,Bzt=C4.ERR_MULTIPLE_CALLBACK,Ozt=C4.ERR_TRANSFORM_ALREADY_TRANSFORMING,Izt=C4.ERR_TRANSFORM_WITH_LENGTH_0,D4=x0();tr()(Yl,D4);function Pzt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Bzt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Yl(e){if(!(this instanceof Yl))return new Yl(e);D4.call(this,e),this._transformState={afterTransform:Pzt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Rzt)}function Rzt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yFe(e,t,r)}):yFe(this,null,null)}Yl.prototype.push=function(e,t){return this._transformState.needTransform=!1,D4.prototype.push.call(this,e,t)};Yl.prototype._transform=function(e,t,r){r(new kzt("_transform()"))};Yl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Yl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Yl.prototype._destroy=function(e,t){D4.prototype._destroy.call(this,e,function(r){t(r)})};function yFe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Izt;if(e._transformState.transforming)throw new Ozt;return e.push(null)}});var EFe=v((vCr,wFe)=>{"use strict";wFe.exports=W2;var _Fe=VH();tr()(W2,_Fe);function W2(e){if(!(this instanceof W2))return new W2(e);_Fe.call(this,e)}W2.prototype._transform=function(e,t,r){r(null,e)}});var DFe=v((bCr,CFe)=>{"use strict";var KH;function jzt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var TFe=nh().codes,Lzt=TFe.ERR_MISSING_ARGS,Mzt=TFe.ERR_STREAM_DESTROYED;function AFe(e){if(e)throw e}function qzt(e){return e.setHeader&&typeof e.abort=="function"}function Nzt(e,t,r,n){n=jzt(n);var i=!1;e.on("close",function(){i=!0}),KH===void 0&&(KH=_4()),KH(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,qzt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Mzt("pipe"))}}}function SFe(e){e()}function Uzt(e,t){return e.pipe(t)}function Gzt(e){return!e.length||typeof e[e.length-1]!="function"?AFe:e.pop()}function zzt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Gzt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Lzt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return Nzt(o,u,c,function(l){i||(i=l),l&&a.forEach(SFe),!u&&(a.forEach(SFe),n(i))})});return t.reduce(Uzt)}CFe.exports=zzt});var FFe=v((Is,K2)=>{var V2=require("stream");process.env.READABLE_STREAM==="disable"&&V2?(K2.exports=V2.Readable,Object.assign(K2.exports,V2),K2.exports.Stream=V2):(Is=K2.exports=OH(),Is.Stream=V2||Is,Is.Readable=Is,Is.Writable=FH(),Is.Duplex=x0(),Is.Transform=VH(),Is.PassThrough=EFe(),Is.finished=_4(),Is.pipeline=DFe())});var YH=v($H=>{var kFe;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof $H=="object"?e($H):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(kFe={}):e(kFe={})})(function(e){e.version="1.2.2";function t(){for(var k=0,N=new Array(256),C=0;C!=256;++C)k=C,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,N[C]=k;return typeof Int32Array<"u"?new Int32Array(N):N}var r=t();function n(k){var N=0,C=0,I=0,P=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)P[I]=k[I];for(I=0;I!=256;++I)for(C=k[I],N=256+I;N<4096;N+=256)C=P[N]=C>>>8^k[C&255];var U=[];for(I=1;I!=16;++I)U[I-1]=typeof Int32Array<"u"?P.subarray(I*256,I*256+256):P.slice(I*256,I*256+256);return U}var i=n(r),a=i[0],o=i[1],s=i[2],u=i[3],c=i[4],l=i[5],f=i[6],p=i[7],h=i[8],d=i[9],b=i[10],g=i[11],x=i[12],E=i[13],S=i[14];function F(k,N){for(var C=N^-1,I=0,P=k.length;I<P;)C=C>>>8^r[(C^k.charCodeAt(I++))&255];return~C}function D(k,N){for(var C=N^-1,I=k.length-15,P=0;P<I;)C=S[k[P++]^C&255]^E[k[P++]^C>>8&255]^x[k[P++]^C>>16&255]^g[k[P++]^C>>>24]^b[k[P++]]^d[k[P++]]^h[k[P++]]^p[k[P++]]^f[k[P++]]^l[k[P++]]^c[k[P++]]^u[k[P++]]^s[k[P++]]^o[k[P++]]^a[k[P++]]^r[k[P++]];for(I+=15;P<I;)C=C>>>8^r[(C^k[P++])&255];return~C}function j(k,N){for(var C=N^-1,I=0,P=k.length,U=0,Y=0;I<P;)U=k.charCodeAt(I++),U<128?C=C>>>8^r[(C^U)&255]:U<2048?(C=C>>>8^r[(C^(192|U>>6&31))&255],C=C>>>8^r[(C^(128|U&63))&255]):U>=55296&&U<57344?(U=(U&1023)+64,Y=k.charCodeAt(I++)&1023,C=C>>>8^r[(C^(240|U>>8&7))&255],C=C>>>8^r[(C^(128|U>>2&63))&255],C=C>>>8^r[(C^(128|Y>>6&15|(U&3)<<4))&255],C=C>>>8^r[(C^(128|Y&63))&255]):(C=C>>>8^r[(C^(224|U>>12&15))&255],C=C>>>8^r[(C^(128|U>>6&63))&255],C=C>>>8^r[(C^(128|U&63))&255]);return~C}e.table=r,e.bstr=F,e.buf=D,e.str=j})});var OFe=v((xCr,BFe)=>{"use strict";var{Transform:Hzt}=FFe(),Wzt=YH(),JH=class extends Hzt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(t,r,n){t&&(this.checksum=Wzt.buf(t,this.checksum)>>>0,this.rawSize+=t.length),n(null,t)}digest(t){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};BFe.exports=JH});var PFe=v((_Cr,IFe)=>{"use strict";var{DeflateRaw:Vzt}=require("zlib"),Kzt=YH(),XH=class extends Vzt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(t,r){return t&&(this.compressedSize+=t.length),super.push(t,r)}_transform(t,r,n){t&&(this.checksum=Kzt.buf(t,this.checksum)>>>0,this.rawSize+=t.length),super._transform(t,r,n)}digest(t){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(t=!1){return t?this.compressedSize:this.rawSize}};IFe.exports=XH});var QH=v((wCr,RFe)=>{"use strict";RFe.exports={CRC32Stream:OFe(),DeflateCRC32Stream:PFe()}});var MFe=v((TCr,LFe)=>{var $zt=require("util").inherits,Yzt=_H(),{CRC32Stream:Jzt}=QH(),{DeflateCRC32Stream:Xzt}=QH(),jFe=vH(),ECr=Nz(),ACr=Mz(),sr=qz(),SCr=mH(),Ut=e4(),ua=LFe.exports=function(e){if(!(this instanceof ua))return new ua(e);e=this.options=this._defaults(e),jFe.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:"",finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};$zt(ua,jFe);ua.prototype._afterAppend=function(e){this._entries.push(e),e.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(e),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()};ua.prototype._appendBuffer=function(e,t,r){t.length===0&&e.setMethod(sr.METHOD_STORED);var n=e.getMethod();if(n===sr.METHOD_STORED&&(e.setSize(t.length),e.setCompressedSize(t.length),e.setCrc(Yzt.unsigned(t))),this._writeLocalFileHeader(e),n===sr.METHOD_STORED){this.write(t),this._afterAppend(e),r(null,e);return}else if(n===sr.METHOD_DEFLATED){this._smartStream(e,r).end(t);return}else{r(new Error("compression method "+n+" not implemented"));return}};ua.prototype._appendStream=function(e,t,r){e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(e);var n=this._smartStream(e,r);t.once("error",function(i){n.emit("error",i),n.end()}),t.pipe(n)};ua.prototype._defaults=function(e){return typeof e!="object"&&(e={}),typeof e.zlib!="object"&&(e.zlib={}),typeof e.zlib.level!="number"&&(e.zlib.level=sr.ZLIB_BEST_SPEED),e.forceZip64=!!e.forceZip64,e.forceLocalTime=!!e.forceLocalTime,e};ua.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(e){this._writeCentralFileHeader(e)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()};ua.prototype._normalizeEntry=function(e){e.getMethod()===-1&&e.setMethod(sr.METHOD_DEFLATED),e.getMethod()===sr.METHOD_DEFLATED&&(e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_DATA_DESCRIPTOR)),e.getTime()===-1&&e.setTime(new Date,this._archive.forceLocalTime),e._offsets={file:0,data:0,contents:0}};ua.prototype._smartStream=function(e,t){var r=e.getMethod()===sr.METHOD_DEFLATED,n=r?new Xzt(this.options.zlib):new Jzt,i=null;function a(){var o=n.digest().readUInt32BE(0);e.setCrc(o),e.setSize(n.size()),e.setCompressedSize(n.size(!0)),this._afterAppend(e),t(i,e)}return n.once("end",a.bind(this)),n.once("error",function(o){i=o}),n.pipe(this,{end:!1}),n};ua.prototype._writeCentralDirectoryEnd=function(){var e=this._entries.length,t=this._archive.centralLength,r=this._archive.centralOffset;this.isZip64()&&(e=sr.ZIP64_MAGIC_SHORT,t=sr.ZIP64_MAGIC,r=sr.ZIP64_MAGIC),this.write(Ut.getLongBytes(sr.SIG_EOCD)),this.write(sr.SHORT_ZERO),this.write(sr.SHORT_ZERO),this.write(Ut.getShortBytes(e)),this.write(Ut.getShortBytes(e)),this.write(Ut.getLongBytes(t)),this.write(Ut.getLongBytes(r));var n=this.getComment(),i=Buffer.byteLength(n);this.write(Ut.getShortBytes(i)),this.write(n)};ua.prototype._writeCentralDirectoryZip64=function(){this.write(Ut.getLongBytes(sr.SIG_ZIP64_EOCD)),this.write(Ut.getEightBytes(44)),this.write(Ut.getShortBytes(sr.MIN_VERSION_ZIP64)),this.write(Ut.getShortBytes(sr.MIN_VERSION_ZIP64)),this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO),this.write(Ut.getEightBytes(this._entries.length)),this.write(Ut.getEightBytes(this._entries.length)),this.write(Ut.getEightBytes(this._archive.centralLength)),this.write(Ut.getEightBytes(this._archive.centralOffset)),this.write(Ut.getLongBytes(sr.SIG_ZIP64_EOCD_LOC)),this.write(sr.LONG_ZERO),this.write(Ut.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(Ut.getLongBytes(1))};ua.prototype._writeCentralFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e._offsets,i=e.getSize(),a=e.getCompressedSize();if(e.isZip64()||n.file>sr.ZIP64_MAGIC){i=sr.ZIP64_MAGIC,a=sr.ZIP64_MAGIC,e.setVersionNeededToExtract(sr.MIN_VERSION_ZIP64);var o=Buffer.concat([Ut.getShortBytes(sr.ZIP64_EXTRA_ID),Ut.getShortBytes(24),Ut.getEightBytes(e.getSize()),Ut.getEightBytes(e.getCompressedSize()),Ut.getEightBytes(n.file)],28);e.setExtra(o)}this.write(Ut.getLongBytes(sr.SIG_CFH)),this.write(Ut.getShortBytes(e.getPlatform()<<8|sr.VERSION_MADEBY)),this.write(Ut.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(Ut.getShortBytes(r)),this.write(Ut.getLongBytes(e.getTimeDos())),this.write(Ut.getLongBytes(e.getCrc())),this.write(Ut.getLongBytes(a)),this.write(Ut.getLongBytes(i));var s=e.getName(),u=e.getComment(),c=e.getCentralDirectoryExtra();t.usesUTF8ForNames()&&(s=Buffer.from(s),u=Buffer.from(u)),this.write(Ut.getShortBytes(s.length)),this.write(Ut.getShortBytes(c.length)),this.write(Ut.getShortBytes(u.length)),this.write(sr.SHORT_ZERO),this.write(Ut.getShortBytes(e.getInternalAttributes())),this.write(Ut.getLongBytes(e.getExternalAttributes())),n.file>sr.ZIP64_MAGIC?this.write(Ut.getLongBytes(sr.ZIP64_MAGIC)):this.write(Ut.getLongBytes(n.file)),this.write(s),this.write(c),this.write(u)};ua.prototype._writeDataDescriptor=function(e){this.write(Ut.getLongBytes(sr.SIG_DD)),this.write(Ut.getLongBytes(e.getCrc())),e.isZip64()?(this.write(Ut.getEightBytes(e.getCompressedSize())),this.write(Ut.getEightBytes(e.getSize()))):(this.write(Ut.getLongBytes(e.getCompressedSize())),this.write(Ut.getLongBytes(e.getSize())))};ua.prototype._writeLocalFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e.getName(),i=e.getLocalFileDataExtra();e.isZip64()&&(t.useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_ZIP64)),t.usesUTF8ForNames()&&(n=Buffer.from(n)),e._offsets.file=this.offset,this.write(Ut.getLongBytes(sr.SIG_LFH)),this.write(Ut.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(Ut.getShortBytes(r)),this.write(Ut.getLongBytes(e.getTimeDos())),e._offsets.data=this.offset,t.usesDataDescriptor()?(this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO)):(this.write(Ut.getLongBytes(e.getCrc())),this.write(Ut.getLongBytes(e.getCompressedSize())),this.write(Ut.getLongBytes(e.getSize()))),this.write(Ut.getShortBytes(n.length)),this.write(Ut.getShortBytes(i.length)),this.write(n),this.write(i),e._offsets.contents=this.offset};ua.prototype.getComment=function(e){return this._archive.comment!==null?this._archive.comment:""};ua.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>sr.ZIP64_MAGIC_SHORT||this._archive.centralLength>sr.ZIP64_MAGIC||this._archive.centralOffset>sr.ZIP64_MAGIC};ua.prototype.setComment=function(e){this._archive.comment=e}});var ZH=v((CCr,qFe)=>{qFe.exports={ArchiveEntry:ZF(),ZipArchiveEntry:Nz(),ArchiveOutputStream:vH(),ZipArchiveOutputStream:MFe()}});var UFe=v((DCr,NFe)=>{var Qzt=require("util").inherits,tW=ZH().ZipArchiveOutputStream,Zzt=ZH().ZipArchiveEntry,eW=Cb(),Nb=NFe.exports=function(e){if(!(this instanceof Nb))return new Nb(e);e=this.options=e||{},e.zlib=e.zlib||{},tW.call(this,e),typeof e.level=="number"&&e.level>=0&&(e.zlib.level=e.level,delete e.level),!e.forceZip64&&typeof e.zlib.level=="number"&&e.zlib.level===0&&(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};Qzt(Nb,tW);Nb.prototype._normalizeFileData=function(e){e=eW.defaults(e,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var t=e.type==="directory",r=e.type==="symlink";return e.name&&(e.name=eW.sanitizePath(e.name),!r&&e.name.slice(-1)==="/"?(t=!0,e.type="directory"):t&&(e.name+="/")),(t||r)&&(e.store=!0),e.date=eW.dateify(e.date),e};Nb.prototype.entry=function(e,t,r){if(typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),t=this._normalizeFileData(t),t.type!=="file"&&t.type!=="directory"&&t.type!=="symlink"){r(new Error(t.type+" entries not currently supported"));return}if(typeof t.name!="string"||t.name.length===0){r(new Error("entry name must be a non-empty string value"));return}if(t.type==="symlink"&&typeof t.linkname!="string"){r(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var n=new Zzt(t.name);return n.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&n.setName(t.name,!0),t.store&&n.setMethod(0),t.comment.length>0&&n.setComment(t.comment),t.type==="symlink"&&typeof t.mode!="number"&&(t.mode=40960),typeof t.mode=="number"&&(t.type==="symlink"&&(t.mode|=40960),n.setUnixMode(t.mode)),t.type==="symlink"&&typeof t.linkname=="string"&&(e=Buffer.from(t.linkname)),tW.prototype.entry.call(this,n,e,r)};Nb.prototype.finalize=function(){this.finish()}});var zFe=v((FCr,GFe)=>{var eHt=UFe(),tHt=Cb(),uh=function(e){if(!(this instanceof uh))return new uh(e);e=this.options=tHt.defaults(e,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new eHt(e)};uh.prototype.append=function(e,t,r){this.engine.entry(e,t,r)};uh.prototype.finalize=function(){this.engine.finalize()};uh.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};uh.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};uh.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};GFe.exports=uh});var iW=v(Gb=>{var rHt=Buffer.alloc,nHt="0000000000000000000",iHt="7777777777777777777",HFe="0".charCodeAt(0),WFe=Buffer.from("ustar\0","binary"),aHt=Buffer.from("00","binary"),oHt=Buffer.from("ustar ","binary"),sHt=Buffer.from(" \0","binary"),uHt=parseInt("7777",8),$2=257,nW=263,cHt=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},lHt=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},fHt=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},VFe=function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},KFe=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},ch=function(e,t){return e=e.toString(8),e.length>t?iHt.slice(0,t)+" ":nHt.slice(0,t-e.length)+e+" "};function pHt(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var i=e[n];t?r.push(i):r.push(255-i)}var a=0,o=r.length;for(n=0;n<o;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}var lh=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return pHt(e);for(;t<e.length&&e[t]===32;)t++;for(var n=cHt(VFe(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},Ub=function(e,t,r,n){return e.slice(t,VFe(e,0,t,t+r)).toString(n)},rW=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};Gb.decodeLongPath=function(e,t){return Ub(e,0,e.length,t)};Gb.encodePax=function(e){var t="";e.name&&(t+=rW(" path="+e.name+`
|
|
171
171
|
`)),e.linkname&&(t+=rW(" linkpath="+e.linkname+`
|
|
172
172
|
`));var r=e.pax;if(r)for(var n in r)t+=rW(" "+n+"="+r[n]+`
|
|
173
|
-
`);return Buffer.from(t)};Gb.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),a=i.indexOf("=");if(a===-1)return t;t[i.slice(0,a)]=i.slice(a+1),e=e.slice(n)}return t};Gb.encode=function(e){var t=rHt(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(i===-1)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(ch(e.mode&uHt,6),100),t.write(ch(e.uid,6),108),t.write(ch(e.gid,6),116),t.write(ch(e.size,11),124),t.write(ch(e.mtime.getTime()/1e3|0,11),136),t[156]=HFe+fHt(e.type),e.linkname&&t.write(e.linkname,157),WFe.copy(t,$2),aHt.copy(t,nW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ch(e.devmajor||0,6),329),t.write(ch(e.devminor||0,6),337),n&&t.write(n,345),t.write(ch(KFe(t),6),148),t)};Gb.decode=function(e,t,r){var n=e[156]===0?0:e[156]-HFe,i=Ub(e,0,100,t),a=lh(e,100,8),o=lh(e,108,8),s=lh(e,116,8),u=lh(e,124,12),c=lh(e,136,12),l=lHt(n),f=e[157]===0?null:Ub(e,157,100,t),p=Ub(e,265,32),h=Ub(e,297,32),d=lh(e,329,8),b=lh(e,337,8),g=KFe(e);if(g===8*32)return null;if(g!==lh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(WFe.compare(e,$2,$2+6)===0)e[345]&&(i=Ub(e,345,155,t)+"/"+i);else if(!(oHt.compare(e,$2,$2+6)===0&&sHt.compare(e,nW,nW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:p,gname:h,devmajor:d,devminor:b}}});var aW=v((BCr,$Fe)=>{$Fe.exports=require("stream")});var e4e=v((OCr,ZFe)=>{"use strict";function YFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function JFe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YFe(Object(r),!0).forEach(function(n){hHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hHt(e,t,r){return t=QFe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QFe(n.key),n)}}function mHt(e,t,r){return t&&XFe(e.prototype,t),r&&XFe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function QFe(e){var t=gHt(e,"string");return typeof t=="symbol"?t:String(t)}function gHt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vHt=require("buffer"),F4=vHt.Buffer,bHt=require("util"),oW=bHt.inspect,yHt=oW&&oW.custom||"inspect";function xHt(e,t,r){F4.prototype.copy.call(e,t,r)}ZFe.exports=function(){function e(){dHt(this,e),this.head=null,this.tail=null,this.length=0}return mHt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return F4.alloc(0);for(var n=F4.allocUnsafe(r>>>0),i=this.head,a=0;i;)xHt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=F4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:yHt,value:function(r,n){return oW(this,JFe(JFe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var uW=v((ICr,r4e)=>{"use strict";function _Ht(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(sW,this,e)):process.nextTick(sW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(k4,r):(r._writableState.errorEmitted=!0,process.nextTick(t4e,r,a)):process.nextTick(t4e,r,a):t?(process.nextTick(k4,r),t(a)):process.nextTick(k4,r)}),this)}function t4e(e,t){sW(e,t),k4(e)}function k4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function wHt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function sW(e,t){e.emit("error",t)}function EHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}r4e.exports={destroy:_Ht,undestroy:wHt,errorOrDestroy:EHt}});var fh=v((PCr,a4e)=>{"use strict";var i4e={};function Ps(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,i4e[e]=i}function n4e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function AHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function SHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function THt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ps("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ps("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&AHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(SHt(e," argument"))i=`The ${e} ${n} ${n4e(t,"type")}`;else{let a=THt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${n4e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Ps("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ps("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ps("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ps("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ps("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ps("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ps("ERR_STREAM_WRITE_AFTER_END","write after end");Ps("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ps("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ps("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");a4e.exports.codes=i4e});var cW=v((RCr,o4e)=>{"use strict";var CHt=fh().codes.ERR_INVALID_OPT_VALUE;function DHt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function FHt(e,t,r,n){var i=DHt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new CHt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}o4e.exports={getHighWaterMark:FHt}});var pW=v((jCr,p4e)=>{"use strict";p4e.exports=li;function u4e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){rWt(t,e)}}var zb;li.WritableState=J2;var kHt={deprecate:pd()},c4e=aW(),O4=require("buffer").Buffer,BHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function OHt(e){return O4.from(e)}function IHt(e){return O4.isBuffer(e)||e instanceof BHt}var fW=uW(),PHt=cW(),RHt=PHt.getHighWaterMark,ph=fh().codes,jHt=ph.ERR_INVALID_ARG_TYPE,LHt=ph.ERR_METHOD_NOT_IMPLEMENTED,MHt=ph.ERR_MULTIPLE_CALLBACK,qHt=ph.ERR_STREAM_CANNOT_PIPE,NHt=ph.ERR_STREAM_DESTROYED,UHt=ph.ERR_STREAM_NULL_VALUES,GHt=ph.ERR_STREAM_WRITE_AFTER_END,zHt=ph.ERR_UNKNOWN_ENCODING,Hb=fW.errorOrDestroy;tr()(li,c4e);function HHt(){}function J2(e,t,r){zb=zb||A0(),e=e||{},typeof r!="boolean"&&(r=t instanceof zb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=RHt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){XHt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new u4e(this)}J2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(J2.prototype,"buffer",{get:kHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var B4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(B4=Function.prototype[Symbol.hasInstance],Object.defineProperty(li,Symbol.hasInstance,{value:function(t){return B4.call(this,t)?!0:this!==li?!1:t&&t._writableState instanceof J2}})):B4=function(t){return t instanceof this};function li(e){zb=zb||A0();var t=this instanceof zb;if(!t&&!B4.call(li,this))return new li(e);this._writableState=new J2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),c4e.call(this)}li.prototype.pipe=function(){Hb(this,new qHt)};function WHt(e,t){var r=new GHt;Hb(e,r),process.nextTick(t,r)}function VHt(e,t,r,n){var i;return r===null?i=new UHt:typeof r!="string"&&!t.objectMode&&(i=new jHt("chunk",["string","Buffer"],r)),i?(Hb(e,i),process.nextTick(n,i),!1):!0}li.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&IHt(e);return a&&!O4.isBuffer(e)&&(e=OHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=HHt),n.ending?WHt(this,r):(a||VHt(this,n,e,r))&&(n.pendingcb++,i=$Ht(this,n,a,e,t,r)),i};li.prototype.cork=function(){this._writableState.corked++};li.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&l4e(this,e))};li.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new zHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function KHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=O4.from(t,r)),t}Object.defineProperty(li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $Ht(e,t,r,n,i,a){if(!r){var o=KHt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else lW(e,t,!1,s,n,i,a);return u}function lW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new NHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function YHt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(Y2,e,t),e._writableState.errorEmitted=!0,Hb(e,n)):(i(n),e._writableState.errorEmitted=!0,Hb(e,n),Y2(e,t))}function JHt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function XHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new MHt;if(JHt(r),t)YHt(e,r,n,t,i);else{var a=f4e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&l4e(e,r),n?process.nextTick(s4e,e,r,a,i):s4e(e,r,a,i)}}function s4e(e,t,r,n){r||QHt(e,t),t.pendingcb--,n(),Y2(e,t)}function QHt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function l4e(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,lW(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new u4e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(lW(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}li.prototype._write=function(e,t,r){r(new LHt("_write()"))};li.prototype._writev=null;li.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||tWt(this,n,r),this};Object.defineProperty(li.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function f4e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ZHt(e,t){e._final(function(r){t.pendingcb--,r&&Hb(e,r),t.prefinished=!0,e.emit("prefinish"),Y2(e,t)})}function eWt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(ZHt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Y2(e,t){var r=f4e(t);if(r&&(eWt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function tWt(e,t,r){t.ending=!0,Y2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function rWt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(li.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});li.prototype.destroy=fW.destroy;li.prototype._undestroy=fW.undestroy;li.prototype._destroy=function(e,t){t(e)}});var A0=v((LCr,d4e)=>{"use strict";var nWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};d4e.exports=Lc;var h4e=mW(),dW=pW();tr()(Lc,h4e);for(hW=nWt(dW.prototype),I4=0;I4<hW.length;I4++)P4=hW[I4],Lc.prototype[P4]||(Lc.prototype[P4]=dW.prototype[P4]);var hW,P4,I4;function Lc(e){if(!(this instanceof Lc))return new Lc(e);h4e.call(this,e),dW.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",iWt)))}Object.defineProperty(Lc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function iWt(){this._writableState.ended||process.nextTick(aWt,this)}function aWt(e){e.end()}Object.defineProperty(Lc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var bW=v(g4e=>{"use strict";var vW=Gs().Buffer,m4e=vW.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function oWt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function sWt(e){var t=oWt(e);if(typeof t!="string"&&(vW.isEncoding===m4e||!m4e(e)))throw new Error("Unknown encoding: "+e);return t||e}g4e.StringDecoder=X2;function X2(e){this.encoding=sWt(e);var t;switch(this.encoding){case"utf16le":this.text=hWt,this.end=dWt,t=4;break;case"utf8":this.fillLast=lWt,t=4;break;case"base64":this.text=mWt,this.end=gWt,t=3;break;default:this.write=vWt,this.end=bWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=vW.allocUnsafe(t)}X2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};X2.prototype.end=pWt;X2.prototype.text=fWt;X2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function gW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function uWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=gW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=gW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=gW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function cWt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function lWt(e){var t=this.lastTotal-this.lastNeed,r=cWt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function fWt(e,t){var r=uWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function pWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function hWt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function dWt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function mWt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function gWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function vWt(e){return e.toString(this.encoding)}function bWt(e){return e&&e.length?this.write(e):""}});var R4=v((qCr,y4e)=>{"use strict";var v4e=fh().codes.ERR_STREAM_PREMATURE_CLOSE;function yWt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function xWt(){}function _Wt(e){return e.setHeader&&typeof e.abort=="function"}function b4e(e,t,r){if(typeof t=="function")return b4e(e,null,t);t||(t={}),r=yWt(r||xWt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new v4e),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new v4e),r.call(e,d)},p=function(){e.req.on("finish",s)};return _Wt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",p),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}y4e.exports=b4e});var _4e=v((NCr,x4e)=>{"use strict";var j4;function hh(e,t,r){return t=wWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wWt(e){var t=EWt(e,"string");return typeof t=="symbol"?t:String(t)}function EWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AWt=R4(),dh=Symbol("lastResolve"),S0=Symbol("lastReject"),Q2=Symbol("error"),L4=Symbol("ended"),T0=Symbol("lastPromise"),yW=Symbol("handlePromise"),C0=Symbol("stream");function mh(e,t){return{value:e,done:t}}function SWt(e){var t=e[dh];if(t!==null){var r=e[C0].read();r!==null&&(e[T0]=null,e[dh]=null,e[S0]=null,t(mh(r,!1)))}}function TWt(e){process.nextTick(SWt,e)}function CWt(e,t){return function(r,n){e.then(function(){if(t[L4]){r(mh(void 0,!0));return}t[yW](r,n)},n)}}var DWt=Object.getPrototypeOf(function(){}),FWt=Object.setPrototypeOf((j4={get stream(){return this[C0]},next:function(){var t=this,r=this[Q2];if(r!==null)return Promise.reject(r);if(this[L4])return Promise.resolve(mh(void 0,!0));if(this[C0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[Q2]?s(t[Q2]):o(mh(void 0,!0))})});var n=this[T0],i;if(n)i=new Promise(CWt(n,this));else{var a=this[C0].read();if(a!==null)return Promise.resolve(mh(a,!1));i=new Promise(this[yW])}return this[T0]=i,i}},hh(j4,Symbol.asyncIterator,function(){return this}),hh(j4,"return",function(){var t=this;return new Promise(function(r,n){t[C0].destroy(null,function(i){if(i){n(i);return}r(mh(void 0,!0))})})}),j4),DWt),kWt=function(t){var r,n=Object.create(FWt,(r={},hh(r,C0,{value:t,writable:!0}),hh(r,dh,{value:null,writable:!0}),hh(r,S0,{value:null,writable:!0}),hh(r,Q2,{value:null,writable:!0}),hh(r,L4,{value:t._readableState.endEmitted,writable:!0}),hh(r,yW,{value:function(a,o){var s=n[C0].read();s?(n[T0]=null,n[dh]=null,n[S0]=null,a(mh(s,!1))):(n[dh]=a,n[S0]=o)},writable:!0}),r));return n[T0]=null,AWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[S0];a!==null&&(n[T0]=null,n[dh]=null,n[S0]=null,a(i)),n[Q2]=i;return}var o=n[dh];o!==null&&(n[T0]=null,n[dh]=null,n[S0]=null,o(mh(void 0,!0))),n[L4]=!0}),t.on("readable",TWt.bind(null,n)),n};x4e.exports=kWt});var S4e=v((UCr,A4e)=>{"use strict";function w4e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function BWt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){w4e(a,n,i,o,s,"next",u)}function s(u){w4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function E4e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function OWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E4e(Object(r),!0).forEach(function(n){IWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IWt(e,t,r){return t=PWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PWt(e){var t=RWt(e,"string");return typeof t=="symbol"?t:String(t)}function RWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jWt=fh().codes.ERR_INVALID_ARG_TYPE;function LWt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new jWt("iterable",["Iterable"],t);var i=new e(OWt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=BWt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}A4e.exports=LWt});var mW=v((zCr,R4e)=>{"use strict";R4e.exports=zr;var Wb;zr.ReadableState=F4e;var GCr=require("events").EventEmitter,D4e=function(t,r){return t.listeners(r).length},ew=aW(),M4=require("buffer").Buffer,MWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function qWt(e){return M4.from(e)}function NWt(e){return M4.isBuffer(e)||e instanceof MWt}var xW=require("util"),xr;xW&&xW.debuglog?xr=xW.debuglog("stream"):xr=function(){};var UWt=e4e(),CW=uW(),GWt=cW(),zWt=GWt.getHighWaterMark,q4=fh().codes,HWt=q4.ERR_INVALID_ARG_TYPE,WWt=q4.ERR_STREAM_PUSH_AFTER_EOF,VWt=q4.ERR_METHOD_NOT_IMPLEMENTED,KWt=q4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Vb,_W,wW;tr()(zr,ew);var Z2=CW.errorOrDestroy,EW=["error","close","destroy","pause","resume"];function $Wt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function F4e(e,t,r){Wb=Wb||A0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Wb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=zWt(this,e,"readableHighWaterMark",r),this.buffer=new UWt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Vb||(Vb=bW().StringDecoder),this.decoder=new Vb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Wb=Wb||A0(),!(this instanceof zr))return new zr(e);var t=this instanceof Wb;this._readableState=new F4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),ew.call(this)}Object.defineProperty(zr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});zr.prototype.destroy=CW.destroy;zr.prototype._undestroy=CW.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=M4.from(e,t),t=""),n=!0),k4e(this,e,t,!1,n)};zr.prototype.unshift=function(e){return k4e(this,e,null,!0,!1)};function k4e(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,XWt(e,a);else{var o;if(i||(o=YWt(a,t)),o)Z2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==M4.prototype&&(t=qWt(t)),n)a.endEmitted?Z2(e,new KWt):AW(e,a,t,!0);else if(a.ended)Z2(e,new WWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?AW(e,a,t,!1):TW(e,a)):AW(e,a,t,!1)}else n||(a.reading=!1,TW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function AW(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&N4(e)),TW(e,t)}function YWt(e,t){var r;return!NWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new HWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Vb||(Vb=bW().StringDecoder);var t=new Vb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var T4e=1073741824;function JWt(e){return e>=T4e?e=T4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function C4e(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=JWt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.prototype.read=function(e){xr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return xr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?SW(this):N4(this),null;if(e=C4e(e,t),e===0&&t.ended)return t.length===0&&SW(this),null;var n=t.needReadable;xr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,xr("length less than watermark",n)),t.ended||t.reading?(n=!1,xr("reading or ended",n)):n&&(xr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C4e(r,t)));var i;return e>0?i=I4e(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&SW(this)),i!==null&&this.emit("data",i),i};function XWt(e,t){if(xr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?N4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B4e(e)))}}function N4(e){var t=e._readableState;xr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(xr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(B4e,e))}function B4e(e){var t=e._readableState;xr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,DW(e)}function TW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(QWt,e,t))}function QWt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(xr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}zr.prototype._read=function(e){Z2(this,new VWt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,xr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){xr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){xr("onend"),e.end()}var u=ZWt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&P4e(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){xr("onerror",g),b(),e.removeListener("error",p),D4e(e,"error")===0&&Z2(e,g)}$Wt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){xr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function ZWt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&D4e(e,"data")&&(r.flowing=!0,DW(e))}}zr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=P4e(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};zr.prototype.on=function(e,t){var r=ew.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,xr("on readable",n.length,n.reading),n.length?N4(this):n.reading||process.nextTick(eVt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=ew.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(O4e,this),r};zr.prototype.removeAllListeners=function(e){var t=ew.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(O4e,this),t};function O4e(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function eVt(e){xr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(xr("resume"),e.flowing=!e.readableListening,tVt(this,e)),e.paused=!1,this};function tVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(rVt,e,t))}function rVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),DW(e),t.flowing&&!t.reading&&e.read(0)}zr.prototype.pause=function(){return xr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function DW(e){var t=e._readableState;for(xr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(xr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(xr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<EW.length;a++)e.on(EW[a],this.emit.bind(this,EW[a]));return this._read=function(o){xr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return _W===void 0&&(_W=_4e()),_W(this)});Object.defineProperty(zr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(zr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(zr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});zr._fromList=I4e;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function I4e(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function SW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(nVt,t,e))}function nVt(e,t){if(xr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(zr.from=function(e,t){return wW===void 0&&(wW=S4e()),wW(zr,e,t)});function P4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var FW=v((HCr,L4e)=>{"use strict";L4e.exports=Jl;var U4=fh().codes,iVt=U4.ERR_METHOD_NOT_IMPLEMENTED,aVt=U4.ERR_MULTIPLE_CALLBACK,oVt=U4.ERR_TRANSFORM_ALREADY_TRANSFORMING,sVt=U4.ERR_TRANSFORM_WITH_LENGTH_0,G4=A0();tr()(Jl,G4);function uVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new aVt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Jl(e){if(!(this instanceof Jl))return new Jl(e);G4.call(this,e),this._transformState={afterTransform:uVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",cVt)}function cVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){j4e(e,t,r)}):j4e(this,null,null)}Jl.prototype.push=function(e,t){return this._transformState.needTransform=!1,G4.prototype.push.call(this,e,t)};Jl.prototype._transform=function(e,t,r){r(new iVt("_transform()"))};Jl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Jl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Jl.prototype._destroy=function(e,t){G4.prototype._destroy.call(this,e,function(r){t(r)})};function j4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new sVt;if(e._transformState.transforming)throw new oVt;return e.push(null)}});var N4e=v((WCr,q4e)=>{"use strict";q4e.exports=tw;var M4e=FW();tr()(tw,M4e);function tw(e){if(!(this instanceof tw))return new tw(e);M4e.call(this,e)}tw.prototype._transform=function(e,t,r){r(null,e)}});var W4e=v((VCr,H4e)=>{"use strict";var kW;function lVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var z4e=fh().codes,fVt=z4e.ERR_MISSING_ARGS,pVt=z4e.ERR_STREAM_DESTROYED;function U4e(e){if(e)throw e}function hVt(e){return e.setHeader&&typeof e.abort=="function"}function dVt(e,t,r,n){n=lVt(n);var i=!1;e.on("close",function(){i=!0}),kW===void 0&&(kW=R4()),kW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,hVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new pVt("pipe"))}}}function G4e(e){e()}function mVt(e,t){return e.pipe(t)}function gVt(e){return!e.length||typeof e[e.length-1]!="function"?U4e:e.pop()}function vVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=gVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new fVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return dVt(o,u,c,function(l){i||(i=l),l&&a.forEach(G4e),!u&&(a.forEach(G4e),n(i))})});return t.reduce(mVt)}H4e.exports=vVt});var iw=v((Rs,nw)=>{var rw=require("stream");process.env.READABLE_STREAM==="disable"&&rw?(nw.exports=rw.Readable,Object.assign(nw.exports,rw),nw.exports.Stream=rw):(Rs=nw.exports=mW(),Rs.Stream=rw||Rs,Rs.Readable=Rs,Rs.Writable=pW(),Rs.Duplex=A0(),Rs.Transform=FW(),Rs.PassThrough=N4e(),Rs.finished=R4(),Rs.pipeline=W4e())});var Q4e=v((KCr,X4e)=>{var K4e=require("util"),bVt=OL(),aw=iW(),$4e=iw().Writable,Y4e=iw().PassThrough,J4e=function(){},V4e=function(e){return e&=511,e&&512-e},yVt=function(e,t){var r=new z4(e,t);return r.end(),r},xVt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},z4=function(e,t){this._parent=e,this.offset=t,Y4e.call(this,{autoDestroy:!1})};K4e.inherits(z4,Y4e);z4.prototype.destroy=function(e){this._parent.destroy(e)};var Xl=function(e){if(!(this instanceof Xl))return new Xl(e);$4e.call(this,e),e=e||{},this._offset=0,this._buffer=bVt(),this._missing=0,this._partial=!1,this._onparse=J4e,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(p){if(t._locked=!1,p)return t.destroy(p);t._stream||n()},a=function(){t._stream=null;var p=V4e(t._header.size);p?t._parse(p,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(V4e(t._header.size)),t._parse(512,f),n()},s=function(){var p=t._header.size;t._paxGlobal=aw.decodePax(r.slice(0,p)),r.consume(p),a()},u=function(){var p=t._header.size;t._pax=aw.decodePax(r.slice(0,p)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(p),a()},c=function(){var p=t._header.size;this._gnuLongPath=aw.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},l=function(){var p=t._header.size;this._gnuLongLinkPath=aw.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},f=function(){var p=t._offset,h;try{h=t._header=aw.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(d){t.emit("error",d)}if(r.consume(512),!h){t._parse(512,f),n();return}if(h.type==="gnu-long-path"){t._parse(h.size,c),n();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),n();return}if(h.type==="pax-global-header"){t._parse(h.size,s),n();return}if(h.type==="pax-header"){t._parse(h.size,u),n();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=xVt(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,f),t.emit("entry",h,yVt(t,p),i);return}t._stream=new z4(t,p),t.emit("entry",h,t._stream,i),t._parse(h.size,a),n()};this._onheader=f,this._parse(512,f)};K4e.inherits(Xl,$4e);Xl.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Xl.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Xl.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=J4e,this._overflow?this._write(this._overflow,void 0,e):e()}};Xl.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}};Xl.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};X4e.exports=Xl});var eke=v(($Cr,Z4e)=>{Z4e.exports=require("fs").constants||require("constants")});var nke=v((YCr,rke)=>{var _Vt=LF(),wVt=function(){},EVt=function(e){return e.setHeader&&typeof e.abort=="function"},AVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},tke=function(e,t,r){if(typeof t=="function")return tke(e,null,t);t||(t={}),r=_Vt(r||wVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},p=function(g){r.call(e,g)},h=function(){process.nextTick(d)},d=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},b=function(){e.req.on("finish",c)};return EVt(e)?(e.on("complete",c),e.on("abort",h),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),AVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",p),e.on("close",h),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",h),e.removeListener("request",b),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",p),e.removeListener("close",h)}};rke.exports=tke});var uke=v((JCr,ske)=>{var Kb=eke(),ike=nke(),W4=tr(),SVt=Buffer.alloc,ake=iw().Readable,$b=iw().Writable,TVt=require("string_decoder").StringDecoder,H4=iW(),CVt=parseInt("755",8),DVt=parseInt("644",8),oke=SVt(1024),OW=function(){},BW=function(e,t){t&=511,t&&e.push(oke.slice(0,512-t))};function FVt(e){switch(e&Kb.S_IFMT){case Kb.S_IFBLK:return"block-device";case Kb.S_IFCHR:return"character-device";case Kb.S_IFDIR:return"directory";case Kb.S_IFIFO:return"fifo";case Kb.S_IFLNK:return"symlink"}return"file"}var V4=function(e){$b.call(this),this.written=0,this._to=e,this._destroyed=!1};W4(V4,$b);V4.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};V4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var K4=function(){$b.call(this),this.linkname="",this._decoder=new TVt("utf-8"),this._destroyed=!1};W4(K4,$b);K4.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};K4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var ow=function(){$b.call(this),this._destroyed=!1};W4(ow,$b);ow.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};ow.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Mc=function(e){if(!(this instanceof Mc))return new Mc(e);ake.call(this,e),this._drain=OW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};W4(Mc,ake);Mc.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=OW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=FVt(e.mode)),e.mode||(e.mode=e.type==="directory"?CVt:DVt),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return BW(n,e.size),i?process.nextTick(r):this._drain=r,new ow}if(e.type==="symlink"&&!e.linkname){var a=new K4;return ike(a,function(s){if(s)return n.destroy(),r(s);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new ow;var o=new V4(this);return this._stream=o,ike(o,function(s){if(n._stream=null,s)return n.destroy(),r(s);if(o.written!==e.size)return n.destroy(),r(new Error("size mismatch"));BW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Mc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(oke),this.push(null))};Mc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Mc.prototype._encode=function(e){if(!e.pax){var t=H4.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Mc.prototype._encodePax=function(e){var t=H4.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(H4.encode(r)),this.push(t),BW(this,t.length),r.size=e.size,r.type=e.type,this.push(H4.encode(r))};Mc.prototype._read=function(e){var t=this._drain;this._drain=OW,t()};ske.exports=Mc});var cke=v(IW=>{IW.extract=Q4e();IW.pack=uke()});var pke=v((QCr,fke)=>{var kVt=require("zlib"),BVt=cke(),lke=Cb(),Ql=function(e){if(!(this instanceof Ql))return new Ql(e);e=this.options=lke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=BVt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=kVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ql.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ql.prototype.append=function(e,t,r){var n=this;t.mtime=t.date;function i(o,s){if(o){r(o);return}n.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")i(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=n.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&lke.collectStream(e,i)};Ql.prototype.finalize=function(){this.engine.finalize()};Ql.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ql.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)};Ql.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};fke.exports=Ql});var gke=v((ZCr,mke)=>{var OVt=require("util").inherits,hke=Pz().Transform,IVt=_H(),dke=Cb(),gh=function(e){if(!(this instanceof gh))return new gh(e);e=this.options=dke.defaults(e,{}),hke.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};OVt(gh,hke);gh.prototype._transform=function(e,t,r){r(null,e)};gh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};gh.prototype.append=function(e,t,r){var n=this;t.crc32=0;function i(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=IVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&dke.collectStream(e,i)};gh.prototype.finalize=function(){this._writeStringified(),this.end()};mke.exports=gh});var bke=v((e8r,vke)=>{var PVt=f8e(),sw={},vh=function(e,t){return vh.create(e,t)};vh.create=function(e,t){if(sw[e]){var r=new PVt(e,t);return r.setFormat(e),r.setModule(new sw[e](t)),r}else throw new Error("create("+e+"): format not registered")};vh.registerFormat=function(e,t){if(sw[e])throw new Error("register("+e+"): format already registered");if(typeof t!="function")throw new Error("register("+e+"): format module invalid");if(typeof t.prototype.append!="function"||typeof t.prototype.finalize!="function")throw new Error("register("+e+"): format module missing methods");sw[e]=t};vh.isRegisteredFormat=function(e){return!!sw[e]};vh.registerFormat("zip",zFe());vh.registerFormat("tar",pke());vh.registerFormat("json",gke());vke.exports=vh});var EV=typeof process!="object"||String(process)!=="[object process]"||process.browser;var AV={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=AV||{};function er(e,t,r){return t<=e&&e<=r}function SOe(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function Pw(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function TOe(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function COe(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function Wo(e){return 0<=e&&e<=127}var Ho=Wo,Fr=-1;function Ak(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Ak.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Fr},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var xn=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function qs(e){throw TypeError("The code point "+e+" could not be encoded.")}function DOe(){}DOe.prototype={handler:function(e,t){}};function FOe(){}FOe.prototype={handler:function(e,t){}};function wk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ek,e)?Ek[e]:null}var SV=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Ek={};SV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){Ek[r]=t})})});var ro={},no={};function q0(e,t){return t&&t[e]||null}function N0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ha(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function kOe(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Ha("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function BOe(e){if(e===59335)return 7457;var t=0,r=0,n=Ha("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function OOe(e){xk=xk||Ha("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=xk;return t.indexOf(e)}var xk;function IOe(e){_k=_k||Ha("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=_k;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):N0(e,t)}var _k,TV="utf-8";function wh(e,t){if(!(this instanceof wh))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):TV,t=Pw(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=wk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!no[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,Boolean(t.fatal)&&(n._error_mode="fatal"),Boolean(t.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(wh.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(wh.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(wh.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));wh.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Pw(r),this._do_not_flush||(this._decoder=no[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new Ak(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===xn))break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(i,i.read()),o===xn)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return SOe(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(c.length>0&&c[0]===65279?(this._BOMseen=!0,c.shift()):c.length>0&&(this._BOMseen=!0)),COe(c)}return u.call(this,a)};function xy(e,t){if(!(this instanceof xy))throw TypeError("Called as a function. Did you forget 'new'?");t=Pw(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";var r=this;if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):TV;var n=wk(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=wk("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(xy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});xy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Pw(r),this._do_not_flush||(this._encoder=ro[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new Ak(TOe(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===xn))break;Array.isArray(a)?i.push.apply(i,a):i.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(n,n.read()),a!==xn;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function POe(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(s,u){if(u===Fr&&i!==0)return i=0,Dr(t);if(u===Fr)return xn;if(i===0){if(er(u,0,127))return u;if(er(u,194,223))i=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),i=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),i=3,r=u&7;else return Dr(t);return null}if(!er(u,a,o))return r=i=n=0,a=128,o=191,s.prepend(u),Dr(t);if(a=128,o=191,r=r<<6|u&63,n+=1,n!==i)return null;var c=r;return r=i=n=0,c}}function ROe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i,a;er(n,128,2047)?(i=1,a=192):er(n,2048,65535)?(i=2,a=224):er(n,65536,1114111)&&(i=3,a=240);for(var o=[(n>>6*i)+a];i>0;){var s=n>>6*(i-1);o.push(128|s&63),i-=1}return o}}ro["UTF-8"]=function(e){return new ROe(e)};no["UTF-8"]=function(e){return new POe(e)};function jOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Wo(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function LOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;var a=N0(i,e);return a===null&&qs(i),a+128}}(function(){"encoding-indexes"in globalThis&&SV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ha(r.toLowerCase());no[r]=function(i){return new jOe(n,i)},ro[r]=function(i){return new LOe(n,i)}})})})();no.GBK=function(e){return new CV(e)};ro.GBK=function(e){return new DV(e,!0)};function CV(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(a,o){if(o===Fr&&r===0&&n===0&&i===0)return xn;o===Fr&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Dr(t));var s;if(i!==0){s=null,er(o,48,57)&&(s=kOe((((r-129)*10+n-48)*126+i-129)*10+o-48));var u=[n,i,o];return r=0,n=0,i=0,s===null?(a.prepend(u),Dr(t)):s}if(n!==0)return er(o,129,254)?(i=o,null):(a.prepend([n,o]),r=0,n=0,Dr(t));if(r!==0){if(er(o,48,57))return n=o,null;var c=r,l=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(l=(c-129)*190+(o-f)),s=l===null?null:q0(l,Ha("gb18030")),s===null&&Wo(o)&&a.prepend(o),s===null?Dr(t):s}return Wo(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function DV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;if(i===58853)return qs(i);if(t&&i===8364)return 128;var a=N0(i,Ha("gb18030"));if(a!==null){var o=Kc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return qs(i);a=BOe(i);var c=Kc(a/10/126/10);a=a-c*10*126*10;var l=Kc(a/10/126);a=a-l*10*126;var f=Kc(a/10),p=a-f*10;return[c+129,l+48,f+129,p+48]}}ro.gb18030=function(e){return new DV(e)};no.gb18030=function(e){return new CV(e)};function MOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:98;switch((er(i,64,126)||er(i,161,254))&&(o=(a-129)*157+(i-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var u=o===null?null:q0(o,Ha("big5"));return u===null&&Wo(i)&&n.prepend(i),u===null?Dr(t):u}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function qOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=IOe(n);if(i===null)return qs(n);var a=Kc(i/157)+129;if(a<161)return qs(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}ro.Big5=function(e){return new qOe(e)};no.Big5=function(e){return new MOe(e)};function NOe(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,a){if(a===Fr&&n!==0)return n=0,Dr(t);if(a===Fr&&n===0)return xn;if(n===142&&er(a,161,223))return n=0,65377-161+a;if(n===143&&er(a,161,254))return r=!0,n=a,null;if(n!==0){var o=n;n=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=q0((o-161)*94+(a-161),Ha(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Wo(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function UOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=N0(n,Ha("jis0208"));if(i===null)return qs(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}ro["EUC-JP"]=function(e){return new UOe(e)};no["EUC-JP"]=function(e){return new NOe(e)};function GOe(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(n){default:case r.ASCII:return u===27?(n=r.EscapeStart,null):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Roman:return u===27?(n=r.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Katakana:return u===27?(n=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Fr?xn:(o=!1,Dr(t));case r.LeadByte:return u===27?(n=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,n=r.TrailByte,null):u===Fr?xn:(o=!1,Dr(t));case r.TrailByte:if(u===27)return n=r.EscapeStart,Dr(t);if(er(u,33,126)){n=r.LeadByte;var c=(a-33)*94+u-33,l=q0(c,Ha("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var p=null;if(f===40&&u===66&&(p=r.ASCII),f===40&&u===74&&(p=r.Roman),f===40&&u===73&&(p=r.Katakana),f===36&&(u===64||u===66)&&(p=r.LeadByte),p!==null){n=n=p;var h=o;return o=!0,h?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function zOe(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,a){if(a===Fr&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if(a===Fr&&n===r.ASCII)return xn;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return qs(65533);if(n===r.ASCII&&Ho(a))return a;if(n===r.Roman&&(Ho(a)&&a!==92&&a!==126||a==165||a==8254)){if(Ho(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Ho(a)&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if((a===165||a===8254)&&n!==r.Roman)return i.prepend(a),n=r.Roman,[27,40,74];a===8722&&(a=65293);var o=N0(a,Ha("jis0208"));if(o===null)return qs(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Kc(o/94)+33,u=o%94+33;return[s,u]}}ro["ISO-2022-JP"]=function(e){return new zOe(e)};no["ISO-2022-JP"]=function(e){return new GOe(e)};function HOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:65,u=a<160?129:193;if((er(i,64,126)||er(i,128,252))&&(o=(a-u)*188+i-s),er(o,8836,10715))return 57344-8836+o;var c=o===null?null:q0(o,Ha("jis0208"));return c===null&&Wo(i)&&n.prepend(i),c===null?Dr(t):c}return Wo(i)||i===128?i:er(i,161,223)?65377-161+i:er(i,129,159)||er(i,224,252)?(r=i,null):Dr(t)}}function WOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=OOe(n);if(i===null)return qs(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}ro.Shift_JIS=function(e){return new WOe(e)};no.Shift_JIS=function(e){return new HOe(e)};function VOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0,er(i,65,254)&&(o=(a-129)*190+(i-65));var s=o===null?null:q0(o,Ha("euc-kr"));return o===null&&Wo(i)&&n.prepend(i),s===null?Dr(t):s}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function KOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=N0(n,Ha("euc-kr"));if(i===null)return qs(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}ro["EUC-KR"]=function(e){return new KOe(e)};no["EUC-KR"]=function(e){return new VOe(e)};function Iw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function FV(e,t){var r=t.fatal,n=null,i=null;this.handler=function(a,o){if(o===Fr&&(n!==null||i!==null))return Dr(r);if(o===Fr&&n===null&&i===null)return xn;if(n===null)return n=o,null;var s;if(e?s=(n<<8)+o:s=(o<<8)+n,n=null,i!==null){var u=i;return i=null,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Iw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function kV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Iw(i,e);var a=Iw((i-65536>>10)+55296,e),o=Iw((i-65536&1023)+56320,e);return a.concat(o)}}ro["UTF-16BE"]=function(e){return new kV(!0,e)};no["UTF-16BE"]=function(e){return new FV(!0,e)};ro["UTF-16LE"]=function(e){return new kV(!1,e)};no["UTF-16LE"]=function(e){return new FV(!1,e)};function $Oe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Wo(n)?n:63360+n-128}}function YOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ho(n)?n:er(n,63360,63487)?n-63360+128:qs(n)}}ro["x-user-defined"]=function(e){return new YOe(e)};no["x-user-defined"]=function(e){return new $Oe(e)};function _y(e){return Buffer.from(e).toString("base64")}function Sk(e){return Buffer.from(e,"base64").toString("ascii")}var AY=Wt(wY(),1),SY=Wt(Fy(),1);function EY(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function cRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,SY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,AY.default)(n,r,t)}function TY(e,t){let r=cRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(EY(a))})})}var aae=Wt(iae(),1),DI=["image/png","image/jpeg","image/gif"];async function FI(e,t){if(!t)throw new Error("MIMEType is required to parse image under Node.js");let r=e instanceof Buffer?e:Buffer.from(e);return await _We(r,t)}function _We(e,t){return new Promise(r=>(0,aae.default)(e,t,(n,i)=>{if(n)throw n;let a=[...i.shape],o=i.shape.length===4?i.shape.shift():1,s=i.data instanceof Buffer?new Uint8Array(i.data):i.data;r({shape:a,data:s,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o?[o]:[]})}))}async function To(e,t,r,n){return n._parse(e,t,r,n)}function Qt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Xu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},sae=Xu.self||Xu.window||Xu.global||{},uae=Xu.window||Xu.self||Xu.global||{},cae=Xu.global||Xu.self||Xu.window||{},lae=Xu.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var oae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wWe=oae&&parseFloat(oae[1])||0;function kI(e,t){return fae(e||{},t)}function fae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=fae(r[n]||{},t[n]):r[n]=t[n];return r}var pae="latest";function EWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.5"),globalThis._loadersgl_.version}var Uh=EWe();function ma(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Qu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Dtr=Qu.self||Qu.window||Qu.global||{},Ftr=Qu.window||Qu.self||Qu.global||{},ktr=Qu.global||Qu.self||Qu.window||{},Btr=Qu.document||{};var ta=typeof process!="object"||String(process)!=="[object process]"||process.browser,Sx=typeof importScripts=="function",dae=typeof window<"u"&&typeof window.orientation<"u",hae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Otr=hae&&parseFloat(hae[1])||0;var Tx=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){ma(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ma(this.isRunning),this.isRunning=!1,this._reject(t)}};var Gh={};fa(Gh,{NodeWorker:()=>Dx,parentPort:()=>AWe});var Cx=Wt(require("worker_threads"),1);yy(Gh,require("worker_threads"));var AWe=Cx==null?void 0:Cx.parentPort,Dx=Cx.Worker;var BI=new Map;function mae(e){ma(e.source&&!e.url||!e.source&&e.url);let t=BI.get(e.source||e.url);return t||(e.url&&(t=SWe(e.url),BI.set(e.url,t)),e.source&&(t=gae(e.source),BI.set(e.source,t))),ma(t),t}function SWe(e){if(!e.startsWith("http"))return e;let t=TWe(e);return gae(t)}function gae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function TWe(e){return`try {
|
|
173
|
+
`);return Buffer.from(t)};Gb.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),a=i.indexOf("=");if(a===-1)return t;t[i.slice(0,a)]=i.slice(a+1),e=e.slice(n)}return t};Gb.encode=function(e){var t=rHt(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(i===-1)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(ch(e.mode&uHt,6),100),t.write(ch(e.uid,6),108),t.write(ch(e.gid,6),116),t.write(ch(e.size,11),124),t.write(ch(e.mtime.getTime()/1e3|0,11),136),t[156]=HFe+fHt(e.type),e.linkname&&t.write(e.linkname,157),WFe.copy(t,$2),aHt.copy(t,nW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ch(e.devmajor||0,6),329),t.write(ch(e.devminor||0,6),337),n&&t.write(n,345),t.write(ch(KFe(t),6),148),t)};Gb.decode=function(e,t,r){var n=e[156]===0?0:e[156]-HFe,i=Ub(e,0,100,t),a=lh(e,100,8),o=lh(e,108,8),s=lh(e,116,8),u=lh(e,124,12),c=lh(e,136,12),l=lHt(n),f=e[157]===0?null:Ub(e,157,100,t),p=Ub(e,265,32),h=Ub(e,297,32),d=lh(e,329,8),b=lh(e,337,8),g=KFe(e);if(g===8*32)return null;if(g!==lh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(WFe.compare(e,$2,$2+6)===0)e[345]&&(i=Ub(e,345,155,t)+"/"+i);else if(!(oHt.compare(e,$2,$2+6)===0&&sHt.compare(e,nW,nW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:p,gname:h,devmajor:d,devminor:b}}});var aW=v((BCr,$Fe)=>{$Fe.exports=require("stream")});var e4e=v((OCr,ZFe)=>{"use strict";function YFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function JFe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YFe(Object(r),!0).forEach(function(n){hHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hHt(e,t,r){return t=QFe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QFe(n.key),n)}}function mHt(e,t,r){return t&&XFe(e.prototype,t),r&&XFe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function QFe(e){var t=gHt(e,"string");return typeof t=="symbol"?t:String(t)}function gHt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vHt=require("buffer"),F4=vHt.Buffer,bHt=require("util"),oW=bHt.inspect,yHt=oW&&oW.custom||"inspect";function xHt(e,t,r){F4.prototype.copy.call(e,t,r)}ZFe.exports=function(){function e(){dHt(this,e),this.head=null,this.tail=null,this.length=0}return mHt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return F4.alloc(0);for(var n=F4.allocUnsafe(r>>>0),i=this.head,a=0;i;)xHt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=F4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:yHt,value:function(r,n){return oW(this,JFe(JFe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var uW=v((ICr,r4e)=>{"use strict";function _Ht(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(sW,this,e)):process.nextTick(sW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(k4,r):(r._writableState.errorEmitted=!0,process.nextTick(t4e,r,a)):process.nextTick(t4e,r,a):t?(process.nextTick(k4,r),t(a)):process.nextTick(k4,r)}),this)}function t4e(e,t){sW(e,t),k4(e)}function k4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function wHt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function sW(e,t){e.emit("error",t)}function EHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}r4e.exports={destroy:_Ht,undestroy:wHt,errorOrDestroy:EHt}});var fh=v((PCr,a4e)=>{"use strict";var i4e={};function Ps(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,i4e[e]=i}function n4e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function AHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function SHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function THt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ps("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ps("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&AHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(SHt(e," argument"))i=`The ${e} ${n} ${n4e(t,"type")}`;else{let a=THt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${n4e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Ps("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ps("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ps("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ps("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ps("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ps("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ps("ERR_STREAM_WRITE_AFTER_END","write after end");Ps("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ps("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ps("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");a4e.exports.codes=i4e});var cW=v((RCr,o4e)=>{"use strict";var CHt=fh().codes.ERR_INVALID_OPT_VALUE;function DHt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function FHt(e,t,r,n){var i=DHt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new CHt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}o4e.exports={getHighWaterMark:FHt}});var pW=v((jCr,p4e)=>{"use strict";p4e.exports=li;function u4e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){rWt(t,e)}}var zb;li.WritableState=J2;var kHt={deprecate:pd()},c4e=aW(),O4=require("buffer").Buffer,BHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function OHt(e){return O4.from(e)}function IHt(e){return O4.isBuffer(e)||e instanceof BHt}var fW=uW(),PHt=cW(),RHt=PHt.getHighWaterMark,ph=fh().codes,jHt=ph.ERR_INVALID_ARG_TYPE,LHt=ph.ERR_METHOD_NOT_IMPLEMENTED,MHt=ph.ERR_MULTIPLE_CALLBACK,qHt=ph.ERR_STREAM_CANNOT_PIPE,NHt=ph.ERR_STREAM_DESTROYED,UHt=ph.ERR_STREAM_NULL_VALUES,GHt=ph.ERR_STREAM_WRITE_AFTER_END,zHt=ph.ERR_UNKNOWN_ENCODING,Hb=fW.errorOrDestroy;tr()(li,c4e);function HHt(){}function J2(e,t,r){zb=zb||A0(),e=e||{},typeof r!="boolean"&&(r=t instanceof zb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=RHt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){XHt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new u4e(this)}J2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(J2.prototype,"buffer",{get:kHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var B4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(B4=Function.prototype[Symbol.hasInstance],Object.defineProperty(li,Symbol.hasInstance,{value:function(t){return B4.call(this,t)?!0:this!==li?!1:t&&t._writableState instanceof J2}})):B4=function(t){return t instanceof this};function li(e){zb=zb||A0();var t=this instanceof zb;if(!t&&!B4.call(li,this))return new li(e);this._writableState=new J2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),c4e.call(this)}li.prototype.pipe=function(){Hb(this,new qHt)};function WHt(e,t){var r=new GHt;Hb(e,r),process.nextTick(t,r)}function VHt(e,t,r,n){var i;return r===null?i=new UHt:typeof r!="string"&&!t.objectMode&&(i=new jHt("chunk",["string","Buffer"],r)),i?(Hb(e,i),process.nextTick(n,i),!1):!0}li.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&IHt(e);return a&&!O4.isBuffer(e)&&(e=OHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=HHt),n.ending?WHt(this,r):(a||VHt(this,n,e,r))&&(n.pendingcb++,i=$Ht(this,n,a,e,t,r)),i};li.prototype.cork=function(){this._writableState.corked++};li.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&l4e(this,e))};li.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new zHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function KHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=O4.from(t,r)),t}Object.defineProperty(li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $Ht(e,t,r,n,i,a){if(!r){var o=KHt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else lW(e,t,!1,s,n,i,a);return u}function lW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new NHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function YHt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(Y2,e,t),e._writableState.errorEmitted=!0,Hb(e,n)):(i(n),e._writableState.errorEmitted=!0,Hb(e,n),Y2(e,t))}function JHt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function XHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new MHt;if(JHt(r),t)YHt(e,r,n,t,i);else{var a=f4e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&l4e(e,r),n?process.nextTick(s4e,e,r,a,i):s4e(e,r,a,i)}}function s4e(e,t,r,n){r||QHt(e,t),t.pendingcb--,n(),Y2(e,t)}function QHt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function l4e(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,lW(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new u4e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(lW(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}li.prototype._write=function(e,t,r){r(new LHt("_write()"))};li.prototype._writev=null;li.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||tWt(this,n,r),this};Object.defineProperty(li.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function f4e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ZHt(e,t){e._final(function(r){t.pendingcb--,r&&Hb(e,r),t.prefinished=!0,e.emit("prefinish"),Y2(e,t)})}function eWt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(ZHt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Y2(e,t){var r=f4e(t);if(r&&(eWt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function tWt(e,t,r){t.ending=!0,Y2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function rWt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(li.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});li.prototype.destroy=fW.destroy;li.prototype._undestroy=fW.undestroy;li.prototype._destroy=function(e,t){t(e)}});var A0=v((LCr,d4e)=>{"use strict";var nWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};d4e.exports=Lc;var h4e=mW(),dW=pW();tr()(Lc,h4e);for(hW=nWt(dW.prototype),I4=0;I4<hW.length;I4++)P4=hW[I4],Lc.prototype[P4]||(Lc.prototype[P4]=dW.prototype[P4]);var hW,P4,I4;function Lc(e){if(!(this instanceof Lc))return new Lc(e);h4e.call(this,e),dW.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",iWt)))}Object.defineProperty(Lc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function iWt(){this._writableState.ended||process.nextTick(aWt,this)}function aWt(e){e.end()}Object.defineProperty(Lc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var bW=v(g4e=>{"use strict";var vW=Gs().Buffer,m4e=vW.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function oWt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function sWt(e){var t=oWt(e);if(typeof t!="string"&&(vW.isEncoding===m4e||!m4e(e)))throw new Error("Unknown encoding: "+e);return t||e}g4e.StringDecoder=X2;function X2(e){this.encoding=sWt(e);var t;switch(this.encoding){case"utf16le":this.text=hWt,this.end=dWt,t=4;break;case"utf8":this.fillLast=lWt,t=4;break;case"base64":this.text=mWt,this.end=gWt,t=3;break;default:this.write=vWt,this.end=bWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=vW.allocUnsafe(t)}X2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};X2.prototype.end=pWt;X2.prototype.text=fWt;X2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function gW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function uWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=gW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=gW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=gW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function cWt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function lWt(e){var t=this.lastTotal-this.lastNeed,r=cWt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function fWt(e,t){var r=uWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function pWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function hWt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function dWt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function mWt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function gWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function vWt(e){return e.toString(this.encoding)}function bWt(e){return e&&e.length?this.write(e):""}});var R4=v((qCr,y4e)=>{"use strict";var v4e=fh().codes.ERR_STREAM_PREMATURE_CLOSE;function yWt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function xWt(){}function _Wt(e){return e.setHeader&&typeof e.abort=="function"}function b4e(e,t,r){if(typeof t=="function")return b4e(e,null,t);t||(t={}),r=yWt(r||xWt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new v4e),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new v4e),r.call(e,d)},p=function(){e.req.on("finish",s)};return _Wt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",p),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}y4e.exports=b4e});var _4e=v((NCr,x4e)=>{"use strict";var j4;function hh(e,t,r){return t=wWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wWt(e){var t=EWt(e,"string");return typeof t=="symbol"?t:String(t)}function EWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AWt=R4(),dh=Symbol("lastResolve"),S0=Symbol("lastReject"),Q2=Symbol("error"),L4=Symbol("ended"),T0=Symbol("lastPromise"),yW=Symbol("handlePromise"),C0=Symbol("stream");function mh(e,t){return{value:e,done:t}}function SWt(e){var t=e[dh];if(t!==null){var r=e[C0].read();r!==null&&(e[T0]=null,e[dh]=null,e[S0]=null,t(mh(r,!1)))}}function TWt(e){process.nextTick(SWt,e)}function CWt(e,t){return function(r,n){e.then(function(){if(t[L4]){r(mh(void 0,!0));return}t[yW](r,n)},n)}}var DWt=Object.getPrototypeOf(function(){}),FWt=Object.setPrototypeOf((j4={get stream(){return this[C0]},next:function(){var t=this,r=this[Q2];if(r!==null)return Promise.reject(r);if(this[L4])return Promise.resolve(mh(void 0,!0));if(this[C0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[Q2]?s(t[Q2]):o(mh(void 0,!0))})});var n=this[T0],i;if(n)i=new Promise(CWt(n,this));else{var a=this[C0].read();if(a!==null)return Promise.resolve(mh(a,!1));i=new Promise(this[yW])}return this[T0]=i,i}},hh(j4,Symbol.asyncIterator,function(){return this}),hh(j4,"return",function(){var t=this;return new Promise(function(r,n){t[C0].destroy(null,function(i){if(i){n(i);return}r(mh(void 0,!0))})})}),j4),DWt),kWt=function(t){var r,n=Object.create(FWt,(r={},hh(r,C0,{value:t,writable:!0}),hh(r,dh,{value:null,writable:!0}),hh(r,S0,{value:null,writable:!0}),hh(r,Q2,{value:null,writable:!0}),hh(r,L4,{value:t._readableState.endEmitted,writable:!0}),hh(r,yW,{value:function(a,o){var s=n[C0].read();s?(n[T0]=null,n[dh]=null,n[S0]=null,a(mh(s,!1))):(n[dh]=a,n[S0]=o)},writable:!0}),r));return n[T0]=null,AWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[S0];a!==null&&(n[T0]=null,n[dh]=null,n[S0]=null,a(i)),n[Q2]=i;return}var o=n[dh];o!==null&&(n[T0]=null,n[dh]=null,n[S0]=null,o(mh(void 0,!0))),n[L4]=!0}),t.on("readable",TWt.bind(null,n)),n};x4e.exports=kWt});var S4e=v((UCr,A4e)=>{"use strict";function w4e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function BWt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){w4e(a,n,i,o,s,"next",u)}function s(u){w4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function E4e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function OWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E4e(Object(r),!0).forEach(function(n){IWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IWt(e,t,r){return t=PWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PWt(e){var t=RWt(e,"string");return typeof t=="symbol"?t:String(t)}function RWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jWt=fh().codes.ERR_INVALID_ARG_TYPE;function LWt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new jWt("iterable",["Iterable"],t);var i=new e(OWt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=BWt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}A4e.exports=LWt});var mW=v((zCr,R4e)=>{"use strict";R4e.exports=zr;var Wb;zr.ReadableState=F4e;var GCr=require("events").EventEmitter,D4e=function(t,r){return t.listeners(r).length},ew=aW(),M4=require("buffer").Buffer,MWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function qWt(e){return M4.from(e)}function NWt(e){return M4.isBuffer(e)||e instanceof MWt}var xW=require("util"),xr;xW&&xW.debuglog?xr=xW.debuglog("stream"):xr=function(){};var UWt=e4e(),CW=uW(),GWt=cW(),zWt=GWt.getHighWaterMark,q4=fh().codes,HWt=q4.ERR_INVALID_ARG_TYPE,WWt=q4.ERR_STREAM_PUSH_AFTER_EOF,VWt=q4.ERR_METHOD_NOT_IMPLEMENTED,KWt=q4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Vb,_W,wW;tr()(zr,ew);var Z2=CW.errorOrDestroy,EW=["error","close","destroy","pause","resume"];function $Wt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function F4e(e,t,r){Wb=Wb||A0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Wb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=zWt(this,e,"readableHighWaterMark",r),this.buffer=new UWt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Vb||(Vb=bW().StringDecoder),this.decoder=new Vb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Wb=Wb||A0(),!(this instanceof zr))return new zr(e);var t=this instanceof Wb;this._readableState=new F4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),ew.call(this)}Object.defineProperty(zr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});zr.prototype.destroy=CW.destroy;zr.prototype._undestroy=CW.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=M4.from(e,t),t=""),n=!0),k4e(this,e,t,!1,n)};zr.prototype.unshift=function(e){return k4e(this,e,null,!0,!1)};function k4e(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,XWt(e,a);else{var o;if(i||(o=YWt(a,t)),o)Z2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==M4.prototype&&(t=qWt(t)),n)a.endEmitted?Z2(e,new KWt):AW(e,a,t,!0);else if(a.ended)Z2(e,new WWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?AW(e,a,t,!1):TW(e,a)):AW(e,a,t,!1)}else n||(a.reading=!1,TW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function AW(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&N4(e)),TW(e,t)}function YWt(e,t){var r;return!NWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new HWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Vb||(Vb=bW().StringDecoder);var t=new Vb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var T4e=1073741824;function JWt(e){return e>=T4e?e=T4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function C4e(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=JWt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.prototype.read=function(e){xr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return xr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?SW(this):N4(this),null;if(e=C4e(e,t),e===0&&t.ended)return t.length===0&&SW(this),null;var n=t.needReadable;xr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,xr("length less than watermark",n)),t.ended||t.reading?(n=!1,xr("reading or ended",n)):n&&(xr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C4e(r,t)));var i;return e>0?i=I4e(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&SW(this)),i!==null&&this.emit("data",i),i};function XWt(e,t){if(xr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?N4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B4e(e)))}}function N4(e){var t=e._readableState;xr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(xr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(B4e,e))}function B4e(e){var t=e._readableState;xr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,DW(e)}function TW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(QWt,e,t))}function QWt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(xr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}zr.prototype._read=function(e){Z2(this,new VWt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,xr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){xr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){xr("onend"),e.end()}var u=ZWt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&P4e(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){xr("onerror",g),b(),e.removeListener("error",p),D4e(e,"error")===0&&Z2(e,g)}$Wt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){xr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function ZWt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&D4e(e,"data")&&(r.flowing=!0,DW(e))}}zr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=P4e(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};zr.prototype.on=function(e,t){var r=ew.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,xr("on readable",n.length,n.reading),n.length?N4(this):n.reading||process.nextTick(eVt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=ew.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(O4e,this),r};zr.prototype.removeAllListeners=function(e){var t=ew.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(O4e,this),t};function O4e(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function eVt(e){xr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(xr("resume"),e.flowing=!e.readableListening,tVt(this,e)),e.paused=!1,this};function tVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(rVt,e,t))}function rVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),DW(e),t.flowing&&!t.reading&&e.read(0)}zr.prototype.pause=function(){return xr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function DW(e){var t=e._readableState;for(xr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(xr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(xr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<EW.length;a++)e.on(EW[a],this.emit.bind(this,EW[a]));return this._read=function(o){xr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return _W===void 0&&(_W=_4e()),_W(this)});Object.defineProperty(zr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(zr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(zr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});zr._fromList=I4e;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function I4e(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function SW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(nVt,t,e))}function nVt(e,t){if(xr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(zr.from=function(e,t){return wW===void 0&&(wW=S4e()),wW(zr,e,t)});function P4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var FW=v((HCr,L4e)=>{"use strict";L4e.exports=Jl;var U4=fh().codes,iVt=U4.ERR_METHOD_NOT_IMPLEMENTED,aVt=U4.ERR_MULTIPLE_CALLBACK,oVt=U4.ERR_TRANSFORM_ALREADY_TRANSFORMING,sVt=U4.ERR_TRANSFORM_WITH_LENGTH_0,G4=A0();tr()(Jl,G4);function uVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new aVt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Jl(e){if(!(this instanceof Jl))return new Jl(e);G4.call(this,e),this._transformState={afterTransform:uVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",cVt)}function cVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){j4e(e,t,r)}):j4e(this,null,null)}Jl.prototype.push=function(e,t){return this._transformState.needTransform=!1,G4.prototype.push.call(this,e,t)};Jl.prototype._transform=function(e,t,r){r(new iVt("_transform()"))};Jl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Jl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Jl.prototype._destroy=function(e,t){G4.prototype._destroy.call(this,e,function(r){t(r)})};function j4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new sVt;if(e._transformState.transforming)throw new oVt;return e.push(null)}});var N4e=v((WCr,q4e)=>{"use strict";q4e.exports=tw;var M4e=FW();tr()(tw,M4e);function tw(e){if(!(this instanceof tw))return new tw(e);M4e.call(this,e)}tw.prototype._transform=function(e,t,r){r(null,e)}});var W4e=v((VCr,H4e)=>{"use strict";var kW;function lVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var z4e=fh().codes,fVt=z4e.ERR_MISSING_ARGS,pVt=z4e.ERR_STREAM_DESTROYED;function U4e(e){if(e)throw e}function hVt(e){return e.setHeader&&typeof e.abort=="function"}function dVt(e,t,r,n){n=lVt(n);var i=!1;e.on("close",function(){i=!0}),kW===void 0&&(kW=R4()),kW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,hVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new pVt("pipe"))}}}function G4e(e){e()}function mVt(e,t){return e.pipe(t)}function gVt(e){return!e.length||typeof e[e.length-1]!="function"?U4e:e.pop()}function vVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=gVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new fVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return dVt(o,u,c,function(l){i||(i=l),l&&a.forEach(G4e),!u&&(a.forEach(G4e),n(i))})});return t.reduce(mVt)}H4e.exports=vVt});var iw=v((Rs,nw)=>{var rw=require("stream");process.env.READABLE_STREAM==="disable"&&rw?(nw.exports=rw.Readable,Object.assign(nw.exports,rw),nw.exports.Stream=rw):(Rs=nw.exports=mW(),Rs.Stream=rw||Rs,Rs.Readable=Rs,Rs.Writable=pW(),Rs.Duplex=A0(),Rs.Transform=FW(),Rs.PassThrough=N4e(),Rs.finished=R4(),Rs.pipeline=W4e())});var Q4e=v((KCr,X4e)=>{var K4e=require("util"),bVt=OL(),aw=iW(),$4e=iw().Writable,Y4e=iw().PassThrough,J4e=function(){},V4e=function(e){return e&=511,e&&512-e},yVt=function(e,t){var r=new z4(e,t);return r.end(),r},xVt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},z4=function(e,t){this._parent=e,this.offset=t,Y4e.call(this,{autoDestroy:!1})};K4e.inherits(z4,Y4e);z4.prototype.destroy=function(e){this._parent.destroy(e)};var Xl=function(e){if(!(this instanceof Xl))return new Xl(e);$4e.call(this,e),e=e||{},this._offset=0,this._buffer=bVt(),this._missing=0,this._partial=!1,this._onparse=J4e,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(p){if(t._locked=!1,p)return t.destroy(p);t._stream||n()},a=function(){t._stream=null;var p=V4e(t._header.size);p?t._parse(p,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(V4e(t._header.size)),t._parse(512,f),n()},s=function(){var p=t._header.size;t._paxGlobal=aw.decodePax(r.slice(0,p)),r.consume(p),a()},u=function(){var p=t._header.size;t._pax=aw.decodePax(r.slice(0,p)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(p),a()},c=function(){var p=t._header.size;this._gnuLongPath=aw.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},l=function(){var p=t._header.size;this._gnuLongLinkPath=aw.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},f=function(){var p=t._offset,h;try{h=t._header=aw.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(d){t.emit("error",d)}if(r.consume(512),!h){t._parse(512,f),n();return}if(h.type==="gnu-long-path"){t._parse(h.size,c),n();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),n();return}if(h.type==="pax-global-header"){t._parse(h.size,s),n();return}if(h.type==="pax-header"){t._parse(h.size,u),n();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=xVt(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,f),t.emit("entry",h,yVt(t,p),i);return}t._stream=new z4(t,p),t.emit("entry",h,t._stream,i),t._parse(h.size,a),n()};this._onheader=f,this._parse(512,f)};K4e.inherits(Xl,$4e);Xl.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Xl.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Xl.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=J4e,this._overflow?this._write(this._overflow,void 0,e):e()}};Xl.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}};Xl.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};X4e.exports=Xl});var eke=v(($Cr,Z4e)=>{Z4e.exports=require("fs").constants||require("constants")});var nke=v((YCr,rke)=>{var _Vt=LF(),wVt=function(){},EVt=function(e){return e.setHeader&&typeof e.abort=="function"},AVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},tke=function(e,t,r){if(typeof t=="function")return tke(e,null,t);t||(t={}),r=_Vt(r||wVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},p=function(g){r.call(e,g)},h=function(){process.nextTick(d)},d=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},b=function(){e.req.on("finish",c)};return EVt(e)?(e.on("complete",c),e.on("abort",h),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),AVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",p),e.on("close",h),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",h),e.removeListener("request",b),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",p),e.removeListener("close",h)}};rke.exports=tke});var uke=v((JCr,ske)=>{var Kb=eke(),ike=nke(),W4=tr(),SVt=Buffer.alloc,ake=iw().Readable,$b=iw().Writable,TVt=require("string_decoder").StringDecoder,H4=iW(),CVt=parseInt("755",8),DVt=parseInt("644",8),oke=SVt(1024),OW=function(){},BW=function(e,t){t&=511,t&&e.push(oke.slice(0,512-t))};function FVt(e){switch(e&Kb.S_IFMT){case Kb.S_IFBLK:return"block-device";case Kb.S_IFCHR:return"character-device";case Kb.S_IFDIR:return"directory";case Kb.S_IFIFO:return"fifo";case Kb.S_IFLNK:return"symlink"}return"file"}var V4=function(e){$b.call(this),this.written=0,this._to=e,this._destroyed=!1};W4(V4,$b);V4.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};V4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var K4=function(){$b.call(this),this.linkname="",this._decoder=new TVt("utf-8"),this._destroyed=!1};W4(K4,$b);K4.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};K4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var ow=function(){$b.call(this),this._destroyed=!1};W4(ow,$b);ow.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};ow.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Mc=function(e){if(!(this instanceof Mc))return new Mc(e);ake.call(this,e),this._drain=OW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};W4(Mc,ake);Mc.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=OW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=FVt(e.mode)),e.mode||(e.mode=e.type==="directory"?CVt:DVt),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return BW(n,e.size),i?process.nextTick(r):this._drain=r,new ow}if(e.type==="symlink"&&!e.linkname){var a=new K4;return ike(a,function(s){if(s)return n.destroy(),r(s);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new ow;var o=new V4(this);return this._stream=o,ike(o,function(s){if(n._stream=null,s)return n.destroy(),r(s);if(o.written!==e.size)return n.destroy(),r(new Error("size mismatch"));BW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Mc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(oke),this.push(null))};Mc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Mc.prototype._encode=function(e){if(!e.pax){var t=H4.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Mc.prototype._encodePax=function(e){var t=H4.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(H4.encode(r)),this.push(t),BW(this,t.length),r.size=e.size,r.type=e.type,this.push(H4.encode(r))};Mc.prototype._read=function(e){var t=this._drain;this._drain=OW,t()};ske.exports=Mc});var cke=v(IW=>{IW.extract=Q4e();IW.pack=uke()});var pke=v((QCr,fke)=>{var kVt=require("zlib"),BVt=cke(),lke=Cb(),Ql=function(e){if(!(this instanceof Ql))return new Ql(e);e=this.options=lke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=BVt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=kVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ql.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ql.prototype.append=function(e,t,r){var n=this;t.mtime=t.date;function i(o,s){if(o){r(o);return}n.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")i(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=n.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&lke.collectStream(e,i)};Ql.prototype.finalize=function(){this.engine.finalize()};Ql.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ql.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)};Ql.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};fke.exports=Ql});var gke=v((ZCr,mke)=>{var OVt=require("util").inherits,hke=Pz().Transform,IVt=_H(),dke=Cb(),gh=function(e){if(!(this instanceof gh))return new gh(e);e=this.options=dke.defaults(e,{}),hke.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};OVt(gh,hke);gh.prototype._transform=function(e,t,r){r(null,e)};gh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};gh.prototype.append=function(e,t,r){var n=this;t.crc32=0;function i(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=IVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&dke.collectStream(e,i)};gh.prototype.finalize=function(){this._writeStringified(),this.end()};mke.exports=gh});var bke=v((e8r,vke)=>{var PVt=f8e(),sw={},vh=function(e,t){return vh.create(e,t)};vh.create=function(e,t){if(sw[e]){var r=new PVt(e,t);return r.setFormat(e),r.setModule(new sw[e](t)),r}else throw new Error("create("+e+"): format not registered")};vh.registerFormat=function(e,t){if(sw[e])throw new Error("register("+e+"): format already registered");if(typeof t!="function")throw new Error("register("+e+"): format module invalid");if(typeof t.prototype.append!="function"||typeof t.prototype.finalize!="function")throw new Error("register("+e+"): format module missing methods");sw[e]=t};vh.isRegisteredFormat=function(e){return!!sw[e]};vh.registerFormat("zip",zFe());vh.registerFormat("tar",pke());vh.registerFormat("json",gke());vke.exports=vh});var EV=typeof process!="object"||String(process)!=="[object process]"||process.browser;var AV={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=AV||{};function er(e,t,r){return t<=e&&e<=r}function SOe(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function Pw(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function TOe(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function COe(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function Wo(e){return 0<=e&&e<=127}var Ho=Wo,Fr=-1;function Ak(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Ak.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Fr},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var xn=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function qs(e){throw TypeError("The code point "+e+" could not be encoded.")}function DOe(){}DOe.prototype={handler:function(e,t){}};function FOe(){}FOe.prototype={handler:function(e,t){}};function wk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ek,e)?Ek[e]:null}var SV=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Ek={};SV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){Ek[r]=t})})});var ro={},no={};function q0(e,t){return t&&t[e]||null}function N0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ha(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function kOe(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Ha("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function BOe(e){if(e===59335)return 7457;var t=0,r=0,n=Ha("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function OOe(e){xk=xk||Ha("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=xk;return t.indexOf(e)}var xk;function IOe(e){_k=_k||Ha("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=_k;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):N0(e,t)}var _k,TV="utf-8";function wh(e,t){if(!(this instanceof wh))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):TV,t=Pw(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=wk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!no[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,Boolean(t.fatal)&&(n._error_mode="fatal"),Boolean(t.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(wh.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(wh.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(wh.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));wh.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Pw(r),this._do_not_flush||(this._decoder=no[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new Ak(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===xn))break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(i,i.read()),o===xn)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return SOe(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(c.length>0&&c[0]===65279?(this._BOMseen=!0,c.shift()):c.length>0&&(this._BOMseen=!0)),COe(c)}return u.call(this,a)};function xy(e,t){if(!(this instanceof xy))throw TypeError("Called as a function. Did you forget 'new'?");t=Pw(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";var r=this;if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):TV;var n=wk(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=wk("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(xy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});xy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Pw(r),this._do_not_flush||(this._encoder=ro[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new Ak(TOe(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===xn))break;Array.isArray(a)?i.push.apply(i,a):i.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(n,n.read()),a!==xn;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function POe(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(s,u){if(u===Fr&&i!==0)return i=0,Dr(t);if(u===Fr)return xn;if(i===0){if(er(u,0,127))return u;if(er(u,194,223))i=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),i=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),i=3,r=u&7;else return Dr(t);return null}if(!er(u,a,o))return r=i=n=0,a=128,o=191,s.prepend(u),Dr(t);if(a=128,o=191,r=r<<6|u&63,n+=1,n!==i)return null;var c=r;return r=i=n=0,c}}function ROe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i,a;er(n,128,2047)?(i=1,a=192):er(n,2048,65535)?(i=2,a=224):er(n,65536,1114111)&&(i=3,a=240);for(var o=[(n>>6*i)+a];i>0;){var s=n>>6*(i-1);o.push(128|s&63),i-=1}return o}}ro["UTF-8"]=function(e){return new ROe(e)};no["UTF-8"]=function(e){return new POe(e)};function jOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Wo(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function LOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;var a=N0(i,e);return a===null&&qs(i),a+128}}(function(){"encoding-indexes"in globalThis&&SV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ha(r.toLowerCase());no[r]=function(i){return new jOe(n,i)},ro[r]=function(i){return new LOe(n,i)}})})})();no.GBK=function(e){return new CV(e)};ro.GBK=function(e){return new DV(e,!0)};function CV(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(a,o){if(o===Fr&&r===0&&n===0&&i===0)return xn;o===Fr&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Dr(t));var s;if(i!==0){s=null,er(o,48,57)&&(s=kOe((((r-129)*10+n-48)*126+i-129)*10+o-48));var u=[n,i,o];return r=0,n=0,i=0,s===null?(a.prepend(u),Dr(t)):s}if(n!==0)return er(o,129,254)?(i=o,null):(a.prepend([n,o]),r=0,n=0,Dr(t));if(r!==0){if(er(o,48,57))return n=o,null;var c=r,l=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(l=(c-129)*190+(o-f)),s=l===null?null:q0(l,Ha("gb18030")),s===null&&Wo(o)&&a.prepend(o),s===null?Dr(t):s}return Wo(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function DV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;if(i===58853)return qs(i);if(t&&i===8364)return 128;var a=N0(i,Ha("gb18030"));if(a!==null){var o=Kc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return qs(i);a=BOe(i);var c=Kc(a/10/126/10);a=a-c*10*126*10;var l=Kc(a/10/126);a=a-l*10*126;var f=Kc(a/10),p=a-f*10;return[c+129,l+48,f+129,p+48]}}ro.gb18030=function(e){return new DV(e)};no.gb18030=function(e){return new CV(e)};function MOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:98;switch((er(i,64,126)||er(i,161,254))&&(o=(a-129)*157+(i-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var u=o===null?null:q0(o,Ha("big5"));return u===null&&Wo(i)&&n.prepend(i),u===null?Dr(t):u}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function qOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=IOe(n);if(i===null)return qs(n);var a=Kc(i/157)+129;if(a<161)return qs(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}ro.Big5=function(e){return new qOe(e)};no.Big5=function(e){return new MOe(e)};function NOe(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,a){if(a===Fr&&n!==0)return n=0,Dr(t);if(a===Fr&&n===0)return xn;if(n===142&&er(a,161,223))return n=0,65377-161+a;if(n===143&&er(a,161,254))return r=!0,n=a,null;if(n!==0){var o=n;n=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=q0((o-161)*94+(a-161),Ha(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Wo(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function UOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=N0(n,Ha("jis0208"));if(i===null)return qs(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}ro["EUC-JP"]=function(e){return new UOe(e)};no["EUC-JP"]=function(e){return new NOe(e)};function GOe(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(n){default:case r.ASCII:return u===27?(n=r.EscapeStart,null):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Roman:return u===27?(n=r.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Katakana:return u===27?(n=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Fr?xn:(o=!1,Dr(t));case r.LeadByte:return u===27?(n=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,n=r.TrailByte,null):u===Fr?xn:(o=!1,Dr(t));case r.TrailByte:if(u===27)return n=r.EscapeStart,Dr(t);if(er(u,33,126)){n=r.LeadByte;var c=(a-33)*94+u-33,l=q0(c,Ha("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var p=null;if(f===40&&u===66&&(p=r.ASCII),f===40&&u===74&&(p=r.Roman),f===40&&u===73&&(p=r.Katakana),f===36&&(u===64||u===66)&&(p=r.LeadByte),p!==null){n=n=p;var h=o;return o=!0,h?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function zOe(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,a){if(a===Fr&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if(a===Fr&&n===r.ASCII)return xn;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return qs(65533);if(n===r.ASCII&&Ho(a))return a;if(n===r.Roman&&(Ho(a)&&a!==92&&a!==126||a==165||a==8254)){if(Ho(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Ho(a)&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if((a===165||a===8254)&&n!==r.Roman)return i.prepend(a),n=r.Roman,[27,40,74];a===8722&&(a=65293);var o=N0(a,Ha("jis0208"));if(o===null)return qs(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Kc(o/94)+33,u=o%94+33;return[s,u]}}ro["ISO-2022-JP"]=function(e){return new zOe(e)};no["ISO-2022-JP"]=function(e){return new GOe(e)};function HOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:65,u=a<160?129:193;if((er(i,64,126)||er(i,128,252))&&(o=(a-u)*188+i-s),er(o,8836,10715))return 57344-8836+o;var c=o===null?null:q0(o,Ha("jis0208"));return c===null&&Wo(i)&&n.prepend(i),c===null?Dr(t):c}return Wo(i)||i===128?i:er(i,161,223)?65377-161+i:er(i,129,159)||er(i,224,252)?(r=i,null):Dr(t)}}function WOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=OOe(n);if(i===null)return qs(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}ro.Shift_JIS=function(e){return new WOe(e)};no.Shift_JIS=function(e){return new HOe(e)};function VOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0,er(i,65,254)&&(o=(a-129)*190+(i-65));var s=o===null?null:q0(o,Ha("euc-kr"));return o===null&&Wo(i)&&n.prepend(i),s===null?Dr(t):s}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function KOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=N0(n,Ha("euc-kr"));if(i===null)return qs(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}ro["EUC-KR"]=function(e){return new KOe(e)};no["EUC-KR"]=function(e){return new VOe(e)};function Iw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function FV(e,t){var r=t.fatal,n=null,i=null;this.handler=function(a,o){if(o===Fr&&(n!==null||i!==null))return Dr(r);if(o===Fr&&n===null&&i===null)return xn;if(n===null)return n=o,null;var s;if(e?s=(n<<8)+o:s=(o<<8)+n,n=null,i!==null){var u=i;return i=null,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Iw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function kV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Iw(i,e);var a=Iw((i-65536>>10)+55296,e),o=Iw((i-65536&1023)+56320,e);return a.concat(o)}}ro["UTF-16BE"]=function(e){return new kV(!0,e)};no["UTF-16BE"]=function(e){return new FV(!0,e)};ro["UTF-16LE"]=function(e){return new kV(!1,e)};no["UTF-16LE"]=function(e){return new FV(!1,e)};function $Oe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Wo(n)?n:63360+n-128}}function YOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ho(n)?n:er(n,63360,63487)?n-63360+128:qs(n)}}ro["x-user-defined"]=function(e){return new YOe(e)};no["x-user-defined"]=function(e){return new $Oe(e)};function _y(e){return Buffer.from(e).toString("base64")}function Sk(e){return Buffer.from(e,"base64").toString("ascii")}var AY=Wt(wY(),1),SY=Wt(Fy(),1);function EY(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function cRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,SY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,AY.default)(n,r,t)}function TY(e,t){let r=cRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(EY(a))})})}var aae=Wt(iae(),1),DI=["image/png","image/jpeg","image/gif"];async function FI(e,t){if(!t)throw new Error("MIMEType is required to parse image under Node.js");let r=e instanceof Buffer?e:Buffer.from(e);return await _We(r,t)}function _We(e,t){return new Promise(r=>(0,aae.default)(e,t,(n,i)=>{if(n)throw n;let a=[...i.shape],o=i.shape.length===4?i.shape.shift():1,s=i.data instanceof Buffer?new Uint8Array(i.data):i.data;r({shape:a,data:s,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o?[o]:[]})}))}async function To(e,t,r,n){return n._parse(e,t,r,n)}function Qt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Xu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},sae=Xu.self||Xu.window||Xu.global||{},uae=Xu.window||Xu.self||Xu.global||{},cae=Xu.global||Xu.self||Xu.window||{},lae=Xu.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var oae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wWe=oae&&parseFloat(oae[1])||0;function kI(e,t){return fae(e||{},t)}function fae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=fae(r[n]||{},t[n]):r[n]=t[n];return r}var pae="latest";function EWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.6"),globalThis._loadersgl_.version}var Uh=EWe();function ma(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Qu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Dtr=Qu.self||Qu.window||Qu.global||{},Ftr=Qu.window||Qu.self||Qu.global||{},ktr=Qu.global||Qu.self||Qu.window||{},Btr=Qu.document||{};var ta=typeof process!="object"||String(process)!=="[object process]"||process.browser,Sx=typeof importScripts=="function",dae=typeof window<"u"&&typeof window.orientation<"u",hae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Otr=hae&&parseFloat(hae[1])||0;var Tx=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){ma(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ma(this.isRunning),this.isRunning=!1,this._reject(t)}};var Gh={};fa(Gh,{NodeWorker:()=>Dx,parentPort:()=>AWe});var Cx=Wt(require("worker_threads"),1);yy(Gh,require("worker_threads"));var AWe=Cx==null?void 0:Cx.parentPort,Dx=Cx.Worker;var BI=new Map;function mae(e){ma(e.source&&!e.url||!e.source&&e.url);let t=BI.get(e.source||e.url);return t||(e.url&&(t=SWe(e.url),BI.set(e.url,t)),e.source&&(t=gae(e.source),BI.set(e.source,t))),ma(t),t}function SWe(e){if(!e.startsWith("http"))return e;let t=TWe(e);return gae(t)}function gae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function TWe(e){return`try {
|
|
174
174
|
importScripts('${e}');
|
|
175
175
|
} catch (error) {
|
|
176
176
|
console.error(error);
|
|
177
177
|
throw error;
|
|
178
178
|
}`}function OI(e,t=!0,r){let n=r||new Set;if(e){if(vae(e))n.add(e);else if(vae(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)OI(e[i],t,n)}}return r===void 0?Array.from(n):[]}function vae(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}function II(e){if(e===null)return{};let t=Object.assign({},e);return Object.keys(t).forEach(r=>{typeof e[r]=="object"&&!ArrayBuffer.isView(e[r])&&!(e[r]instanceof Array)?t[r]=II(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var PI=()=>{},Rf=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&ta||typeof Dx<"u"&&!ta}constructor(t){let{name:r,source:n,url:i}=t;ma(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=PI,this.onError=a=>console.log(a),this.worker=ta?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=PI,this.onError=PI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||OI(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=mae({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new Dx(n,{eval:!1})}else if(this.source)t=new Dx(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var Fx=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Rf.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(i,a,o)=>i.done(o),n=(i,a)=>i.error(a)){let i=new Promise(a=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:a}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new Tx(r.name,t);t.onMessage=i=>r.onMessage(n,i.type,i.payload),t.onError=i=>r.onError(n,i),r.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!ta||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Rf({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return dae?this.maxMobileConcurrency:this.maxConcurrency}};var CWe={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},zh=class{props;workerPools=new Map;static isSupported(){return Rf.isSupported()}static getWorkerFarm(t={}){return zh._workerFarm=zh._workerFarm||new zh({}),zh._workerFarm.setProps(t),zh._workerFarm}constructor(t){this.props={...CWe},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:i}=t,a=this.workerPools.get(r);return a||(a=new Fx({name:r,source:n,url:i}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},La=zh;wV(La,"_workerFarm");function bae(e){let t=e.version!==Uh?` (worker-utils@${Uh})`:"";return`${e.name}@${e.version}${t}`}function kx(e,t={}){let r=t[e.id]||{},n=ta?`${e.id}-worker.js`:`${e.id}-worker-node.js`,i=r.workerUrl;if(!i&&e.id==="compression"&&(i=t.workerUrl),t._workerType==="test"&&(ta?i=`modules/${e.module}/dist/${n}`:i=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!i){let a=e.version;a==="latest"&&(a=pae);let o=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return ma(i),i}async function RI(e,t,r={},n={}){let i=bae(e),a=La.getWorkerFarm(r),{source:o}=r,s={name:i,source:o};o||(s.url=kx(e,r));let u=a.getWorkerPool(s),c=r.jobName||e.name,l=await u.startJob(c,DWe.bind(null,n)),f=II(r);return l.postMessage("process",{input:t,options:f}),(await l.result).result}async function DWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{if(!e.process){t.postMessage("error",{id:i,error:"Worker not set up to process on main thread"});return}let s=await e.process(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`process-on-worker: unknown message ${r}`)}}function jI(e,t=Uh){ma(e,"no worker provided");let r=e.version;return!(!t||!r)}var MI={};fa(MI,{readFileAsArrayBuffer:()=>FA,readFileAsText:()=>kA,requireFromFile:()=>BA,requireFromString:()=>km});var LI=Wt(require("module"),1),yae=Wt(require("path"),1),Bx=Wt(require("fs"),1);async function FA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Bx.readFileSync(e).buffer}async function kA(e){return e.startsWith("http")?await(await fetch(e)).text():Bx.readFileSync(e,"utf8")}async function BA(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return km(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await Bx.promises.readFile(e,"utf8");return km(t)}function km(e,t="",r){if(typeof t=="object"&&(r=t,t=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=LI.default._nodeModulePaths(yae.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new LI.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var qI={};async function Zu(e,t=null,r={},n=null){return t&&(e=xae(e,t,r,n)),qI[e]=qI[e]||FWe(e),await qI[e]}function xae(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let i=r.modules||{};return i[n]?i[n]:ta?r.CDN?(ma(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Uh}/dist/libs/${n}`):Sx?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function FWe(e){if(e.endsWith("wasm"))return await BWe(e);if(!ta)try{return MI&&BA&&await BA(e)}catch(r){return console.error(r),null}if(Sx)return importScripts(e);let t=await OWe(e);return kWe(t,e)}function kWe(e,t){if(!ta)return km&&km(e,t);if(Sx)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function BWe(e){return ta||!FA||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await FA(e)}async function OWe(e){return ta||!kA||e.startsWith("http")?await(await fetch(e)).text():await kA(e)}var Aae=Wt(require("child_process"),1);var _ae=Wt(require("child_process"),1);function wae(e=3e3){return new Promise(t=>{_ae.default.exec("lsof -i -P -n | grep LISTEN",(r,n)=>{if(r){t(e);return}let i=[],a=/:(\d+) \(LISTEN\)/;n.split(`
|
|
179
|
-
`).forEach(s=>{let u=a.exec(s);u&&i.push(Number(u[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}var Eae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...Eae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Eae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await wae(t.port)),r.push(t.portArg,String(this.port))),await new Promise((n,i)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),n({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=Aae.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),i(new Error(o)))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),i(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),n({})})}catch(a){i(a)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(t=0){try{await this.stop(),process.exit(t)}catch(r){console.error(r.message||r),process.exit(1)}}_setTimeout(t){Number(this.props.wait)>0&&(this.successTimer=setTimeout(t,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}};function NI(e,t){return!La.isSupported()||!ta&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function UI(e,t,r,n,i){let a=e.id,o=kx(e,r),u=La.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let c=await u.startJob("process-on-worker",IWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function IWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{let s=await e(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function GI(e,t){return!La.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Tae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Sae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Sae(e,0,t):""}function Sae(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function zI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Tae(e)}"`)}}function ec(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),i=new Uint8Array(t);for(let a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function tc(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function Co(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,s)=>o+s.length,0),i=new r(n),a=0;for(let o of t)i.set(o,a),a+=o.length;return i}function Hh(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Do(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function HI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Do(n.byteLength,4)}function WI(e,t){let r=e.length,i=Math.ceil(r/t)*t-r,a="";for(let o=0;o<i;++o)a+=" ";return e+a}function Bm(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Ox(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function OA(e,t,r,n){let i=Do(r.byteLength,n),a=i-r.byteLength;if(e){let o=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),s=new Uint8Array(r);o.set(s);for(let u=0;u<a;++u)e.setUint8(t+r.byteLength+u,32)}return t+=i,t}function Om(e,t,r,n){let a=new TextEncoder().encode(r);return t=OA(e,t,a,n),t}async function Wh(e){let t=[];for await(let r of e)t.push(r);return tc(...t)}function jf(e){return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(e)}function VI(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KI(e){var t=VI(e,"string");return jf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=KI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var PWe="",Cae={};function rc(e){for(let t in Cae)if(e.startsWith(t)){let r=Cae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${PWe}${e}`),e}var RWe="4.0.5",$I={name:"JSON",id:"json",module:"json",version:RWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Dae,parse:async e=>Dae(new TextDecoder().decode(e)),options:{}};function Dae(e){return JSON.parse(e)}function Fae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function kae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(kae(e))return Fae(e);if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Im(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var tu={};fa(tu,{dirname:()=>MWe,filename:()=>LWe,join:()=>qWe,resolve:()=>NWe});function Bae(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)==null?void 0:t.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function LWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function MWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function qWe(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function NWe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",n=!1,i;for(let a=t.length-1;a>=-1&&!n;a--){let o;a>=0?o=t[a]:(i===void 0&&(i=Bae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Ix)}return r=UWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Ix=47,YI=46;function UWe(e,t){let r="",n=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Ix)break;a=Ix}if(a===Ix){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==YI||r.charCodeAt(r.length-2)!==YI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Ix;--c);if(c!==u){r=c===-1?"":r.slice(0,c),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(n+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}n=s,i=0}else a===YI&&i!==-1?++i:i=-1}return r}var JI=new Error("Not implemented"),Vh=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){var i;if((i=globalThis.loaders)!=null&&i.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw gn?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw JI}async write(t,r,n){throw JI}async stat(){throw JI}async close(){}};var XI=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Px=class{file;size;constructor(t){this.file=new Vh(t,"r"),this.size=this.file.bigsize}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let i=Number(n);return await this.file.read(t,i)}get length(){return this.size}};var Kh=Wt(require("fs"),1),$h=class{handle;size;bigsize;url;constructor(t,r,n){t=rc(t),this.handle=Kh.default.openSync(t,r,n);let i=Kh.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Kh.default.close(this.handle,n=>n?r(n):t())})}async stat(){return await new Promise((t,r)=>Kh.default.fstat(this.handle,{bigint:!0},(n,i)=>{let a={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(a)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),a=0,o=new Uint8Array(n),s;for(;r>0;){let u=await zWe(this.handle,o,0,r,i);if(u===0)break;a+=u,i+=BigInt(u),r-=u,s!==void 0&&(s+=u)}return a<r?n.slice(0,a):n}async write(t,r=0,n=t.byteLength){return new Promise((i,a)=>{let o=Number(r),s=new Uint8Array(t,Number(r),n);Kh.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function zWe(e,t,r,n,i){return await new Promise((a,o)=>Kh.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var jA=Wt(require("fs/promises"),1);var ZI=Wt(require("fs"),1),QI=require("stream");var IA=Wt(require("zlib"),1),HWe=e=>e&&e instanceof ArrayBuffer,WWe=e=>e&&e instanceof Buffer;function PA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(IA.default.createBrotliDecompress());case"gzip":return e.pipe(IA.default.createGunzip());case"deflate":return e.pipe(IA.default.createDeflate());default:return e}}async function Oae(e){let t=[];return await new Promise((r,n)=>{e.on("error",i=>n(i)),e.on("readable",()=>e.read()),e.on("data",i=>{typeof i=="string"&&n(new Error("Read stream not binary")),t.push(KWe(i))}),e.on("end",()=>{let i=VWe(t);r(i)})})}function VWe(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function KWe(e){if(HWe(e))return e;if(WWe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var $We=e=>typeof e=="boolean",Iae=e=>typeof e=="function",YWe=e=>e!==null&&typeof e=="object",JWe=e=>YWe(e)&&Iae(e.read)&&Iae(e.pipe)&&$We(e.readable);async function RA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=rc(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,p)=>{let h=ZI.default.createReadStream(n,{encoding:null});h.once("readable",()=>f(h)),h.on("error",d=>p(d))}),o=a;JWe(a)?o=PA(a,i):typeof a=="string"?o=QI.Readable.from([new TextEncoder().encode(a)]):o=QI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=XWe(n),l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}catch(a){let o=a.message,s=400,u=o,c={},l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}}function XWe(e){let t={};if(!t["content-length"]){let r=ZI.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var LA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await jA.default.readdir(t,r)}async stat(t){let r=await jA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await jA.default.unlink(t)}async fetch(t,r){return await RA(t,r)}async openReadableFile(t,r="r"){return new $h(t,r)}async openWritableFile(t,r="w",n){return new $h(t,r,n)}};var Yh=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){var o,s;let n=[];for await(let u of t)n.push(u),yield u;let i=await this.concatenate(n),a=await this.hash(i,r);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:a})}async concatenate(t){return await Wh(t)}};function Pae(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let i=0;i<n.length;i++)typeof n[i]>"u"?t+="=":t+=QWe(n[i])}return t}function QWe(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Rae(e,t){switch(t){case"hex":return e;case"base64":return ZWe(e);default:throw new Error(t)}}function ZWe(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Pae(r)||""}var Lae=typeof atob=="function"?atob:typeof Buffer=="function"?oVe:qae,eVe=Lae("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="),eP=WebAssembly&&Lae!==qae?aVe(eVe).buffer:!1,nc=sVe(),tP=240*16*16,Mae=Math.floor(tP*16*1.066666667),tVe=268435456-65536,jae="Parameter must be Buffer, ArrayBuffer or Uint8Array",rVe="Parameter exceeds max size of 255.9 Mbytes";eP||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function rP(e){var t,r,n,i,a,o,s,u,c,l;let f=iVe(),p=nVe(),h={},d=new Date().getTime();return h.then=function(E){return s=E,g(),h},h.catch=function(E){return u=E,h},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?o=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?o=e.constructor===ArrayBuffer?new Uint8Array(e):e:x(new TypeError(jae)):x(new TypeError(jae)),o&&(a=o.length,eP&&a>Mae?a>tVe?x(new Error(rVe)):(t=new WebAssembly.Memory({initial:a>32e6?a>64e6?a>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),i={mem:t,log:console.log},n={imports:i},WebAssembly.instantiate(eP,n).then(b)):g(f(o))),h;function b(E){g(p(o,E.instance.exports,r))}function g(E){var S=Boolean(E)?E:c;Boolean(E)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-d),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function nVe(){var e,t,r,n,i,a,o,s,u,c,l,f,p,h=function(d){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,he,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=d.length*8,ft;for(ft=Ie(d,p),p[at>>>5]|=128<<at%32,p[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,he=p;Ge<ft;)ft>Ge+Mae?(n(oe),a(V),s(ne),c(se),t(tP),Ge=Ge+tP*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=he[Ge+0]>>>0,g=he[Ge+1]>>>0,x=he[Ge+2]>>>0,E=he[Ge+3]>>>0,S=he[Ge+4]>>>0,F=he[Ge+5]>>>0,D=he[Ge+6]>>>0,j=he[Ge+7]>>>0,k=he[Ge+8]>>>0,N=he[Ge+9]>>>0,C=he[Ge+10]>>>0,I=he[Ge+11]>>>0,P=he[Ge+12]>>>0,U=he[Ge+13]>>>0,Y=he[Ge+14]>>>0,J=he[Ge+15]>>>0,oe=me(7,25,oe+(V&ne|~V&se)+b-680876936)+V,se=me(12,20,se+(oe&V|~oe&ne)+g-389564586)+oe,ne=me(17,15,ne+(se&oe|~se&V)+x+606105819)+se,V=me(22,10,V+(ne&se|~ne&oe)+E-1044525330)+ne,oe=me(7,25,oe+(V&ne|~V&se)+S-176418897)+V,se=me(12,20,se+(oe&V|~oe&ne)+F+1200080426)+oe,ne=me(17,15,ne+(se&oe|~se&V)+D-1473231341)+se,V=me(22,10,V+(ne&se|~ne&oe)+j-45705983)+ne,oe=me(7,25,oe+(V&ne|~V&se)+k+1770035416)+V,se=me(12,20,se+(oe&V|~oe&ne)+N-1958414417)+oe,ne=me(17,15,ne+(se&oe|~se&V)+C-42063)+se,V=me(22,10,V+(ne&se|~ne&oe)+I-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+P+1804603682)+V,se=me(12,20,se+(oe&V|~oe&ne)+U-40341101)+oe,ne=me(17,15,ne+(se&oe|~se&V)+Y-1502002290)+se,V=me(22,10,V+(ne&se|~ne&oe)+J+1236535329)+ne,oe=me(5,27,oe+(V&se|ne&~se)+g-165796510)+V,se=me(9,23,se+(oe&ne|V&~ne)+D-1069501632)+oe,ne=me(14,18,ne+(se&V|oe&~V)+I+643717713)+se,V=me(20,12,V+(ne&oe|se&~oe)+b-373897302)+ne,oe=me(5,27,oe+(V&se|ne&~se)+F-701558691)+V,se=me(9,23,se+(oe&ne|V&~ne)+C+38016083)+oe,ne=me(14,18,ne+(se&V|oe&~V)+J-660478335)+se,V=me(20,12,V+(ne&oe|se&~oe)+S-405537848)+ne,oe=me(5,27,oe+(V&se|ne&~se)+N+568446438)+V,se=me(9,23,se+(oe&ne|V&~ne)+Y-1019803690)+oe,ne=me(14,18,ne+(se&V|oe&~V)+E-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+k+1163531501)+ne,oe=me(5,27,oe+(V&se|ne&~se)+U-1444681467)+V,se=me(9,23,se+(oe&ne|V&~ne)+x-51403784)+oe,ne=me(14,18,ne+(se&V|oe&~V)+j+1735328473)+se,V=me(20,12,V+(ne&oe|se&~oe)+P-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+k-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+I+1839030562)+se,V=me(23,9,V+(ne^se^oe)+Y-35309556)+ne,oe=me(4,28,oe+(V^ne^se)+g-1530992060)+V,se=me(11,21,se+(oe^V^ne)+S+1272893353)+oe,ne=me(16,16,ne+(se^oe^V)+j-155497632)+se,V=me(23,9,V+(ne^se^oe)+C-1094730640)+ne,oe=me(4,28,oe+(V^ne^se)+U+681279174)+V,se=me(11,21,se+(oe^V^ne)+b-358537222)+oe,ne=me(16,16,ne+(se^oe^V)+E-722521979)+se,V=me(23,9,V+(ne^se^oe)+D+76029189)+ne,oe=me(4,28,oe+(V^ne^se)+N-640364487)+V,se=me(11,21,se+(oe^V^ne)+P-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+J+530742520)+se,V=me(23,9,V+(ne^se^oe)+x-995338651)+ne,oe=me(6,26,oe+(ne^(V|~se))+b-198630844)+V,se=me(10,22,se+(V^(oe|~ne))+j+1126891415)+oe,ne=me(15,17,ne+(oe^(se|~V))+Y-1416354905)+se,V=me(21,11,V+(se^(ne|~oe))+F-57434055)+ne,oe=me(6,26,oe+(ne^(V|~se))+P+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+E-1894986606)+oe,ne=me(15,17,ne+(oe^(se|~V))+C-1051523)+se,V=me(21,11,V+(se^(ne|~oe))+g-2054922799)+ne,oe=me(6,26,oe+(ne^(V|~se))+k+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+J-30611744)+oe,ne=me(15,17,ne+(oe^(se|~V))+D-1560198380)+se,V=me(21,11,V+(se^(ne|~oe))+U+1309151649)+ne,oe=me(6,26,oe+(ne^(V|~se))+S-145523070)+V,se=me(10,22,se+(V^(oe|~ne))+I-1120210379)+oe,ne=me(15,17,ne+(oe^(se|~V))+x+718787259)+se,V=me(21,11,V+(se^(ne|~oe))+N-343485551)+ne,Ge=Ge+16,oe=oe+re>>>0,V=V+ee>>>0,ne=ne+ge>>>0,se=se+ye>>>0);return nc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function Ie(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,pe,Xe,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],pe=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Xe=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|pe<<8|Xe<<16|ct<<24;return _t+1}};return function(d,b,g,x){var E;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,p=g,E=nc.wordsToBytes(h(d)),x&&x.asBytes?E:nc.bytesconvertNumberToHex(E)}}function iVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,p,h,d,b,g,x,E,S,F,D,j,k,N=new Date().getTime(),C=1732584193,I=-271733879,P=-1732584194,U=271733878,Y=t.length*8;k=nc.bytesToWords(t);for(var J=0;J<k.length;J++)k[J]=(k[J]<<8|k[J]>>>24)&16711935|(k[J]<<24|k[J]>>>8)&4278255360;k[Y>>>5]|=128<<Y%32,k[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<k.length;re+=16)S=C,F=I,D=P,j=U,n=k[re+0]>>>0,i=k[re+1]>>>0,a=k[re+2]>>>0,o=k[re+3]>>>0,s=k[re+4]>>>0,u=k[re+5]>>>0,c=k[re+6]>>>0,l=k[re+7]>>>0,f=k[re+8]>>>0,p=k[re+9]>>>0,h=k[re+10]>>>0,d=k[re+11]>>>0,b=k[re+12]>>>0,g=k[re+13]>>>0,x=k[re+14]>>>0,E=k[re+15]>>>0,C=ee(7,25,C+(I&P|~I&U)+n-680876936)+I,U=ee(12,20,U+(C&I|~C&P)+i-389564586)+C,P=ee(17,15,P+(U&C|~U&I)+a+606105819)+U,I=ee(22,10,I+(P&U|~P&C)+o-1044525330)+P,C=ee(7,25,C+(I&P|~I&U)+s-176418897)+I,U=ee(12,20,U+(C&I|~C&P)+u+1200080426)+C,P=ee(17,15,P+(U&C|~U&I)+c-1473231341)+U,I=ee(22,10,I+(P&U|~P&C)+l-45705983)+P,C=ee(7,25,C+(I&P|~I&U)+f+1770035416)+I,U=ee(12,20,U+(C&I|~C&P)+p-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+h-42063)+U,I=ee(22,10,I+(P&U|~P&C)+d-1990404162)+P,C=ee(7,25,C+(I&P|~I&U)+b+1804603682)+I,U=ee(12,20,U+(C&I|~C&P)+g-40341101)+C,P=ee(17,15,P+(U&C|~U&I)+x-1502002290)+U,I=ee(22,10,I+(P&U|~P&C)+E+1236535329)+P,C=ee(5,27,C+(I&U|P&~U)+i-165796510)+I,U=ee(9,23,U+(C&P|I&~P)+c-1069501632)+C,P=ee(14,18,P+(U&I|C&~I)+d+643717713)+U,I=ee(20,12,I+(P&C|U&~C)+n-373897302)+P,C=ee(5,27,C+(I&U|P&~U)+u-701558691)+I,U=ee(9,23,U+(C&P|I&~P)+h+38016083)+C,P=ee(14,18,P+(U&I|C&~I)+E-660478335)+U,I=ee(20,12,I+(P&C|U&~C)+s-405537848)+P,C=ee(5,27,C+(I&U|P&~U)+p+568446438)+I,U=ee(9,23,U+(C&P|I&~P)+x-1019803690)+C,P=ee(14,18,P+(U&I|C&~I)+o-187363961)+U,I=ee(20,12,I+(P&C|U&~C)+f+1163531501)+P,C=ee(5,27,C+(I&U|P&~U)+g-1444681467)+I,U=ee(9,23,U+(C&P|I&~P)+a-51403784)+C,P=ee(14,18,P+(U&I|C&~I)+l+1735328473)+U,I=ee(20,12,I+(P&C|U&~C)+b-1926607734)+P,C=ee(4,28,C+(I^P^U)+u-378558)+I,U=ee(11,21,U+(C^I^P)+f-2022574463)+C,P=ee(16,16,P+(U^C^I)+d+1839030562)+U,I=ee(23,9,I+(P^U^C)+x-35309556)+P,C=ee(4,28,C+(I^P^U)+i-1530992060)+I,U=ee(11,21,U+(C^I^P)+s+1272893353)+C,P=ee(16,16,P+(U^C^I)+l-155497632)+U,I=ee(23,9,I+(P^U^C)+h-1094730640)+P,C=ee(4,28,C+(I^P^U)+g+681279174)+I,U=ee(11,21,U+(C^I^P)+n-358537222)+C,P=ee(16,16,P+(U^C^I)+o-722521979)+U,I=ee(23,9,I+(P^U^C)+c+76029189)+P,C=ee(4,28,C+(I^P^U)+p-640364487)+I,U=ee(11,21,U+(C^I^P)+b-421815835)+C,P=ee(16,16,P+(U^C^I)+E+530742520)+U,I=ee(23,9,I+(P^U^C)+a-995338651)+P,C=ee(6,26,C+(P^(I|~U))+n-198630844)+I,U=ee(10,22,U+(I^(C|~P))+l+1126891415)+C,P=ee(15,17,P+(C^(U|~I))+x-1416354905)+U,I=ee(21,11,I+(U^(P|~C))+u-57434055)+P,C=ee(6,26,C+(P^(I|~U))+b+1700485571)+I,U=ee(10,22,U+(I^(C|~P))+o-1894986606)+C,P=ee(15,17,P+(C^(U|~I))+h-1051523)+U,I=ee(21,11,I+(U^(P|~C))+i-2054922799)+P,C=ee(6,26,C+(P^(I|~U))+f+1873313359)+I,U=ee(10,22,U+(I^(C|~P))+E-30611744)+C,P=ee(15,17,P+(C^(U|~I))+c-1560198380)+U,I=ee(21,11,I+(U^(P|~C))+g+1309151649)+P,C=ee(6,26,C+(P^(I|~U))+s-145523070)+I,U=ee(10,22,U+(I^(C|~P))+d-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+p-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return nc.endian([C,I,P,U]);function ee(ge,ye,he){return he<<ge|he>>>ye}};return function(t,r){var n=nc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:nc.bytesconvertNumberToHex(n);return i}}function aVe(e){var t,r,n,i=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>i++;)n[i]=e.charCodeAt(i);return n}function oVe(e){return Buffer.from(e,"base64").toString("binary")}function qae(e){return e}function sVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return nc.rotl(t,8)&16711935|nc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=nc.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,i=0;n<t.length;n++,i+=8)r[i>>>5]|=t[n]<<24-i%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var Rx=class extends Yh{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>rP(t).then(a).catch(o));return Rae(i,r)}};var jx=Wt(require("crypto"),1),MA=class extends Yh{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(super(),this.options=t,!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async hash(t,r){var i,a,o,s;let n=(o=(a=(i=this.options)==null?void 0:i.crypto)==null?void 0:a.algorithm)==null?void 0:o.toLowerCase();try{if(!jx.createHash)throw new Error("crypto.createHash not available");let u=(s=jx.createHash)==null?void 0:s(n),c=new Uint8Array(t);return u.update(c).digest("base64")}catch(u){throw Error(`${n} hash not available. ${u}`)}}async*hashBatches(t,r="base64"){var a,o,s,u,c,l,f;if(!jx.createHash)throw new Error("crypto.createHash not available");let n=(u=jx.createHash)==null?void 0:u((s=(o=(a=this.options)==null?void 0:a.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let p of t){let h=new Uint8Array(p);n.update(h),yield p}let i=n.digest(r);(f=(l=(c=this.options)==null?void 0:c.crypto)==null?void 0:l.onEnd)==null||f.call(l,{hash:i})}};var eoe=require("process");var Nae=Wt(require("stream"),1),nP=class{},uVe=Nae.Readable||nP;function aP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new iP(r,t)}var iP=class extends uVe{_pulling;_bytesMode;_iterator;constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,r){var n,i,a,o;this._iterator&&(t?await((i=(n=this._iterator)==null?void 0:n.throw)==null?void 0:i.call(n,t)):await((o=(a=this._iterator)==null?void 0:a.return)==null?void 0:o.call(a,t)),r==null||r(null))}async _pull(t,r){var a;let n=this._bytesMode,i=null;for(;this.readable&&!(i=await r.next()).done&&(t!==null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(new Uint8Array(i.value))||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&((a=r==null?void 0:r.return)==null||a.call(r)),!this.readable}};var zae=Wt(Gae(),1);delete globalThis.ReadableStream;var NA=class extends zae.ReadableStream{};var UA=class{chunks;isWorking=!1;isCancelled=!1;constructor(t){this.chunks=t}start(t){this.work(t)}async work(t){let{chunks:r}=this;for(this.isWorking=!0;!this.isCancelled&&(t.desiredSize||0)>0;){let n;try{n=r.next()}catch(i){t.error(i);break}n&&(!n.done&&!this.isCancelled?t.enqueue(n.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var GA=class extends NA{_chunks;constructor(t){super(new UA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Jh=class{type;size;parts;constructor(t=[],r={}){this.parts=[],this.size=0;for(let n of t)if(typeof n=="string"){let i=new TextEncoder().encode(n);this.parts.push(i),this.size+=i.byteLength}else if(n instanceof Jh)this.size+=n.size,this.parts.push(...n.parts);else if(n instanceof ArrayBuffer)this.parts.push(new Uint8Array(n)),this.size+=n.byteLength;else if(n instanceof Uint8Array)this.parts.push(n),this.size+=n.byteLength;else if(ArrayBuffer.isView(n)){let{buffer:i,byteOffset:a,byteLength:o}=n;this.parts.push(new Uint8Array(i,a,o)),this.size+=o}else{let i=new TextEncoder().encode(String(n));this.parts.push(i),this.size+=i.byteLength}this.type=cVe(r.type)}slice(t=0,r=this.size,n=""){let{size:i,parts:a}=this,o=t<0?Math.max(i+t,0):Math.min(t,i),s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.max(s-o,0),c=new Jh([],{type:n});if(u===0)return c;let l=0,f=[];for(let p of a){let{byteLength:h}=p;if(o>0&&h<=o)o-=h,s-=h;else{let d=p.subarray(o,Math.min(h,s));if(f.push(d),l+=d.byteLength,o=0,l>=u)break}}return c.parts=f,c.size=l,c}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let n of this.parts)r+=t.decode(n);return r}stream(){return new GA(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),n=0;for(let i of this.parts)r.set(i,n),n+=i.byteLength;return t}};function cVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function lVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Jh),globalThis.Blob}var fVe=lVe();var zA=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${_y(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var HA=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(t,r,n={}){super(t,n),this.name=String(r).replace(/\//g,":"),this.lastModified=(n==null?void 0:n.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function Hae(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=zA),typeof File>"u"&&!globalThis.File&&(globalThis.File=HA),global}var pVe=Hae();var oP=Wt(require("module"),1),Wae=Wt(require("path"),1),VA=Wt(require("fs"),1);async function Vae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():VA.default.readFileSync(e).buffer}async function Kae(e){return e.startsWith("http")?await(await fetch(e)).text():VA.default.readFileSync(e,"utf8")}async function $ae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return WA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await VA.default.readFileSync(e,"utf8");return WA(t)}function WA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=oP.default._nodeModulePaths(Wae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new oP.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var ru=class{map;constructor(t){this.map={},t instanceof ru?t.forEach((r,n)=>this.append(n,r)):Array.isArray(t)?t.forEach(r=>this.append(r[0],r[1])):t&&Object.getOwnPropertyNames(t).forEach(r=>this.append(r,t[r]))}append(t,r){t=Lx(t),r=Yae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Lx(t)]}get(t){return t=Lx(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Lx(t))}set(t,r){this.map[Lx(t)]=Yae(r)}forEach(t,r=null){for(let n in this.map)this.map.hasOwnProperty(n)&&(r?t.call(r,this.map[n],n,this):t(this.map[n],n,this))}keys(){let t=[];return this.forEach(function(r,n){t.push(n)}),sP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),sP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),sP(t)}*[Symbol.iterator](){yield*this.entries()}};function Lx(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||e==="")throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function Yae(e){return typeof e!="string"&&(e=String(e)),e}function sP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function uP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var lP=Wt(require("stream"),1),hVe=e=>typeof e=="boolean",Jae=e=>typeof e=="function",dVe=e=>e!==null&&typeof e=="object",cP=e=>dVe(e)&&Jae(e.read)&&Jae(e.pipe)&&hVe(e.readable),pl=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(t,r){let{headers:n,status:i=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=i===200,this.status=i,this.statusText=a,this.headers=new ru((r==null?void 0:r.headers)||{}),cP(t)?this._body=PA(t,n):typeof t=="string"?this._body=lP.Readable.from([new TextEncoder().encode(t)]):this._body=lP.Readable.from([t||new ArrayBuffer(0)])}get body(){return uP(!this.bodyUsed),uP(cP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return cP(this._body)?await Oae(this._body):this._body||new ArrayBuffer(0)}async text(){let t=await this.arrayBuffer();return new TextDecoder().decode(t)}async json(){let t=await this.text();return JSON.parse(t)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var Qae=Wt(require("http"),1),Zae=Wt(require("https"),1);var mVe=e=>e&&e instanceof ArrayBuffer,gVe=e=>e&&e instanceof Buffer;function Xae(e){let t=e.indexOf(","),r,n;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n=`text/plain${n}`):n="text/plain;charset=US-ASCII",{arrayBuffer:vVe(r),mimeType:n}}function vVe(e){if(mVe(e))return e;if(gVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var fP=e=>e.startsWith("data:"),bVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Mx(e,t){try{if(globalThis.fetch!==Mx&&(bVe(e)||fP(e)))return await fetch(e,t);if(fP(e)){let{arrayBuffer:c,mimeType:l}=Xae(e);return new pl(c,{headers:{"content-type":l},url:e})}let r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let i=await yVe(n,t),a=EVe(e,i,r),{status:o,statusText:s}=wVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=xVe(e,a.get("location"));return await Mx(c,t)}return new pl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new pl(null,{status:400,statusText:String(r),url:e})}}async function yVe(e,t){return await new Promise((r,n)=>{let i=_Ve(e,t),a=e.startsWith("https:")?Zae.default.request(i,o=>r(o)):Qae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function xVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function _Ve(e,t){let r=(t==null?void 0:t.headers)||{},n={};for(let a of Object.keys(r))n[a.toLowerCase()]=r[a];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";let i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...t==null?void 0:t.fetch,headers:n,port:i.port}}function wVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function EVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=AVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new ru(n)}function AVe(e){return fP(e)?e.length-5:null}var SVe=parseInt(eoe.versions.node.split(".")[0]);EV&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=aP;globalThis.loaders.NodeFile=$h;globalThis.loaders.NodeFileSystem=LA;globalThis.loaders.fetchNode=RA;globalThis.loaders.NodeHash=MA;globalThis.TextEncoder||(globalThis.TextEncoder=xy);globalThis.TextDecoder||(globalThis.TextDecoder=wh);!("atob"in globalThis)&&_y&&(globalThis.atob=_y);!("btoa"in globalThis)&&Sk&&(globalThis.btoa=Sk);globalThis.loaders.encodeImageNode=TY;globalThis.loaders.parseImageNode=FI;globalThis.loaders.imageFormatsNode=DI;globalThis._parseImageNode=FI;globalThis._imageFormatsNode=DI;globalThis.loaders.readFileAsArrayBuffer=Vae;globalThis.loaders.readFileAsText=Kae;globalThis.loaders.requireFromFile=$ae;globalThis.loaders.requireFromString=WA;SVe<18&&(!("Headers"in globalThis)&&ru&&(globalThis.Headers=ru),!("Response"in globalThis)&&pl&&(globalThis.Response=pl),!("fetch"in globalThis)&&Mx&&(globalThis.fetch=Mx));var NBe=require("path"),UBe=Wt(Wye(),1);var Ln={OBJECT_ID_TYPE:"OBJECTID",STRING_TYPE:"string",DOUBLE_TYPE:"double",SHORT_INT_TYPE:"Int32"};var XC=class{_attributeStorageInfo;_fields;_popupInfo;constructor(){this._attributeStorageInfo=[],this._fields=[]}get attributeStorageInfo(){return this._attributeStorageInfo}get fields(){return this._fields}get popupInfo(){return this._popupInfo}addMetadataInfo(t){if(!Object.keys(t).length)return;let r={OBJECTID:Ln.OBJECT_ID_TYPE,...t},n=!1,i=this._attributeStorageInfo.length;for(let a in r)if(!this._attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=this.createStorageAttribute(i,a,s),c=this.getFieldAttributeType(s),l=this.createFieldAttribute(a,c);this._attributeStorageInfo.push(u),this._fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this._attributeStorageInfo)a.push(o.name);this._popupInfo=this.createPopupInfo(a)}}createStorageAttribute(t,r,n){let i={key:`f_${t}`,name:r,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(n){case Ln.OBJECT_ID_TYPE:this.setupIdAttribute(i);break;case Ln.STRING_TYPE:this.setupStringAttribute(i);break;case Ln.DOUBLE_TYPE:this.setupDoubleAttribute(i);break;case Ln.SHORT_INT_TYPE:break;default:this.setupStringAttribute(i)}return i}getFieldAttributeType(t){switch(t){case Ln.OBJECT_ID_TYPE:return"esriFieldTypeOID";case Ln.STRING_TYPE:return"esriFieldTypeString";case Ln.SHORT_INT_TYPE:return"esriFieldTypeInteger";case Ln.DOUBLE_TYPE:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}setupIdAttribute(t){t.attributeValues={valueType:"Oid32",valuesPerElement:1}}setupStringAttribute(t){t.ordering.unshift("attributeByteCounts"),t.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),t.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},t.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}setupDoubleAttribute(t){t.attributeValues={valueType:"Float64",valuesPerElement:1}}createFieldAttribute(t,r){return{name:t,type:r,alias:t}}createPopupInfo(t){let r="{OBJECTID}",n=[],i=[],a=[],o=[];for(let s of t)i.push({fieldName:s,visible:!0,isEditable:!1,label:s});return a.push({fieldInfos:i,type:"fields"}),{title:r,mediaInfos:n,popupElements:a,fieldInfos:i,expressionInfos:o}}};var iTt=e=>typeof e=="boolean",$1=e=>typeof e=="function",Ad=e=>e!==null&&typeof e=="object",VM=e=>Ad(e)&&e.constructor==={}.constructor;var Vye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",Kye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var cs=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ls=e=>typeof Blob<"u"&&e instanceof Blob,$ye=e=>e&&typeof e=="object"&&e.isBuffer;var aTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ad(e)&&$1(e.tee)&&$1(e.cancel)&&$1(e.getReader);var oTt=e=>Ad(e)&&$1(e.read)&&$1(e.pipe)&&iTt(e.readable),QC=e=>aTt(e)||oTt(e);var sTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,uTt=/^([-\w.]+\/[-\w.+]+)/;function Yye(e){let t=uTt.exec(e);return t?t[1]:e}function KM(e){let t=sTt.exec(e);return t?t[1]:""}var Jye=/\?.*/;function Xye(e){let t=e.match(Jye);return t&&t[0]}function uv(e){return e.replace(Jye,"")}function Sd(e){return cs(e)?e.url:ls(e)?e.name||"":typeof e=="string"?e:""}function Y1(e){if(cs(e)){let t=e,r=t.headers.get("content-type")||"",n=uv(t.url);return Yye(r)||KM(n)}return ls(e)?e.type||"":typeof e=="string"?KM(e):""}function Qye(e){return cs(e)?e.headers["content-length"]||-1:ls(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function ZC(e){if(cs(e))return e;let t={},r=Qye(e);r>=0&&(t["content-length"]=String(r));let n=Sd(e),i=Y1(e);i&&(t["content-type"]=i);let a=await lTt(e);a&&(t["x-first-bytes"]=a),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function Zye(e){if(!e.ok){let t=await cTt(e);throw new Error(t)}}async function cTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r!=null&&r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function lTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${fTt(r)}`}return null}function fTt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function pTt(e){return!hTt(e)&&!dTt(e)}function hTt(e){return e.startsWith("http:")||e.startsWith("https:")}function dTt(e){return e.startsWith("data:")}async function ko(e,t){var r,n;if(typeof e=="string"){let i=rc(e);return pTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await ZC(e)}function $M(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function fu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||$M()}var mTt=globalThis.self||globalThis.window||globalThis.global,cv=globalThis.window||globalThis.self||globalThis.global,gTt=globalThis.document||{},Td=globalThis.process||{},vTt=globalThis.console,Ydr=globalThis.navigator||{};var e8="4.0.5",Qdr=fu();function bTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var t8=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";zt(this,"storage",void 0),zt(this,"id",void 0),zt(this,"config",void 0),this.storage=bTt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function exe(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function txe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function r8(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var n8;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(n8||(n8={}));var yTt=10;function rxe(e){return typeof e!="string"?e:(e=e.toUpperCase(),n8[e]||n8.WHITE)}function nxe(e,t,r){if(!fu&&typeof e=="string"){if(t){let n=rxe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=rxe(r);e="\x1B[".concat(n+yTt,"m").concat(e,"\x1B[49m")}}return e}function ixe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function lv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Cd(){let e;if(fu()&&cv.performance){var t,r;e=cv===null||cv===void 0||(t=cv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Td){var n;let i=Td===null||Td===void 0||(n=Td.hrtime)===null||n===void 0?void 0:n.call(Td);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var fv={debug:fu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},xTt={enabled:!0,level:0};function fs(){}var axe={},oxe={once:!0},bc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",e8),zt(this,"_startTs",Cd()),zt(this,"_deltaTs",Cd()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new t8("__probe-".concat(this.id,"__"),xTt),this.timeStamp("".concat(this.id," started")),ixe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Cd()-this._startTs).toPrecision(10))}getDelta(){return Number((Cd()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){lv(t,r)}warn(t){return this._getLogFunction(0,t,fv.warn,arguments,oxe)}error(t){return this._getLogFunction(0,t,fv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,fv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,fv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,fv.debug||fv.info,arguments,oxe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||fs,n&&[n],{tag:ATt(r)}):fs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?fu()?ETt({image:i,message:a,scale:o}):wTt({image:i,message:a,scale:o}):fs}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||fs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=sxe({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||fs)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=sxe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,lv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Cd();let o=a.tag||a.message;if(a.once&&o)if(!axe[o])axe[o]=Cd();else return fs;return r=_Tt(this.id,a.message,a),n.bind(console,r,...a.args)}return fs}};zt(bc,"VERSION",e8);function uxe(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return lv(Number.isFinite(t)&&t>=0),t}function sxe(e){let{logLevel:t,message:r}=e;e.logLevel=uxe(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return lv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function _Tt(e,t,r){if(typeof t=="string"){let n=r.time?txe(exe(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=nxe(t,r.color,r.background)}return t}function wTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),fs}function ETt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=r8(a,r,n);console.log(...o)},a.src=t,fs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...r8(t,r,n)),fs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...r8(a,r,n)),a.src=t.toDataURL(),fs}return fs}function ATt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var S0r=new bc({id:"@probe.gl/log"});var YM=new bc({id:"loaders.gl"}),i8=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},a8=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var JM={fetch:null,mimeType:void 0,nothrow:!1,log:new a8,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:gn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},cxe={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function XM(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function pv(){let e=XM();return e.globalOptions=e.globalOptions||{...JM},e.globalOptions}function pxe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],STt(e,r),CTt(t,e,n)}function STt(e,t){lxe(e,null,JM,cxe,t);for(let r of t){let n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};lxe(n,r.id,i,a,t)}}function lxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ad(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)YM.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=TTt(s,i);YM.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function TTt(e,t){let r=e.toLowerCase(),n="";for(let i of t)for(let a in i.options){if(e===a)return`Did you mean '${i.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${a}'?`)}return n}function CTt(e,t,r){let i={...e.options||{}};return DTt(i,r),i.log===null&&(i.log=new i8),fxe(i,pv()),fxe(i,t),i}function fxe(e,t){for(let r in t)if(r in t){let n=t[r];VM(n)&&VM(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function DTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function J1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function QM(e){Qt(e,"null loader"),Qt(J1(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var FTt=()=>{let e=XM();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function hxe(){return FTt()}var dxe=new bc({id:"loaders.gl"});var kTt=/\.([^.]+)$/;async function vxe(e,t=[],r,n){if(!bxe(e))return null;let i=mxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(ls(e)&&(e=await e.slice(0,10).arrayBuffer(),i=mxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(yxe(e));return i}function mxe(e,t=[],r,n){if(!bxe(e))return null;if(t&&!Array.isArray(t))return QM(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...hxe()),OTt(i);let a=BTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(yxe(e));return a}function BTt(e,t,r,n){let i=Sd(e),a=Y1(e),o=uv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=ZM(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||ITt(t,o),u=u||(s?`matched url ${o}`:""),s=s||ZM(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||RTt(t,e),u=u||(s?`matched initial data ${xxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||ZM(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&dxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function bxe(e){return!(e instanceof Response&&e.status===204)}function yxe(e){let t=Sd(e),r=Y1(e),n="No valid loader found (";n+=t?`${tu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?xxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function OTt(e){for(let t of e)QM(t)}function ITt(e,t){let r=t&&kTt.exec(t),n=r&&r[1];return n?PTt(e,n):null}function PTt(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function ZM(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function RTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(jTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(gxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&gxe(t,0,r))return r;return null}function jTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function gxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>LTt(e,t,r,i))}function LTt(e,t,r,n){if(n instanceof ArrayBuffer)return ec(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=e7(e,t,n.length);return n===i;default:return!1}}function xxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?e7(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?e7(e,0,t):""}function e7(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function*_xe(e,t){let r=(t==null?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;for(;n<e.length;){let a=Math.min(e.length-n,r),o=e.slice(n,n+a);n+=a,yield i.encode(o)}}function*wxe(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let i=Math.min(e.byteLength-n,r),a=new ArrayBuffer(i),o=new Uint8Array(e,n,i);new Uint8Array(a).set(o),n+=i,yield a}}async function*Exe(e,t){let r=(t==null?void 0:t.chunkSize)||1048576,n=0;for(;n<e.size;){let i=n+r,a=await e.slice(n,i).arrayBuffer();n=i,yield a}}function t7(e,t){return gn?MTt(e,t):qTt(e,t)}async function*MTt(e,t){let r=e.getReader(),n;try{for(;;){let i=n||r.read();t!=null&&t._streamReadAhead&&(n=r.read());let{done:a,value:o}=await i;if(a)return;yield fl(o)}}catch{r.releaseLock()}}async function*qTt(e,t){for await(let r of e)yield fl(r)}function Axe(e,t){if(typeof e=="string")return _xe(e,t);if(e instanceof ArrayBuffer)return wxe(e,t);if(ls(e))return Exe(e,t);if(QC(e))return t7(e,t);if(cs(e))return t7(e.body,t);throw new Error("makeIterator")}var Sxe="Cannot convert supplied data type";function NTt(e,t,r){if(t.text&&typeof e=="string")return e;if($ye(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,i=e.byteLength||e.length;return(e.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+i)),n}throw new Error(Sxe)}async function Txe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return NTt(e,t,r);if(ls(e)&&(e=await ZC(e)),cs(e)){let i=e;return await Zye(i),t.binary?await i.arrayBuffer():await i.text()}if(QC(e)&&(e=Axe(e,r)),Vye(e)||Kye(e))return Wh(e);throw new Error(Sxe)}function o8(e,t){let r=pv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ad(n.fetch)?i=>ko(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:ko}function Cxe(e,t,r){if(r)return r;let n={fetch:o8(t,e),...e};if(n.url){let i=uv(n.url);n.baseUrl=i,n.queryString=Xye(n.url),n.filename=tu.filename(i),n.baseUrl=tu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Dxe(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function Bo(e,t,r,n){t&&!Array.isArray(t)&&!J1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Sd(e),o=Dxe(t,n),s=await vxe(e,o,r);return s?(r=pxe(r,s,o,i),n=Cxe({url:i,_parse:Bo,loaders:o},r,n||null),await UTt(s,e,r,n)):null}async function UTt(e,t,r,n){if(jI(e),r=kI(e.options,r),cs(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,p=Object.fromEntries(a.headers.entries());n.response={headers:p,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Txe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(NI(e,r))return await UI(e,t,r,n,Bo);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw ma(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Fxe(e){switch(e.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 r7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],p=s[c+2];t=l<t?l:t,r=f<r?f:r,n=p<n?p:n,i=l>i?l:i,a=f>a?f:a,o=p>o?p:o}return[[t,r,n],[i,a,o]]}function n7(e,t,r){let n=Fxe(t.value),i=r||kxe(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function kxe(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function An(e,t,r,n){let i,a;!Array.isArray(t)&&!J1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=o8(a),s=e;return typeof e=="string"&&(s=await o(e)),ls(e)&&(s=await o(e)),Array.isArray(i)?await Bo(s,i,a):await Bo(s,i,a)}async function hv(e,t,r){if(r={...pv(),...r},GI(t,r))return await RI(t,e,r);if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return new TextEncoder().encode(await t.encodeText(e,r));if(t.encodeInBatches){let i=Oxe(e,t,r),a=[];for await(let o of i)a.push(o);return tc(...a)}if(!gn&&t.encodeURLtoURL){let i=Bxe("input");await new Vh(i,"w").write(e);let o=Bxe("output"),s=await Ixe(i,o,t,r);return(await ko(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function s8(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Oxe(e,t,r){if(t.encodeInBatches){let n=GTt(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function Ixe(e,t,r,n){if(e=rc(e),t=rc(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}function GTt(e){return[{...e,start:0,end:e.length}]}function Bxe(e){return`/tmp/${e}`}var zTt=1/Math.PI*180,HTt=1/180*Math.PI,WTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...WTt}};var Sn=globalThis.mathgl.config;function i7(e,{precision:t=Sn.precision}={}){return e=VTt(e),"".concat(parseFloat(e.toPrecision(t)))}function ps(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a7(e){return Pxe(e)}function o7(e){return Cl(e)}function Pxe(e,t){return u7(e,r=>r*HTt,t)}function Cl(e,t){return u7(e,r=>r*zTt,t)}function s7(e,t,r){return u7(e,n=>Math.max(t,Math.min(r,n)))}function Oo(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(ps(e)&&ps(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Oo(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Sn.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Sn.EPSILON=n}}function VTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function KTt(e){return e.clone?e.clone():new Array(e.length)}function u7(e,t,r){if(ps(e)){let n=e;r=r||KTt(n);for(let i=0;i<r.length&&i<n.length;++i){let a=typeof e=="number"?e:e[i];r[i]=t(a,i,r)}return r}return t(e)}function $Tt(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var bp=class extends $Tt(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:ps(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Sn)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+i7(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Oo(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let a=t[i],o=typeof r=="number"?r:r[i];this[i]=a+n*(o-a)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Sn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function YTt(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Ar(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function yp(e,t,r=""){if(Sn.debug&&!YTt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function aa(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var xp=class extends bp{get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Ar(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Ar(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return aa(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return aa(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Mn=typeof Float32Array<"u"?Float32Array:Array,X1=Math.random;function dv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var _gr=Math.PI/180;function JTt(){let e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function Rxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function jxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function u8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function c8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var wgr=function(){let e=JTt();return function(t,r,n,i,a,o){let s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function l8(e,t,r){let n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function f8(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Lxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function Mxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function p8(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Dd=class extends xp{constructor(t=0,r=0){super(2),ps(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return c8(this,this,t),this.check()}transformAsVector(t){return l8(this,this,t),this.check()}transformByMatrix3(t){return u8(this,this,t),this.check()}transformByMatrix2x3(t){return jxe(this,this,t),this.check()}transformByMatrix2(t){return Rxe(this,this,t),this.check()}};var gv={};fa(gv,{add:()=>e6t,angle:()=>h7,bezier:()=>h6t,ceil:()=>t6t,clone:()=>XTt,copy:()=>QTt,create:()=>h8,cross:()=>Fd,dist:()=>w6t,distance:()=>zxe,div:()=>_6t,divide:()=>Gxe,dot:()=>Q1,equals:()=>b6t,exactEquals:()=>v6t,floor:()=>r6t,forEach:()=>S6t,fromValues:()=>d8,hermite:()=>p6t,inverse:()=>c6t,len:()=>d7,length:()=>qxe,lerp:()=>l6t,max:()=>i6t,min:()=>n6t,mul:()=>x6t,multiply:()=>Uxe,negate:()=>u6t,normalize:()=>c7,random:()=>d6t,rotateX:()=>l7,rotateY:()=>f7,rotateZ:()=>p7,round:()=>a6t,scale:()=>o6t,scaleAndAdd:()=>s6t,set:()=>ZTt,slerp:()=>f6t,sqrDist:()=>E6t,sqrLen:()=>A6t,squaredDistance:()=>Hxe,squaredLength:()=>Wxe,str:()=>g6t,sub:()=>y6t,subtract:()=>Nxe,transformMat3:()=>Z1,transformMat4:()=>kd,transformQuat:()=>e_,zero:()=>m6t});function h8(){let e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function XTt(e){let t=new Mn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function qxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function d8(e,t,r){let n=new Mn(3);return n[0]=e,n[1]=t,n[2]=r,n}function QTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ZTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function e6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Nxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Uxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Gxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function t6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function r6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function n6t(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function i6t(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function a6t(e,t){return e[0]=dv(t[0]),e[1]=dv(t[1]),e[2]=dv(t[2]),e}function o6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function s6t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function zxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function Hxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function Wxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function u6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function c6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function c7(e,t){let r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Q1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function l6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function f6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(Q1(t,r),-1),1)),a=Math.sin(i),o=Math.sin((1-n)*i)/a,s=Math.sin(n*i)/a;return e[0]=o*t[0]+s*r[0],e[1]=o*t[1]+s*r[1],e[2]=o*t[2]+s*r[2],e}function p6t(e,t,r,n,i,a){let o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,c=o*(a-1),l=o*(3-2*a);return e[0]=t[0]*s+r[0]*u+n[0]*c+i[0]*l,e[1]=t[1]*s+r[1]*u+n[1]*c+i[1]*l,e[2]=t[2]*s+r[2]*u+n[2]*c+i[2]*l,e}function h6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,p=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*p,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*p,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*p,e}function d6t(e,t){t=t===void 0?1:t;let r=X1()*2*Math.PI,n=X1()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function kd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function Z1(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function e_(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,p=n*u-i*s,h=i*p-a*f,d=a*l-n*p,b=n*f-i*l,g=o*2;return l*=g,f*=g,p*=g,h*=2,d*=2,b*=2,e[0]=s+l+h,e[1]=u+f+d,e[2]=c+p+b,e}function l7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function f7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function p7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function h7(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt((r*r+n*n+i*i)*(a*a+o*o+s*s)),c=u&&Q1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function m6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function g6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function v6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function b6t(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=1e-6*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}var y6t=Nxe,x6t=Uxe,_6t=Gxe,w6t=zxe,E6t=Hxe,d7=qxe,A6t=Wxe,S6t=function(){let e=h8();return function(t,r,n,i,a,o){let s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();var m7=[0,0,0],m8,ce=class extends xp{static get ZERO(){return m8||(m8=new ce(0,0,0),Object.freeze(m8)),m8}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ps(t)?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Ar(t)}angle(t){return h7(this,t)}cross(t){return Fd(this,this,t),this.check()}rotateX({radians:t,origin:r=m7}){return l7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=m7}){return f7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=m7}){return p7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return kd(this,this,t),this.check()}transformAsVector(t){return f8(this,this,t),this.check()}transformByMatrix3(t){return Z1(this,this,t),this.check()}transformByMatrix2(t){return Lxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}};var g8,hs=class extends xp{static get ZERO(){return g8||(g8=new hs(0,0,0,0),Object.freeze(g8)),g8}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),ps(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n),Ar(i)),this[0]=t,this[1]=r,this[2]=n,this[3]=i)}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z),Ar(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}transform(t){return kd(this,this,t),this.check()}transformByMatrix3(t){return p8(this,this,t),this.check()}transformByMatrix2(t){return Mxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var vv=class extends bp{toString(){let t="[";if(Sn.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Ar(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function Vxe(){let e=new Mn(9);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Kxe(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function $xe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,p=-l*a+s*u,h=c*a-o*u,d=r*f+n*p+i*h;return d?(d=1/d,e[0]=f*d,e[1]=(-l*n+i*c)*d,e[2]=(s*n-i*o)*d,e[3]=p*d,e[4]=(l*r-i*u)*d,e[5]=(-s*r+i*a)*d,e[6]=h*d,e[7]=(-c*r+n*u)*d,e[8]=(o*r-n*a)*d,e):null}function Yxe(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s)}function g7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=r[0],h=r[1],d=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=p*n+h*o+d*c,e[1]=p*i+h*s+d*l,e[2]=p*a+h*u+d*f,e[3]=b*n+g*o+x*c,e[4]=b*i+g*s+x*l,e[5]=b*a+g*u+x*f,e[6]=E*n+S*o+F*c,e[7]=E*i+S*s+F*l,e[8]=E*a+S*u+F*f,e}function Jxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=p*n+h*o+c,e[7]=p*i+h*s+l,e[8]=p*a+h*u+f,e}function Xxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=Math.sin(r),h=Math.cos(r);return e[0]=h*n+p*o,e[1]=h*i+p*s,e[2]=h*a+p*u,e[3]=h*o-p*n,e[4]=h*s-p*i,e[5]=h*u-p*a,e[6]=c,e[7]=l,e[8]=f,e}function v7(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Qxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[3]=l-x,e[6]=p+g,e[1]=l+x,e[4]=1-c-d,e[7]=h-b,e[2]=p-g,e[5]=h+b,e[8]=1-c-f,e}var b7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(b7||(b7={}));var C6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends vv{static get IDENTITY(){return F6t()}static get ZERO(){return D6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return b7}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(C6t)}fromObject(t){return this.check()}fromQuaternion(t){return Qxe(this,t),this.check()}set(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=i,this[2]=s,this[3]=r,this[4]=a,this[5]=u,this[6]=n,this[7]=o,this[8]=c,this.check()}determinant(){return Yxe(this)}transpose(){return Kxe(this,this),this.check()}invert(){return $xe(this,this),this.check()}multiplyLeft(t){return g7(this,t,this),this.check()}multiplyRight(t){return g7(this,this,t),this.check()}rotate(t){return Xxe(this,this,t),this.check()}scale(t){return Array.isArray(t)?v7(this,this,t):v7(this,this,[t,t]),this.check()}translate(t){return Jxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=u8(r||[-0,-0],t,this);break;case 3:n=Z1(r||[-0,-0,-0],t,this);break;case 4:n=p8(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yp(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},v8,b8=null;function D6t(){return v8||(v8=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(v8)),v8}function F6t(){return b8||(b8=new Rr,Object.freeze(b8)),b8}var y8={};fa(y8,{add:()=>e3t,adjoint:()=>R6t,clone:()=>B6t,copy:()=>O6t,create:()=>k6t,decompose:()=>W6t,determinant:()=>_7,equals:()=>i3t,exactEquals:()=>n3t,frob:()=>Z6t,fromQuat:()=>D7,fromQuat2:()=>G6t,fromRotation:()=>M6t,fromRotationTranslation:()=>e1e,fromRotationTranslationScale:()=>V6t,fromRotationTranslationScaleOrigin:()=>K6t,fromScaling:()=>L6t,fromTranslation:()=>j6t,fromValues:()=>I6t,fromXRotation:()=>q6t,fromYRotation:()=>N6t,fromZRotation:()=>U6t,frustum:()=>F7,getRotation:()=>H6t,getScaling:()=>t1e,getTranslation:()=>z6t,identity:()=>Zxe,invert:()=>x7,lookAt:()=>O7,mul:()=>a3t,multiply:()=>t_,multiplyScalar:()=>t3t,multiplyScalarAndAdd:()=>r3t,ortho:()=>B7,orthoNO:()=>n1e,orthoZO:()=>J6t,perspective:()=>k7,perspectiveFromFieldOfView:()=>Y6t,perspectiveNO:()=>r1e,perspectiveZO:()=>$6t,rotate:()=>A7,rotateX:()=>S7,rotateY:()=>T7,rotateZ:()=>C7,scale:()=>E7,set:()=>P6t,str:()=>Q6t,sub:()=>o3t,subtract:()=>i1e,targetTo:()=>X6t,translate:()=>w7,transpose:()=>y7});function k6t(){let e=new Mn(16);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function B6t(e){let t=new Mn(16);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 O6t(e,t){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 I6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,b){let g=new Mn(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=p,g[13]=h,g[14]=d,g[15]=b,g}function P6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=p,e[12]=h,e[13]=d,e[14]=b,e[15]=g,e}function Zxe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function y7(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function x7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],p=t[10],h=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*g,J=E*Y-S*U+F*P+D*I-j*C+k*N;return J?(J=1/J,e[0]=(s*Y-u*U+c*P)*J,e[1]=(i*U-n*Y-a*P)*J,e[2]=(b*k-g*j+x*D)*J,e[3]=(p*j-f*k-h*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-d*k-x*S)*J,e[7]=(l*k-p*F+h*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(d*j-b*F+x*E)*J,e[11]=(f*F-l*j-h*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-d*D-g*E)*J,e[15]=(l*D-f*S+p*E)*J,e):null}function R6t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],p=t[10],h=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*g;return e[0]=s*Y-u*U+c*P,e[1]=i*U-n*Y-a*P,e[2]=b*k-g*j+x*D,e[3]=p*j-f*k-h*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-d*k-x*S,e[7]=l*k-p*F+h*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=d*j-b*F+x*E,e[11]=f*F-l*j-h*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-d*D-g*E,e[15]=l*D-f*S+p*E,e}function _7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],p=e[11],h=e[12],d=e[13],b=e[14],g=e[15],x=t*o-r*a,E=t*s-n*a,S=r*s-n*o,F=c*d-l*h,D=c*b-f*h,j=l*b-f*d,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=h*S-d*E+b*x;return u*k-i*N+g*C-p*I}function t_(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=t[9],h=t[10],d=t[11],b=t[12],g=t[13],x=t[14],E=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*p+j*g,e[2]=S*a+F*c+D*h+j*x,e[3]=S*o+F*l+D*d+j*E,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*p+j*g,e[6]=S*a+F*c+D*h+j*x,e[7]=S*o+F*l+D*d+j*E,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*p+j*g,e[10]=S*a+F*c+D*h+j*x,e[11]=S*o+F*l+D*d+j*E,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*p+j*g,e[14]=S*a+F*c+D*h+j*x,e[15]=S*o+F*l+D*d+j*E,e}function w7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,p,h,d,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],p=t[6],h=t[7],d=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=p,e[7]=h,e[8]=d,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+d*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+p*i+g*a+t[14],e[15]=c*n+h*i+x*a+t[15]),e}function E7(e,t,r){let n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function A7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,p,h,d,b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],p=t[1],h=t[2],d=t[3],b=t[4],g=t[5],x=t[6],E=t[7],S=t[8],F=t[9],D=t[10],j=t[11],k=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,I=i*a*l-o*c,P=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,J=a*o*l-i*c,re=o*o*l+u,e[0]=f*k+b*N+S*C,e[1]=p*k+g*N+F*C,e[2]=h*k+x*N+D*C,e[3]=d*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=p*I+g*P+F*U,e[6]=h*I+x*P+D*U,e[7]=d*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=p*Y+g*J+F*re,e[10]=h*Y+x*J+D*re,e[11]=d*Y+E*J+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function S7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+p*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=p*i-u*n,e}function T7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-p*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+p*i,e}function C7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],p=t[7];return t!==e&&(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[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+p*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=p*i-u*n,e}function j6t(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function L6t(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function M6t(e,t,r){let n=r[0],i=r[1],a=r[2],o=Math.sqrt(n*n+i*i+a*a),s,u,c;return o<1e-6?null:(o=1/o,n*=o,i*=o,a*=o,u=Math.sin(t),s=Math.cos(t),c=1-s,e[0]=n*n*c+s,e[1]=i*n*c+a*u,e[2]=a*n*c-i*u,e[3]=0,e[4]=n*i*c-a*u,e[5]=i*i*c+s,e[6]=a*i*c+n*u,e[7]=0,e[8]=n*a*c+i*u,e[9]=i*a*c-n*u,e[10]=a*a*c+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function q6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function U6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function e1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,p=n*c,h=i*u,d=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(h+b),e[1]=f+E,e[2]=p-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=d+g,e[7]=0,e[8]=p+x,e[9]=d-g,e[10]=1-(l+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function G6t(e,t){let r=new Mn(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=n*n+i*i+a*a+o*o;return f>0?(r[0]=(s*o+l*n+u*a-c*i)*2/f,r[1]=(u*o+l*i+c*n-s*a)*2/f,r[2]=(c*o+l*a+s*i-u*n)*2/f):(r[0]=(s*o+l*n+u*a-c*i)*2,r[1]=(u*o+l*i+c*n-s*a)*2,r[2]=(c*o+l*a+s*i-u*n)*2),e1e(e,t,r),e}function z6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function t1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(u*u+c*c+l*l),e}function H6t(e,t){let r=new Mn(3);t1e(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,p=t[8]*n,h=t[9]*i,d=t[10]*a,b=o+l+d,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(p-u)/g,e[2]=(s-c)/g):o>l&&o>d?(g=Math.sqrt(1+o-l-d)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(p+u)/g):l>d?(g=Math.sqrt(1+l-o-d)*2,e[3]=(p-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+d-o-l)*2,e[3]=(s-c)/g,e[0]=(p+u)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function W6t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],p=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+p*p);let h=1/r[0],d=1/r[1],b=1/r[2],g=i*h,x=a*d,E=o*b,S=s*h,F=u*d,D=c*b,j=l*h,k=f*d,N=p*b,C=g+F+N,I=0;return C>0?(I=Math.sqrt(C+1)*2,e[3]=.25*I,e[0]=(D-k)/I,e[1]=(j-E)/I,e[2]=(x-S)/I):g>F&&g>N?(I=Math.sqrt(1+g-F-N)*2,e[3]=(D-k)/I,e[0]=.25*I,e[1]=(x+S)/I,e[2]=(j+E)/I):F>N?(I=Math.sqrt(1+F-g-N)*2,e[3]=(j-E)/I,e[0]=(x+S)/I,e[1]=.25*I,e[2]=(D+k)/I):(I=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/I,e[0]=(j+E)/I,e[1]=(D+k)/I,e[2]=.25*I),e}function V6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,p=i*c,h=i*l,d=a*c,b=a*l,g=o*l,x=s*u,E=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(d+g))*F,e[1]=(p+S)*F,e[2]=(h-E)*F,e[3]=0,e[4]=(p-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(h+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+d))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function K6t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,p=a*c,h=a*l,d=a*f,b=o*l,g=o*f,x=s*f,E=u*c,S=u*l,F=u*f,D=n[0],j=n[1],k=n[2],N=i[0],C=i[1],I=i[2],P=(1-(b+x))*D,U=(h+F)*D,Y=(d-S)*D,J=(h-F)*j,re=(1-(p+x))*j,ee=(g+E)*j,ge=(d+S)*k,ye=(g-E)*k,he=(1-(p+b))*k;return e[0]=P,e[1]=U,e[2]=Y,e[3]=0,e[4]=J,e[5]=re,e[6]=ee,e[7]=0,e[8]=ge,e[9]=ye,e[10]=he,e[11]=0,e[12]=r[0]+N-(P*N+J*C+ge*I),e[13]=r[1]+C-(U*N+re*C+ye*I),e[14]=r[2]+I-(Y*N+ee*C+he*I),e[15]=1,e}function D7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[1]=l+x,e[2]=p-g,e[3]=0,e[4]=l-x,e[5]=1-c-d,e[6]=h+b,e[7]=0,e[8]=p+g,e[9]=h-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function F7(e,t,r,n,i,a,o){let s=1/(r-t),u=1/(i-n),c=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function r1e(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=(i+n)*o,e[14]=2*i*n*o}else e[10]=-1,e[14]=-2*n;return e}var k7=r1e;function $6t(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=i*o,e[14]=i*n*o}else e[10]=-1,e[14]=-n;return e}function Y6t(e,t,r,n){let i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((o-s)*u*.5),e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function n1e(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e}var B7=n1e;function J6t(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=a*c,e[15]=1,e}function O7(e,t,r,n){let i,a,o,s,u,c,l,f,p,h,d=t[0],b=t[1],g=t[2],x=n[0],E=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(d-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?Zxe(e):(f=d-F,p=b-D,h=g-j,i=1/Math.sqrt(f*f+p*p+h*h),f*=i,p*=i,h*=i,a=E*h-S*p,o=S*f-x*h,s=x*p-E*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=p*s-h*o,c=h*a-f*s,l=f*o-p*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*d+o*b+s*g),e[13]=-(u*d+c*b+l*g),e[14]=-(f*d+p*b+h*g),e[15]=1,e)}function X6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],p=o-r[2],h=l*l+f*f+p*p;h>0&&(h=1/Math.sqrt(h),l*=h,f*=h,p*=h);let d=u*p-c*f,b=c*l-s*p,g=s*f-u*l;return h=d*d+b*b+g*g,h>0&&(h=1/Math.sqrt(h),d*=h,b*=h,g*=h),e[0]=d,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-p*b,e[5]=p*d-l*g,e[6]=l*b-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=p,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function Q6t(e){return"mat4(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3],", ").concat(e[4],", ").concat(e[5],", ").concat(e[6],", ").concat(e[7],", ").concat(e[8],", ").concat(e[9],", ").concat(e[10],", ").concat(e[11],", ").concat(e[12],", ").concat(e[13],", ").concat(e[14],", ").concat(e[15],")")}function Z6t(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function e3t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function i1e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function t3t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function r3t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function n3t(e,t){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]}function i3t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],p=e[10],h=e[11],d=e[12],b=e[13],g=e[14],x=e[15],E=t[0],S=t[1],F=t[2],D=t[3],j=t[4],k=t[5],N=t[6],C=t[7],I=t[8],P=t[9],U=t[10],Y=t[11],J=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-S)<=1e-6*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-F)<=1e-6*Math.max(1,Math.abs(i),Math.abs(F))&&Math.abs(a-D)<=1e-6*Math.max(1,Math.abs(a),Math.abs(D))&&Math.abs(o-j)<=1e-6*Math.max(1,Math.abs(o),Math.abs(j))&&Math.abs(s-k)<=1e-6*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(u-N)<=1e-6*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(p-U)<=1e-6*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(h-Y)<=1e-6*Math.max(1,Math.abs(h),Math.abs(Y))&&Math.abs(d-J)<=1e-6*Math.max(1,Math.abs(d),Math.abs(J))&&Math.abs(b-re)<=1e-6*Math.max(1,Math.abs(b),Math.abs(re))&&Math.abs(g-ee)<=1e-6*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(x-ge)<=1e-6*Math.max(1,Math.abs(x),Math.abs(ge))}var a3t=t_,o3t=i1e;function s3t(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function a1e(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function o1e(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function s1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function u1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function c1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function l1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function f1e(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function p1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function h1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,p=c*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=l*c+h*-o+f*-u-p*-s,e[1]=f*c+h*-s+p*-o-l*-u,e[2]=p*c+h*-u+l*-s-f*-o,e[3]=t[3],e}var evr=function(){let e=s3t();return function(t,r,n,i,a,o){let s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var R7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(R7||(R7={}));var c3t=45*Math.PI/180,l3t=1,I7=.1,P7=500,f3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends vv{static get IDENTITY(){return h3t()}static get ZERO(){return p3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return R7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=p,this[12]=h,this[13]=d,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=h,this[4]=r,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=p,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(f3t)}fromObject(t){return this.check()}fromQuaternion(t){return D7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return s===1/0?d3t(this,r,n,i,a,o):F7(this,r,n,i,a,o,s),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return O7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return B7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=c3t,aspect:n=l3t,focalDistance:i=1,near:a=I7,far:o=P7}=t;d1e(r);let s=r/2,u=i*Math.tan(s),c=u*n;return this.ortho({left:-c,right:c,bottom:-u,top:u,near:a,far:o})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:a=500}=t;return d1e(r),k7(this,r,n,i,a),this.check()}determinant(){return _7(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-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],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*a,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*a,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*a,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*a,t[8]=this[10]*o,t}transpose(){return y7(this,this),this.check()}invert(){return x7(this,this),this.check()}multiplyLeft(t){return t_(this,t,this),this.check()}multiplyRight(t){return t_(this,this,t),this.check()}rotateX(t){return S7(this,this,t),this.check()}rotateY(t){return T7(this,this,t),this.check()}rotateZ(t){return C7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return A7(this,this,t,r),this.check()}scale(t){return E7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return w7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=p1e(r||[-0,-0,-0,-0],t,this),yp(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=c8(r||[-0,-0],t,this);break;case 3:i=kd(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yp(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=l8(r||[-0,-0],t,this);break;case 3:n=f8(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yp(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},x8,_8;function p3t(){return x8||(x8=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(x8)),x8}function h3t(){return _8||(_8=new Kr,Object.freeze(_8)),_8}function d1e(e){if(e>Math.PI*2)throw Error("expected radians")}function d3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,p=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}function m1e(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function g1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function j7(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function L7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function v1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function b1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function y1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function x1e(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function r_(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],p,h,d,b,g;return p=i*u+a*c+o*l+s*f,p<0&&(p=-p,u=-u,c=-c,l=-l,f=-f),1-p>1e-6?(h=Math.acos(p),g=Math.sin(h),d=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(d=1-n,b=n),e[0]=d*i+b*u,e[1]=d*a+b*c,e[2]=d*o+b*l,e[3]=d*s+b*f,e}function _1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function w1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function M7(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var E1e=a1e;var A1e=o1e,S1e=l1e,T1e=f1e,C1e=s1e;var D1e=u1e;var F1e=c1e;var k1e=function(){let e=h8(),t=d8(1,0,0),r=d8(0,1,0);return function(n,i,a){let o=Q1(i,a);return o<-.999999?(Fd(e,t,i),d7(e)<1e-6&&Fd(e,r,i),c7(e,e),j7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Fd(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,F1e(n,n))}}(),dvr=function(){let e=m1e(),t=m1e();return function(r,n,i,a,o,s){return r_(e,n,o,s),r_(t,i,a,s),r_(r,e,t,2*s*(1-s)),r}}(),mvr=function(){let e=Vxe();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],F1e(t,M7(t,e))}}();var m3t=[0,0,0,1],ds=class extends bp{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return M7(this,t),this.check()}fromAxisRotation(t,r){return j7(this,t,r),this.check()}identity(){return g1e(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}len(){return C1e(this)}lengthSquared(){return D1e(this)}dot(t){return S1e(this,t)}rotationTo(t,r){return k1e(this,t,r),this.check()}add(t){return E1e(this,this,t),this.check()}calculateW(){return x1e(this,this),this.check()}conjugate(){return w1e(this,this),this.check()}invert(){return _1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(T1e(this,t,r,n),this.check())}multiplyRight(t){return L7(this,this,t),this.check()}multiplyLeft(t){return L7(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return v1e(this,this,t),this.check()}rotateY(t){return b1e(this,this,t),this.check()}rotateZ(t){return y1e(this,this,t),this.check()}scale(t){return A1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=m3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return r_(this,i,a,o),this.check()}transformVector4(t,r=new hs){return h1e(r,t,this),yp(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var pu={};fa(pu,{EPSILON1:()=>g3t,EPSILON10:()=>S3t,EPSILON11:()=>T3t,EPSILON12:()=>C3t,EPSILON13:()=>D3t,EPSILON14:()=>F3t,EPSILON15:()=>k3t,EPSILON16:()=>B3t,EPSILON17:()=>O3t,EPSILON18:()=>I3t,EPSILON19:()=>P3t,EPSILON2:()=>v3t,EPSILON20:()=>R3t,EPSILON3:()=>b3t,EPSILON4:()=>y3t,EPSILON5:()=>x3t,EPSILON6:()=>_3t,EPSILON7:()=>w3t,EPSILON8:()=>E3t,EPSILON9:()=>A3t,PI_OVER_FOUR:()=>L3t,PI_OVER_SIX:()=>M3t,PI_OVER_TWO:()=>j3t,TWO_PI:()=>q3t});var g3t=.1,v3t=.01,b3t=.001,y3t=1e-4,x3t=1e-5,_3t=1e-6,w3t=1e-7,E3t=1e-8,A3t=1e-9,S3t=1e-10,T3t=1e-11,C3t=1e-12,D3t=1e-13,F3t=1e-14,k3t=1e-15,B3t=1e-16,O3t=1e-17,I3t=1e-18,P3t=1e-19,R3t=1e-20,j3t=Math.PI/2,L3t=Math.PI/4,M3t=Math.PI/6,q3t=Math.PI*2;var Dl=6356752314245179e-9,N3t={radii:[6378137,6378137,Dl],radiiSquared:[6378137*6378137,6378137*6378137,Dl*Dl],oneOverRadii:[1/6378137,1/6378137,1/Dl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dl*Dl)],maximumRadius:Math.max(6378137,6378137,Dl),centerToleranceSquared:.1};function w8(e){return e}var Vvr=new ce;function U3t(e,t=[],r=w8){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function B1e(e,t=[]){return U3t(e,t,Sn._cartographicRadians?w8:a7)}function G3t(e,t,r=w8){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function O1e(e,t){return G3t(e,t,Sn._cartographicRadians?w8:o7)}var I1e=1e-14,z3t=new ce,P1e={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"}},q7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},n_={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},H3t=new ce,W3t=new ce,V3t=new ce;function N7(e,t,r,n,i,a){let o=P1e[t]&&P1e[t][r];aa(o&&(!n||n===o));let s,u,c,l=z3t.copy(i);if(Oo(l.x,0,I1e)&&Oo(l.y,0,I1e)){let p=Math.sign(l.z);s=H3t.fromArray(q7[t]),t!=="east"&&t!=="west"&&s.scale(p),u=W3t.fromArray(q7[r]),r!=="east"&&r!=="west"&&u.scale(p),c=V3t.fromArray(q7[n]),n!=="east"&&n!=="west"&&c.scale(p)}else{let{up:p,east:h,north:d}=n_;h.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),d.copy(p).cross(h);let{down:b,west:g,south:x}=n_;b.copy(p).scale(-1),g.copy(h).scale(-1),x.copy(d).scale(-1),s=n_[t],u=n_[r],c=n_[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=c.x,a[9]=c.y,a[10]=c.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var bv=new ce,K3t=new ce,$3t=new ce;function R1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;bv.from(e);let o=bv.x,s=bv.y,u=bv.z,c=n.x,l=n.y,f=n.z,p=o*o*c*c,h=s*s*l*l,d=u*u*f*f,b=p+h+d,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=K3t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=$3t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*bv.len()/(.5*D.len()),k=0,N,C,I,P;do{j-=k,N=1/(1+j*E),C=1/(1+j*S),I=1/(1+j*F);let U=N*N,Y=C*C,J=I*I,re=U*N,ee=Y*C,ge=J*I;P=p*U+h*Y+d*J-1;let he=-2*(p*re*E+h*ee*S+d*ge*F);k=P/he}while(Math.abs(P)>pu.EPSILON12);return bv.scale([N,C,I]).to(r)}var E8=new ce,j1e=new ce,X3t=new ce,hu=new ce,Q3t=new ce,A8=new ce,or=class{constructor(t=0,r=0,n=0){zt(this,"radii",void 0),zt(this,"radiiSquared",void 0),zt(this,"radiiToTheFourth",void 0),zt(this,"oneOverRadii",void 0),zt(this,"oneOverRadiiSquared",void 0),zt(this,"minimumRadius",void 0),zt(this,"maximumRadius",void 0),zt(this,"centerToleranceSquared",pu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),aa(t>=0),aa(r>=0),aa(n>=0),this.radii=new ce(t,r,n),this.radiiSquared=new ce(t*t,r*r,n*n),this.radiiToTheFourth=new ce(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new ce(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new ce(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=j1e,i=X3t,[,,a]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);let o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(a),i.add(n),i.to(r)}cartesianToCartographic(t,r=[0,0,0]){A8.from(t);let n=this.scaleToGeodeticSurface(A8,hu);if(!n)return;let i=this.geodeticSurfaceNormal(n,j1e),a=Q3t;a.copy(A8).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(gv.dot(a,A8))*gv.length(a);return O1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return N7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return N7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return E8.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=B1e(t),i=n[0],a=n[1],o=Math.cos(a);return E8.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),E8.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return E8.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return R1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){hu.from(t);let n=hu.x,i=hu.y,a=hu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return hu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){aa(Oo(this.radii.x,this.radii.y,pu.EPSILON15)),aa(this.radii.z>0),hu.from(t);let i=hu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return hu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Dl));var oa={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var hbr=new ce,dbr=new ce;var i_=new ce,L1e=new ce,Ja=class{constructor(t=[0,0,0],r=0){zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new ce,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=i_.from(r),this.center=new ce().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Ja(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=i_.copy(i).subtract(r),s=o.magnitude();if(n>=s+a)return this.clone();if(a>=s+n)return t.clone();let u=(n+s+a)*.5;return L1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(L1e),this.radius=u,this}expand(t){let n=i_.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=y8.getScaling(i_,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=i_.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,a=t.normal.dot(r)+t.distance;return a<-n?oa.OUTSIDE:a<n?oa.INTERSECTING:oa.INSIDE}};var Z3t=new ce,eCt=new ce,S8=new ce,T8=new ce,C8=new ce,tCt=new ce,rCt=new ce,Fl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},sa=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=new ce().from(t),this.halfAxes=new Rr(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new ce(t).len(),new ce(r).len(),new ce(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new ce(t).normalize(),a=new ce(r).normalize(),o=new ce(n).normalize();return new ds().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new ds(n),a=new Rr().fromQuaternion(i);return a[0]=a[0]*r[0],a[1]=a[1]*r[0],a[2]=a[2]*r[0],a[3]=a[3]*r[1],a[4]=a[4]*r[1],a[5]=a[5]*r[1],a[6]=a[6]*r[2],a[7]=a[7]*r[2],a[8]=a[8]*r[2],this.center=new ce().from(t),this.halfAxes=a,this}clone(){return new sa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ja){let r=this.halfAxes,n=r.getColumn(0,S8),i=r.getColumn(1,T8),a=r.getColumn(2,C8),o=Z3t.copy(n).add(i).add(a);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,i=this.halfAxes,a=n.x,o=n.y,s=n.z,u=Math.abs(a*i[Fl.COLUMN0ROW0]+o*i[Fl.COLUMN0ROW1]+s*i[Fl.COLUMN0ROW2])+Math.abs(a*i[Fl.COLUMN1ROW0]+o*i[Fl.COLUMN1ROW1]+s*i[Fl.COLUMN1ROW2])+Math.abs(a*i[Fl.COLUMN2ROW0]+o*i[Fl.COLUMN2ROW1]+s*i[Fl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?oa.OUTSIDE:c>=u?oa.INSIDE:oa.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=eCt.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,S8),a=n.getColumn(1,T8),o=n.getColumn(2,C8),s=i.magnitude(),u=a.magnitude(),c=o.magnitude();i.normalize(),a.normalize(),o.normalize();let l=0,f;return f=Math.abs(r.dot(i))-s,f>0&&(l+=f*f),f=Math.abs(r.dot(a))-u,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),l}computePlaneDistances(t,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=this.center,s=this.halfAxes,u=s.getColumn(0,S8),c=s.getColumn(1,T8),l=s.getColumn(2,C8),f=tCt.copy(u).add(c).add(l).add(o),p=rCt.copy(f).subtract(t),h=r.dot(p);return i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,S8);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,T8);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,C8);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var M1e=new ce,q1e=new ce,kl=class{constructor(t=[0,0,1],r=0){zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new ce,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return aa(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=M1e.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,i){return this.normal.set(t,r,n),aa(Oo(this.normal.len(),1)),this.distance=i,this}clone(){return new kl(this.normal,this.distance)}equals(t){return Oo(this.distance,t.distance)&&Oo(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=q1e.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=M1e.from(t),i=this.getPointDistance(n),a=q1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var N1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],U1e=new ce,nCt=new ce,ms=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*N1e.length;let r=t.center,n=t.radius,i=0;for(let a of N1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new kl),s||(s=this.planes[i+1]=new kl);let u=U1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=U1e.copy(a).scale(n).add(r),l=nCt.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=oa.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case oa.OUTSIDE:return oa.OUTSIDE;case oa.INTERSECTING:r=oa.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(aa(Number.isFinite(r),"parentPlaneMask is required."),r===ms.MASK_OUTSIDE||r===ms.MASK_INSIDE)return r;let n=ms.MASK_INSIDE,i=this.planes;for(let a=0;a<this.planes.length;++a){let o=a<31?1<<a:0;if(a<31&&!(r&o))continue;let s=i[a],u=t.intersectPlane(s);if(u===oa.OUTSIDE)return ms.MASK_OUTSIDE;u===oa.INTERSECTING&&(n|=o)}return n}};zt(ms,"MASK_OUTSIDE",4294967295);zt(ms,"MASK_INSIDE",0);zt(ms,"MASK_INDETERMINATE",2147483647);var Lbr=new ce,Mbr=new ce,qbr=new ce,Nbr=new ce,Ubr=new ce;var aCt=new ce,oCt=new ce,sCt=new ce,uCt=new ce,cCt=new ce,lCt=new ce,fCt=new ce,yv=new ce,pCt=new ce,hCt=new ce,dCt=new ce,mCt=new ce;function U7(e,t=new Ja){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=fCt.copy(e[0]),n=aCt.copy(r),i=oCt.copy(r),a=sCt.copy(r),o=uCt.copy(r),s=cCt.copy(r),u=lCt.copy(r);for(let j of e){r.copy(j);let k=r.x,N=r.y,C=r.z;k<n.x&&n.copy(r),k>o.x&&o.copy(r),N<i.y&&i.copy(r),N>s.y&&s.copy(r),C<a.z&&a.copy(r),C>u.z&&u.copy(r)}let c=yv.copy(o).subtract(n).magnitudeSquared(),l=yv.copy(s).subtract(i).magnitudeSquared(),f=yv.copy(u).subtract(a).magnitudeSquared(),p=n,h=o,d=c;l>d&&(d=l,p=i,h=s),f>d&&(d=f,p=a,h=u);let b=pCt;b.x=(p.x+h.x)*.5,b.y=(p.y+h.y)*.5,b.z=(p.z+h.z)*.5;let g=yv.copy(h).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=hCt;E.x=n.x,E.y=i.y,E.z=a.z;let S=dCt;S.x=o.x,S.y=s.y,S.z=u.z;let F=mCt.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=yv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=yv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let I=C-x;b.x=(x*b.x+I*r.x)/C,b.y=(x*b.y+I*r.y)/C,b.z=(x*b.z+I*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var yc=new Rr,gCt=new Rr,vCt=new Rr,D8=new Rr,G1e=new Rr;function H7(e,t={}){let r=pu.EPSILON20,n=10,i=0,a=0,o=gCt,s=vCt;o.identity(),s.copy(e);let u=r*bCt(s);for(;a<n&&yCt(s)>u;)xCt(s,D8),G1e.copy(D8).transpose(),s.multiplyRight(D8),s.multiplyLeft(G1e),o.multiplyRight(D8),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function bCt(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var G7=[1,0,0],z7=[2,2,1];function yCt(e){let t=0;for(let r=0;r<3;++r){let n=e[yc.getElementIndex(z7[r],G7[r])];t+=2*n*n}return Math.sqrt(t)}function xCt(e,t){let r=pu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[yc.getElementIndex(z7[c],G7[c])]);l>n&&(i=c,n=l)}let a=G7[i],o=z7[i],s=1,u=0;if(Math.abs(e[yc.getElementIndex(o,a)])>r){let c=e[yc.getElementIndex(o,o)],l=e[yc.getElementIndex(a,a)],f=e[yc.getElementIndex(o,a)],p=(c-l)/2/f,h;p<0?h=-1/(-p+Math.sqrt(1+p*p)):h=1/(p+Math.sqrt(1+p*p)),s=1/Math.sqrt(1+h*h),u=h*s}return Rr.IDENTITY.to(t),t[yc.getElementIndex(a,a)]=t[yc.getElementIndex(o,o)]=s,t[yc.getElementIndex(o,a)]=u,t[yc.getElementIndex(a,o)]=-u,t}var _p=new ce,wCt=new ce,ECt=new ce,ACt=new ce,SCt=new ce,TCt=new Rr,CCt={diagonal:new Rr,unitary:new Rr};function a_(e,t=new sa){if(!e||e.length===0)return t.halfAxes=new Rr([0,0,0,0,0,0,0,0,0]),t.center=new ce,t;let r=e.length,n=new ce(0,0,0);for(let C of e)n.add(C);let i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,u=0,c=0,l=0;for(let C of e){let I=_p.copy(C).subtract(n);a+=I.x*I.x,o+=I.x*I.y,s+=I.x*I.z,u+=I.y*I.y,c+=I.y*I.z,l+=I.z*I.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=TCt;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:p}=H7(f,CCt),h=t.halfAxes.copy(p),d=h.getColumn(0,ECt),b=h.getColumn(1,ACt),g=h.getColumn(2,SCt),x=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)_p.copy(C),x=Math.max(_p.dot(d),x),E=Math.max(_p.dot(b),E),S=Math.max(_p.dot(g),S),F=Math.min(_p.dot(d),F),D=Math.min(_p.dot(b),D),j=Math.min(_p.dot(g),j);d=d.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(d).add(b).add(g);let k=wCt.set(x-F,E-D,S-j).multiplyByScalar(.5),N=new Rr([k[0],0,0,0,k[1],0,0,0,k[2]]);return t.halfAxes.multiplyRight(N),t}function V1e(e){return e!=null}var xyr=new ce,DCt=new ce,FCt=new ce,kCt=new ce,Bd=new ce,z1e=new ce,H1e=new ce,W1e=new ce;function F8(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return K1e(e.box,t,r);if(e.region)return OCt(e.region);if(e.sphere)return BCt(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function K1e(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(e.length===10){let c=e.slice(3,6),l=new ds;l.fromArray(e,6);let f=new ce([1,0,0]),p=new ce([0,1,0]),h=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),p.transformByQuaternion(l),p.scale(c[1]),h.transformByQuaternion(l),h.scale(c[2]),i=[...f.toArray(),...p.toArray(),...h.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),u=new Rr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return V1e(r)?(r.center=n,r.halfAxes=u,r):new sa(n,u)}function BCt(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(DCt),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return V1e(r)?(r.center=n,r.radius=o,r):new Ja(n,o)}function OCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Cl(t),Cl(i),a],FCt),u=or.WGS84.cartographicToCartesian([Cl(n),Cl(r),o],kCt),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Bd),or.WGS84.cartographicToCartesian([Cl(n),Bd[1],Bd[2]],z1e),or.WGS84.cartographicToCartesian([Bd[0],Cl(i),Bd[2]],H1e),or.WGS84.cartographicToCartesian([Bd[0],Bd[1],o],W1e),K1e([...c,...z1e.subtract(c),...H1e.subtract(c),...W1e.subtract(c)],new Kr)}var xv="4.0.5";var gs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Syr=Object.keys(gs),wp={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function W7(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function $1e(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var k8="4.0.5";var ICt={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Y1e={name:"Draco",id:"draco",module:"draco",version:k8,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:ICt};function X1e(e,t,r){let n=Q1e(t.metadata),i=[],a=PCt(t.attributes);for(let o in e){let s=e[o],u=J1e(o,s,a[o]);i.push(u)}if(r){let o=J1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function PCt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function J1e(e,t,r){let n=r?Q1e(r.metadata):void 0;return n7(e,t,n)}function Q1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Z1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},RCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},jCt=4,o_=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=r7(u.attributes),l=X1e(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:c},...u,schema:l}}finally{this.draco.destroy(n),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:a}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let a=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[a.unique_id()]={unique_id:a.unique_id(),attribute_type:a.attribute_type(),data_type:a.data_type(),num_components:a.num_components(),byte_offset:a.byte_offset(),byte_stride:a.byte_stride(),normalized:a.normalized(),attribute_index:i,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(n[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(n[a.unique_id()].octahedron_transform=u)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,n);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);i[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return i}_getTriangleListIndices(t){let n=t.num_faces()*3,i=n*jCt,a=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,a),new Uint32Array(this.draco.HEAPF32.buffer,a,n).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),qCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=RCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=LCt(this.draco,n),c,l=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,l),c=new n(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===n)return o;let i=t.attribute_type;for(let o in Z1e)if(this.draco[o]===i)return Z1e[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let a=this.metadataQuerier.GetEntryName(t,i);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=MCt(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let a of i)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(s=>o.min_value(s))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function LCt(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function MCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function qCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var NCt="1.5.6",UCt="1.4.1",V7=`https://www.gstatic.com/draco/versioned/decoders/${NCt}`,ai={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Ep={[ai.DECODER]:`${V7}/${ai.DECODER}`,[ai.DECODER_WASM]:`${V7}/${ai.DECODER_WASM}`,[ai.FALLBACK_DECODER]:`${V7}/${ai.FALLBACK_DECODER}`,[ai.ENCODER]:`https://raw.githubusercontent.com/google/draco/${UCt}/javascript/${ai.ENCODER}`},s_;async function e_e(e){let t=e.modules||{};return t.draco3d?s_=s_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):s_=s_||GCt(e),await s_}async function GCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Zu(Ep[ai.FALLBACK_DECODER],"draco",e,ai.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Zu(Ep[ai.DECODER],"draco",e,ai.DECODER),await Zu(Ep[ai.DECODER_WASM],"draco",e,ai.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await zCt(t,r)}function zCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var K7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:k8,worker:!0,options:{draco:{},source:null}};var _v={...Y1e,parse:HCt};async function HCt(e,t){let{draco:r}=await e_e(t),n=new o_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var WCt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ht={...WCt,...bi};var $7={[bi.DOUBLE]:Float64Array,[bi.FLOAT]:Float32Array,[bi.UNSIGNED_SHORT]:Uint16Array,[bi.UNSIGNED_INT]:Uint32Array,[bi.UNSIGNED_BYTE]:Uint8Array,[bi.BYTE]:Int8Array,[bi.SHORT]:Int16Array,[bi.INT]:Int32Array},VCt={DOUBLE:bi.DOUBLE,FLOAT:bi.FLOAT,UNSIGNED_SHORT:bi.UNSIGNED_SHORT,UNSIGNED_INT:bi.UNSIGNED_INT,UNSIGNED_BYTE:bi.UNSIGNED_BYTE,BYTE:bi.BYTE,SHORT:bi.SHORT,INT:bi.INT},Y7="Failed to convert GL type",qa=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in $7)if($7[r]===t)return r;throw new Error(Y7)}static fromName(t){let r=VCt[t];if(!r)throw new Error(Y7);return r}static getArrayType(t){switch(t){case bi.UNSIGNED_SHORT_5_6_5:case bi.UNSIGNED_SHORT_4_4_4_4:case bi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=$7[t];if(!r)throw new Error(Y7);return r}}static getByteSize(t){return qa.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(qa.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/qa.getByteSize(t));let a=qa.getArrayType(t);return new a(r,n,i)}};function t_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function J7(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Zyr=1/256;var exr=new Dd,txr=new ce,rxr=new Dd,nxr=new Dd,ixr=new Uint8Array(1);function r_e(e,t=255){return s7(e,0,t)/t*2-1}function n_e(e){return e<0?-1:1}function i_e(e,t,r,n){if(t_e(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=r_e(e,r),n.y=r_e(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*n_e(i),n.y=(1-Math.abs(i))*n_e(n.y)}return n.normalize()}function X7(e,t,r){return i_e(e,t,255,r)}function Od(e){return(e%1+1)%1}var Bl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Ht.UNSIGNED_INT,n=1){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,i.byteOffset):i}getPropertyArray(t,r,n){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=qa.fromName(i.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,r,i)}getProperty(t,r,n,i,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,n);if(n===1)return s[i];for(let u=0;u<n;++u)a[u]=s[n*i+u];return a}_getTypedArrayFromBinary(t,r,n,i,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=qa.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,i*n),o[t]=s),s}_getTypedArrayFromArray(t,r,n){let i=this._cachedTypedArrays,a=i[t];return a||(a=qa.createTypedArray(r,n),i[t]=a),a}};var KCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$Ct={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},YCt={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function a_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?qa.fromName(i):i,o=KCt[e.type],s=$Ct[e.type],u=YCt[e.type];return r+=e.byteOffset,{values:qa.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var xc=e=>e!==void 0;function o_e(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?JCt(n,r):null}function JCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;xc(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(xc(u))for(xc(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),l=0,r=0;r<a;++r)f[r]=l,l+=u[r];xc(c)&&xc(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let p=o.length;for(r=0;r<p;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let h=new Array(p).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],d[r]=h[n],++h[n];let b={classes:o,classIds:s,classIndexes:d,parentCounts:u,parentIndexes:f,parentIds:c};return ZCt(b),b}function wv(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?XCt(e,t,r):QCt(e,t,r)}function XCt(e,t,r){let n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);let c=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;){if(t=l.pop(),u[t]===c)continue;u[t]=c;let f=r(e,t);if(xc(f))return f;let p=i[t],h=o[t];for(let d=0;d<p;++d){let b=a[h+d];b!==t&&l.push(b)}}return null}function QCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(xc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function ZCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)s_e(e,i,stack)}function s_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!xc(i))return;assert(t<s,`Parent index ${t} exceeds the total number of instances: ${s}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let u=xc(n)?n[t]:1,c=xc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&s_e(e,f,r)}r.pop(t)}function mo(e){return e!=null}var B8=(e,t)=>e,e8t={HIERARCHY:!0,extensions:!0,extras:!0},Id=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Qt(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)e8t[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=o_e(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._hierarchy){let n=wv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return mo(n)}return!1}isExactClass(t,r){return Qt(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),Qt(typeof r=="string",r),mo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=mo(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(mo(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(mo(n))return B8(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(mo(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let a=this._properties[r];mo(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=B8(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(t=t||{},t[r]=i)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;Qt(this.binary,`Property ${t} requires a batch table binary.`),Qt(n.type,`Property ${t} requires a type.`);let i=a_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=wv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return mo(s[r])});return mo(n)}_getPropertyNamesInHierarchy(t,r){wv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return wv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return mo(u)?mo(u.typedArray)?this._getBinaryProperty(u,s):B8(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=wv(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return mo(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),mo(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=B8(i,!0),!0):!1});return mo(a)}};var Q7=4;function Ap(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=Q7,e.version=n.getUint32(r,!0),r+=Q7,e.byteLength=n.getUint32(r,!0),r+=Q7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Ev=4,u_e="b3dm tile in legacy format.";function Av(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=Ev;let o=n.getUint32(r,!0);r+=Ev;let s=n.getUint32(r,!0);r+=Ev;let u=n.getUint32(r,!0);return r+=Ev,s>=570425344?(r-=Ev*2,i=a,s=o,u=0,a=0,o=0,console.warn(u_e)):u>=570425344&&(r-=Ev,i=s,s=a,u=o,a=0,o=0,console.warn(u_e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Sv(e,t,r,n){return r=t8t(e,t,r,n),r=r8t(e,t,r,n),r}function t8t(e,t,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let s=W7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function r8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=W7(t,r,i);e.batchTableJson=JSON.parse(o),r+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function Z7(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:a=0}=e;if(n&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=n[s],l=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&i){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=J7(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ht.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var c_e=new ce;function l_e(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)X7(t[n*2],t[n*2+1],c_e),c_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function f_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,n8t(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function n8t(e,t){let r=new ce,n=new Float32Array(e.pointCount*3);for(let i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}async function p_e(e,t,r,n,i){r=Ap(e,t,r),r=Av(e,t,r),r=Sv(e,t,r,n),i8t(e);let{featureTable:a,batchTable:o}=a8t(e);return await l8t(e,a,o,n,i),o8t(e,a,n),s8t(e,a,o),u8t(e,a),r}function i8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function a8t(e){let t=new Bl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let n=c8t(e,t);return{featureTable:t,batchTable:n}}function o8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ht.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=f_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function s8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",Ht.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Ht.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Ht.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Z7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function u8t(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Ht.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Ht.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=l_e(e,r)}}function c8t(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ht.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:a}=e;r=new Id(i,a,n)}return r}async function l8t(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,p=c.byteLength;if(!o||!Number.isFinite(f)||!p)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+p),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await f8t(e,l,n,i)}async function f8t(e,t,r,n){if(!n)return;let i={...r,draco:{...r==null?void 0:r.draco,extraAttributes:t.batchTableProperties||{}}};delete i["3d-tiles"];let a=await To(t.buffer,_v,i,n),o=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,u=a.attributes.NORMAL&&a.attributes.NORMAL.value,c=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=o&&a.attributes.POSITION.value.quantization,f=u&&a.attributes.NORMAL.value.quantization;if(l){let h=a.POSITION.data.quantization,d=h.range;e.quantizedVolumeScale=new ce(d,d,d),e.quantizedVolumeOffset=new ce(h.minValues),e.quantizedRange=(1<<h.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let p={};if(t.batchTableProperties)for(let h of Object.keys(t.batchTableProperties))a.attributes[h]&&a.attributes[h].value&&(p[h.toLowerCase()]=a.attributes[h].value);e.attributes={positions:o,colors:Z7(e,s,void 0),normals:u,batchIds:c,...p}}var uq={};fa(uq,{decode:()=>J8t,name:()=>G8});var O8="4.0.5";var h_e,p8t=(h_e=globalThis.loaders)==null?void 0:h_e.parseImageNode,eq=typeof Image<"u",tq=typeof ImageBitmap<"u",h8t=Boolean(p8t),rq=gn?!0:h8t;function d_e(e){switch(e){case"auto":return tq||eq||rq;case"imagebitmap":return tq;case"image":return eq;case"data":return rq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function m_e(){if(tq)return"imagebitmap";if(eq)return"image";if(rq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function g_e(e){let t=d8t(e);if(!t)throw new Error("Not an image");return t}function nq(e){return Tv(e)}function Tv(e){switch(g_e(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function d8t(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var m8t=/^data:image\/svg\+xml/,g8t=/\.svg((\?|#).*)?$/;function I8(e){return e&&(m8t.test(e)||g8t.test(e))}function v_e(e,t){if(I8(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return iq(e,t)}function iq(e,t){if(I8(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function P8(e,t,r){let n=v_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await v8t(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function v8t(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=a=>{let o=a instanceof Error?a.message:"error";i(new Error(o))}}catch(a){i(a)}})}var b8t={},b_e=!0;async function y_e(e,t,r){let n;I8(r)?n=await P8(e,t,r):n=iq(e,r);let i=t&&t.imagebitmap;return await y8t(n,i)}async function y8t(e,t=null){if((x8t(t)||!b_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),b_e=!1}return await createImageBitmap(e)}function x8t(e){for(let t in e||b8t)return!1;return!0}function x_e(e){return!A8t(e,"ftyp",4)||!(e[8]&96)?null:_8t(e)}function _8t(e){switch(w8t(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function w8t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function E8t(e){return[...e].map(t=>t.charCodeAt(0))}function A8t(e,t,r=0){let n=E8t(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var _c=!1,u_=!0;function Pd(e){let t=c_(e);return T8t(t)||F8t(t)||C8t(t)||D8t(t)||S8t(t)}function S8t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=x_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function T8t(e){let t=c_(e);return t.byteLength>=24&&t.getUint32(0,_c)===2303741511?{mimeType:"image/png",width:t.getUint32(16,_c),height:t.getUint32(20,_c)}:null}function C8t(e){let t=c_(e);return t.byteLength>=10&&t.getUint32(0,_c)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,u_),height:t.getUint16(8,u_)}:null}function D8t(e){let t=c_(e);return t.byteLength>=14&&t.getUint16(0,_c)===16973&&t.getUint32(2,u_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,u_),height:t.getUint32(22,u_)}:null}function F8t(e){let t=c_(e);if(!(t.byteLength>=3&&t.getUint16(0,_c)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=k8t(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,_c);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,_c),width:t.getUint16(a+7,_c)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,_c)}return null}function k8t(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function c_(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function __e(e,t){var i;let{mimeType:r}=Pd(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function w_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=B8t(i),s;switch(o){case"imagebitmap":s=await y_e(e,t,a);break;case"image":s=await P8(e,t,a);break;case"data":s=await __e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Tv(s)),s}function B8t(e){switch(e){case"auto":case"data":return m_e();default:return d_e(e),e}}var O8t=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],I8t=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],P8t={image:{type:"auto",decode:!0}},Cv={id:"image",module:"images",name:"Images",version:O8,mimeTypes:I8t,extensions:O8t,parse:w_e,tests:[e=>Boolean(Pd(new DataView(e)))],options:P8t};var S_e,E_e=(S_e=globalThis.loaders)==null?void 0:S_e.encodeImageNode;async function T_e(e,t){return t=t||{},t.image=t.image||{},E_e?E_e(e,{type:t.image.mimeType}):R8t(e,t)}var A_e=!0;async function R8t(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=nq(e),o=document.createElement("canvas");o.width=i,o.height=a,j8t(e,o);let s=await new Promise(u=>{if(n&&A_e)try{o.toBlob(u,r,n);return}catch{A_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function j8t(e,t,r=0,n=0){if(r===0&&n===0&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let i=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return i.putImageData(o,0,0),t}return i.drawImage(e,0,0),t}var aq={name:"Images",id:"image",module:"images",version:O8,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:T_e};var oq={};function sq(e){if(oq[e]===void 0){let t=gn?M8t(e):L8t(e);oq[e]=t}return oq[e]}function L8t(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=((i=globalThis.loaders)==null?void 0:i.imageFormatsNode)||t,n=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return Boolean(n)&&r.includes(e)}function M8t(e){switch(e){case"image/avif":case"image/webp":return q8t(e);default:return!0}}function q8t(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ui(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var R8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var N8t=1.33,C_e=["SCALAR","VEC2","VEC3","VEC4"],U8t=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],G8t=new Map(U8t),z8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H8t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},W8t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function L8(e){return C_e[e-1]||C_e[0]}function Dv(e){let t=G8t.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Fv(e,t){let r=W8t[e.componentType],n=z8t[e.type],i=H8t[e.componentType],a=e.count*n,o=e.count*n*i;Ui(o>=0&&o<=t.byteLength);let s=j8[e.componentType],u=R8[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function l_(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(o=>o.bufferView);r=r.filter(o=>!n.includes(o));let i=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:c}=s.image;return o+u*c},0);return i+Math.ceil(4*a*N8t)}function D_e(e,t,r){let n=e.bufferViews[r];Ui(n);let i=n.buffer,a=t[i];Ui(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function F_e(e,t,r){var b,g;let n=typeof r=="number"?(b=e.accessors)==null?void 0:b[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let i=(g=e.bufferViews)==null?void 0:g[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:u,length:c,componentByteSize:l,numberOfComponentsInElement:f}=Fv(n,i),p=l*f,h=i.byteStride||p;if(typeof i.byteStride>"u"||i.byteStride===p)return new u(a,s,c);let d=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*h,f);d.set(E,x*f)}return d}function V8t(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var qr=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:(t==null?void 0:t.json)||V8t(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.getRequiredExtensions().find(i=>i===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];Ui(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return F_e(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),i=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(i,a,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let i=t.extensions||{};i[r]=n}removeObjectExtension(t,r){let n=(t==null?void 0:t.extensions)||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(t,r={}){return Ui(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ui(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)!=null&&r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:i,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(n){let u=this._addIndices(n);s.primitives[0].indices=u}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Pd(t),i=r||(n==null?void 0:n.mimeType),o={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let i=t.byteLength;Ui(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Do(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:L8(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:Dv(t),count:Math.round(t.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var a,o;this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;for(let s of this.sourceBuffers||[])i=HI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};var k_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},K8t={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},B_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function f_(e,t){return B_e[t]*k_e[e]}function kv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=Bv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function Bv(e,t,r,n=1){let i=k_e[t],a=K8t[r],o=B_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Ov(e,t,r){var c,l,f,p,h;let n=`TEXCOORD_${t.texCoord||0}`,i=r.attributes[n],a=e.getTypedArrayForAccessor(i),o=e.gltf.json,s=t.index,u=(l=(c=o.textures)==null?void 0:c[s])==null?void 0:l.source;if(typeof u<"u"){let d=(p=(f=o.images)==null?void 0:f[u])==null?void 0:p.mimeType,b=(h=e.gltf.images)==null?void 0:h[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=$8t(b,d,a,x,t.channels);g.push(E)}return g}}return[]}function M8(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(p=>p===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Dv(o),count:o.length});i.attributes[t]=c}function $8t(e,t,r,n,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],s=r[n+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let c=Y8t(o,s,e,u),l=0;for(let f of i){let p=typeof f=="number"?Object.values(a)[f]:a[f],h=c+p.offset,d=Tv(e);if(d.data.length<=h)throw new Error(`${d.data.length} <= ${h}`);let b=d.data[h];l|=b<<p.shift}return l}function Y8t(e,t,r,n=1){let i=r.width,a=Od(e)*(i-1),o=Math.round(a),s=r.height,u=Od(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function q8(e,t,r,n,i){let a=[];for(let o=0;o<t;o++){let s=r[o],u=r[o+1]-r[o];if(u+s>n)break;let c=s/i,l=u/i;a.push(e.slice(c,c+l))}return a}function N8(e,t,r){let n=[];for(let i=0;i<t;i++){let a=i*r;n.push(e.slice(a,a+r))}return n}function U8(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],a=new TextDecoder("utf8"),o=0;for(let s=0;s<e;s++){let u=n[s+1]-n[s];if(u+o<=t.length){let c=t.subarray(o,u+o),l=a.decode(c);i.push(l),o+=u}}return i}return[]}var O_e="EXT_mesh_features",G8=O_e;async function J8t(e,t){let r=new qr(e);X8t(r,t)}function X8t(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)Q8t(e,i,t)}function Q8t(e,t,r){var a,o,s;if(!((a=r==null?void 0:r.gltf)!=null&&a.loadBuffers))return;let n=(o=t.extensions)==null?void 0:o[O_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Ov(e,u.texture,t):c=[];u.data=c}}var fq={};fa(fq,{decode:()=>Z8t,name:()=>Ol});var cq="EXT_structural_metadata",Ol=cq;async function Z8t(e,t){let r=new qr(e);eDt(r,t)}function eDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(cq);r&&((i=t.gltf)!=null&&i.loadImages&&tDt(e,r),rDt(e,r))}function tDt(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let a of i.primitives)iDt(e,r,a,t)}function rDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.propertyTables;if(n&&i)for(let a in n){let o=nDt(i,a);o&&oDt(e,r,o)}}function nDt(e,t){for(let r of e)if(r.class===t)return r;return null}function iDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[cq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];aDt(e,u,r,n)}}function aDt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Ov(e,u,r);l!==null&&(M8(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function oDt(e,t,r){var a,o;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=sDt(e,t,u,i,c);c.data=l}}}function sDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=uDt(e,r,i,n),c=cDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=lDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=U8(n,s,u,c);break}case"ENUM":{a=fDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function uDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?kv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function cDt(e,t,r){return typeof t.stringOffsets<"u"?kv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function lDt(e,t,r,n){let i=e.array,a=e.count,o=f_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=Bv(r,e.type,e.componentType,s):u=r,i?n?q8(u,t,n,r.length,o):a?N8(u,t,a):[]:u}function fDt(e,t,r,n,i){var f;let a=t.enumType;if(!a)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=(f=e.enums)==null?void 0:f[a];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||"UINT16",u=f_(t.type,s),c=n.byteLength/u,l=Bv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return pDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let p=t.count;return p?hDt(l,r,p,o):[]}return lq(l,0,r,o)}function pDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,p=l/a,h=lq(t,f,p,o);s.push(h)}return s}function hDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=lq(e,o,r,n);i.push(s)}return i}function lq(e,t,r,n){let i=[];for(let a=0;a<r;a++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)i.push("");else{let o=e[t+a],s=dDt(n,o);s?i.push(s.name):i.push("")}return i}function dDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var pq={};fa(pq,{decode:()=>mDt,name:()=>vs});var I_e="EXT_feature_metadata",vs=I_e;async function mDt(e,t){let r=new qr(e);gDt(r,t)}function gDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(I_e);r&&((i=t.gltf)!=null&&i.loadImages&&vDt(e,r),bDt(e,r))}function vDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:i}=t;if(n&&i)for(let a in n){let o=n[a],s=xDt(i,a);s&&wDt(e,s,o)}}function bDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.featureTables;if(n&&i)for(let a in n){let o=yDt(i,a);o&&_Dt(e,r,o)}}function yDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function xDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function _Dt(e,t,r){var a,o;if(!r.class)return;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=EDt(e,t,u,i,c);c.data=l}}}function wDt(e,t,r){var i;let n=t.class;for(let a in r.properties){let o=(i=t==null?void 0:t.properties)==null?void 0:i[a];if(o){let s=DDt(e,o,n);o.data=s}}}function EDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=ADt(e,r,i,n),c=SDt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=U8(n,s,u,c):TDt(r)&&(a=CDt(r,n,s,u)),a}function ADt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?kv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function SDt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?kv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function TDt(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function CDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=f_(o,s),c=r.byteLength/u,l=Bv(r,o,s,c);return i?n?q8(l,t,n,r.length,u):a?N8(l,t,a):[]:l}function DDt(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let i=[];for(let a of n.meshes)for(let o of a.primitives)FDt(e,r,t,i,o);return i}function FDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Ov(e,a,i);o&&M8(e,t,o,n,i)}var z8="4.0.5";var Iv="4.0.5";var wc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},hq;async function mq(e){let t=e.modules||{};return t.basis?t.basis:(hq=hq||kDt(e),await hq)}async function kDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.TRANSCODER,"textures",e),await Zu(wc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await BDt(t,r)}function BDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,initializeBasis:o}=i;o(),n({BasisFile:a})})})}var dq;async function gq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(dq=dq||ODt(e),await dq)}async function ODt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.ENCODER,"textures",e),await Zu(wc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await IDt(t,r)}function IDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=i;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var ke={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 PDt=["","WEBKIT_","MOZ_"],P_e={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"},H8=null;function p_(e){if(!H8){e=e||RDt()||void 0,H8=new Set;for(let t of PDt)for(let r in P_e)if(e&&e.getExtension(`${t}${r}`)){let n=P_e[r];H8.add(n)}}return H8}function RDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var V_e=Wt(H_e(),1);function Pv(e,t){let r=new Array(t.mipMapLevels),n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=MDt(t,n,i,e,o),u=LDt(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function LDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function MDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var qDt={131:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ke.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ke.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ke.COMPRESSED_RED_RGTC1_EXT,140:ke.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ke.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ke.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ke.COMPRESSED_RGB8_ETC2,148:ke.COMPRESSED_SRGB8_ETC2,149:ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ke.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ke.COMPRESSED_RGBA8_ETC2_EAC,152:ke.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ke.COMPRESSED_R11_EAC,154:ke.COMPRESSED_SIGNED_R11_EAC,155:ke.COMPRESSED_RG11_EAC,156:ke.COMPRESSED_SIGNED_RG11_EAC,157:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ke.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ke.COMPRESSED_RGBA_ASTC_12x12_KHR};function W_e(e){return qDt[e]}var Io=[171,75,84,88,32,50,48,187,13,10,26,10];function Y8(e){let t=new Uint8Array(e);return!(t.byteLength<Io.length||t[0]!==Io[0]||t[1]!==Io[1]||t[2]!==Io[2]||t[3]!==Io[3]||t[4]!==Io[4]||t[5]!==Io[5]||t[6]!==Io[6]||t[7]!==Io[7]||t[8]!==Io[8]||t[9]!==Io[9]||t[10]!==Io[10]||t[11]!==Io[11])}function K_e(e){let t=new Uint8Array(e),r=(0,V_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=W_e(r.vkFormat);return Pv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var NDt={etc1:{basisFormat:0,compressed:!0,format:ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ke.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:ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ke.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 d_(e,t){if(t.basis.containerFormat==="auto"){if(Y8(e)){let n=await gq(t);return $_e(n.KTX2File,e,t)}let{BasisFile:r}=await mq(t);return _q(r,e,t)}switch(t.basis.module){case"encoder":let r=await gq(t);switch(t.basis.containerFormat){case"ktx2":return $_e(r.KTX2File,e,t);case"basis":default:return _q(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await mq(t);return _q(n,e,t)}}function _q(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),a=[];for(let o=0;o<i;o++){let s=n.getNumLevels(o),u=[];for(let c=0;c<s;c++)u.push(UDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function UDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=Y_e(n,o),l=e.getImageTranscodedSizeInBytes(t,r,c),f=new Uint8Array(l);if(!e.transcodeImage(f,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function $_e(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),a=[];for(let o=0;o<i;o++){a.push(GDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function GDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=Y_e(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,u),l=new Uint8Array(c);if(!e.transcodeImage(l,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:i,data:l,compressed:o,levelSize:c,hasAlpha:n,format:s}}function Y_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Rv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),NDt[r]}function Rv(){let e=p_();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var J_e={name:"Basis",id:"basis",module:"textures",version:Iv,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"}}},Rd={...J_e,parse:d_};var Po={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},zDt={DXT1:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ke.COMPRESSED_RGB_ATC_WEBGL,ATCA:ke.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ke.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},HDt=Z_e,WDt=J8,VDt=J8,KDt={DXT1:Z_e,DXT3:J8,DXT5:J8,"ATC ":HDt,ATCA:WDt,ATCI:VDt};function X_e(e){return new Uint32Array(e,0,Po.HEADER_LENGTH)[Po.MAGIC_NUMBER_INDEX]===Po.MAGIC_NUMBER}function Q_e(e){let t=new Int32Array(e,0,Po.HEADER_LENGTH),r=t[Po.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[Po.HEADER_PF_FLAGS_INDEX]&Po.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=$Dt(r),i=zDt[n],a=KDt[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Po.HEADER_FLAGS_INDEX]&Po.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Po.MIPMAPCOUNT_INDEX]));let s=t[Po.HEADER_WIDTH_INDEX],u=t[Po.HEADER_HEIGHT_INDEX],c=t[Po.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Pv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function Z_e(e,t){return(e+3>>2)*(t+3>>2)*8}function J8(e,t){return(e+3>>2)*(t+3>>2)*16}function $Dt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bs={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},YDt={0:[ke.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ke.COMPRESSED_RGB_ETC1_WEBGL],7:[ke.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ke.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ke.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ke.COMPRESSED_RGB8_ETC2],23:[ke.COMPRESSED_RGBA8_ETC2_EAC],24:[ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ke.COMPRESSED_R11_EAC],26:[ke.COMPRESSED_RG11_EAC],27:[ke.COMPRESSED_RGBA_ASTC_4X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ke.COMPRESSED_RGBA_ASTC_5X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ke.COMPRESSED_RGBA_ASTC_5X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ke.COMPRESSED_RGBA_ASTC_6X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ke.COMPRESSED_RGBA_ASTC_6X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ke.COMPRESSED_RGBA_ASTC_8X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ke.COMPRESSED_RGBA_ASTC_8X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ke.COMPRESSED_RGBA_ASTC_8X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ke.COMPRESSED_RGBA_ASTC_10X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ke.COMPRESSED_RGBA_ASTC_10X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ke.COMPRESSED_RGBA_ASTC_10X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ke.COMPRESSED_RGBA_ASTC_10X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ke.COMPRESSED_RGBA_ASTC_12X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ke.COMPRESSED_RGBA_ASTC_12X12_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},JDt={0:e2e,1:e2e,2:t2e,3:t2e,6:m_,7:m_,9:g_,11:g_,22:m_,23:g_,24:m_,25:m_,26:g_,27:g_,28:XDt,29:QDt,30:ZDt,31:eFt,32:tFt,33:rFt,34:nFt,35:iFt,36:aFt,37:oFt,38:sFt,39:uFt,40:cFt};function r2e(e){let r=new Uint32Array(e,0,bs.HEADER_LENGTH)[bs.MAGIC_NUMBER_INDEX];return r===bs.MAGIC_NUMBER||r===bs.MAGIC_NUMBER_EXTRA}function n2e(e){let t=new Uint32Array(e,0,bs.HEADER_LENGTH),r=t[bs.PIXEL_FORMAT_INDEX],n=t[bs.COLOUR_SPACE_INDEX],i=YDt[r]||[],a=i.length>1&&n?i[1]:i[0],o=JDt[r],s=t[bs.MIPMAPCOUNT_INDEX],u=t[bs.WIDTH_INDEX],c=t[bs.HEIGHT_INDEX],l=bs.HEADER_SIZE+t[bs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Pv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function e2e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function t2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function m_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function g_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function XDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function QDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function ZDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function eFt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function tFt(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function rFt(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function nFt(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function iFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function aFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function oFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function sFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function uFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function cFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function i2e(e){if(Y8(e))return K_e(e);if(X_e(e))return Q_e(e);if(r2e(e))return n2e(e);throw new Error("Texture container format not recognized")}var a2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Iv,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}}},X8={...a2e,parse:async(e,t)=>{var r;return(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},(await d_(e,t))[0]):i2e(e)}};var wq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:Iv,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var jv=!0,o2e=1735152710,Sq=12,Q8=8,lFt=1313821514,fFt=5130562,pFt=0,hFt=0,dFt=1;function mFt(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function s2e(e,t=0,r={}){let n=new DataView(e),{magic:i=o2e}=r,a=n.getUint32(t,!1);return a===i||a===o2e}function u2e(e,t,r=0,n={}){let i=new DataView(t),a=mFt(i,r+0),o=i.getUint32(r+4,jv),s=i.getUint32(r+8,jv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Sq,e.version){case 1:return gFt(e,i,r);case 2:return vFt(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function gFt(e,t,r){Qt(e.header.byteLength>Sq+Q8);let n=t.getUint32(r+0,jv),i=t.getUint32(r+4,jv);return r+=Q8,Qt(i===pFt),Eq(e,t,r,n),r+=n,r+=Aq(e,t,r,e.header.byteLength),r}function vFt(e,t,r,n){return Qt(e.header.byteLength>Sq+Q8),bFt(e,t,r,n),r+e.header.byteLength}function bFt(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,jv),a=t.getUint32(r+4,jv);switch(r+=Q8,a){case lFt:Eq(e,t,r,i);break;case fFt:Aq(e,t,r,i);break;case hFt:n.strict||Eq(e,t,r,i);break;case dFt:n.strict||Aq(e,t,r,i);break;default:break}r+=Do(i,4)}return r}function Eq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Do(n,4)}function Aq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Do(n,4)}function Tq(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var Dq={};fa(Dq,{decode:()=>kFt,name:()=>FFt});var yFt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",xFt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",_Ft=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),wFt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),EFt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},AFt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function c2e(e,t,r,n,i,a="NONE"){let o=await SFt();DFt(o,o.exports[AFt[i]],e,t,r,n,o.exports[EFt[a||"NONE"]])}var Cq;async function SFt(){return Cq||(Cq=TFt()),Cq}async function TFt(){let e=yFt;WebAssembly.validate(_Ft)&&(e=xFt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(CFt(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function CFt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);t[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?wFt[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function DFt(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let p=t(c,n,i,l,a.length);if(p===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),p!==0)throw new Error(`Malformed buffer data: ${p}`)}var Z8="EXT_meshopt_compression",FFt=Z8;async function kFt(e,t){var i,a;let r=new qr(e);if(!((i=t==null?void 0:t.gltf)!=null&&i.decompressMeshes)||!((a=t.gltf)!=null&&a.loadBuffers))return;let n=[];for(let o of e.json.bufferViews||[])n.push(BFt(r,o));await Promise.all(n),r.removeExtension(Z8)}async function BFt(e,t){let r=e.getObjectExtension(t,Z8);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),p=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await c2e(p,o,a,f,s,u),e.removeObjectExtension(t,Z8)}}var Fq={};fa(Fq,{name:()=>OFt,preprocess:()=>IFt});var Lv="EXT_texture_webp",OFt=Lv;function IFt(e,t){let r=new qr(e);if(!sq("image/webp")){if(r.getRequiredExtensions().includes(Lv))throw new Error(`gltf: Required extension ${Lv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,Lv);a&&(i.source=a.source),r.removeObjectExtension(i,Lv)}r.removeExtension(Lv)}var kq={};fa(kq,{name:()=>PFt,preprocess:()=>RFt});var eD="KHR_texture_basisu",PFt=eD;function RFt(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,eD);a&&(i.source=a.source,r.removeObjectExtension(i,eD))}r.removeExtension(eD)}var Oq={};fa(Oq,{decode:()=>NFt,encode:()=>UFt,name:()=>MFt,preprocess:()=>qFt});function l2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Bq(n);t[r]=i}}return t}function Bq(e){let{buffer:t,size:r,count:n}=jFt(e);return{value:t,size:r,byteOffset:0,count:n,type:L8(r),componentType:Dv(t)}}function jFt(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=LFt(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function LFt(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Sp="KHR_draco_mesh_compression",MFt=Sp;function qFt(e,t,r){let n=new qr(e);for(let i of f2e(n))n.getObjectExtension(i,Sp)}async function NFt(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)!=null&&a.decompressMeshes))return;let n=new qr(e),i=[];for(let o of f2e(n))n.getObjectExtension(o,Sp)&&i.push(GFt(n,o,t,r));await Promise.all(i),n.removeExtension(Sp)}function UFt(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])zFt(n,t),r.addRequiredExtension(Sp)}async function GFt(e,t,r,n){let i=e.getObjectExtension(t,Sp);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Hh(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await To(o,_v,s,n),c=l2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let p=t.attributes[l],h=e.getAccessor(p);h!=null&&h.min&&(h!=null&&h.max)&&(f.min=h.min,f.max=h.max)}t.attributes=c,u.indices&&(t.indices=Bq(u.indices)),e.removeObjectExtension(t,Sp),HFt(t)}function zFt(e,t,r=4,n,i){var l;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=n.DracoWriter.encodeSync({attributes:e}),o=(l=i==null?void 0:i.parseSync)==null?void 0:l.call(i,{attributes:e}),s=n._addFauxAttributes(o.attributes),u=n.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Sp]:{bufferView:u,attributes:s}}}]}}function HFt(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*f2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Pq={};fa(Pq,{decode:()=>$Ft,name:()=>WFt});var Iq="KHR_texture_transform",WFt=Iq,tD=new ce,VFt=new Rr,KFt=new Rr;async function $Ft(e,t){var a;if(!new qr(e).hasExtension(Iq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)YFt(o,e)}function YFt(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&v_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&v_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&v_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&v_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&v_(t,e,u,r)}function v_(e,t,r,n){let i=JFt(r,n);if(!i)return;let a=e.json.meshes||[];for(let o of a)for(let s of o.primitives){let u=s.material;Number.isFinite(u)&&t===u&&XFt(e,s,i)}}function JFt(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Iq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=e4t(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function XFt(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:p}=e.buffers[l.buffer],h=(p||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:d,length:b}=Fv(c,l),g=j8[c.componentType],x=R8[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new d(f,h+F*E,2);tD.set(D[0],D[1],1),tD.transformByMatrix3(a),S.set([tD[0],tD[1]],F*x)}n===i?QFt(c,l,e.buffers,S):ZFt(i,c,t,e,S)}}}}function QFt(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function ZFt(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let a=n.json.bufferViews;if(!a)return;a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:(a==null?void 0:a.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=o.length-1)}function e4t(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Rr().set(1,0,0,0,1,0,t[0],t[1],1),a=VFt.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=KFt.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Rq={};fa(Rq,{decode:()=>r4t,encode:()=>n4t,name:()=>t4t});var jd="KHR_lights_punctual",t4t=jd;async function r4t(e){let t=new qr(e),{json:r}=t,n=t.getExtension(jd);n&&(t.json.lights=n.lights,t.removeExtension(jd));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,jd);a&&(i.light=a.light),t.removeObjectExtension(i,jd)}}async function n4t(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(jd);Ui(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let i=n.node;t.addObjectExtension(i,jd,n)}delete t.json.lights}}var jq={};fa(jq,{decode:()=>a4t,encode:()=>o4t,name:()=>i4t});var b_="KHR_materials_unlit",i4t=b_;async function a4t(e){let t=new qr(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,b_);t.removeExtension(b_)}function o4t(e){let t=new qr(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,b_,{}),t.addExtension(b_))}var Lq={};fa(Lq,{decode:()=>u4t,encode:()=>c4t,name:()=>s4t});var y_="KHR_techniques_webgl",s4t=y_;async function u4t(e){let t=new qr(e),{json:r}=t,n=t.getExtension(y_);if(n){let i=l4t(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,y_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=f4t(a.technique,t)),t.removeObjectExtension(a,y_)}t.removeExtension(y_)}}async function c4t(e,t){}function l4t(e,t){let{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=a.decode(t.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=r[o.program]}),i}function f4t(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var p2e=[fq,uq,Dq,Fq,kq,Oq,Rq,jq,Lq,Pq,pq];function h2e(e,t={},r){var i;let n=p2e.filter(a=>m2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function d2e(e,t={},r){var i;let n=p2e.filter(a=>m2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function m2e(e,t){var i;let r=((i=t==null?void 0:t.gltf)==null?void 0:i.excludeExtensions)||{};return!(e in r&&!r[e])}var Mq="KHR_binary_glTF";function g2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Mq);i&&Object.assign(n,i),t.removeObjectExtension(n,Mq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Mq)}var v2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},h4t={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},qq=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),g2e(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in v2e)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let i in n){let a=n[i];a.id=a.id||i;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][i]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in v2e)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:i,material:a}=r;for(let o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let i in n){let a=n[i],o=this._convertIdToIndex(a,i);n[i]=o}}_convertIdToIndex(t,r){let n=h4t[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return i}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,n,i;for(let a of t.materials){a.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let o=((r=a.values)==null?void 0:r.tex)||((n=a.values)==null?void 0:n.texture2d_0)||((i=a.values)==null?void 0:i.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function b2e(e,t={}){return new qq().normalize(e,t)}async function y2e(e,t,r=0,n,i){var a,o,s;return d4t(e,t,r,n),b2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),h2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await m4t(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await g4t(e,n,i),await d2e(e,n,i),e}function d4t(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!s2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=zI(t);else if(t instanceof ArrayBuffer){let o={};r=u2e(o,t,r,n.glb),Ui(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ui(!1,"GLTF: must be ArrayBuffer or string");let i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:o}=e._glb;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}let a=e.json.images||[];e.images=new Array(a.length).fill({})}async function m4t(e,t,r){var i,a;let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:u}=r;Ui(u);let c=Tq(s.uri,t),l=await((i=r==null?void 0:r.fetch)==null?void 0:i.call(r,c)),f=await((a=l==null?void 0:l.arrayBuffer)==null?void 0:a.call(l));e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function g4t(e,t,r){let n=v4t(e),i=e.json.images||[],a=[];for(let o of n)a.push(b4t(e,i[o],o,t,r));return await Promise.all(a)}function v4t(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function b4t(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Tq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=D_e(e.json,e.buffers,t.bufferView);a=Hh(s.buffer,s.byteOffset,s.byteLength)}Ui(a,"glTF image has no data");let o=await To(a,[Cv,Rd],{...n,mimeType:t.mimeType,basis:n.basis||{format:Rv()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),e.images=e.images||[],e.images[r]=o}var Il={name:"glTF",id:"gltf",module:"gltf",version:z8,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:y4t,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function y4t(e,t={},r){t={...Il.options,...t},t.gltf={...Il.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await y2e({},e,n,t,r)}var x4t=1179937895,_4t=1313821514,w4t=5130562,Ec=!0;function x2e(e,t,r=0,n={}){let{magic:i=x4t,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,Ec),t.setUint32(r+4,a,Ec),t.setUint32(r+8,0,Ec));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,_4t,Ec)),r+=8;let f=JSON.stringify(o);if(r=Om(t,r,f,4),t){let p=r-l-8;t.setUint32(l+0,p,Ec)}if(s){let p=r;if(t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,w4t,Ec)),r+=8,r=OA(t,r,s,4),t){let h=r-p-8;t.setUint32(p+0,h,Ec)}}if(t){let p=r-u;t.setUint32(c,p,Ec)}return r}function Nq(e,t,r,n){return E4t(e),x2e(e,t,r,n)}function E4t(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Uq={name:"glTF",id:"gltf",module:"gltf",version:z8,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,options:{gltf:{}},encode:async(e,t={})=>_2e(e,t),encodeSync:_2e};function _2e(e,t={}){let{byteOffset:r=0}=t,n=Nq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Nq(e,a,r,t),i}var A4t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},S4t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ys={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},T4t={magFilter:ys.TEXTURE_MAG_FILTER,minFilter:ys.TEXTURE_MIN_FILTER,wrapS:ys.TEXTURE_WRAP_S,wrapT:ys.TEXTURE_WRAP_T},C4t={[ys.TEXTURE_MAG_FILTER]:ys.LINEAR,[ys.TEXTURE_MIN_FILTER]:ys.NEAREST_MIPMAP_LINEAR,[ys.TEXTURE_WRAP_S]:ys.REPEAT,[ys.TEXTURE_WRAP_T]:ys.REPEAT};function D4t(){return{id:"default-sampler",parameters:C4t}}function F4t(e){return S4t[e]}function k4t(e){return A4t[e]}var Gq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ui(n),this.baseUri=o,this.buffers=i,this.images=a,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((i,a)=>this._resolveBufferView(i,a))),t.images&&(n.images=t.images.map((i,a)=>this._resolveImage(i,a))),t.samplers&&(n.samplers=t.samplers.map((i,a)=>this._resolveSampler(i,a))),t.textures&&(n.textures=t.textures.map((i,a)=>this._resolveTexture(i,a))),t.accessors&&(n.accessors=t.accessors.map((i,a)=>this._resolveAccessor(i,a))),t.materials&&(n.materials=t.materials.map((i,a)=>this._resolveMaterial(i,a))),t.meshes&&(n.meshes=t.meshes.map((i,a)=>this._resolveMesh(i,a))),t.nodes&&(n.nodes=t.nodes.map((i,a)=>this._resolveNode(i,a)),n.nodes=n.nodes.map((i,a)=>this._resolveNodeChildren(i))),t.skins&&(n.skins=t.skins.map((i,a)=>this._resolveSkin(i,a))),t.scenes&&(n.scenes=t.scenes.map((i,a)=>this._resolveScene(i,a))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:(t==null?void 0:t.id)||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((i,a)=>{let o=this.getMesh(a);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(i=>{let a={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return i.indices!==void 0&&(a.indices=this.getAccessor(i.indices)),i.material!==void 0&&(a.material=this.getMaterial(i.material)),a})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=F4t(t.componentType),i=k4t(t.type),a=n*i,o={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:c}=Fv(o,o.bufferView),l=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(l,l+c);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,l,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_getValueFromInterleavedBuffer(t,r,n,i,a){let o=new Uint8Array(a*i);for(let s=0;s<a;s++){let u=r+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+i)),s*i)}return o.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):D4t(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let i in n){let a=this._enumSamplerParameter(i);a!==void 0&&(n.parameters[a]=n[i])}return n}_enumSamplerParameter(t){return T4t[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(t,r){let n=t.buffer,i=this.buffers[n].arrayBuffer,a=this.buffers[n].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,a,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function x_(e,t){return new Gq().postProcess(e,t)}var rD={URI:0,EMBEDDED:1};function nD(e,t,r,n){e.rotateYtoZ=!0;let i=(e.byteOffset||0)+(e.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Hh(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function iD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(B4t(e,t,r),i.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:a}=n,o=await a(e.gltfUrl,r);e.gltfArrayBuffer=await o.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let a=await To(e.gltfArrayBuffer,Il,r,n);e.gltf=x_(a),e.gpuMemoryUsageInBytes=l_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function B4t(e,t,r){switch(t){case rD.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case rD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function w2e(e,t,r,n,i){var o;r=O4t(e,t,r,n,i),await iD(e,rD.EMBEDDED,n,i);let a=(o=e==null?void 0:e.gltf)==null?void 0:o.extensions;return a&&a.CESIUM_RTC&&(e.rtcCenter=a.CESIUM_RTC.center),r}function O4t(e,t,r,n,i){r=Ap(e,t,r),r=Av(e,t,r),r=Sv(e,t,r,n),r=nD(e,t,r,n);let a=new Bl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function E2e(e,t,r,n,i){return r=I4t(e,t,r,n,i),await iD(e,e.gltfFormat||0,n,i),r}function I4t(e,t,r,n,i){var c;if(r=Ap(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Av(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Sv(e,t,r,n),r=nD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Bl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let u=new Id(e.batchTableJson,e.batchTableBinary,s);return P4t(e,o,u,s),r}function P4t(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Rr,l=new ds,f=new ce,p={},h=new Kr,d=[],b=[],g=[],x=[];for(let E=0;E<n;E++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Ht.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3,E,a);let I=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3);if(!I)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let U=65535;for(let Y=0;Y<3;Y++)S[Y]=S[Y]/U*P[Y]+I[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),p.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,d),e.normalRight=t.getProperty("NORMAL_RIGHT",Ht.FLOAT,3,E,b);let F=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ht.UNSIGNED_SHORT,2,E,d),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ht.UNSIGNED_SHORT,2,E,b),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(or.WGS84.eastNorthUpToFixedFrame(a,h),h.getRotationMatrix3(c)):c.identity()}F&&(u.copy(o).cross(s).normalize(),c.setColumn(0,o),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),p.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Ht.FLOAT,1,E,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Ht.FLOAT,3,E,d);j&&f.scale(j),p.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(p.rotation);h.identity(),h.translate(p.translation),h.multiplyRight(N),h.scale(p.scale);let C=h.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function A2e(e,t,r,n,i,a){r=Ap(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={shape:"tile3d"};e.tiles.push(s),r=await a(t,r,n,i,s)}return r}async function S2e(e,t,r,n){var i,a;if(e.rotateYtoZ=!0,e.gltfUpAxis=(i=r==null?void 0:r["3d-tiles"])!=null&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(a=r==null?void 0:r["3d-tiles"])!=null&&a.loadGLTF){if(!n)return t.byteLength;let o=await To(t,Il,r,n);e.gltf=x_(o),e.gpuMemoryUsageInBytes=l_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function zq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=$1e(e,t),i.type){case gs.COMPOSITE:return await A2e(i,e,t,r,n,zq);case gs.BATCHED_3D_MODEL:return await w2e(i,e,t,r,n);case gs.GLTF:return await S2e(i,e,r,n);case gs.INSTANCED_3D_MODEL:return await E2e(i,e,t,r,n);case gs.POINT_CLOUD:return await p_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Hq(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let a=T2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=T2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await aD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let p of c.contentAvailability)await aD(c,p,f,r);else await aD(c,c.contentAvailability,f,r);return await aD(c,c.childSubtreeAvailability,f,r),c}async function aD(e,t,r,n){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!="number")return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){let s=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,c=await(await n.fetch(s)).arrayBuffer();t.explicitBitstream=new Uint8Array(c,a.byteOffset,a.byteLength);return}t.explicitBitstream=new Uint8Array(r,a.byteOffset,a.byteLength)}function T2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var oD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:xv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Hq,options:{}};function Wq(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function du(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Wq()}var R4t=globalThis.self||globalThis.window||globalThis.global,Mv=globalThis.window||globalThis.self||globalThis.global,j4t=globalThis.document||{},Ld=globalThis.process||{},L4t=globalThis.console,Qwr=globalThis.navigator||{};var sD="4.0.5",tEr=du();function M4t(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var uD=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=M4t(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function C2e(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function D2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function cD(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var lD;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(lD||(lD={}));var q4t=10;function F2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),lD[e]||lD.WHITE)}function k2e(e,t,r){if(!du&&typeof e=="string"){if(t){let n=F2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=F2e(r);e="\x1B[".concat(n+q4t,"m").concat(e,"\x1B[49m")}}return e}function B2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function qv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Md(){let e;if(du()&&Mv.performance){var t,r;e=Mv===null||Mv===void 0||(t=Mv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Ld){var n;let i=Ld===null||Ld===void 0||(n=Ld.hrtime)===null||n===void 0?void 0:n.call(Ld);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Nv={debug:du()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},N4t={enabled:!0,level:0};function xs(){}var O2e={},I2e={once:!0},__=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=sD,this._startTs=Md(),this._deltaTs=Md(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new uD("__probe-".concat(this.id,"__"),N4t),this.timeStamp("".concat(this.id," started")),B2e(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Md()-this._startTs).toPrecision(10))}getDelta(){return Number((Md()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){qv(t,r)}warn(t){return this._getLogFunction(0,t,Nv.warn,arguments,I2e)}error(t){return this._getLogFunction(0,t,Nv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Nv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Nv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Nv.debug||Nv.info,arguments,I2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||xs,n&&[n],{tag:H4t(r)}):xs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?du()?z4t({image:i,message:a,scale:o}):G4t({image:i,message:a,scale:o}):xs}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||xs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=P2e({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||xs)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=R2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=P2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,qv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Md();let o=a.tag||a.message;if(a.once&&o)if(!O2e[o])O2e[o]=Md();else return xs;return r=U4t(this.id,a.message,a),n.bind(console,r,...a.args)}return xs}};__.VERSION=sD;function R2e(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return qv(Number.isFinite(t)&&t>=0),t}function P2e(e){let{logLevel:t,message:r}=e;e.logLevel=R2e(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return qv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function U4t(e,t,r){if(typeof t=="string"){let n=r.time?D2e(C2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=k2e(t,r.color,r.background)}return t}function G4t(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),xs}function z4t(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=cD(a,r,n);console.log(...o)},a.src=t,xs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...cD(t,r,n)),xs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...cD(a,r,n)),a.src=t.toDataURL(),xs}return xs}function H4t(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Vq=new __({id:"@probe.gl/log"});var _s=null;try{_s=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function kn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}kn.prototype.__isLong__;Object.defineProperty(kn.prototype,"__isLong__",{value:!0});function Na(e){return(e&&e.__isLong__)===!0}function j2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Na;var L2e={},M2e={};function qd(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=M2e[e],n)?n:(r=$r(e,0,!0),i&&(M2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=L2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(L2e[e]=r),r))}kn.fromInt=qd;function ws(e,t){if(isNaN(e))return t?Pl:mu;if(t){if(e<0)return Pl;if(e>=G2e)return W2e}else{if(e<=-N2e)return go;if(e+1>=N2e)return H2e}return e<0?ws(-e,t).neg():$r(e%Gv|0,e/Gv|0,t)}kn.fromNumber=ws;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var fD=Math.pow;function $q(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?Pl:mu;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return $q(e.substring(1),t,r).neg();for(var i=ws(fD(r,8)),a=mu,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var c=ws(fD(r,s));a=a.mul(c).add(ws(u))}else a=a.mul(i),a=a.add(ws(u))}return a.unsigned=t,a}kn.fromString=$q;function gu(e,t){return typeof e=="number"?ws(e,t):typeof e=="string"?$q(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=gu;var q2e=1<<16,W4t=1<<24,Gv=q2e*q2e,G2e=Gv*Gv,N2e=G2e/2,U2e=qd(W4t),mu=qd(0);kn.ZERO=mu;var Pl=qd(0,!0);kn.UZERO=Pl;var Uv=qd(1);kn.ONE=Uv;var z2e=qd(1,!0);kn.UONE=z2e;var Kq=qd(-1);kn.NEG_ONE=Kq;var H2e=$r(-1,2147483647,!1);kn.MAX_VALUE=H2e;var W2e=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=W2e;var go=$r(0,-2147483648,!1);kn.MIN_VALUE=go;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Gv+(this.low>>>0):this.high*Gv+(this.low>>>0)};Ke.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(go)){var r=ws(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=ws(fD(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),c=o.sub(u.mul(a)).toInt()>>>0,l=c.toString(t);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};Ke.getHighBits=function(){return this.high};Ke.getHighBitsUnsigned=function(){return this.high>>>0};Ke.getLowBits=function(){return this.low};Ke.getLowBitsUnsigned=function(){return this.low>>>0};Ke.getNumBitsAbs=function(){if(this.isNegative())return this.eq(go)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};Ke.isZero=function(){return this.high===0&&this.low===0};Ke.eqz=Ke.isZero;Ke.isNegative=function(){return!this.unsigned&&this.high<0};Ke.isPositive=function(){return this.unsigned||this.high>=0};Ke.isOdd=function(){return(this.low&1)===1};Ke.isEven=function(){return(this.low&1)===0};Ke.equals=function(t){return Na(t)||(t=gu(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};Ke.eq=Ke.equals;Ke.notEquals=function(t){return!this.eq(t)};Ke.neq=Ke.notEquals;Ke.ne=Ke.notEquals;Ke.lessThan=function(t){return this.comp(t)<0};Ke.lt=Ke.lessThan;Ke.lessThanOrEqual=function(t){return this.comp(t)<=0};Ke.lte=Ke.lessThanOrEqual;Ke.le=Ke.lessThanOrEqual;Ke.greaterThan=function(t){return this.comp(t)>0};Ke.gt=Ke.greaterThan;Ke.greaterThanOrEqual=function(t){return this.comp(t)>=0};Ke.gte=Ke.greaterThanOrEqual;Ke.ge=Ke.greaterThanOrEqual;Ke.compare=function(t){if(Na(t)||(t=gu(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};Ke.comp=Ke.compare;Ke.negate=function(){return!this.unsigned&&this.eq(go)?go:this.not().add(Uv)};Ke.neg=Ke.negate;Ke.add=function(t){Na(t)||(t=gu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,p=0,h=0;return h+=a+c,p+=h>>>16,h&=65535,p+=i+u,f+=p>>>16,p&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(p<<16|h,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Na(t)||(t=gu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Na(t)||(t=gu(t)),_s){var r=_s.mul(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Pl:mu;if(this.eq(go))return t.isOdd()?go:mu;if(t.eq(go))return this.isOdd()?go:mu;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(U2e)&&t.lt(U2e))return ws(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,p=0,h=0,d=0;return d+=o*l,h+=d>>>16,d&=65535,h+=a*l,p+=h>>>16,h&=65535,h+=o*c,p+=h>>>16,h&=65535,p+=i*l,f+=p>>>16,p&=65535,p+=a*c,f+=p>>>16,p&=65535,p+=o*u,f+=p>>>16,p&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(h<<16|d,f<<16|p,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Na(t)||(t=gu(t)),t.isZero())throw Error("division by zero");if(_s){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?_s.div_u:_s.div_s)(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Pl:mu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Pl;if(t.gt(this.shru(1)))return z2e;a=Pl}else{if(this.eq(go)){if(t.eq(Uv)||t.eq(Kq))return go;if(t.eq(go))return Uv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(mu)?t.isNegative()?Uv:Kq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(go))return this.unsigned?Pl:mu;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=mu}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:fD(2,s-48),c=ws(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=ws(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Uv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Na(t)||(t=gu(t)),_s){var r=(this.unsigned?_s.rem_u:_s.rem_s)(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return $r(~this.low,~this.high,this.unsigned)};Ke.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};Ke.clz=Ke.countLeadingZeros;Ke.countTrailingZeros=function(){return this.low?j2e(this.low):j2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Na(t)||(t=gu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Na(t)||(t=gu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Na(t)||(t=gu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$r(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?$r(this.high,0,this.unsigned):$r(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,$r(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};Ke.rotl=Ke.rotateLeft;Ke.rotateRight=function(t){var r;return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,$r(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?$r(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:$r(this.low,this.high,!0)};Ke.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};Ke.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};Ke.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};kn.fromBytes=function(t,r,n){return n?kn.fromBytesLE(t,r):kn.fromBytesBE(t,r)};kn.fromBytesLE=function(t,r){return new kn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};kn.fromBytesBE=function(t,r){return new kn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var zv=kn;var V4t=16;function w_(e){e==="X"&&(e="");let t=e.padEnd(V4t,"0");return zv.fromString(t,!0,16)}function Yq(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-a.length).join("0")+a}function Jq(e,t){let r=K4t(e).shiftRightUnsigned(2);return e.add(zv.fromNumber(2*t+1-4).multiply(r))}function K4t(e){return e.and(e.not().add(1))}var $4t=3,Y4t=30,J4t=2*Y4t+1,V2e=180/Math.PI;function $2e(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0];for(let s=i-1;s>=0;s--){a=i-s;let u=n[s],c=0,l=0;u==="1"?l=1:u==="2"?(c=1,l=1):u==="3"&&(c=1);let f=Math.pow(2,a-1);X4t(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(r%2===1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function Y2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<$4t+J4t;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=zv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=zv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function Xq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function K2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Qq(e){return[K2e(e[0]),K2e(e[1])]}function Zq(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function eN([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*V2e,n*V2e]}function X4t(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let i=t[0];t[0]=t[1],t[1]=i}}function J2e(e){let t=Xq(e.ij,e.level,[.5,.5]),r=Qq(t),n=Zq(e.face,r);return eN(n)}var Q4t=100;function tN(e){let{face:t,ij:r,level:n}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(Q4t*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],p=(f[0]-l[0])/a,h=(f[1]-l[1])/a;for(let d=0;d<a;d++){l[0]+=p,l[1]+=h;let b=Xq(r,n,l),g=Qq(b),x=Zq(t,g),E=eN(x);Math.abs(E[1])>89.999&&(E[0]=u);let S=E[0]-u;E[0]+=S>180?-360:S<-180?360:0,o[s++]=E[0],o[s++]=E[1],u=E[0]}}return o[s++]=o[0],o[s++]=o[1],o}function Hv(e){let t=Z4t(e);return $2e(t)}function Z4t(e){if(e.indexOf("/")>0)return e;let t=w_(e);return Y2e(t)}function rN(e){let t=Hv(e);return J2e(t)}function Q2e(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let i=0;i<4;i++){let a=`${e.face}/${i}`,o=Hv(a),s=tN(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=X2e(r)}else{let r=tN(e);t=X2e(r)}return t}function X2e(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function nN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=Hv(e),a=Q2e(i),o=a.west,s=a.south,u=a.east,c=a.north,l=[];return l.push(new ce(o,c,r)),l.push(new ce(u,c,r)),l.push(new ce(u,s,r)),l.push(new ce(o,s,r)),l.push(new ce(o,c,n)),l.push(new ce(u,c,n)),l.push(new ce(u,s,n)),l.push(new ce(o,s,n)),l}function pD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=nN(t,r),i=rN(t),a=i[0],o=i[1],s=or.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new ce(s[0],s[1],s[2]);n.push(u);let c=a_(n);return[...c.center,...c.halfAxes]}var ekt=4,tkt=8,rkt={QUADTREE:ekt,OCTREE:tkt};function nkt(e,t,r){if(e!=null&&e.box){let n=w_(e.s2VolumeInfo.token),i=Jq(n,t),a=Yq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,p=c.minimumHeight+l/2;c.minimumHeight=p-f,c.maximumHeight=p+f;break;default:break}return{box:pD(o),s2VolumeInfo:o}}}async function aN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a,loaderOptions:o}=e,{subtree:s,level:u=0}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:p,subtreesUriTemplate:h,basePath:d}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Vq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${p} won't be loaded...`),b;let g=u+i.level;if(g>f)return b;let x=rkt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**u-1)/(x-1),k=Nd(r.mortonIndex,n,E),N=j+k,C=Nd(r.x,S,1),I=Nd(r.y,F,1),P=Nd(r.z,D,1),U=!1;u>=l&&(U=iN(s.childSubtreeAvailability,k));let Y=Nd(i.x,C,u*E),J=Nd(i.y,I,u*E),re=Nd(i.z,P,u*E);if(U){let Te=`${d}/${h}`,$e=hD(Te,g,Y,J,re);s=await An($e,oD,o),i.mortonIndex=k,i.x=C,i.y=I,i.z=P,i.level=u,k=0,N=0,C=0,I=0,P=0,u=0}if(!iN(s.tileAvailability,N))return b;iN(s.contentAvailability,N)&&(b.contentUrl=hD(p,g,Y,J,re));let ye=u+1,he={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=nkt(a,Te,c),We=await aN({subtree:s,implicitOptions:t,loaderOptions:o,parentData:he,childIndex:Te,level:ye,globalData:{...i},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=ikt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,a);b.children.push(ne)}}return b}function iN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Vq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?skt(t,r.explicitBitstream):!1}function ikt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,p=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),h=l/2**t,d=i!=null&&i.box?{box:i.box}:f,b=akt(t,d,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:p},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:b}}function akt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,p=2**e,h=(u-o)/p,d=(c-s)/p,b=(f-l)/p,[g,x]=[o+h*n,o+h*(n+1)],[E,S]=[s+d*i,s+d*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,E,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Nd(e,t,r){return(e<<r)+t}function hD(e,t,r,n,i){let a=okt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function okt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function skt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function sN(e,t=""){if(!t)return"empty";let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return"pointcloud";case"i3dm":case"b3dm":case"glb":case"gltf":return"scenegraph";default:return n||"empty"}}function uN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function oN(e="",t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return tu.resolve(t,e)}function Z2e(e,t){var i;if(!e)return null;let r;if(e.content){let a=e.content.uri||((i=e.content)==null?void 0:i.url);r=oN(a,t)}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:sN(e,r),refine:uN(e.refine)}}async function rwe(e,t,r){let n=null,i=twe(e.root);i&&e.root?n=await ewe(e.root,e,t,i,r):n=Z2e(e.root,t);let a=[];for(a.push(n);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let c of s){let l=twe(c),f;l?f=await ewe(c,e,t,l,r):f=Z2e(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function ewe(e,t,r,n,i){var S,F,D;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=hD(c,0,0,0,0),f=oN(l,r),p=await An(f,oD,i),h=oN((S=e.content)==null?void 0:S.uri,r),d=(F=t==null?void 0:t.root)==null?void 0:F.refine,b=e.geometricError,g=(D=e.boundingVolume.extensions)==null?void 0:D["3DTILES_bounding_volume_S2"];if(g){let k={box:pD(g),s2VolumeInfo:g};e.boundingVolume=k}let x=e.boundingVolume,E={contentUrlTemplate:h,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:d,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:b,rootBoundingVolume:x,getTileType:sN,getRefine:uN};return await ukt(e,r,p,E,i)}async function ukt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await aN({subtree:r,implicitOptions:n,loaderOptions:i}),s,u=null;return o&&(s=o,u={uri:o.replace(`${t}/`,"")}),{...e,id:s,contentUrl:s,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:sN(e,s),refine:uN(e.refine),content:u||e.content,children:a}}function twe(e){var t;return((t=e==null?void 0:e.extensions)==null?void 0:t["3DTILES_implicit_tiling"])||(e==null?void 0:e.implicitTiling)}var Ac={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:xv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ckt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ckt(e,t={},r){let n=t["3d-tiles"]||{},i;return n.isTileset==="auto"?i=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?lkt(e,t,r):fkt(e,t,r)}async function lkt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=pkt(i),o=await rwe(n,a,t||{});return{...n,shape:"tileset3d",loader:Ac,url:i,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||n.root,type:"TILES3D",lodMetricType:"geometricError",lodMetricValue:((u=n.root)==null?void 0:u.geometricError)||0}}async function fkt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await zq(e,0,t,r,n.content),n.content}function pkt(e){return tu.dirname(e)}var nwe="https://api.cesium.com/v1/assets";async function iwe(e,t){if(!t){let a=await hkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await dkt(e,t),{type:n,url:i}=r;return Qt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function hkt(e){Qt(e);let t=nwe,r={Authorization:`Bearer ${e}`},n=await ko(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function dkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${nwe}/${t}`,i=await ko(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await ko(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function mkt(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let i=e.match(/\/([0-9]+)\/tileset.json/);n=i&&i[1]}return iwe(r,n)}var dD={...Ac,id:"cesium-ion",name:"Cesium Ion",preload:mkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=dD,Ac.parse(e,t,r)),options:{"cesium-ion":{...Ac.options["3d-tiles"],accessToken:null}}};var pTe=Wt(YU(),1),RIt="4.0.5",JU={id:"zip",module:"zip",name:"Zip Archive",version:RIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:jIt};async function jIt(e,t={}){let r=[],n={};try{let i=new pTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=LIt(i,u,t).then(l=>{n[o]=l});r.push(c)}),await Promise.all(r),n}catch(i){throw t.log.error(`Unable to read zip archive: ${i}`),i}}async function LIt(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(n){return r.log.error(`Unable to read ${t} from zip archive: ${n}`),n}}var a2=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let i=e.length-4n;i>-1;i--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(i),r.every((a,o)=>a===t[o])){n=i;break}return n};var MIt=new Uint8Array([80,75,5,6]),qIt=new Uint8Array([80,75,6,7]),NIt=new Uint8Array([80,75,6,6]),UIt=8n,GIt=16n,zIt=8n,HIt=24n,WIt=48n,hTe=async e=>{let t=await a2(e,MIt),r=BigInt(await e.getUint16(t+UIt)),n=BigInt(await e.getUint32(t+GIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!ec(a,qIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+zIt),s=await e.slice(o,o+4n);if(!ec(s,NIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+HIt),n=await e.getBigUint64(o+WIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var VIt=20n,KIt=24n,$It=28n,YIt=30n,JIt=32n,XIt=42n,XU=46n,aF=new Uint8Array([80,75,1,2]),o2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,aF.buffer))return null;let n=BigInt(await t.getUint32(e+VIt)),i=BigInt(await t.getUint32(e+KIt)),a=await t.getUint16(e+YIt),o=BigInt(await t.getUint16(e+JIt)),s=await t.getUint16(e+$It),u=await t.slice(e+XU,e+XU+BigInt(s)),c=new TextDecoder().decode(u),l=e+XU+BigInt(s),f=await t.getUint32(e+XIt),p=BigInt(f),h=new DataView(await t.slice(l,l+BigInt(a))),d={uncompressedSize:i,compressedSize:n,localHeaderOffset:p,startDisk:o},b=QIt(d,h);return{...d,...b,extraFieldLength:a,fileNameLength:s,fileName:c,extraOffset:l}};async function*oF(e){let{cdStartOffset:t}=await hTe(e),r=await o2(t,e);for(;r;)yield r,r=await o2(r.extraOffset+BigInt(r.extraFieldLength),e)}var dTe=(...e)=>e[0]+e[1]*16,QIt=(e,t)=>{let r=ZIt(e),n={};if(r.length>0){let i=r.reduce((s,u)=>s+u.length,0),a=new Uint8Array(t.buffer).findIndex((s,u,c)=>dTe(c[u],c[u+1])===1&&dTe(c[u+2],c[u+3])===i),o=0;for(let s of r){let u=o;n[s.name]=t.getBigUint64(a+4+u,!0),o=u+s.length}}return n},ZIt=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var ePt=8n,tPt=18n,rPt=22n,nPt=26n,iPt=28n,sF=30n,mTe=new Uint8Array([80,75,3,4]),t0=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,mTe))return null;let n=await t.getUint16(e+nPt),i=new TextDecoder().decode(await t.slice(e+sF,e+sF+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+iPt),o=e+sF+BigInt(n+a),s=await t.getUint16(e+ePt),u=BigInt(await t.getUint32(e+tPt)),c=BigInt(await t.getUint32(e+rPt)),l=e+sF+BigInt(n),f=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(l+f),f+=8n),u===BigInt(4294967295)&&(u=await t.getBigUint64(l+f),f+=8n),o===BigInt(4294967295)&&(o=await t.getBigUint64(l+f)),{fileNameLength:n,fileName:i,extraFieldLength:a,fileDataOffset:o,compressedSize:u,compressionMethod:s}};function QU(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let i=t.getBigUint64(n+16,!0),a=aPt(e,n,16);r[a]=i}return r}function aPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var gb=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Wh(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var s2=class extends gb{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var r0=Wt(jU(),1),Wl=Wt(require("zlib"),1);var n0=class extends gb{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Im(Wl.default.gzip)(t):await Im(Wl.default.deflate)(t);return fl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Im(Wl.default.gunzip)(t):await Im(Wl.default.inflate)(t);return fl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gzipSync(t):Wl.default.deflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?r0.default.deflateRaw:r0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gunzipSync(t):Wl.default.inflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?r0.default.inflateRaw:r0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new r0.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new r0.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of r){let s=new Uint8Array(o);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=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[t]}`}};var oPt={0:async e=>e,8:async e=>await new n0({raw:!0}).decompress(e)},u2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new Px(t);else throw new Error("Cannot open file for random access in a WEB browser");else XI(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=oF(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=await this.getCDFileHeader(t),n=await t0(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=oPt[n.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(n.fileDataOffset,n.fileDataOffset+n.compressedSize),o=await i(a),s=new Response(o);return Object.defineProperty(s,"url",{value:`${this.fileName||""}/${t}`}),s}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=oF(this.fileProvider),n=null;for await(let i of r)if(i.fileName===t){n=i;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var sPt={0:e=>new s2().decompress(e),8:e=>new n0({raw:!0}).decompress(e)},uF=class{fileProvider;hashTable;constructor(t,r){this.fileProvider=t,this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r=new TextEncoder().encode(t).buffer,n=await new Rx().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await t0(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=sPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var c2=class extends u2{hashTable;constructor(t){super(t)}async fetch(t){let r=this.fileProvider;if(!r)throw new Error("No data detected in the zip archive");if(await this.parseHashTable(),this.hashTable){let i=await new uF(r,this.hashTable).getFile(t),a=new Response(i);return Object.defineProperty(a,"url",{value:`${this.fileName||""}/${t}`}),a}return super.fetch(t)}async parseHashTable(){if(this.hashTable!==void 0)return;let t=this.fileProvider;if(!t)throw new Error("No data detected in the zip archive");let r=await a2(t,aF),n=await o2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await t0(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=QU(o)}else this.hashTable=null}};function Lp(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Qt(Array.isArray(i)&&Number.isFinite(a)&&Number.isFinite(o)),t.setUint8(r+0,i[0]),t.setUint8(r+1,i[1]),t.setUint8(r+2,i[2]),t.setUint8(r+3,i[3]),t.setUint32(r+4,a,!0),t.setUint32(r+8,o,!0),r+=12,r}function Mp(e,t,r){e&&e.setUint32(t+8,r,!0)}function gTe(e,t,r,n,i){e={magic:wp.COMPOSITE,tiles:[],...e};let a=r;r+=Lp(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let o=0;o<e.tiles.length;++o)r+=i(e.tiles[o],t,r,n);return Mp(t,a,r-a),r}function vTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Do(s.length,8),l=u?Do(u.length,8):0;e={magic:wp.BATCHED_MODEL,...e};let f=r;r=Lp(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r+=16,r=Om(t,r,s,8),a&&(r=Om(t,r,u,8));let p=e.gltfEncoded;return p&&(r=Ox(t,r,p,p.byteLength)),Mp(t,f,r-f),r}function bTe(e,t,r,n){let{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,u={INSTANCES_LENGTH:i,POSITION:new Array(i*3).fill(0)},c=JSON.stringify(u),l=c.length;e={magic:wp.INSTANCED_MODEL,...e};let f=r;return r=Lp(e,t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=Bm(t,r,c,l),r+=Bm(t,r,o,s),Mp(t,f,r-f),r}var uPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function yTe(e,t,r,n){let{featureTableJson:i=uPt}=e,a=JSON.stringify(i);a=WI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:wp.POINT_CLOUD,...e};let c=r;return r+=Lp(e,t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,u,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Bm(t,r,a,o),r+=Ox(t,r,s,u),Mp(t,c,r-c),r}function eG(e,t){let r=ZU(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return ZU(e,i,0,t),n}function ZU(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case gs.COMPOSITE:return gTe(e,t,r,n,ZU);case gs.POINT_CLOUD:return yTe(e,t,r,n);case gs.BATCHED_3D_MODEL:return vTe(e,t,r,n);case gs.INSTANCED_3D_MODEL:return bTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var tG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:xv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>xTe(e,t),encodeSync:xTe};function xTe(e,t){return eG(e,t)}var Ga=require("path");var _Te=Wt(require("crypto")),lF=new Uint8Array(256),cF=lF.length;function rG(){return cF>lF.length-16&&(_Te.default.randomFillSync(lF),cF=0),lF.slice(cF,cF+=16)}var Aa=[];for(let e=0;e<256;++e)Aa.push((e+256).toString(16).slice(1));function wTe(e,t=0){return(Aa[e[t+0]]+Aa[e[t+1]]+Aa[e[t+2]]+Aa[e[t+3]]+"-"+Aa[e[t+4]]+Aa[e[t+5]]+"-"+Aa[e[t+6]]+Aa[e[t+7]]+"-"+Aa[e[t+8]]+Aa[e[t+9]]+"-"+Aa[e[t+10]]+Aa[e[t+11]]+Aa[e[t+12]]+Aa[e[t+13]]+Aa[e[t+14]]+Aa[e[t+15]]).toLowerCase()}var ETe=Wt(require("crypto")),nG={randomUUID:ETe.default.randomUUID};function cPt(e,t,r){if(nG.randomUUID&&!t&&!e)return nG.randomUUID();e=e||{};let n=e.random||(e.rng||rG)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return wTe(n)}var Oc=cPt;var F0=Wt(require("process"),1),ak=Wt(wu(),1),$W=Wt(sG(),1);var Xb=require("path"),Eke=Wt(wu(),1);var PTe=()=>({folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}});var Yb=require("fs"),Jb=require("path");var yke=require("zlib"),xke=require("path"),uw=require("fs"),RVt=Wt(bke(),1);var jVt=Wt(YU(),1);var LVt=Wt(iG(),1);function $4(e){let t=`${e}.gz`,r=(0,yke.createGzip)(),n=(0,uw.createReadStream)(e),i=(0,uw.createWriteStream)(t);return new Promise((a,o)=>{n.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),n.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),n.pipe(r).pipe(i)})}async function _ke(e,t,r,n,i){process.platform==="win32"?await qVt(e,t,r,n,i):await MVt(e,t,r,n)}async function MVt(e,t,r=0,n="."){let i=cw(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function qVt(e,t,r=0,n=(0,xke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=cw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function ki(e,t,r="index.json"){let n;t instanceof Promise?n=new Uint8Array(await t):t instanceof ArrayBuffer?n=new Uint8Array(t):n=t,await Yb.promises.mkdir(e,{recursive:!0});let i=(0,Jb.join)(e,r);try{await Yb.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function qc(e,t,r="index.json",n=!0,i){let a=await ki(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await $4(a);return await PW(a),o}}return a}async function Y4(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,Jb.join)(e,t);An(o,$I).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function wke(e){try{return await Yb.promises.stat(e),!0}catch{return!1}}function lw(e){return Yb.promises.rm(e,{recursive:!0})}function PW(e){return Yb.promises.unlink(e)}function cw(e){return(0,Jb.isAbsolute)(e)?e:(0,Jb.join)(process.cwd(),e)}var eo=class{nodesPerPage;nodesCounter;writeFile;converter;nodePages;length=0;constructor(t,r,n){this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=n,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,n;return this.converter.options.slpk?(r=(0,Xb.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,Xb.join)(this.converter.layers0Path,"nodepages",t.toString()),n="index.json"),{filePath:r,fileName:n}}async loadNodePage(t){let{filePath:r,fileName:n}=this.getNodePageFileName(t),i=(0,Xb.join)(r,n);return await wke(i)?(console.log(`load ${i}.`),await Y4(r,n)):{nodes:[]}}getPageIndexByNodeId(t){return Math.floor(t/this.nodesPerPage)}async getPageByNodeId(t){let r=this.getPageIndexByNodeId(t);return this.converter.options.instantNodeWriting?await this.loadNodePage(r):this.nodePages[r]}async getNodeById(t,r){let n=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[n]}async addChildRelation(t,r){var i;if(t==null)return;let n=await this.getNodeById(t);(i=n.children)==null||i.push(r),await this.saveNode(n)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let n=this.nodePages[this.nodePages.length-1];n.nodes.length===this.nodesPerPage&&(n={nodes:[]},this.nodePages.push(n)),n.nodes.push(t)}return await this.addChildRelation(r,t.index),eo.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),n=await this.getPageByNodeId(t.index),{filePath:i,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,n);o?eo.updateAll(o,t):n.nodes.push(t);let s=JSON.stringify(n);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(i,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,s)},!0)}else return}async saveMetadata(){let t=(0,Eke.default)({nodeCount:this.nodesCounter},PTe()),r=!1;await this.converter.writeQueue.enqueue({archiveKey:"metadata.json",writePromise:()=>this.writeFile(this.converter.layers0Path,JSON.stringify(t),"metadata.json",r)})}async save(){if(this.converter.options.instantNodeWriting){await this.saveMetadata();return}if(this.converter.options.slpk){for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Xb.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(i,n,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Xb.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,n)})}}static updateResourceInMesh(t){t.mesh&&isFinite(t.index)&&(t.mesh.geometry.resource=t.index)}static updateAll(t,r){return Object.assign(t,r,{index:t.index}),eo.updateResourceInMesh(t),t}static updateMaterialByNodeId(t,r){t.mesh&&(t.mesh.material={definition:r,resource:t.index})}static updateVertexCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.vertexCount=r)}static updateNodeAttributeByNodeId(t){!t.mesh||!t.index||(t.mesh.attribute.resource=t.index)}static updateFeatureCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.featureCount=r)}static updateTexelCountHintByNodeId(t,r){!t.mesh||!t.mesh.material||(t.mesh.material.texelCountHint=r)}};var fw=require("path"),J4=require("fs");function Qb(e){if(typeof e=="number"){let r=Math.floor(e/1e3),n=e-r*1e3;return Ake(r,n)}else{let r=e[0],n=e[1]/1e6;return Ake(r,n)}}function Ake(e,t){let r=Math.floor(e/3600);e=e-r*3600;let n=Math.floor(e/60);e=e-n*60;let i=Math.floor(e),a="";return r&&(a+=`${r}h `),n&&(a+=`${n}m `),i&&(a+=`${i}s`),a||(a+=`${t}ms`),a}async function X4(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=cw(r);try{if(t){let s=(0,fw.join)(i,`${n}.slpk`);return(await J4.promises.stat(s)).size}let a=(0,fw.join)(i,n);return await Ske(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function Ske(e){let t=0,r=await J4.promises.readdir(e);for(let n of r){let i=await J4.promises.stat((0,fw.join)(e,n));i.isDirectory()?t+=await Ske((0,fw.join)(e,n)):t+=i.size}return t}var zke=Wt(sG(),1);var D0=3,Zb=9;function Cke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Zb;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i,uvRegions:a};let u=NVt(o),c=UVt({...u,...e}),l=GVt(c);return zVt(l,u.featureCount)}function NVt(e){let t=1,r=1,n=Tke(e.slice(0,D0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=D0;c<e.length;c+=D0){let l=Tke(e.slice(c,c+D0));n!==l&&(i[t]=c/D0-1,i[t+1]=c/D0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/D0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Tke(e){let t={},r=e[0],n=1;for(let i of e)t[i]=(t[i]||0)+1,n=n>t[i]?n:t[i],r=n>t[i]?r:i;return r}function UVt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),p=new Float32Array(o),h=new Uint16Array(a),d=0,b=0,g=0,x=0,E=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=pw("positions",F,D),k=pw("normals",F,D),N=pw("colors",F,D),C=pw("uvRegions",F,D),I=pw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(d,d+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:h.subarray(x,x+C),texCoords:p.subarray(E,E+I)}),d+=j,b+=k,g+=N,x+=C,E+=I}return u}function pw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Zb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function GVt(e){let t=[];for(let n of e){let i=t.find(a=>a.featureId===n.featureId);i?i.attributes.push(n):t.push({featureId:n.featureId,attributes:[n]})}let r=[];for(let n of t){let i=Dke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function zVt(e,t){let n=[e[0].featureId||0],i=[0],a=0,o=0;for(let c=1;c<e.length;c++){let l=e[c];n.push(l.featureId||0);let f=e[a];i.push(f.positions.length/Zb-1+o),i.push(f.positions.length/Zb+o),o+=f.positions.length/Zb,a+=1}let s=Dke(e);return i.push(s.positions.length/Zb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function Dke(e){let t=e.map(({positions:f})=>f),r=t.length>1?Co(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?Co(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?Co(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?Co(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?Co(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function RW(e,t){let r,n,i,a=or.WGS84.cartesianToCartographic(e.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof sa?(n=e.halfSize,r=new ce(n[0],n[1],n[2]).len(),i=e.quaternion):(r=e.radius,n=[r,r,r],i=new ds().fromMatrix3(new Rr([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:n,quaternion:i}}}function Fke(e,t){let r=HVt(e),n=a_(r),i=U7(r),a=or.WGS84.cartesianToCartographic(i.center,new ce),o=or.WGS84.cartesianToCartographic(n.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function HVt(e){let t=[];for(let r=0;r<e.length;r+=3){let n=new ce([e[r],e[r+1],e[r+2]]);t.push(n)}return t}function kke(e){let t;e instanceof Ja?t=e:t=e.getBoundingSphere();let r=t.center,n=t.radius,i=or.WGS84.cartesianToCartographic(new ce(r[0]+n,r[1]+n,r[2]+n),new ce),a=or.WGS84.cartesianToCartographic(new ce(r[0]-n,r[1]-n,r[2]-n),new ce);return{xmin:Math.min(a[0],i[0]),xmax:Math.max(a[0],i[0]),ymin:Math.min(a[1],i[1]),ymax:Math.max(a[1],i[1]),zmin:Math.min(a[2],i[2]),zmax:Math.max(a[2],i[2])}}function jW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Rr([t,0,0,0,t,0,0,0,t]);return new sa(r,n)}function Bke(e,t,r){var s,u,c,l,f,p,h,d;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((p=e.gltf)==null?void 0:p.nodes)||[],i=((d=(h=e.gltf)==null?void 0:h.images)==null?void 0:d.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let E=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(E.length);return S.set(E),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];Oke(n);let{cartographicOrigin:a,modelMatrix:o}=VVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function WVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function VVt(e,t,r){let{rtcCenter:n,gltfUpAxis:i}=e,{center:a}=r,o=new Kr(t);switch(n&&o.translate(n),i){case"Z":break;case"Y":let c=new Kr().rotateX(Math.PI/2);o=o.multiplyRight(c);break;case"X":let l=new Kr().rotateY(-Math.PI/2);o=o.multiplyRight(l);break;default:break}let s=new ce(a),u=or.WGS84.cartesianToCartographic(s,new ce);return{modelMatrix:o,cartographicOrigin:u}}function Oke(e){var t;for(let r=0;r<e.length;r++){let n=e[r];n.mesh&&(e[r]={...n,mesh:{...n.mesh,primitives:(t=n.mesh)==null?void 0:t.primitives.map(i=>{var a,o,s;return{...i,indices:{value:(a=i==null?void 0:i.indices)==null?void 0:a.value},attributes:WVt(i.attributes),material:{id:(o=i==null?void 0:i.material)==null?void 0:o.id,uniqueId:(s=i==null?void 0:i.material)==null?void 0:s.uniqueId}}})}}),n.children&&Oke(n.children)}}function Ike(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[vs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function Pke(e,t,r,n){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[a,o]of Object.entries(i||{}))switch(a){case vs:return $Vt(e,o,r,n);case G8:return KVt(e,o);default:return[]}return[]}function KVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function $Vt(e,t,r,n){var o,s,u,c,l,f,p;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let h=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return YVt(h,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let d=`TEXCOORD_${((p=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:p.texCoord)||0}`,b=e[d].value;return JVt(a,b,r)}return n?e[n].value:[]}function YVt(e,t=0,r=0){let n=[];if(r>0){let i=t,a=r;for(let o=0;o<e;o++)n.push(i),a-=1,a===0&&(i++,a=r)}else n=Array(e).fill(t,0,e);return n}function JVt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let p=0;p<t.length;p+=2){let h=t[p],d=t[p+1],b=Math.min(Od(h)*o.width|0,o.width-1),x=(Math.min(Od(d)*o.height|0,o.height-1)*o.width+b)*o.components+u,E=new Uint8Array(o.data)[x];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function Rke(e,t){let r={};for(let n in t){let i=t[n];r[n]=XVt(i,e)}return r}function XVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function jke(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}function QVt(e){return typeof e=="string"||typeof e=="bigint"?Ln.STRING_TYPE:typeof e=="number"?Number.isInteger(e)?Ln.SHORT_INT_TYPE:Ln.DOUBLE_TYPE:Ln.STRING_TYPE}function Lke(e){let t={};for(let r in e){let n=e[r][0],i=QVt(n);t[r]=i}return t}var Mke=(e,t)=>{var a,o,s,u,c,l,f,p;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[vs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let h in n.properties){let d=n.properties[h],b=ZVt(d);r[h]=b}return r}let i=(p=(f=(l=(c=e.extensions)==null?void 0:c[Ol])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:p[t];if(i){for(let h in i.properties){let d=i.properties[h],b=eKt(d);r[h]=b}return r}return null},ZVt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t},eKt=e=>{let t;if(e.array)t=Ln.STRING_TYPE;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t};var Q4=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var tKt=1,rKt=1,Au=3,hw=2,nKt=4,iKt="string",aKt="Int32",oKt="Float64",sKt="Oid32",qke=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],bh=new ce;async function LW(e,t,r,n,i,a,o,s,u,c,l,f,p){var S;let h=u,d=await wKt((S=e.gltf)==null?void 0:S.materials,c),b=Bke(e,t,r),g=Ike(e,p),x=await lKt(b,d,h,g);u&&uKt(x,l);let E=[];for(let F of d){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:k,texture:N}=F,C=await n();E.push(await cKt({convertedAttributes:j,material:k,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return E.length?E:null}function uKt(e,t){for(let r of e.values()){let n=Fke(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Au){let o=r.positions.subarray(a,a+Au);or.WGS84.cartesianToCartographic(Array.from(o),bh),bh[2]=bh[2]-t.getHeight(bh[1],bh[0]),bh=bh.subtract(i),r.positions.set(bh,a)}}}async function cKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var I;let l=e.boundingVolumes,f=e.positions.length/Au,{faceRange:p,featureIds:h,positions:d,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=Cke(e),F={};o&&(F=IKt(h,e.featureIndices,a,o));let D=new Uint32Array(2),j=GKt(h);D.set([f,S],0);let k=new Uint8Array(tc(D.buffer,d.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,p.buffer)),N=u?zKt(f,e,{positions:d,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:h,faceRange:p},c):null,C=[];return s&&o&&(C=LKt(h,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:DKt(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function lKt(e,t,r,n){let{nodes:i,images:a,cartographicOrigin:o,cartesianModelMatrix:s}=e,u=new Map;for(let c of t){let l={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let f of c.mergedMaterials)u.set(f.originalMaterialId,l)}Hke(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,p)=>f.concat(p)),delete l.featureIndicesGroups)}}return u}function Hke(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){if(e)for(let u of e)pKt(u,t,r,n,i,a,o,s)}function fKt(e,t){let r=t,{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),o&&(r=r.translate(o)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),r}function pKt(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){let u=fKt(e,o),c=e.mesh;c&&hKt(c,t,r,n,i,a,u,s),Hke(e.children||[],t,r,n,i,a,u,s)}function hKt(e,t,r,n,i,a=!1,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){var u;for(let c of e.primitives){let l=null,f;c.material?(l=i.get(c.material.id),f=(u=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var b;return d===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Qt(l!==null,"Primitive - material mapping failed"),Qt(c.mode===void 0||c.mode===Ht.TRIANGLES||c.mode===Ht.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let p=c.attributes;if(!l)continue;let h=dKt(c);l.positions=Co(l.positions,Nke({vertices:p.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:mKt,useCartesianPositions:a})),l.normals=Co(l.normals,Nke({vertices:p.NORMAL&&p.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:gKt,useCartesianPositions:!1})),l.texCoords=Co(l.texCoords,vKt(p.TEXCOORD_0&&p.TEXCOORD_0.value,h)),l.colors=Co(l.colors,bKt(p.COLOR_0,h)),f&&(l.uvRegions=Co(l.uvRegions,yKt(f,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(xKt(_Kt(p,c,t,s),h))}}function dKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return Q4(n.length/Au)}if(t&&e.mode===Ht.TRIANGLE_STRIP){let n=t.constructor,i=new n((t.length-2)*3),a=0,o=t.slice(0,3);i.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2===0?i.set(o,a):i.set(o.reverse(),a);t=i}return t}function Nke(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Au);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Au,s=t.subarray(o,o+Au),u=new ce(Array.from(s));u=n(u,e),i[a*Au]=u.x,i[a*Au+1]=u.y,i[a*Au+2]=u.z}return i}function mKt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a||(or.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n)),e}function gKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function vKt(e,t){let r=new Float32Array(t.length*hw);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*hw,a=e.subarray(i,i+hw);r[n*hw]=a[0],r[n*hw+1]=a[1]}return r}function bKt(e,t){let r=(e==null?void 0:e.components)||nKt,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;let i=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=i.subarray(o,o+r),u=new Uint8Array(r);for(let c=0;c<s.length;c++)u[c]=s[c]*255;n.set(u,a*r)}return n}function yKt(e,t){let r=new Uint16Array(t.length*4);for(let n=0;n<r.length;n+=4)r.set(e,n);return r}function xKt(e,t){if(!e.length||!t.length)return[];let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(e[i])}return r}function _Kt(e,t,r,n){let i=Pke(e,t,r,n);if(i.length)return i;for(let a=0;a<qke.length;a++){let o=qke[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function wKt(e=[],t){let r=[];for(let n of e)r.push(SKt(n));return t&&(r=await EKt(r)),r}async function EKt(e){var r,n;let t=[];for(;e.length>0;){let i=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(i.texture&&s.texture||!i.texture&&!s.texture)&&(i=await AKt(i,s),a.push(o))}if(i.texture&&a.length){let o=(r=i.mergedMaterials)==null?void 0:r.reduce((c,{textureSize:l})=>c+((l==null?void 0:l.width)||0),0),s=(n=i.mergedMaterials)==null?void 0:n.reduce((c,{textureSize:l})=>Math.max(c,(l==null?void 0:l.height)||0),0),u=-1;for(let c of i.mergedMaterials)if(c.textureSize){let l=u+1+c.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;c.uvRegion=new Uint16Array([u+1,0,l,c.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=l}i.texture.image.width=o,i.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(i)}return t.length||t.push({material:CKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function AKt(e,t){var r,n;if((r=e.texture)!=null&&r.bufferView&&((n=t.texture)!=null&&n.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let i=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([i,a],{direction:"horizontal"});e.texture.bufferView.data=await s.toFormat(e.texture.mimeType==="image/png"?"png":"jpeg").toBuffer()}catch(o){throw console.log("Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)"),o}e.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId=1}return e.mergedMaterials=e.mergedMaterials.concat(t.mergedMaterials),e}function SKt(e){var i,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(i=e.emissiveFactor)==null?void 0:i.map(c=>Math.round(c*255)),alphaMode:TKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||tKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||rKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Oc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function TKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function CKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function DKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=FKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function FKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=BKt(r.texture,t));let{baseColorFactor:i,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=i;return(!i||i[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:kKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function kKt(e,t=1){let r=.00015686274509803922,n=new hs(0,0,0,1),i=new hs(1,1,1,1),a=new hs(r,r,r,0),o=new hs(e),s=i.subtract(a).multiply(o),u=s.lerp(s,n,t);a[3]=1;let c=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:c.toArray(),renderMode:"solid"}}}function BKt(e,t){var r,n,i,a;return{encoding:(r=e==null?void 0:e.source)!=null&&r.mimeType?[e.source.mimeType]:void 0,images:[{id:OKt(e,t),size:(n=e.source)==null?void 0:n.image.width,length:(i=e.source)!=null&&i.image.data.length?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function OKt(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,p=n-1<<0,h=c+l+f+p;return BigInt(`0b${h.toString(2)}${u}`).toString()}function IKt(e,t,r,n){let i=PKt(e,n,r);return Uke(t,i),Uke(e,i),i}function PKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=jKt(i,t,r);n[a.toString()]=o}return n}function RKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function jKt(e,t,r){let n=RKt(t,e),i=(0,zke.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function Uke(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function LKt(e,t,r,n){let i=[],o=jke(e,r)?Rke(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=qKt(u,n);if(c){let l=s[u],f=MKt(c,l);i.push(f)}}return i}function MKt(e,t){let r;switch(e){case sKt:case aKt:r=NKt(t);break;case oKt:r=UKt(t);break;case iKt:r=Gke(t);break;default:r=Gke(t)}return r}function qKt(e,t){let r=t.find(n=>n.name===e);return r?r.attributeValues?r.attributeValues.valueType:(console.error(`attributeValues is null, attribute=${r}`),""):(console.error(`attribute is null, key=${e}, attributeStorageInfo=${JSON.stringify(t,null,2)}`),"")}function NKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return tc(t.buffer,r.buffer)}function UKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return tc(t.buffer,r.buffer,n.buffer)}function Gke(e){let t=new Uint32Array([e.length]),r=0,n=new Uint32Array(e.length),i=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),c=u.length;r+=c,n[o]=c,i.push(u)}let a=new Uint32Array([r]);return tc(t.buffer,a.buffer,n.buffer,...i)}function GKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function zKt(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let p=new Uint32Array(t.featureIndices.length?t.featureIndices:e),h=HKt(p,l),d={positions:i,normals:a,colors:s,"feature-index":h};o.length&&(d.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(d["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),hv({attributes:d,indices:f},K7,{...K7.options,reuseWorkers:!0,_nodeWorkers:!0,modules:n,useLocalLibraries:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:b},["draco-writer"]:{workerUrl:"./modules/draco/dist/draco-writer-worker-node.js"}})}function HKt(e,t){let r=new Uint32Array(e.length),n=0,i=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Au;r.fill(n,i,o),n++,i=o+1}return r}function Wke(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=KKt(e);switch(i){case Ol:return r=WKt(a,t),r;case vs:return r=VKt(a,t),r;default:return null}}function WKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return Z4(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return Z4(r)}return null}function VKt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return Z4(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return Z4(n)}return null}function Z4(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function KKt(e){var a,o,s,u;let t=[vs,Ol];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let n="";for(let c of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(c)){n=c;break}if(!n)return{extensionName:null,extension:null};let i=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[n];return{extensionName:n,extension:i}}var Kke=Wt(wu(),1),$ke=require("path");var Vke=()=>({serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}});async function Yke(e,t,r){let n={serviceItemId:Oc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,Kke.default)(n,Vke()),a=(0,$ke.join)(r,"SceneServer");await ki(a,JSON.stringify(i))}var MW=16;function Jke(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*MW/i},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return n.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function qW(e){var n,i;let t=(n=e.lodSelection)==null?void 0:n.find(a=>a.metricType==="maxScreenThreshold"),r=t==null?void 0:t.maxError;if(!r){let a=(i=e.lodSelection)==null?void 0:i.find(o=>o.metricType==="maxScreenThresholdSQ");a&&(r=Math.sqrt(a.maxError/(Math.PI*.25)))}return r||(r=MW),e.mbs[3]*2*MW/r}var $Kt=240,YKt=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],JKt=372,XKt=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],QKt=372,ZKt=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],e$t=12,NW=(3+1)*(3+2)/2,t$t=2,ey=class{constructor(t){zt(this,"_v00",0),zt(this,"_v01",0),zt(this,"_v10",0),zt(this,"_v11",0),zt(this,"_t",[]),zt(this,"_ix",void 0),zt(this,"_iy",void 0),zt(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,r){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(r))return NaN;let n=r$t(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,p=new Array(NW);if(o===this._ix&&s===this._iy)this.options.cubic?p=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let d=[this._rawval(o,s-1),this._rawval(o+1,s-1),this._rawval(o-1,s),this._rawval(o,s),this._rawval(o+1,s),this._rawval(o+2,s),this._rawval(o-1,s+1),this._rawval(o,s+1),this._rawval(o+1,s+1),this._rawval(o+2,s+1),this._rawval(o,s+2),this._rawval(o+1,s+2)],b=XKt;s!==0&&(b=s===this.options._height-2?ZKt:YKt);let g=JKt;s!==0&&(g=s===this.options._height-2?QKt:$Kt);for(let x=0;x<NW;++x){p[x]=0;for(let E=0;E<e$t;++E)p[x]+=d[E]*b[NW*E+x];p[x]/=g}}if(!this.options.cubic){let d=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*d+a*b,x=this.options._offset+this.options._scale*g;return this._ix=o,this._iy=s,this._v00=u,this._v01=c,this._v10=l,this._v11=f,x}let h=p[0]+i*(p[1]+i*(p[3]+i*p[6]))+a*(p[2]+i*(p[4]+i*p[7])+a*(p[5]+i*p[8]+a*p[9]));return h=this.options._offset+this.options._scale*h,this._ix=o,this._iy=s,this._t=p,h}_rawval(t,r){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(r<0||r>=this.options._height)&&(r=r<0?-r:2*(this.options._height-1)-r,t+=(t<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+t$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function r$t(e,t){t=Math.abs(t);let r=Xke(e,t);return 2*Math.abs(r)===t?r-=Xke(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Xke(e,t){return e-Math.floor(e/t)*t}var n$t=10,i$t=65535;function UW(e,t){let r=a$t(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,p=null,h=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let E=x.split(" "),S=E[0],F=E[1];if(S!=="#"||!F)continue;let D=E.length>2?E.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!E[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(E[2],10)}else if(F==="Scale"){if(!E[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(E[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(E[2]))&&(o=parseFloat(E[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(E[2]))&&(s=parseFloat(E[2]))}else{let E=x.split(" ");if(E=E.filter(S=>S!==""),l=parseInt(E[0],10),f=parseInt(E[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(d!==i$t)throw new Error("Geoid model file: Incorrect value of maxval");if(p=n.value.offset,h=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(a===0)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(f<2||l<2)throw new Error("Geoid model file: Raster size too small");if(l&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");let b=l/360,g=(f-1)/180;return new ey({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:h,_datastart:p,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*a$t(e){let t=0;do{let r=e.indexOf(n$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:Qke(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Qke(n)}}}while(t<e.length);return{offset:t,line:""}}function Qke(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var o$t="4.0.5";var ek={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:o$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>UW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var ty=Wt(wu(),1);var Zke={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}};var s$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),u$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),c$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),l$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),eBe=()=>({version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>(0,ty.default)(e,s$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,ty.default)(e,Zke)},fullExtent:{path:"fullExtent",transform:e=>(0,ty.default)(e,l$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,ty.default)(e,u$t())},nodePages:{path:"nodePages",transform:e=>(0,ty.default)(e,c$t())},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"geometryDefinitions",default:[]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}});var GW=Wt(wu(),1),f$t=()=>({offset:{default:8},position:{default:{type:"Float32",component:3}},normal:{default:{type:"Float32",component:3}},uv0:{path:"hasTexture",transform:e=>e&&{type:"Float32",component:2}||!1,omitValues:[!1]},color:{default:{type:"UInt8",component:4}},uvRegion:{path:"hasUvRegions",transform:e=>e&&{type:"UInt16",component:4}||!1,omitValues:[!1]},featureId:{default:{binding:"per-feature",type:"UInt64",component:1}},faceRange:{default:{binding:"per-feature",type:"UInt32",component:2}}}),p$t=()=>({"compressedAttributes.encoding":{default:"draco"},"compressedAttributes.attributes":{path:"geometryConfig",transform:e=>{let t=["position","normal"];return e.hasTexture&&t.push("uv0"),t.push("color"),e.hasUvRegions&&t.push("uv-region"),t.push("feature-index"),t}}}),tBe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,GW.default)(e,f$t())];return e.draco&&t.push((0,GW.default)({geometryConfig:e},p$t())),t}}});var dw=Wt(wu(),1),h$t=()=>({renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1]},diffuse:{path:"diffuse",default:[1,1,1]},specular:{path:"specular",default:[0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}}),d$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,dw.default)(r,h$t())}}),m$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),g$t=()=>({encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(n=>(0,dw.default)(n,m$t()))}}),rBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:v$t},textureDefinitions:{path:"textureDefinitionInfos",transform:b$t}});function v$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,dw.default)(a,d$t());return n}function b$t(e,t,r){if(!e)return null;let n={};for(let[i,a]of e.entries()){let o=`${r.nodePath}${i}`;a.imageIndex=o,n[o]=(0,dw.default)(a,g$t())}return n}var y$t=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]);function iBe(e){var r,n;if(!((r=e==null?void 0:e.parentNode)!=null&&r.obb)||!((n=e==null?void 0:e.parentNode)!=null&&n.mbs))return[];let t=[];return x$t(t,e),_$t(t,e),t}function x$t(e,t){var o;let r=w$t(t.parentNode.obb),n=E$t(t);if(A$t(r,n))return;let a=`OBB of Tile (${t.id}) doesn't fit into Parent (${(o=t.parentNode)==null?void 0:o.id}) tile OBB`;e.push(a)}function _$t(e,t){var a;let r=nBe(t.mbs),n=nBe(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){let o=`MBS of Tile (${t.id}) doesn't fit into Parent (${(a=t.parentNode)==null?void 0:a.id}) tile MBS`;e.push(o)}}function nBe(e){return new Ja([e[0],e[1],e[2]],e[3])}function w$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new sa().fromCenterHalfSizeQuaternion(t,r,n)}function E$t(e){let t=e.obb.halfSize,r=y$t,n=or.WGS84.cartographicToCartesian(e.obb.center),i=[];for(let a=0;a<r.length;a+=3){let s=new ce(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(n);i=i.concat(s)}return i}function A$t(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){let i=[t[n],t[n+1],t[n+2]],a=or.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}var tk=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var aBe=Wt(require("process"),1),S$t=4*1024*1024*1024,ry=class extends tk{intervalId;writePromise=null;fileMap={};listeningInterval;writeConcurrency;constructor(t=2e3,r=400){super(),this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:n,writePromise:i}=t,a=await i();n&&a&&(this.fileMap[n]=a)}else super.enqueue(t),aBe.default.memoryUsage().rss>S$t&&await this.startWrite()}startListening(){this.intervalId=setInterval(this.startWrite.bind(this),this.listeningInterval)}stopListening(){this.intervalId&&clearInterval(this.intervalId)}async startWrite(){this.writePromise||(this.writePromise=this.doWrite()),await this.writePromise,this.writePromise=null}async finalize(){this.stopListening(),await this.startWrite()}async doWrite(){for(;this.length;){let t=[],r=[];for(let i=0;i<this.writeConcurrency;i++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let n=await Promise.allSettled(t);this.updateFileMap(r,n)}}updateFileMap(t,r){for(let n=0;n<t.length;n++){let i=t[n];i&&"value"in r[n]&&(this.fileMap[i]=r[n].value)}}};var ny="Tile converter does not work in browser, only in node js environment";var HW=require("path"),WW=Wt(wu(),1);var oBe=Wt(wu(),1),sBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),T$t=()=>({href:{path:"href"}}),C$t=()=>({id:{path:"id"},...T$t(),...sBe()}),zW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...sBe(),lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>(0,oBe.default)(e,C$t()),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});var Su=class{id;inPageId;data=null;children=[];converter;_finalized=!1;get finalized(){return this._finalized}constructor(t,r){this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}async addData(t){return this.converter.options.instantNodeWriting?await this.write(t):this.data=t,this}async addChildren(t){let r=[];for(let i of t){let a=await i.load();r.push({id:i.id,href:`../${i.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let n=this.data;this.converter.options.instantNodeWriting&&(n=await this.load()),n&&(n.children=n.children??[],n.children=n.children.concat(r)),this.converter.options.instantNodeWriting&&n&&await this.write(n)}async addNeighbors(){var r;if(this.finalized)return;let t=await this.load();for(let n of this.children){let i=await n.load();if(i.neighbors=i.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])n.id!==a.id&&i.neighbors.push({...a});else console.warn(`Node ${n.id}: neighbors attribute is omited because of large number of neigbors`),delete i.neighbors;this.converter.options.instantNodeWriting&&i&&await n.write(i),await n.save()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,HW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>qc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>ki(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,HW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await Y4(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Su.createRootNodeIndexDocument(t);return await new Su(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Su.createNodeIndexDocument(t,r,n,i,a);return await new Su(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Oc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,WW.default)(r,zW())}static async createNodeIndexDocument(t,r,n,i,a){var p,h;let{texture:o,attributes:s}=a,u=i.index,c=await t.load(),l={version:c.version,id:u.toString(),level:c.level+1,...r,lodSelection:n,parentNode:{id:t.id,href:`../${t.id}`,mbs:c.mbs,obb:c.obb},children:[],neighbors:[]},f=(0,WW.default)(l,zW());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((h=(p=t.converter.layers0)==null?void 0:p.attributeStorageInfo)!=null&&h.length))){f.attributeData=[];let d=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<d;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var VW=async(e,t,r)=>{let n=mw(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await rk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},KW=async(e,t,r)=>{let n=mw(t);if(!e||!t.contentUrl||n)return null;let i={...r,[e.loader.id]:{...r[e.loader.id]||{},isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}};return await rk(t.contentUrl,e.loader,i)};async function rk(e,t,r){let n=e.split(".3tz"),i;if(n.length===1)i=null;else if(n.length===2)i=n[1].slice(1),i===""&&(i="tileset.json");else throw new Error("Unexpected URL format");if(i){let a=`${n[0]}.3tz`,o=new c2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function mw(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var nk=async(e,t,r,n,i,a=0)=>{if(i&&a>i)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await nk(u,s,r,n,i,a+1);n&&await n(o,t)};var D$t=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],uBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Bo(e.gltfArrayBuffer,Il,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=F$t(n),a=k$t(n);return{meshTopologyTypes:i,metadataClasses:a}},F$t=e=>{let t=new Set;for(let r of e.meshes||[])for(let n of r.primitives){let{mode:i}=n;typeof i!="number"&&(i=4),t.add(D$t[i])}return t},k$t=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[vs])==null?void 0:a.schema)==null?void 0:o.classes;if(r)for(let l of Object.keys(r))t.add(l);let n=(c=(u=(s=e.extensions)==null?void 0:s[Ol])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},cBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var lBe=Wt(require("process"),1);var B$t=.2,ik=class{_stepsTotal=0;_stepsDone=0;startTime=0;stopTime=0;timeOfUpdatingStepsDone=0;milliSecForOneStep=0;trust=!1;numberOfDigitsInPercentage=0;threshold;getTime;constructor(t={}){this.getTime=t.getTime||lBe.default.hrtime.bigint,this.threshold=t.threshold||B$t}get stepsTotal(){return this._stepsTotal}set stepsTotal(t){this._stepsTotal=t,this.numberOfDigitsInPercentage=this.stepsTotal>100?Math.ceil(Math.log10(this.stepsTotal))-2:0}get stepsDone(){return this._stepsDone}set stepsDone(t){if(this._stepsDone=t,this.timeOfUpdatingStepsDone=this.getCurrentTimeInMilliSeconds(),this._stepsDone){let n=(this.timeOfUpdatingStepsDone-this.startTime)/this._stepsDone;this.trust=this.isVelocityTrust(n,this.milliSecForOneStep),this.milliSecForOneStep=n}}startMonitoring(){this.startTime=this.getCurrentTimeInMilliSeconds(),this.milliSecForOneStep=0,this.trust=!1,this.timeOfUpdatingStepsDone=0,this.stopTime=0,this.stepsDone=0}stopMonitoring(){this.stopTime=this.getCurrentTimeInMilliSeconds()}getPercent(){return this._stepsTotal?this._stepsDone/this._stepsTotal*100:null}getPercentString(){let t=this.getPercent();return t!==null?t.toFixed(this.numberOfDigitsInPercentage):""}getTimeCurrentlyElapsed(){return(this.stopTime?this.stopTime:this.getCurrentTimeInMilliSeconds())-this.startTime}getTimeRemaining(){return!this._stepsDone||!this.startTime?null:{timeRemaining:(this._stepsTotal-this._stepsDone)*this.milliSecForOneStep,trust:this.trust}}getTimeRemainingString(){let t=this.getTimeRemaining();return t!=null&&t.trust?Qb(t.timeRemaining):""}isVelocityTrust(t,r){return r?Math.abs((t-r)/r)<this.threshold:!1}getCurrentTimeInMilliSeconds(){return Number(this.getTime()/BigInt(1e6))}};var pBe,O$t=(pBe=F0.default.env)==null?void 0:pBe.IonToken,fBe=64,I$t="3DTILES",P$t="3DObject",R$t=1800,j$t="https://",yh="phase1-count",iy=class{attributeMetadataInfo;nodePages;options;layers0Path;materialMap;materialDefinitions;geometryMap;geometryConfigs;vertexCounter;layers0;featuresHashArray;refinementCounter;validate;boundingVolumeWarnings=[];conversionStartTime=[0,0];refreshTokenTime=[0,0];sourceTileset=null;loadOptions={_nodeWorkers:!0,reuseWorkers:!0,useLocalLibraries:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{},modules:{}};geoidHeightModel=null;Loader=Ac;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ry;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};progresses={};constructor(){this.attributeMetadataInfo=new XC,this.nodePages=new eo(ki,fBe,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(gn)return console.log(ny),ny;this.conversionStartTime=F0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:p,generateBoundingVolumes:h,instantNodeWriting:d=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:E=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:d,mergeMaterials:b,inquirer:g,metadataClass:x},this.progresses[yh]=new ik,this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(j$t)!==-1?dD:Ac,this.generateTextures=Boolean(p),this.generateBoundingVolumes=Boolean(h),this.writeQueue=new ry,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,ek),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(qc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await rk(F,this.Loader,this.loadOptions),(this.Loader===Ac||E?await this.preprocessConversion():!0)&&!E&&await this.selectMetadataClass()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(n),outputPath:s,tilesetName:r}))}catch(S){throw S}finally{await this.writeQueue.finalize(),La.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await nk(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r,metadataClasses:n}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`Tile count: ${this.progresses[yh].stepsTotal}`),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),n.size?console.log(`Feature metadata classes have been found: ${Array.from(n).join(", ")}`):console.log("Feature metadata classes have not been found"),console.log("------------------------------------------------"),!r.has("TRIANGLES")&&!r.has("TRIANGLE_STRIP")?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(mw(t))return await VW(this.sourceTileset,t,this.loadOptions),null;t.id&&(this.progresses[yh].stepsTotal+=1,console.log(`[analyze]: ${t.id}`));let i=null;try{i=await KW(this.sourceTileset,t,{...this.loadOptions,"3d-tiles":{...this.loadOptions["3d-tiles"],loadGLTF:!1}})}catch{console.log(`[warning]: Failed to load ${t.contentUrl}. An I3S tile with empty content will be added to the output tileset`)}let a=await uBe(i);return cBe(this.preprocessData,a),null}async selectMetadataClass(){var r;let{metadataClasses:t}=this.preprocessData;if(t.size>1)if((r=this.options.metadataClass)!=null&&r.length)console.log(`${this.options.metadataClass} has been selected`);else if(this.options.inquirer){let n=await this.options.inquirer.prompt([{name:"metadataClass",type:"list",message:"Select feature metadata data class to convert...",choices:Array.from(t)}]);this.options.metadataClass=n.metadataClass,console.log(`${n.metadataClass} has been selected`)}else return console.log(`A feature metadata class has not been selected. Start the converter with option "--metadata-class". For example, "npx tile-converter ... --metadata-class ${Array.from(t)[0]}"`),console.log("------------------------------------------------"),!1;return!0}async _createAndSaveTileset(t,r){var u,c,l;let n=(0,Ga.join)(`${t}`,`${r}`);try{await lw(n)}catch{}this.layers0Path=(0,Ga.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=F8(i.boundingVolume,new Kr(i.transform),null);this._formLayers0(r,a,(l=(c=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:c.boundingVolume)==null?void 0:l.region);let o=RW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]}),this.progresses[yh].startMonitoring();let s=await Su.createRootNode(o,this);await nk(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.progresses[yh].stopMonitoring(),console.log("[finalizing conversion]"),this.layers0.attributeStorageInfo=this.attributeMetadataInfo.attributeStorageInfo,this.layers0.fields=this.attributeMetadataInfo.fields,this.layers0.popupInfo=this.attributeMetadataInfo.popupInfo,this.attributeMetadataInfo.attributeStorageInfo.length&&(this.layers0.layerType=P$t),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,ak.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),tBe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Yke(r,this.layers0,n);for(let f of this.compressList||[])await $4(f),await PW(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r,n){var s;if(!((s=this.sourceTileset)!=null&&s.root))return;let i=kke(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Oc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Oc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:fBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,ak.default)(o,eBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>qc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>ki(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Ga.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await _ke(r,n,0,".",this.options.sevenZipExe);try{await lw(t)}catch{}}}async convertTile(t,r){let n=mw(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await VW(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:a}=r,o=a.clone();t.transform&&(o=o.multiplyRight(t.transform));let s=i[0],u=await this._createNode(s,t,o);await s.addChildren(u);let c={transform:o,parentNodes:u};if(t.id){this.progresses[yh].stepsDone+=1;let l="Calculating time left...",f=this.progresses[yh].getTimeRemainingString();f&&(l=`${f} left`);let p=this.progresses[yh].getPercentString();console.log(`[converted ${p}%, ${l}]: ${t.id}`)}return c}async finalizeTile(t,r){for(let n of t)for(let i of n.parentNodes)await i.addNeighbors();for(let n of r.parentNodes)await n.save()}async _createNode(t,r,n){this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let i=null;try{i=await KW(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=F8(r.boundingVolume,n,null),o=RW(a,this.geoidHeightModel),s=Wke(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],p={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let h of u||[p]){this.layersHasTexture=this.layersHasTexture||Boolean(h.texture),this.generateBoundingVolumes&&h.boundingVolumes&&(o=h.boundingVolumes);let d=Jke(r,o),b=d.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,h),x=await Su.createNodeIndexDocument(t,o,d,g,h),E=await new Su(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(h,E.id),this.validate&&(this.boundingVolumeWarnings=iBe(x),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),l.push(g.index),f.push(g)}return c}async _convertResources(t,r,n,i,a,o){if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await LW(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,this.attributeMetadataInfo.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,p={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(p.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let h=a.nodeId,d;if(h?d=await this.nodePages.getNodeById(h):d=await this.nodePages.push(p,i),p.mesh||console.log(`[warning]: node ${d.index} is created with empty content`),eo.updateAll(d,p),o&&eo.updateMaterialByNodeId(d,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;eo.updateTexelCountHintByNodeId(d,b)}return u&&(this.vertexCounter+=u,eo.updateVertexCountByNodeId(d,u)),eo.updateNodeAttributeByNodeId(d),c&&eo.updateFeatureCountByNodeId(d,c),this.nodePages.saveNode(d),d}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Ga.join)(this.layers0Path,"nodes",r),c=(0,Ga.join)("nodes",r);await this._writeGeometries(n,i,u,c),await this._writeShared(o,u,c,r),await this._writeTexture(a,u,c),await this._writeAttributes(s,u,c)}async _writeGeometries(t,r,n,i){if(this.options.slpk){let a=(0,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>qc(a,t,"0.bin")})}else{let a=(0,Ga.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>ki(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>qc(a,r,"1.bin")})}else{let a=(0,Ga.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>ki(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,ak.default)(t,rBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Ga.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>qc(s,o,"sharedResource.json")})}else{let s=(0,Ga.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>ki(s,o)})}}async _writeTexture(t,r,n){if(t){let i=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(i){case"jpg":case"png":{if(a.push({name:"0",format:i}),await this.writeTextureFile(o,"0",i,r,n),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),c=hv({...t.image,data:u},wq,{...wq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=hv(t.image.data[0],aq);await this.writeTextureFile(s,"0","jpg",r,n)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,n,i,a){if(this.options.slpk){let o=(0,Ga.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>qc(o,t,`${r}.${n}`,s)})}else{let o=(0,Ga.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>ki(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){if(t!=null&&t.length&&this.attributeMetadataInfo.attributeStorageInfo.length){let i=t.length<this.attributeMetadataInfo.attributeStorageInfo.length?t.length:this.attributeMetadataInfo.attributeStorageInfo.length;for(let a=0;a<i;a++){let o=this.attributeMetadataInfo.attributeStorageInfo[a].key,s=new Uint8Array(t[a]);if(this.options.slpk){let u=(0,Ga.join)(r,"attributes",o);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${o}.bin.gz`,writePromise:()=>qc(u,s,"0.bin")})}else{let u=(0,Ga.join)(r,`attributes/${o}/0`);await this.writeQueue.enqueue({writePromise:()=>ki(u,s,"index.bin")})}}}}_getFormatByMimeType(t){switch(t){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(t){let r=(0,$W.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let n=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,n),n}findOrCreateGeometryDefinition(t,r){let n={hasTexture:t,hasUvRegions:r},i=(0,$W.default)(JSON.stringify(n));if(this.geometryMap.has(i))return this.geometryMap.get(i)||0;let a=this.geometryConfigs.push(n)-1;return this.geometryMap.set(i,a),a}createAttributeStorageInfo(t,r){let n=null;this.options.metadataClass?!this.attributeMetadataInfo.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=Mke(t.gltf,this.options.metadataClass)):r&&(n=Lke(r)),n&&this.attributeMetadataInfo.addMetadataInfo(n)}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await X4(t),o=F0.default.hrtime(this.conversionStartTime),s=Qb(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${I$t}`),console.log(`Total conversion time: ${s}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",a," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',i,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||O$t}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=F0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(F0.default.hrtime(this.refreshTokenTime)[0]<R$t)return;this.refreshTokenTime=F0.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch={...this.loadOptions.fetch,headers:r.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){t.refine===1&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){return["b3dm","glTF","scenegraph"].includes(t.type||"")}};var RBe=require("path"),ZW=Wt(require("process"),1),jBe=Wt(wu(),1);function YW(e){switch(e){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: ${e}`)}}var hBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function ay(e){switch(e){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: ${e}`)}}var dBe="String",mBe="Oid32",gBe="Float64",vBe="Int16";function ok(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function oy(e,t=null){return t?`${e}?token=${t}`:e}function bBe(e,t){let{attributeData:r=[]}=t,n=[];for(let i=0;i<r.length;i++){let a=r[i].href.replace("./","");n.push(`${e}/${a}`)}return n}function yBe(e,t,r){let n=[],{attributeStorageInfo:i=[]}=e;for(let a=0;a<i.length;a++){let o=i[a].key;n.push(`${t}/nodes/${r}/attributes/${o}/0`)}return n}var sk=new ce([0,0,0]);function M$t(e){switch(e){case"ktx-etc2":case"dds":return X8;case"ktx2":return Rd;case"jpg":case"png":default:return Cv}}var q$t="i3s-attribute-type";async function EBe(e,t,r,n,i){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Kr,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=oy(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=M$t(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Cv){let p={...t.textureLoaderOptions,image:{type:"data"}};try{let h=await To(f,[],p,i);a.texture=h}catch{let d=await Bo(f,u,p,i);a.texture=d}}else if(u===X8||u===Rd){let p=await An(f,u,t.textureLoaderOptions);u===Rd&&(p=p[0]),a.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else a.texture=f}return a.material=$$t(t.materialDefinition,a.texture),a.material&&(a.texture=null),await N$t(e,a,t,r,n)}async function N$t(e,t,r,n,i){var f,p;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let h=await Bo(e,_v,{draco:{attributeNameEntry:q$t}});s=h.header.vertexCount,l=(f=h.indices)==null?void 0:f.value;let{POSITION:d,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=h.attributes;o={position:d,normal:b,color:g,uv0:x,uvRegion:S,id:E},U$t(o,h);let F=Q$t(E);F&&X$t(o,F)}else{let{vertexAttributes:h,ordering:d,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=z$t(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=_Be(e,u,h,s,d),{attributes:F}=_Be(e,S,b,c,g);J$t(F),o=G$t(E,F)}if(!((p=i==null?void 0:i.i3s)!=null&&p.coordinateSystem)||i.i3s.coordinateSystem===2){let h=W$t(o.position,r);t.modelMatrix=h.invert(),t.coordinateSystem=2}else t.modelMatrix=K$t(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:xBe(o.color),texCoords:o.uv0,uvRegions:xBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let h in t.attributes)t.attributes[h]||delete t.attributes[h];return t.vertexCount=s,t.byteLength=a,t}function U$t(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function G$t(e,t){return{...e,...t}}function xBe(e){return e&&(e.normalized=!0,e)}function z$t(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=YW(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=ay(o);break;case"featureCount":i=new s(e,4,4)[0],r+=ay(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function _Be(e,t,r,n,i){let a={};for(let o of i)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+n*u*ay(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=H$t(c,n*u,ay(s));else{let f=YW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:hBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*ay(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function H$t(e,t,r){let n=[],i=new DataView(e),a=0;for(let o=0;o<t;o++){let s=i.getUint32(a,!0),u=i.getUint32(a+4,!0),c=s+2**32*u;n.push(c),a+=r}return new Uint32Array(n)}function W$t(e,t){let r=t.mbs,n=e.value,i=e.metadata,a=new Kr,o=new ce(r[0],r[1],r[2]),s=new ce;return or.WGS84.cartographicToCartesian(o,s),or.WGS84.eastNorthUpToFixedFrame(s,a),e.value=V$t(n,i,o),a}function V$t(e,t={},r){let n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let o=0;o<n.length;o+=3)n[o]=e[o]*i+r.x,n[o+1]=e[o+1]*a+r.y,n[o+2]=e[o+2]+r.z;for(let o=0;o<n.length;o+=3)or.WGS84.cartographicToCartesian(n.subarray(o,o+3),sk),n[o]=sk.x,n[o+1]=sk.y,n[o+2]=sk.z;return n}function K$t(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,n=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,i=new Kr;return i[0]=r,i[5]=n,i}function $$t(e,t){let r;return e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?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=wBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=wBe(r.pbrMetallicRoughness.baseColorFactor)),t&&Y$t(r,t),r}function wBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function Y$t(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function J$t(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],p=i[c-1],h=f-p+1,d=u+h*3;o.fill(l,u,d),s++,u=d}e.id.value=o}function X$t(e,t){let r=e.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function Q$t(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var Z$t="4.0.5",ABe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Z$t,mimeTypes:["application/octet-stream"],parse:eYt,extensions:["bin"],options:{"i3s-content":{}}};async function eYt(e,t,r){let{tile:n,_tileOptions:i,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=i||n,u=o||a;return!s||!u?null:await EBe(e,s,u,t,r)}var tYt="4.0.5",SBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:tYt,mimeTypes:["application/json"],parse:rYt,extensions:["json"],options:{i3s:{}}};async function rYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var gw=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(t,r="",n){var i,a;this.tileset={...t},this.url=r,this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(a=t.nodePages)==null?void 0:a.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var i;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=oy(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,SBe,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=t%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(t){let r=await this.getNodeById(t),n=[],i=[];for(let h of r.children||[])i.push(this.getNodeById(h));let a=await Promise.all(i);for(let h of a)n.push({id:h.index.toString(),obb:h.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:d}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=h,f=d;let{textureData:b,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,c=b.format||c,b.name&&(s=`${this.url}/nodes/${r.mesh.material.resource}/textures/${b.name}`),this.tileset.attributeStorageInfo&&(l=yBe(this.tileset,this.url,r.mesh.attribute.resource))}let p=this.getLodSelection(r);return JW({id:t.toString(),lodSelection:p,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Rv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=p_();r.has("etc2")&&t.push("ktx-etc2"),r.has("dxt")&&t.push("dds"),t.push("ktx2")}return t.push("jpg"),t.push("png"),t}};function TBe(e,t){let r=t.url||"",n;e.geometryData&&(n=`${r}/${e.geometryData[0].href}`);let i;e.textureData&&(i=`${r}/${e.textureData[0].href}`);let a;e.attributeData&&(a=bBe(r,e));let o=e.children||[];return JW({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function JW(e){var s,u;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...or.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...or.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let l=new sa().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...l.center,l.radius],r=[...e.obb.center,l.radius]}let n=(s=e.lodSelection)==null?void 0:s[0].metricType,i=(u=e.lodSelection)==null?void 0:u[0].maxError,a="mesh",o=2;return{...e,mbs:r,boundingVolume:t,lodMetricType:n,lodMetricValue:i,type:a,refine:o}}async function CBe(e,t,r){let n=ok(r.url||""),i,a;if(e.nodePages)i=new gw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=oy(`${n}/nodes/root`,o.token);a=await An(s,Zl,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:Zl,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var nYt="4.0.5",iYt=/layers\/[0-9]+$/,aYt=/nodes\/([0-9-]+|root)$/,oYt="504b0304",sYt="PointCloud",Zl={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:nYt,mimeTypes:["application/octet-stream"],parse:uYt,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:2}}};async function uYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},pYt(e)===oYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=ok(n),o;t.i3s.isTileset==="auto"?o=iYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=aYt.test(a):s=t.i3s.isTileHeader,o?e=await lYt(e,t,r):s?e=await fYt(e,r):e=await cYt(e,t),e}async function cYt(e,t){return await Bo(e,ABe,t)}async function lYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===sYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await CBe(n,t,r)}async function fYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),TBe(e,t)}function pYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function FBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?hYt(n,e):null}:{}}function hYt(e,t){switch(e){case dBe:return gYt(t);case mBe:return DBe(t);case gBe:return mYt(t);case vBe:return dYt(t);default:return DBe(t)}}function DBe(e){return new Uint32Array(e,4)}function dYt(e){return new Int16Array(e,4)}function mYt(e){return new Float64Array(e,8)}function gYt(e){let i=[];try{let a=new DataView(e,0,4).getUint32(0,!0),o=new Uint32Array(e,8,a),s=8+a*4;for(let u of o){let c=new TextDecoder("utf-8"),l=new Uint8Array(e,s,u);i.push(c.decode(l)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return i}var vYt="4.0.5";var XW={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:vYt,mimeTypes:["application/binary"],parse:async(e,t)=>FBe(e,t),extensions:["bin"],options:{},binary:!0};function QW(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=or.WGS84.cartographicToCartesian(r,new ce),i=new sa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var uk=Wt(wu(),1),bYt=()=>({version:{path:"version",default:"1.0"}}),kBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,uk.default)(t,kBe()))}}),BBe=()=>({asset:{path:"asset",transform:e=>(0,uk.default)(e,bYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,uk.default)(e,kBe())}});function OBe(e,t){let r=new Float32Array(e.length),n=xYt(t);for(let i=0;i<e.length;i+=2){let a=e.subarray(i,i+2),o=n.slice(i*2,i*2+4),s=yYt([a[0],a[1]]),u=[o[2]-o[0],o[3]-o[1]],c=[s[0]*u[0],s[1]*u[1]],l=[c[0]+o[0],c[1]+o[1]];r[i]=l[0],r[i+1]=l[1]}return r}function yYt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function xYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var _Yt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),IBe=new ce,vw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return s8({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},tG)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),p=this._convertI3sMaterialToGLTFMaterial(o,f),h=l.addMaterial(p),d=s.positions,b=d.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=OBe(s.texCoords.value,s.uvRegions.value));let g=new ce(a),x=or.WGS84.cartesianToCartographic(g,new ce);s.positions.value=this._normalizePositions(b,g,x,c),this._createBatchIds(n,r),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let E=u||Q4(b.length/d.size),S=l.addMesh({attributes:s,indices:E,material:h,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),s8(l.gltf,Uq)}async _addI3sTextureToGLTF(t,r,n){let{texture:i,material:a,attributes:o}=t,s=null,u=i;if(!i&&a&&(u=a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.texture.source.image),u){let c=this._deduceMimeTypeFromFormat(r),l=n.addImage(u,c);s=n.addTexture({imageIndex:l}),delete o.colors}return s}_normalizePositions(t,r,n,i){let a=new Float32Array(t.length);for(let o=0;o<t.length;o+=3){let s=t.subarray(o,o+3),u=new ce(r),c=new ce(Array.from(s)).transform(i).add(n);or.WGS84.cartographicToCartesian(c,IBe),c=IBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(_Yt)}_createBatchIds(t,r){let{featureIds:n}=t,{OBJECTID:i}=r||{};if(!(!n||!i)){for(let a=0;a<n.length;a++){let o=n[a],s=i.indexOf(o);n[a]=s}t.attributes._BATCHID={size:1,byteOffset:0,value:n}}}_deduceMimeTypeFromFormat(t){switch(t){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${t}`),"image/jpeg"}}_convertI3sMaterialToGLTFMaterial(t,r){let n=r!==null;return t?(r!==null&&(t=this._setGLTFTexture(t,r)),t):(t={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},n?t.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],t)}_setGLTFTexture(t,r){let n={...t,pbrMetallicRoughness:{...t.pbrMetallicRoughness}};return t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?n.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.emissiveTexture?n.emissiveTexture={index:r,texCoord:0}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?n.pbrMetallicRoughness.metallicRoughnessTexture={index:r,texCoord:0}:t.normalTexture?n.normalTexture={index:r,texCoord:0}:t.occlusionTexture&&(n.occlusionTexture={index:r,texCoord:0}),n}_getFeaturesLength(t){if(!t)return 0;let r=Object.keys(t)[0];return r?t[r].length:0}_checkNormals(t){return t.find(r=>r)}};var PBe=async(e,t,r)=>{if(!e||!t.contentUrl)return null;let n={...r,i3s:{...r.i3s,isTileset:!1,isTileHeader:!1,_tileOptions:{attributeUrls:t.attributeUrls,textureUrl:t.textureUrl,textureFormat:t.textureFormat,textureLoaderOptions:t.textureLoaderOptions,materialDefinition:t.materialDefinition,isDracoGeometry:t.isDracoGeometry,mbs:t.mbs},_tilesetOptions:{store:e.store,attributeStorageInfo:e.attributeStorageInfo,fields:e.fields}}};return await An(t.contentUrl,Zl,n)};var wYt="I3S",sy=class{options;tilesetPath;vertexCounter;conversionStartTime;geoidHeightModel;sourceTileset;attributeStorageInfo;workerSource={};loaderOptions={_nodeWorkers:!0,reuseWorkers:!0,worker:!1,i3s:{coordinateSystem:3,decodeTextures:!1},"i3s-content":{workerUrl:"./modules/i3s/dist/i3s-content-worker-node.js"}};constructor(){this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null,this.workerSource={}}async convert(t){var f;if(gn)return console.log(ny),ny;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=ZW.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,ek),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,Zl,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=jW(s.mbs)),this.tilesetPath=(0,RBe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await lw(this.tilesetPath)}catch{}let u={boundingVolume:{box:QW(s.obb,this.geoidHeightModel)},geometricError:qW(s),children:[]};await this._addChildren(s,u,1);let c=(0,jBe.default)({root:u},BBe());await ki(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),La.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await PBe(this.sourceTileset,a,this.loaderOptions);if(!o){await this._addChildren(a,r,n+1);return}this.vertexCounter+=(o==null?void 0:o.vertexCount)||0;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.obb||(a.obb=jW(a.mbs));let u={box:QW(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:qW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},p=await new vw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await ki(this.tilesetPath,new Uint8Array(p),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(!(this.options.maxDepth&&n>this.options.maxDepth))for(let i of t.children||[])await this.convertChildNode(t,r,n,i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await An(a,Zl,o)}return n}_relativeUrlToFullUrl(t="",r){let n=t.split("/"),i=r.split("/");for(let a of i)switch(a){case".":continue;case"..":n=n.slice(0,-1);break;default:n.push(a)}return n.join("/")}async _loadChildAttributes(t,r){let n=[],{attributeUrls:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o],u=r[o],c={attributeName:u.name,attributeType:this._getAttributeType(u)};n.push(An(s,XW,c))}let a=await Promise.all(n);return this._replaceNestedArrays(a),Object.assign({},...a)}_getAttributeType(t){return t.attributeValues?t.attributeValues.valueType:t.objectIds?"Oid32":""}_replaceNestedArrays(t){for(let r=0;r<t.length;r++){let n=t[r];for(let i in n)n[i]=Array.from(n[i])}}async _finishConversion(t){let r=await X4(t),n=ZW.default.hrtime(this.conversionStartTime),i=Qb(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${wYt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var ck=require("path");var EYt="4.0.5",AYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",lk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(AYt,JU,{}),n=process.cwd();t&&(n=(0,ck.join)(n,t)),await ki(n,new Uint8Array(r["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader" worker'),await this.installFromNpm("i3s","i3s-content-worker-node.js"),console.log('Installing "Draco Loader" worker'),await this.installFromNpm("draco","draco-worker-node.js"),console.log('Installing "Draco Writer" worker'),await this.installFromNpm("draco","draco-writer-worker-node.js"),console.log('Installing "Basis Loader" worker'),await this.installFromNpm("textures","basis-worker-node.js"),console.log('Installing "KTX2 Basis Writer" worker'),await this.installFromNpm("textures","ktx2-basis-writer-worker-node.js"),console.log('Installing "Draco decoder" library'),await this.installFromUrl(Ep[ai.DECODER],"draco",ai.DECODER),await this.installFromUrl(Ep[ai.DECODER_WASM],"draco",ai.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Ep[ai.ENCODER],"draco",ai.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",wc.TRANSCODER,"libs"),await this.installFromNpm("textures",wc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",wc.ENCODER,"libs"),await this.installFromNpm("textures",wc.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new ll().start({command:process.platform==="win32"?"npm.cmd":"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installFromNpm(t,r,n=""){let a=await(await ko(`https://unpkg.com/@loaders.gl/${t}@${EYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,ck.join)(process.cwd(),"modules",t,"dist",n);await ki(o,a,r)}async installFromUrl(t,r,n){let a=await(await ko(t)).arrayBuffer();if(!a)return;let o=(0,ck.join)(process.cwd(),"modules",r,"dist","libs");await ki(o,a,n)}};function Tu(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function LBe(e,t){let r=Tu(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function MBe(e){return e.reduce((t,r)=>{let n=r.indexOf("="),i=r.slice(0,n),a=r.slice(n+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(i,a):t.concat(r)},[])}function qBe(e,t){let r=Tu(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Tu(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var eV={I3S:"I3S",_3DTILES:"3DTILES"};async function SYt(){let[,,...e]=process.argv;e.length===0&&tV();let t=MBe(e),r=DYt(t);if(r.installDependencies){new lk().install("deps");return}let n=CYt(r);await TYt(n)}SYt().catch(e=>{console.log(e),process.exit(1)});function tV(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--instant-node-writing [Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed]"),console.log("--split-nodes [Prevent to merge similar materials that could lead to incorrect visualization (I3S to 3DTiles conversion only)]"),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]"),console.log("--analyze [Analyze the input tileset content without conversion, default: false]"),console.log('--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'),console.log("--validate [Enable validation]"),process.exit(0)}async function TYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case eV.I3S:await new sy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case eV._3DTILES:await new iy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,mergeMaterials:e.mergeMaterials,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate,instantNodeWriting:e.instantNodeWriting,metadataClass:e.metadataClass,analyze:e.analyze,inquirer:UBe.default});break;default:tV()}}function CYt(e){let t={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:n=>Boolean(n)||Boolean(e.analyze)},output:{getMessage:()=>console.log("Missed: --output [Output path name]")},sevenZipExe:{getMessage:()=>console.log("Missed: --7zExe [7z archiver executable path]")},egm:{getMessage:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]")},tileset:{getMessage:()=>console.log("Missed: --tileset [tileset.json file]")},inputType:{getMessage:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]"),condition:n=>Boolean(n)&&Object.values(eV).includes(n.toUpperCase())}},r=[];for(let n in t){let i=e[n],a=t[n].condition;(a?a(i):i)||r.push(t[n].getMessage)}return r.length&&(r.forEach(n=>n()),process.exit(1)),e}function DYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,NBe.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Tu(n,e);break;case"--tileset":t.tileset=LBe(n,e);break;case"--name":t.name=Tu(n,e);break;case"--output":t.output=Tu(n,e);break;case"--instant-node-writing":t.instantNodeWriting=Nc(n,e);break;case"--split-nodes":t.mergeMaterials=Nc(n,e);break;case"--max-depth":t.maxDepth=qBe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Tu(n,e);break;case"--egm":t.egm=Tu(n,e);break;case"--token":t.token=Tu(n,e);break;case"--no-draco":t.draco=Nc(n,e);break;case"--validate":t.validate=Nc(n,e);break;case"--install-dependencies":t.installDependencies=Nc(n,e);break;case"--generate-textures":t.generateTextures=Nc(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Nc(n,e);break;case"--analyze":t.analyze=Nc(n,e);break;case"--metadata-class":t.metadataClass=Tu(n,e);break;case"--help":tV();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
179
|
+
`).forEach(s=>{let u=a.exec(s);u&&i.push(Number(u[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}var Eae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...Eae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Eae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await wae(t.port)),r.push(t.portArg,String(this.port))),await new Promise((n,i)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),n({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=Aae.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),i(new Error(o)))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),i(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),n({})})}catch(a){i(a)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(t=0){try{await this.stop(),process.exit(t)}catch(r){console.error(r.message||r),process.exit(1)}}_setTimeout(t){Number(this.props.wait)>0&&(this.successTimer=setTimeout(t,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}};function NI(e,t){return!La.isSupported()||!ta&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function UI(e,t,r,n,i){let a=e.id,o=kx(e,r),u=La.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let c=await u.startJob("process-on-worker",IWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function IWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{let s=await e(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function GI(e,t){return!La.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Tae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Sae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Sae(e,0,t):""}function Sae(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function zI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Tae(e)}"`)}}function ec(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),i=new Uint8Array(t);for(let a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function tc(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function Co(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,s)=>o+s.length,0),i=new r(n),a=0;for(let o of t)i.set(o,a),a+=o.length;return i}function Hh(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Do(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function HI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Do(n.byteLength,4)}function WI(e,t){let r=e.length,i=Math.ceil(r/t)*t-r,a="";for(let o=0;o<i;++o)a+=" ";return e+a}function Bm(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Ox(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function OA(e,t,r,n){let i=Do(r.byteLength,n),a=i-r.byteLength;if(e){let o=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),s=new Uint8Array(r);o.set(s);for(let u=0;u<a;++u)e.setUint8(t+r.byteLength+u,32)}return t+=i,t}function Om(e,t,r,n){let a=new TextEncoder().encode(r);return t=OA(e,t,a,n),t}async function Wh(e){let t=[];for await(let r of e)t.push(r);return tc(...t)}function jf(e){return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(e)}function VI(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KI(e){var t=VI(e,"string");return jf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=KI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var PWe="",Cae={};function rc(e){for(let t in Cae)if(e.startsWith(t)){let r=Cae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${PWe}${e}`),e}var RWe="4.0.6",$I={name:"JSON",id:"json",module:"json",version:RWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Dae,parse:async e=>Dae(new TextDecoder().decode(e)),options:{}};function Dae(e){return JSON.parse(e)}function Fae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function kae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(kae(e))return Fae(e);if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Im(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var tu={};fa(tu,{dirname:()=>MWe,filename:()=>LWe,join:()=>qWe,resolve:()=>NWe});function Bae(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)==null?void 0:t.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function LWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function MWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function qWe(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function NWe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",n=!1,i;for(let a=t.length-1;a>=-1&&!n;a--){let o;a>=0?o=t[a]:(i===void 0&&(i=Bae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Ix)}return r=UWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Ix=47,YI=46;function UWe(e,t){let r="",n=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Ix)break;a=Ix}if(a===Ix){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==YI||r.charCodeAt(r.length-2)!==YI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Ix;--c);if(c!==u){r=c===-1?"":r.slice(0,c),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(n+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}n=s,i=0}else a===YI&&i!==-1?++i:i=-1}return r}var JI=new Error("Not implemented"),Vh=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){var i;if((i=globalThis.loaders)!=null&&i.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw gn?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw JI}async write(t,r,n){throw JI}async stat(){throw JI}async close(){}};var XI=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Px=class{file;size;constructor(t){this.file=new Vh(t,"r"),this.size=this.file.bigsize}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let i=Number(n);return await this.file.read(t,i)}get length(){return this.size}};var Kh=Wt(require("fs"),1),$h=class{handle;size;bigsize;url;constructor(t,r,n){t=rc(t),this.handle=Kh.default.openSync(t,r,n);let i=Kh.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Kh.default.close(this.handle,n=>n?r(n):t())})}async stat(){return await new Promise((t,r)=>Kh.default.fstat(this.handle,{bigint:!0},(n,i)=>{let a={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(a)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),a=0,o=new Uint8Array(n),s;for(;r>0;){let u=await zWe(this.handle,o,0,r,i);if(u===0)break;a+=u,i+=BigInt(u),r-=u,s!==void 0&&(s+=u)}return a<r?n.slice(0,a):n}async write(t,r=0,n=t.byteLength){return new Promise((i,a)=>{let o=Number(r),s=new Uint8Array(t,Number(r),n);Kh.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function zWe(e,t,r,n,i){return await new Promise((a,o)=>Kh.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var jA=Wt(require("fs/promises"),1);var ZI=Wt(require("fs"),1),QI=require("stream");var IA=Wt(require("zlib"),1),HWe=e=>e&&e instanceof ArrayBuffer,WWe=e=>e&&e instanceof Buffer;function PA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(IA.default.createBrotliDecompress());case"gzip":return e.pipe(IA.default.createGunzip());case"deflate":return e.pipe(IA.default.createDeflate());default:return e}}async function Oae(e){let t=[];return await new Promise((r,n)=>{e.on("error",i=>n(i)),e.on("readable",()=>e.read()),e.on("data",i=>{typeof i=="string"&&n(new Error("Read stream not binary")),t.push(KWe(i))}),e.on("end",()=>{let i=VWe(t);r(i)})})}function VWe(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function KWe(e){if(HWe(e))return e;if(WWe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var $We=e=>typeof e=="boolean",Iae=e=>typeof e=="function",YWe=e=>e!==null&&typeof e=="object",JWe=e=>YWe(e)&&Iae(e.read)&&Iae(e.pipe)&&$We(e.readable);async function RA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=rc(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,p)=>{let h=ZI.default.createReadStream(n,{encoding:null});h.once("readable",()=>f(h)),h.on("error",d=>p(d))}),o=a;JWe(a)?o=PA(a,i):typeof a=="string"?o=QI.Readable.from([new TextEncoder().encode(a)]):o=QI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=XWe(n),l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}catch(a){let o=a.message,s=400,u=o,c={},l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}}function XWe(e){let t={};if(!t["content-length"]){let r=ZI.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var LA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await jA.default.readdir(t,r)}async stat(t){let r=await jA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await jA.default.unlink(t)}async fetch(t,r){return await RA(t,r)}async openReadableFile(t,r="r"){return new $h(t,r)}async openWritableFile(t,r="w",n){return new $h(t,r,n)}};var Yh=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){var o,s;let n=[];for await(let u of t)n.push(u),yield u;let i=await this.concatenate(n),a=await this.hash(i,r);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:a})}async concatenate(t){return await Wh(t)}};function Pae(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let i=0;i<n.length;i++)typeof n[i]>"u"?t+="=":t+=QWe(n[i])}return t}function QWe(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Rae(e,t){switch(t){case"hex":return e;case"base64":return ZWe(e);default:throw new Error(t)}}function ZWe(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Pae(r)||""}var Lae=typeof atob=="function"?atob:typeof Buffer=="function"?oVe:qae,eVe=Lae("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="),eP=WebAssembly&&Lae!==qae?aVe(eVe).buffer:!1,nc=sVe(),tP=240*16*16,Mae=Math.floor(tP*16*1.066666667),tVe=268435456-65536,jae="Parameter must be Buffer, ArrayBuffer or Uint8Array",rVe="Parameter exceeds max size of 255.9 Mbytes";eP||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function rP(e){var t,r,n,i,a,o,s,u,c,l;let f=iVe(),p=nVe(),h={},d=new Date().getTime();return h.then=function(E){return s=E,g(),h},h.catch=function(E){return u=E,h},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?o=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?o=e.constructor===ArrayBuffer?new Uint8Array(e):e:x(new TypeError(jae)):x(new TypeError(jae)),o&&(a=o.length,eP&&a>Mae?a>tVe?x(new Error(rVe)):(t=new WebAssembly.Memory({initial:a>32e6?a>64e6?a>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),i={mem:t,log:console.log},n={imports:i},WebAssembly.instantiate(eP,n).then(b)):g(f(o))),h;function b(E){g(p(o,E.instance.exports,r))}function g(E){var S=Boolean(E)?E:c;Boolean(E)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-d),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function nVe(){var e,t,r,n,i,a,o,s,u,c,l,f,p,h=function(d){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,he,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=d.length*8,ft;for(ft=Ie(d,p),p[at>>>5]|=128<<at%32,p[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,he=p;Ge<ft;)ft>Ge+Mae?(n(oe),a(V),s(ne),c(se),t(tP),Ge=Ge+tP*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=he[Ge+0]>>>0,g=he[Ge+1]>>>0,x=he[Ge+2]>>>0,E=he[Ge+3]>>>0,S=he[Ge+4]>>>0,F=he[Ge+5]>>>0,D=he[Ge+6]>>>0,j=he[Ge+7]>>>0,k=he[Ge+8]>>>0,N=he[Ge+9]>>>0,C=he[Ge+10]>>>0,I=he[Ge+11]>>>0,P=he[Ge+12]>>>0,U=he[Ge+13]>>>0,Y=he[Ge+14]>>>0,J=he[Ge+15]>>>0,oe=me(7,25,oe+(V&ne|~V&se)+b-680876936)+V,se=me(12,20,se+(oe&V|~oe&ne)+g-389564586)+oe,ne=me(17,15,ne+(se&oe|~se&V)+x+606105819)+se,V=me(22,10,V+(ne&se|~ne&oe)+E-1044525330)+ne,oe=me(7,25,oe+(V&ne|~V&se)+S-176418897)+V,se=me(12,20,se+(oe&V|~oe&ne)+F+1200080426)+oe,ne=me(17,15,ne+(se&oe|~se&V)+D-1473231341)+se,V=me(22,10,V+(ne&se|~ne&oe)+j-45705983)+ne,oe=me(7,25,oe+(V&ne|~V&se)+k+1770035416)+V,se=me(12,20,se+(oe&V|~oe&ne)+N-1958414417)+oe,ne=me(17,15,ne+(se&oe|~se&V)+C-42063)+se,V=me(22,10,V+(ne&se|~ne&oe)+I-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+P+1804603682)+V,se=me(12,20,se+(oe&V|~oe&ne)+U-40341101)+oe,ne=me(17,15,ne+(se&oe|~se&V)+Y-1502002290)+se,V=me(22,10,V+(ne&se|~ne&oe)+J+1236535329)+ne,oe=me(5,27,oe+(V&se|ne&~se)+g-165796510)+V,se=me(9,23,se+(oe&ne|V&~ne)+D-1069501632)+oe,ne=me(14,18,ne+(se&V|oe&~V)+I+643717713)+se,V=me(20,12,V+(ne&oe|se&~oe)+b-373897302)+ne,oe=me(5,27,oe+(V&se|ne&~se)+F-701558691)+V,se=me(9,23,se+(oe&ne|V&~ne)+C+38016083)+oe,ne=me(14,18,ne+(se&V|oe&~V)+J-660478335)+se,V=me(20,12,V+(ne&oe|se&~oe)+S-405537848)+ne,oe=me(5,27,oe+(V&se|ne&~se)+N+568446438)+V,se=me(9,23,se+(oe&ne|V&~ne)+Y-1019803690)+oe,ne=me(14,18,ne+(se&V|oe&~V)+E-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+k+1163531501)+ne,oe=me(5,27,oe+(V&se|ne&~se)+U-1444681467)+V,se=me(9,23,se+(oe&ne|V&~ne)+x-51403784)+oe,ne=me(14,18,ne+(se&V|oe&~V)+j+1735328473)+se,V=me(20,12,V+(ne&oe|se&~oe)+P-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+k-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+I+1839030562)+se,V=me(23,9,V+(ne^se^oe)+Y-35309556)+ne,oe=me(4,28,oe+(V^ne^se)+g-1530992060)+V,se=me(11,21,se+(oe^V^ne)+S+1272893353)+oe,ne=me(16,16,ne+(se^oe^V)+j-155497632)+se,V=me(23,9,V+(ne^se^oe)+C-1094730640)+ne,oe=me(4,28,oe+(V^ne^se)+U+681279174)+V,se=me(11,21,se+(oe^V^ne)+b-358537222)+oe,ne=me(16,16,ne+(se^oe^V)+E-722521979)+se,V=me(23,9,V+(ne^se^oe)+D+76029189)+ne,oe=me(4,28,oe+(V^ne^se)+N-640364487)+V,se=me(11,21,se+(oe^V^ne)+P-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+J+530742520)+se,V=me(23,9,V+(ne^se^oe)+x-995338651)+ne,oe=me(6,26,oe+(ne^(V|~se))+b-198630844)+V,se=me(10,22,se+(V^(oe|~ne))+j+1126891415)+oe,ne=me(15,17,ne+(oe^(se|~V))+Y-1416354905)+se,V=me(21,11,V+(se^(ne|~oe))+F-57434055)+ne,oe=me(6,26,oe+(ne^(V|~se))+P+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+E-1894986606)+oe,ne=me(15,17,ne+(oe^(se|~V))+C-1051523)+se,V=me(21,11,V+(se^(ne|~oe))+g-2054922799)+ne,oe=me(6,26,oe+(ne^(V|~se))+k+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+J-30611744)+oe,ne=me(15,17,ne+(oe^(se|~V))+D-1560198380)+se,V=me(21,11,V+(se^(ne|~oe))+U+1309151649)+ne,oe=me(6,26,oe+(ne^(V|~se))+S-145523070)+V,se=me(10,22,se+(V^(oe|~ne))+I-1120210379)+oe,ne=me(15,17,ne+(oe^(se|~V))+x+718787259)+se,V=me(21,11,V+(se^(ne|~oe))+N-343485551)+ne,Ge=Ge+16,oe=oe+re>>>0,V=V+ee>>>0,ne=ne+ge>>>0,se=se+ye>>>0);return nc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function Ie(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,pe,Xe,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],pe=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Xe=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|pe<<8|Xe<<16|ct<<24;return _t+1}};return function(d,b,g,x){var E;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,p=g,E=nc.wordsToBytes(h(d)),x&&x.asBytes?E:nc.bytesconvertNumberToHex(E)}}function iVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,p,h,d,b,g,x,E,S,F,D,j,k,N=new Date().getTime(),C=1732584193,I=-271733879,P=-1732584194,U=271733878,Y=t.length*8;k=nc.bytesToWords(t);for(var J=0;J<k.length;J++)k[J]=(k[J]<<8|k[J]>>>24)&16711935|(k[J]<<24|k[J]>>>8)&4278255360;k[Y>>>5]|=128<<Y%32,k[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<k.length;re+=16)S=C,F=I,D=P,j=U,n=k[re+0]>>>0,i=k[re+1]>>>0,a=k[re+2]>>>0,o=k[re+3]>>>0,s=k[re+4]>>>0,u=k[re+5]>>>0,c=k[re+6]>>>0,l=k[re+7]>>>0,f=k[re+8]>>>0,p=k[re+9]>>>0,h=k[re+10]>>>0,d=k[re+11]>>>0,b=k[re+12]>>>0,g=k[re+13]>>>0,x=k[re+14]>>>0,E=k[re+15]>>>0,C=ee(7,25,C+(I&P|~I&U)+n-680876936)+I,U=ee(12,20,U+(C&I|~C&P)+i-389564586)+C,P=ee(17,15,P+(U&C|~U&I)+a+606105819)+U,I=ee(22,10,I+(P&U|~P&C)+o-1044525330)+P,C=ee(7,25,C+(I&P|~I&U)+s-176418897)+I,U=ee(12,20,U+(C&I|~C&P)+u+1200080426)+C,P=ee(17,15,P+(U&C|~U&I)+c-1473231341)+U,I=ee(22,10,I+(P&U|~P&C)+l-45705983)+P,C=ee(7,25,C+(I&P|~I&U)+f+1770035416)+I,U=ee(12,20,U+(C&I|~C&P)+p-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+h-42063)+U,I=ee(22,10,I+(P&U|~P&C)+d-1990404162)+P,C=ee(7,25,C+(I&P|~I&U)+b+1804603682)+I,U=ee(12,20,U+(C&I|~C&P)+g-40341101)+C,P=ee(17,15,P+(U&C|~U&I)+x-1502002290)+U,I=ee(22,10,I+(P&U|~P&C)+E+1236535329)+P,C=ee(5,27,C+(I&U|P&~U)+i-165796510)+I,U=ee(9,23,U+(C&P|I&~P)+c-1069501632)+C,P=ee(14,18,P+(U&I|C&~I)+d+643717713)+U,I=ee(20,12,I+(P&C|U&~C)+n-373897302)+P,C=ee(5,27,C+(I&U|P&~U)+u-701558691)+I,U=ee(9,23,U+(C&P|I&~P)+h+38016083)+C,P=ee(14,18,P+(U&I|C&~I)+E-660478335)+U,I=ee(20,12,I+(P&C|U&~C)+s-405537848)+P,C=ee(5,27,C+(I&U|P&~U)+p+568446438)+I,U=ee(9,23,U+(C&P|I&~P)+x-1019803690)+C,P=ee(14,18,P+(U&I|C&~I)+o-187363961)+U,I=ee(20,12,I+(P&C|U&~C)+f+1163531501)+P,C=ee(5,27,C+(I&U|P&~U)+g-1444681467)+I,U=ee(9,23,U+(C&P|I&~P)+a-51403784)+C,P=ee(14,18,P+(U&I|C&~I)+l+1735328473)+U,I=ee(20,12,I+(P&C|U&~C)+b-1926607734)+P,C=ee(4,28,C+(I^P^U)+u-378558)+I,U=ee(11,21,U+(C^I^P)+f-2022574463)+C,P=ee(16,16,P+(U^C^I)+d+1839030562)+U,I=ee(23,9,I+(P^U^C)+x-35309556)+P,C=ee(4,28,C+(I^P^U)+i-1530992060)+I,U=ee(11,21,U+(C^I^P)+s+1272893353)+C,P=ee(16,16,P+(U^C^I)+l-155497632)+U,I=ee(23,9,I+(P^U^C)+h-1094730640)+P,C=ee(4,28,C+(I^P^U)+g+681279174)+I,U=ee(11,21,U+(C^I^P)+n-358537222)+C,P=ee(16,16,P+(U^C^I)+o-722521979)+U,I=ee(23,9,I+(P^U^C)+c+76029189)+P,C=ee(4,28,C+(I^P^U)+p-640364487)+I,U=ee(11,21,U+(C^I^P)+b-421815835)+C,P=ee(16,16,P+(U^C^I)+E+530742520)+U,I=ee(23,9,I+(P^U^C)+a-995338651)+P,C=ee(6,26,C+(P^(I|~U))+n-198630844)+I,U=ee(10,22,U+(I^(C|~P))+l+1126891415)+C,P=ee(15,17,P+(C^(U|~I))+x-1416354905)+U,I=ee(21,11,I+(U^(P|~C))+u-57434055)+P,C=ee(6,26,C+(P^(I|~U))+b+1700485571)+I,U=ee(10,22,U+(I^(C|~P))+o-1894986606)+C,P=ee(15,17,P+(C^(U|~I))+h-1051523)+U,I=ee(21,11,I+(U^(P|~C))+i-2054922799)+P,C=ee(6,26,C+(P^(I|~U))+f+1873313359)+I,U=ee(10,22,U+(I^(C|~P))+E-30611744)+C,P=ee(15,17,P+(C^(U|~I))+c-1560198380)+U,I=ee(21,11,I+(U^(P|~C))+g+1309151649)+P,C=ee(6,26,C+(P^(I|~U))+s-145523070)+I,U=ee(10,22,U+(I^(C|~P))+d-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+p-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return nc.endian([C,I,P,U]);function ee(ge,ye,he){return he<<ge|he>>>ye}};return function(t,r){var n=nc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:nc.bytesconvertNumberToHex(n);return i}}function aVe(e){var t,r,n,i=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>i++;)n[i]=e.charCodeAt(i);return n}function oVe(e){return Buffer.from(e,"base64").toString("binary")}function qae(e){return e}function sVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return nc.rotl(t,8)&16711935|nc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=nc.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,i=0;n<t.length;n++,i+=8)r[i>>>5]|=t[n]<<24-i%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var Rx=class extends Yh{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>rP(t).then(a).catch(o));return Rae(i,r)}};var jx=Wt(require("crypto"),1),MA=class extends Yh{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(super(),this.options=t,!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async hash(t,r){var i,a,o,s;let n=(o=(a=(i=this.options)==null?void 0:i.crypto)==null?void 0:a.algorithm)==null?void 0:o.toLowerCase();try{if(!jx.createHash)throw new Error("crypto.createHash not available");let u=(s=jx.createHash)==null?void 0:s(n),c=new Uint8Array(t);return u.update(c).digest("base64")}catch(u){throw Error(`${n} hash not available. ${u}`)}}async*hashBatches(t,r="base64"){var a,o,s,u,c,l,f;if(!jx.createHash)throw new Error("crypto.createHash not available");let n=(u=jx.createHash)==null?void 0:u((s=(o=(a=this.options)==null?void 0:a.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let p of t){let h=new Uint8Array(p);n.update(h),yield p}let i=n.digest(r);(f=(l=(c=this.options)==null?void 0:c.crypto)==null?void 0:l.onEnd)==null||f.call(l,{hash:i})}};var eoe=require("process");var Nae=Wt(require("stream"),1),nP=class{},uVe=Nae.Readable||nP;function aP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new iP(r,t)}var iP=class extends uVe{_pulling;_bytesMode;_iterator;constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,r){var n,i,a,o;this._iterator&&(t?await((i=(n=this._iterator)==null?void 0:n.throw)==null?void 0:i.call(n,t)):await((o=(a=this._iterator)==null?void 0:a.return)==null?void 0:o.call(a,t)),r==null||r(null))}async _pull(t,r){var a;let n=this._bytesMode,i=null;for(;this.readable&&!(i=await r.next()).done&&(t!==null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(new Uint8Array(i.value))||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&((a=r==null?void 0:r.return)==null||a.call(r)),!this.readable}};var zae=Wt(Gae(),1);delete globalThis.ReadableStream;var NA=class extends zae.ReadableStream{};var UA=class{chunks;isWorking=!1;isCancelled=!1;constructor(t){this.chunks=t}start(t){this.work(t)}async work(t){let{chunks:r}=this;for(this.isWorking=!0;!this.isCancelled&&(t.desiredSize||0)>0;){let n;try{n=r.next()}catch(i){t.error(i);break}n&&(!n.done&&!this.isCancelled?t.enqueue(n.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var GA=class extends NA{_chunks;constructor(t){super(new UA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Jh=class{type;size;parts;constructor(t=[],r={}){this.parts=[],this.size=0;for(let n of t)if(typeof n=="string"){let i=new TextEncoder().encode(n);this.parts.push(i),this.size+=i.byteLength}else if(n instanceof Jh)this.size+=n.size,this.parts.push(...n.parts);else if(n instanceof ArrayBuffer)this.parts.push(new Uint8Array(n)),this.size+=n.byteLength;else if(n instanceof Uint8Array)this.parts.push(n),this.size+=n.byteLength;else if(ArrayBuffer.isView(n)){let{buffer:i,byteOffset:a,byteLength:o}=n;this.parts.push(new Uint8Array(i,a,o)),this.size+=o}else{let i=new TextEncoder().encode(String(n));this.parts.push(i),this.size+=i.byteLength}this.type=cVe(r.type)}slice(t=0,r=this.size,n=""){let{size:i,parts:a}=this,o=t<0?Math.max(i+t,0):Math.min(t,i),s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.max(s-o,0),c=new Jh([],{type:n});if(u===0)return c;let l=0,f=[];for(let p of a){let{byteLength:h}=p;if(o>0&&h<=o)o-=h,s-=h;else{let d=p.subarray(o,Math.min(h,s));if(f.push(d),l+=d.byteLength,o=0,l>=u)break}}return c.parts=f,c.size=l,c}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let n of this.parts)r+=t.decode(n);return r}stream(){return new GA(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),n=0;for(let i of this.parts)r.set(i,n),n+=i.byteLength;return t}};function cVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function lVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Jh),globalThis.Blob}var fVe=lVe();var zA=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${_y(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var HA=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(t,r,n={}){super(t,n),this.name=String(r).replace(/\//g,":"),this.lastModified=(n==null?void 0:n.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function Hae(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=zA),typeof File>"u"&&!globalThis.File&&(globalThis.File=HA),global}var pVe=Hae();var oP=Wt(require("module"),1),Wae=Wt(require("path"),1),VA=Wt(require("fs"),1);async function Vae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():VA.default.readFileSync(e).buffer}async function Kae(e){return e.startsWith("http")?await(await fetch(e)).text():VA.default.readFileSync(e,"utf8")}async function $ae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return WA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await VA.default.readFileSync(e,"utf8");return WA(t)}function WA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=oP.default._nodeModulePaths(Wae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new oP.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var ru=class{map;constructor(t){this.map={},t instanceof ru?t.forEach((r,n)=>this.append(n,r)):Array.isArray(t)?t.forEach(r=>this.append(r[0],r[1])):t&&Object.getOwnPropertyNames(t).forEach(r=>this.append(r,t[r]))}append(t,r){t=Lx(t),r=Yae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Lx(t)]}get(t){return t=Lx(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Lx(t))}set(t,r){this.map[Lx(t)]=Yae(r)}forEach(t,r=null){for(let n in this.map)this.map.hasOwnProperty(n)&&(r?t.call(r,this.map[n],n,this):t(this.map[n],n,this))}keys(){let t=[];return this.forEach(function(r,n){t.push(n)}),sP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),sP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),sP(t)}*[Symbol.iterator](){yield*this.entries()}};function Lx(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||e==="")throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function Yae(e){return typeof e!="string"&&(e=String(e)),e}function sP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function uP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var lP=Wt(require("stream"),1),hVe=e=>typeof e=="boolean",Jae=e=>typeof e=="function",dVe=e=>e!==null&&typeof e=="object",cP=e=>dVe(e)&&Jae(e.read)&&Jae(e.pipe)&&hVe(e.readable),pl=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(t,r){let{headers:n,status:i=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=i===200,this.status=i,this.statusText=a,this.headers=new ru((r==null?void 0:r.headers)||{}),cP(t)?this._body=PA(t,n):typeof t=="string"?this._body=lP.Readable.from([new TextEncoder().encode(t)]):this._body=lP.Readable.from([t||new ArrayBuffer(0)])}get body(){return uP(!this.bodyUsed),uP(cP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return cP(this._body)?await Oae(this._body):this._body||new ArrayBuffer(0)}async text(){let t=await this.arrayBuffer();return new TextDecoder().decode(t)}async json(){let t=await this.text();return JSON.parse(t)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var Qae=Wt(require("http"),1),Zae=Wt(require("https"),1);var mVe=e=>e&&e instanceof ArrayBuffer,gVe=e=>e&&e instanceof Buffer;function Xae(e){let t=e.indexOf(","),r,n;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n=`text/plain${n}`):n="text/plain;charset=US-ASCII",{arrayBuffer:vVe(r),mimeType:n}}function vVe(e){if(mVe(e))return e;if(gVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var fP=e=>e.startsWith("data:"),bVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Mx(e,t){try{if(globalThis.fetch!==Mx&&(bVe(e)||fP(e)))return await fetch(e,t);if(fP(e)){let{arrayBuffer:c,mimeType:l}=Xae(e);return new pl(c,{headers:{"content-type":l},url:e})}let r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let i=await yVe(n,t),a=EVe(e,i,r),{status:o,statusText:s}=wVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=xVe(e,a.get("location"));return await Mx(c,t)}return new pl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new pl(null,{status:400,statusText:String(r),url:e})}}async function yVe(e,t){return await new Promise((r,n)=>{let i=_Ve(e,t),a=e.startsWith("https:")?Zae.default.request(i,o=>r(o)):Qae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function xVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function _Ve(e,t){let r=(t==null?void 0:t.headers)||{},n={};for(let a of Object.keys(r))n[a.toLowerCase()]=r[a];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";let i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...t==null?void 0:t.fetch,headers:n,port:i.port}}function wVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function EVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=AVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new ru(n)}function AVe(e){return fP(e)?e.length-5:null}var SVe=parseInt(eoe.versions.node.split(".")[0]);EV&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=aP;globalThis.loaders.NodeFile=$h;globalThis.loaders.NodeFileSystem=LA;globalThis.loaders.fetchNode=RA;globalThis.loaders.NodeHash=MA;globalThis.TextEncoder||(globalThis.TextEncoder=xy);globalThis.TextDecoder||(globalThis.TextDecoder=wh);!("atob"in globalThis)&&_y&&(globalThis.atob=_y);!("btoa"in globalThis)&&Sk&&(globalThis.btoa=Sk);globalThis.loaders.encodeImageNode=TY;globalThis.loaders.parseImageNode=FI;globalThis.loaders.imageFormatsNode=DI;globalThis._parseImageNode=FI;globalThis._imageFormatsNode=DI;globalThis.loaders.readFileAsArrayBuffer=Vae;globalThis.loaders.readFileAsText=Kae;globalThis.loaders.requireFromFile=$ae;globalThis.loaders.requireFromString=WA;SVe<18&&(!("Headers"in globalThis)&&ru&&(globalThis.Headers=ru),!("Response"in globalThis)&&pl&&(globalThis.Response=pl),!("fetch"in globalThis)&&Mx&&(globalThis.fetch=Mx));var NBe=require("path"),UBe=Wt(Wye(),1);var Ln={OBJECT_ID_TYPE:"OBJECTID",STRING_TYPE:"string",DOUBLE_TYPE:"double",SHORT_INT_TYPE:"Int32"};var XC=class{_attributeStorageInfo;_fields;_popupInfo;constructor(){this._attributeStorageInfo=[],this._fields=[]}get attributeStorageInfo(){return this._attributeStorageInfo}get fields(){return this._fields}get popupInfo(){return this._popupInfo}addMetadataInfo(t){if(!Object.keys(t).length)return;let r={OBJECTID:Ln.OBJECT_ID_TYPE,...t},n=!1,i=this._attributeStorageInfo.length;for(let a in r)if(!this._attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=this.createStorageAttribute(i,a,s),c=this.getFieldAttributeType(s),l=this.createFieldAttribute(a,c);this._attributeStorageInfo.push(u),this._fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this._attributeStorageInfo)a.push(o.name);this._popupInfo=this.createPopupInfo(a)}}createStorageAttribute(t,r,n){let i={key:`f_${t}`,name:r,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(n){case Ln.OBJECT_ID_TYPE:this.setupIdAttribute(i);break;case Ln.STRING_TYPE:this.setupStringAttribute(i);break;case Ln.DOUBLE_TYPE:this.setupDoubleAttribute(i);break;case Ln.SHORT_INT_TYPE:break;default:this.setupStringAttribute(i)}return i}getFieldAttributeType(t){switch(t){case Ln.OBJECT_ID_TYPE:return"esriFieldTypeOID";case Ln.STRING_TYPE:return"esriFieldTypeString";case Ln.SHORT_INT_TYPE:return"esriFieldTypeInteger";case Ln.DOUBLE_TYPE:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}setupIdAttribute(t){t.attributeValues={valueType:"Oid32",valuesPerElement:1}}setupStringAttribute(t){t.ordering.unshift("attributeByteCounts"),t.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),t.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},t.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}setupDoubleAttribute(t){t.attributeValues={valueType:"Float64",valuesPerElement:1}}createFieldAttribute(t,r){return{name:t,type:r,alias:t}}createPopupInfo(t){let r="{OBJECTID}",n=[],i=[],a=[],o=[];for(let s of t)i.push({fieldName:s,visible:!0,isEditable:!1,label:s});return a.push({fieldInfos:i,type:"fields"}),{title:r,mediaInfos:n,popupElements:a,fieldInfos:i,expressionInfos:o}}};var iTt=e=>typeof e=="boolean",$1=e=>typeof e=="function",Ad=e=>e!==null&&typeof e=="object",VM=e=>Ad(e)&&e.constructor==={}.constructor;var Vye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",Kye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var cs=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ls=e=>typeof Blob<"u"&&e instanceof Blob,$ye=e=>e&&typeof e=="object"&&e.isBuffer;var aTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ad(e)&&$1(e.tee)&&$1(e.cancel)&&$1(e.getReader);var oTt=e=>Ad(e)&&$1(e.read)&&$1(e.pipe)&&iTt(e.readable),QC=e=>aTt(e)||oTt(e);var sTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,uTt=/^([-\w.]+\/[-\w.+]+)/;function Yye(e){let t=uTt.exec(e);return t?t[1]:e}function KM(e){let t=sTt.exec(e);return t?t[1]:""}var Jye=/\?.*/;function Xye(e){let t=e.match(Jye);return t&&t[0]}function uv(e){return e.replace(Jye,"")}function Sd(e){return cs(e)?e.url:ls(e)?e.name||"":typeof e=="string"?e:""}function Y1(e){if(cs(e)){let t=e,r=t.headers.get("content-type")||"",n=uv(t.url);return Yye(r)||KM(n)}return ls(e)?e.type||"":typeof e=="string"?KM(e):""}function Qye(e){return cs(e)?e.headers["content-length"]||-1:ls(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function ZC(e){if(cs(e))return e;let t={},r=Qye(e);r>=0&&(t["content-length"]=String(r));let n=Sd(e),i=Y1(e);i&&(t["content-type"]=i);let a=await lTt(e);a&&(t["x-first-bytes"]=a),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function Zye(e){if(!e.ok){let t=await cTt(e);throw new Error(t)}}async function cTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r!=null&&r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function lTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${fTt(r)}`}return null}function fTt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function pTt(e){return!hTt(e)&&!dTt(e)}function hTt(e){return e.startsWith("http:")||e.startsWith("https:")}function dTt(e){return e.startsWith("data:")}async function ko(e,t){var r,n;if(typeof e=="string"){let i=rc(e);return pTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await ZC(e)}function $M(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function fu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||$M()}var mTt=globalThis.self||globalThis.window||globalThis.global,cv=globalThis.window||globalThis.self||globalThis.global,gTt=globalThis.document||{},Td=globalThis.process||{},vTt=globalThis.console,Ydr=globalThis.navigator||{};var e8="4.0.6",Qdr=fu();function bTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var t8=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";zt(this,"storage",void 0),zt(this,"id",void 0),zt(this,"config",void 0),this.storage=bTt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function exe(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function txe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function r8(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var n8;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(n8||(n8={}));var yTt=10;function rxe(e){return typeof e!="string"?e:(e=e.toUpperCase(),n8[e]||n8.WHITE)}function nxe(e,t,r){if(!fu&&typeof e=="string"){if(t){let n=rxe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=rxe(r);e="\x1B[".concat(n+yTt,"m").concat(e,"\x1B[49m")}}return e}function ixe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function lv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Cd(){let e;if(fu()&&cv.performance){var t,r;e=cv===null||cv===void 0||(t=cv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Td){var n;let i=Td===null||Td===void 0||(n=Td.hrtime)===null||n===void 0?void 0:n.call(Td);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var fv={debug:fu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},xTt={enabled:!0,level:0};function fs(){}var axe={},oxe={once:!0},bc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",e8),zt(this,"_startTs",Cd()),zt(this,"_deltaTs",Cd()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new t8("__probe-".concat(this.id,"__"),xTt),this.timeStamp("".concat(this.id," started")),ixe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Cd()-this._startTs).toPrecision(10))}getDelta(){return Number((Cd()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){lv(t,r)}warn(t){return this._getLogFunction(0,t,fv.warn,arguments,oxe)}error(t){return this._getLogFunction(0,t,fv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,fv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,fv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,fv.debug||fv.info,arguments,oxe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||fs,n&&[n],{tag:ATt(r)}):fs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?fu()?ETt({image:i,message:a,scale:o}):wTt({image:i,message:a,scale:o}):fs}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||fs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=sxe({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||fs)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=sxe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,lv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Cd();let o=a.tag||a.message;if(a.once&&o)if(!axe[o])axe[o]=Cd();else return fs;return r=_Tt(this.id,a.message,a),n.bind(console,r,...a.args)}return fs}};zt(bc,"VERSION",e8);function uxe(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return lv(Number.isFinite(t)&&t>=0),t}function sxe(e){let{logLevel:t,message:r}=e;e.logLevel=uxe(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return lv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function _Tt(e,t,r){if(typeof t=="string"){let n=r.time?txe(exe(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=nxe(t,r.color,r.background)}return t}function wTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),fs}function ETt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=r8(a,r,n);console.log(...o)},a.src=t,fs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...r8(t,r,n)),fs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...r8(a,r,n)),a.src=t.toDataURL(),fs}return fs}function ATt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var S0r=new bc({id:"@probe.gl/log"});var YM=new bc({id:"loaders.gl"}),i8=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},a8=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var JM={fetch:null,mimeType:void 0,nothrow:!1,log:new a8,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:gn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},cxe={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function XM(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function pv(){let e=XM();return e.globalOptions=e.globalOptions||{...JM},e.globalOptions}function pxe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],STt(e,r),CTt(t,e,n)}function STt(e,t){lxe(e,null,JM,cxe,t);for(let r of t){let n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};lxe(n,r.id,i,a,t)}}function lxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ad(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)YM.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=TTt(s,i);YM.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function TTt(e,t){let r=e.toLowerCase(),n="";for(let i of t)for(let a in i.options){if(e===a)return`Did you mean '${i.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${a}'?`)}return n}function CTt(e,t,r){let i={...e.options||{}};return DTt(i,r),i.log===null&&(i.log=new i8),fxe(i,pv()),fxe(i,t),i}function fxe(e,t){for(let r in t)if(r in t){let n=t[r];VM(n)&&VM(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function DTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function J1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function QM(e){Qt(e,"null loader"),Qt(J1(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var FTt=()=>{let e=XM();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function hxe(){return FTt()}var dxe=new bc({id:"loaders.gl"});var kTt=/\.([^.]+)$/;async function vxe(e,t=[],r,n){if(!bxe(e))return null;let i=mxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(ls(e)&&(e=await e.slice(0,10).arrayBuffer(),i=mxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(yxe(e));return i}function mxe(e,t=[],r,n){if(!bxe(e))return null;if(t&&!Array.isArray(t))return QM(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...hxe()),OTt(i);let a=BTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(yxe(e));return a}function BTt(e,t,r,n){let i=Sd(e),a=Y1(e),o=uv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=ZM(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||ITt(t,o),u=u||(s?`matched url ${o}`:""),s=s||ZM(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||RTt(t,e),u=u||(s?`matched initial data ${xxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||ZM(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&dxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function bxe(e){return!(e instanceof Response&&e.status===204)}function yxe(e){let t=Sd(e),r=Y1(e),n="No valid loader found (";n+=t?`${tu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?xxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function OTt(e){for(let t of e)QM(t)}function ITt(e,t){let r=t&&kTt.exec(t),n=r&&r[1];return n?PTt(e,n):null}function PTt(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function ZM(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function RTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(jTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(gxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&gxe(t,0,r))return r;return null}function jTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function gxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>LTt(e,t,r,i))}function LTt(e,t,r,n){if(n instanceof ArrayBuffer)return ec(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=e7(e,t,n.length);return n===i;default:return!1}}function xxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?e7(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?e7(e,0,t):""}function e7(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function*_xe(e,t){let r=(t==null?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;for(;n<e.length;){let a=Math.min(e.length-n,r),o=e.slice(n,n+a);n+=a,yield i.encode(o)}}function*wxe(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let i=Math.min(e.byteLength-n,r),a=new ArrayBuffer(i),o=new Uint8Array(e,n,i);new Uint8Array(a).set(o),n+=i,yield a}}async function*Exe(e,t){let r=(t==null?void 0:t.chunkSize)||1048576,n=0;for(;n<e.size;){let i=n+r,a=await e.slice(n,i).arrayBuffer();n=i,yield a}}function t7(e,t){return gn?MTt(e,t):qTt(e,t)}async function*MTt(e,t){let r=e.getReader(),n;try{for(;;){let i=n||r.read();t!=null&&t._streamReadAhead&&(n=r.read());let{done:a,value:o}=await i;if(a)return;yield fl(o)}}catch{r.releaseLock()}}async function*qTt(e,t){for await(let r of e)yield fl(r)}function Axe(e,t){if(typeof e=="string")return _xe(e,t);if(e instanceof ArrayBuffer)return wxe(e,t);if(ls(e))return Exe(e,t);if(QC(e))return t7(e,t);if(cs(e))return t7(e.body,t);throw new Error("makeIterator")}var Sxe="Cannot convert supplied data type";function NTt(e,t,r){if(t.text&&typeof e=="string")return e;if($ye(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,i=e.byteLength||e.length;return(e.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+i)),n}throw new Error(Sxe)}async function Txe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return NTt(e,t,r);if(ls(e)&&(e=await ZC(e)),cs(e)){let i=e;return await Zye(i),t.binary?await i.arrayBuffer():await i.text()}if(QC(e)&&(e=Axe(e,r)),Vye(e)||Kye(e))return Wh(e);throw new Error(Sxe)}function o8(e,t){let r=pv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ad(n.fetch)?i=>ko(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:ko}function Cxe(e,t,r){if(r)return r;let n={fetch:o8(t,e),...e};if(n.url){let i=uv(n.url);n.baseUrl=i,n.queryString=Xye(n.url),n.filename=tu.filename(i),n.baseUrl=tu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Dxe(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function Bo(e,t,r,n){t&&!Array.isArray(t)&&!J1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Sd(e),o=Dxe(t,n),s=await vxe(e,o,r);return s?(r=pxe(r,s,o,i),n=Cxe({url:i,_parse:Bo,loaders:o},r,n||null),await UTt(s,e,r,n)):null}async function UTt(e,t,r,n){if(jI(e),r=kI(e.options,r),cs(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,p=Object.fromEntries(a.headers.entries());n.response={headers:p,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Txe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(NI(e,r))return await UI(e,t,r,n,Bo);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw ma(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Fxe(e){switch(e.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 r7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],p=s[c+2];t=l<t?l:t,r=f<r?f:r,n=p<n?p:n,i=l>i?l:i,a=f>a?f:a,o=p>o?p:o}return[[t,r,n],[i,a,o]]}function n7(e,t,r){let n=Fxe(t.value),i=r||kxe(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function kxe(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function An(e,t,r,n){let i,a;!Array.isArray(t)&&!J1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=o8(a),s=e;return typeof e=="string"&&(s=await o(e)),ls(e)&&(s=await o(e)),Array.isArray(i)?await Bo(s,i,a):await Bo(s,i,a)}async function hv(e,t,r){if(r={...pv(),...r},GI(t,r))return await RI(t,e,r);if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return new TextEncoder().encode(await t.encodeText(e,r));if(t.encodeInBatches){let i=Oxe(e,t,r),a=[];for await(let o of i)a.push(o);return tc(...a)}if(!gn&&t.encodeURLtoURL){let i=Bxe("input");await new Vh(i,"w").write(e);let o=Bxe("output"),s=await Ixe(i,o,t,r);return(await ko(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function s8(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Oxe(e,t,r){if(t.encodeInBatches){let n=GTt(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function Ixe(e,t,r,n){if(e=rc(e),t=rc(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}function GTt(e){return[{...e,start:0,end:e.length}]}function Bxe(e){return`/tmp/${e}`}var zTt=1/Math.PI*180,HTt=1/180*Math.PI,WTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...WTt}};var Sn=globalThis.mathgl.config;function i7(e,{precision:t=Sn.precision}={}){return e=VTt(e),"".concat(parseFloat(e.toPrecision(t)))}function ps(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a7(e){return Pxe(e)}function o7(e){return Cl(e)}function Pxe(e,t){return u7(e,r=>r*HTt,t)}function Cl(e,t){return u7(e,r=>r*zTt,t)}function s7(e,t,r){return u7(e,n=>Math.max(t,Math.min(r,n)))}function Oo(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(ps(e)&&ps(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Oo(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Sn.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Sn.EPSILON=n}}function VTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function KTt(e){return e.clone?e.clone():new Array(e.length)}function u7(e,t,r){if(ps(e)){let n=e;r=r||KTt(n);for(let i=0;i<r.length&&i<n.length;++i){let a=typeof e=="number"?e:e[i];r[i]=t(a,i,r)}return r}return t(e)}function $Tt(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var bp=class extends $Tt(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:ps(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Sn)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+i7(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Oo(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let a=t[i],o=typeof r=="number"?r:r[i];this[i]=a+n*(o-a)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Sn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function YTt(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Ar(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function yp(e,t,r=""){if(Sn.debug&&!YTt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function aa(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var xp=class extends bp{get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Ar(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Ar(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return aa(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return aa(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Mn=typeof Float32Array<"u"?Float32Array:Array,X1=Math.random;function dv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var _gr=Math.PI/180;function JTt(){let e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function Rxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function jxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function u8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function c8(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var wgr=function(){let e=JTt();return function(t,r,n,i,a,o){let s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function l8(e,t,r){let n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function f8(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Lxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function Mxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function p8(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Dd=class extends xp{constructor(t=0,r=0){super(2),ps(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return c8(this,this,t),this.check()}transformAsVector(t){return l8(this,this,t),this.check()}transformByMatrix3(t){return u8(this,this,t),this.check()}transformByMatrix2x3(t){return jxe(this,this,t),this.check()}transformByMatrix2(t){return Rxe(this,this,t),this.check()}};var gv={};fa(gv,{add:()=>e6t,angle:()=>h7,bezier:()=>h6t,ceil:()=>t6t,clone:()=>XTt,copy:()=>QTt,create:()=>h8,cross:()=>Fd,dist:()=>w6t,distance:()=>zxe,div:()=>_6t,divide:()=>Gxe,dot:()=>Q1,equals:()=>b6t,exactEquals:()=>v6t,floor:()=>r6t,forEach:()=>S6t,fromValues:()=>d8,hermite:()=>p6t,inverse:()=>c6t,len:()=>d7,length:()=>qxe,lerp:()=>l6t,max:()=>i6t,min:()=>n6t,mul:()=>x6t,multiply:()=>Uxe,negate:()=>u6t,normalize:()=>c7,random:()=>d6t,rotateX:()=>l7,rotateY:()=>f7,rotateZ:()=>p7,round:()=>a6t,scale:()=>o6t,scaleAndAdd:()=>s6t,set:()=>ZTt,slerp:()=>f6t,sqrDist:()=>E6t,sqrLen:()=>A6t,squaredDistance:()=>Hxe,squaredLength:()=>Wxe,str:()=>g6t,sub:()=>y6t,subtract:()=>Nxe,transformMat3:()=>Z1,transformMat4:()=>kd,transformQuat:()=>e_,zero:()=>m6t});function h8(){let e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function XTt(e){let t=new Mn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function qxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function d8(e,t,r){let n=new Mn(3);return n[0]=e,n[1]=t,n[2]=r,n}function QTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ZTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function e6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Nxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Uxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Gxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function t6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function r6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function n6t(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function i6t(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function a6t(e,t){return e[0]=dv(t[0]),e[1]=dv(t[1]),e[2]=dv(t[2]),e}function o6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function s6t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function zxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function Hxe(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function Wxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function u6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function c6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function c7(e,t){let r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Q1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function l6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function f6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(Q1(t,r),-1),1)),a=Math.sin(i),o=Math.sin((1-n)*i)/a,s=Math.sin(n*i)/a;return e[0]=o*t[0]+s*r[0],e[1]=o*t[1]+s*r[1],e[2]=o*t[2]+s*r[2],e}function p6t(e,t,r,n,i,a){let o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,c=o*(a-1),l=o*(3-2*a);return e[0]=t[0]*s+r[0]*u+n[0]*c+i[0]*l,e[1]=t[1]*s+r[1]*u+n[1]*c+i[1]*l,e[2]=t[2]*s+r[2]*u+n[2]*c+i[2]*l,e}function h6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,p=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*p,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*p,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*p,e}function d6t(e,t){t=t===void 0?1:t;let r=X1()*2*Math.PI,n=X1()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function kd(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function Z1(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function e_(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,p=n*u-i*s,h=i*p-a*f,d=a*l-n*p,b=n*f-i*l,g=o*2;return l*=g,f*=g,p*=g,h*=2,d*=2,b*=2,e[0]=s+l+h,e[1]=u+f+d,e[2]=c+p+b,e}function l7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function f7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function p7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function h7(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt((r*r+n*n+i*i)*(a*a+o*o+s*s)),c=u&&Q1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function m6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function g6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function v6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function b6t(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=1e-6*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}var y6t=Nxe,x6t=Uxe,_6t=Gxe,w6t=zxe,E6t=Hxe,d7=qxe,A6t=Wxe,S6t=function(){let e=h8();return function(t,r,n,i,a,o){let s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();var m7=[0,0,0],m8,ce=class extends xp{static get ZERO(){return m8||(m8=new ce(0,0,0),Object.freeze(m8)),m8}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ps(t)?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Ar(t)}angle(t){return h7(this,t)}cross(t){return Fd(this,this,t),this.check()}rotateX({radians:t,origin:r=m7}){return l7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=m7}){return f7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=m7}){return p7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return kd(this,this,t),this.check()}transformAsVector(t){return f8(this,this,t),this.check()}transformByMatrix3(t){return Z1(this,this,t),this.check()}transformByMatrix2(t){return Lxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}};var g8,hs=class extends xp{static get ZERO(){return g8||(g8=new hs(0,0,0,0),Object.freeze(g8)),g8}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),ps(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n),Ar(i)),this[0]=t,this[1]=r,this[2]=n,this[3]=i)}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z),Ar(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}transform(t){return kd(this,this,t),this.check()}transformByMatrix3(t){return p8(this,this,t),this.check()}transformByMatrix2(t){return Mxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var vv=class extends bp{toString(){let t="[";if(Sn.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Ar(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function Vxe(){let e=new Mn(9);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Kxe(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function $xe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,p=-l*a+s*u,h=c*a-o*u,d=r*f+n*p+i*h;return d?(d=1/d,e[0]=f*d,e[1]=(-l*n+i*c)*d,e[2]=(s*n-i*o)*d,e[3]=p*d,e[4]=(l*r-i*u)*d,e[5]=(-s*r+i*a)*d,e[6]=h*d,e[7]=(-c*r+n*u)*d,e[8]=(o*r-n*a)*d,e):null}function Yxe(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s)}function g7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=r[0],h=r[1],d=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=p*n+h*o+d*c,e[1]=p*i+h*s+d*l,e[2]=p*a+h*u+d*f,e[3]=b*n+g*o+x*c,e[4]=b*i+g*s+x*l,e[5]=b*a+g*u+x*f,e[6]=E*n+S*o+F*c,e[7]=E*i+S*s+F*l,e[8]=E*a+S*u+F*f,e}function Jxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=p*n+h*o+c,e[7]=p*i+h*s+l,e[8]=p*a+h*u+f,e}function Xxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=Math.sin(r),h=Math.cos(r);return e[0]=h*n+p*o,e[1]=h*i+p*s,e[2]=h*a+p*u,e[3]=h*o-p*n,e[4]=h*s-p*i,e[5]=h*u-p*a,e[6]=c,e[7]=l,e[8]=f,e}function v7(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Qxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[3]=l-x,e[6]=p+g,e[1]=l+x,e[4]=1-c-d,e[7]=h-b,e[2]=p-g,e[5]=h+b,e[8]=1-c-f,e}var b7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(b7||(b7={}));var C6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends vv{static get IDENTITY(){return F6t()}static get ZERO(){return D6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return b7}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(C6t)}fromObject(t){return this.check()}fromQuaternion(t){return Qxe(this,t),this.check()}set(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=i,this[2]=s,this[3]=r,this[4]=a,this[5]=u,this[6]=n,this[7]=o,this[8]=c,this.check()}determinant(){return Yxe(this)}transpose(){return Kxe(this,this),this.check()}invert(){return $xe(this,this),this.check()}multiplyLeft(t){return g7(this,t,this),this.check()}multiplyRight(t){return g7(this,this,t),this.check()}rotate(t){return Xxe(this,this,t),this.check()}scale(t){return Array.isArray(t)?v7(this,this,t):v7(this,this,[t,t]),this.check()}translate(t){return Jxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=u8(r||[-0,-0],t,this);break;case 3:n=Z1(r||[-0,-0,-0],t,this);break;case 4:n=p8(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yp(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},v8,b8=null;function D6t(){return v8||(v8=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(v8)),v8}function F6t(){return b8||(b8=new Rr,Object.freeze(b8)),b8}var y8={};fa(y8,{add:()=>e3t,adjoint:()=>R6t,clone:()=>B6t,copy:()=>O6t,create:()=>k6t,decompose:()=>W6t,determinant:()=>_7,equals:()=>i3t,exactEquals:()=>n3t,frob:()=>Z6t,fromQuat:()=>D7,fromQuat2:()=>G6t,fromRotation:()=>M6t,fromRotationTranslation:()=>e1e,fromRotationTranslationScale:()=>V6t,fromRotationTranslationScaleOrigin:()=>K6t,fromScaling:()=>L6t,fromTranslation:()=>j6t,fromValues:()=>I6t,fromXRotation:()=>q6t,fromYRotation:()=>N6t,fromZRotation:()=>U6t,frustum:()=>F7,getRotation:()=>H6t,getScaling:()=>t1e,getTranslation:()=>z6t,identity:()=>Zxe,invert:()=>x7,lookAt:()=>O7,mul:()=>a3t,multiply:()=>t_,multiplyScalar:()=>t3t,multiplyScalarAndAdd:()=>r3t,ortho:()=>B7,orthoNO:()=>n1e,orthoZO:()=>J6t,perspective:()=>k7,perspectiveFromFieldOfView:()=>Y6t,perspectiveNO:()=>r1e,perspectiveZO:()=>$6t,rotate:()=>A7,rotateX:()=>S7,rotateY:()=>T7,rotateZ:()=>C7,scale:()=>E7,set:()=>P6t,str:()=>Q6t,sub:()=>o3t,subtract:()=>i1e,targetTo:()=>X6t,translate:()=>w7,transpose:()=>y7});function k6t(){let e=new Mn(16);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function B6t(e){let t=new Mn(16);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 O6t(e,t){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 I6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,b){let g=new Mn(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=p,g[13]=h,g[14]=d,g[15]=b,g}function P6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=p,e[12]=h,e[13]=d,e[14]=b,e[15]=g,e}function Zxe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function y7(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function x7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],p=t[10],h=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*g,J=E*Y-S*U+F*P+D*I-j*C+k*N;return J?(J=1/J,e[0]=(s*Y-u*U+c*P)*J,e[1]=(i*U-n*Y-a*P)*J,e[2]=(b*k-g*j+x*D)*J,e[3]=(p*j-f*k-h*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-d*k-x*S)*J,e[7]=(l*k-p*F+h*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(d*j-b*F+x*E)*J,e[11]=(f*F-l*j-h*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-d*D-g*E)*J,e[15]=(l*D-f*S+p*E)*J,e):null}function R6t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],p=t[10],h=t[11],d=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*g;return e[0]=s*Y-u*U+c*P,e[1]=i*U-n*Y-a*P,e[2]=b*k-g*j+x*D,e[3]=p*j-f*k-h*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-d*k-x*S,e[7]=l*k-p*F+h*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=d*j-b*F+x*E,e[11]=f*F-l*j-h*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-d*D-g*E,e[15]=l*D-f*S+p*E,e}function _7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],p=e[11],h=e[12],d=e[13],b=e[14],g=e[15],x=t*o-r*a,E=t*s-n*a,S=r*s-n*o,F=c*d-l*h,D=c*b-f*h,j=l*b-f*d,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=h*S-d*E+b*x;return u*k-i*N+g*C-p*I}function t_(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],p=t[9],h=t[10],d=t[11],b=t[12],g=t[13],x=t[14],E=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*p+j*g,e[2]=S*a+F*c+D*h+j*x,e[3]=S*o+F*l+D*d+j*E,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*p+j*g,e[6]=S*a+F*c+D*h+j*x,e[7]=S*o+F*l+D*d+j*E,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*p+j*g,e[10]=S*a+F*c+D*h+j*x,e[11]=S*o+F*l+D*d+j*E,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*p+j*g,e[14]=S*a+F*c+D*h+j*x,e[15]=S*o+F*l+D*d+j*E,e}function w7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,p,h,d,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],p=t[6],h=t[7],d=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=p,e[7]=h,e[8]=d,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+d*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+p*i+g*a+t[14],e[15]=c*n+h*i+x*a+t[15]),e}function E7(e,t,r){let n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function A7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,p,h,d,b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],p=t[1],h=t[2],d=t[3],b=t[4],g=t[5],x=t[6],E=t[7],S=t[8],F=t[9],D=t[10],j=t[11],k=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,I=i*a*l-o*c,P=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,J=a*o*l-i*c,re=o*o*l+u,e[0]=f*k+b*N+S*C,e[1]=p*k+g*N+F*C,e[2]=h*k+x*N+D*C,e[3]=d*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=p*I+g*P+F*U,e[6]=h*I+x*P+D*U,e[7]=d*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=p*Y+g*J+F*re,e[10]=h*Y+x*J+D*re,e[11]=d*Y+E*J+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function S7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+p*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=p*i-u*n,e}function T7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-p*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+p*i,e}function C7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],p=t[7];return t!==e&&(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[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+p*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=p*i-u*n,e}function j6t(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function L6t(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function M6t(e,t,r){let n=r[0],i=r[1],a=r[2],o=Math.sqrt(n*n+i*i+a*a),s,u,c;return o<1e-6?null:(o=1/o,n*=o,i*=o,a*=o,u=Math.sin(t),s=Math.cos(t),c=1-s,e[0]=n*n*c+s,e[1]=i*n*c+a*u,e[2]=a*n*c-i*u,e[3]=0,e[4]=n*i*c-a*u,e[5]=i*i*c+s,e[6]=a*i*c+n*u,e[7]=0,e[8]=n*a*c+i*u,e[9]=i*a*c-n*u,e[10]=a*a*c+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function q6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function U6t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function e1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,p=n*c,h=i*u,d=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(h+b),e[1]=f+E,e[2]=p-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=d+g,e[7]=0,e[8]=p+x,e[9]=d-g,e[10]=1-(l+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function G6t(e,t){let r=new Mn(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=n*n+i*i+a*a+o*o;return f>0?(r[0]=(s*o+l*n+u*a-c*i)*2/f,r[1]=(u*o+l*i+c*n-s*a)*2/f,r[2]=(c*o+l*a+s*i-u*n)*2/f):(r[0]=(s*o+l*n+u*a-c*i)*2,r[1]=(u*o+l*i+c*n-s*a)*2,r[2]=(c*o+l*a+s*i-u*n)*2),e1e(e,t,r),e}function z6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function t1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(u*u+c*c+l*l),e}function H6t(e,t){let r=new Mn(3);t1e(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,p=t[8]*n,h=t[9]*i,d=t[10]*a,b=o+l+d,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(p-u)/g,e[2]=(s-c)/g):o>l&&o>d?(g=Math.sqrt(1+o-l-d)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(p+u)/g):l>d?(g=Math.sqrt(1+l-o-d)*2,e[3]=(p-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+d-o-l)*2,e[3]=(s-c)/g,e[0]=(p+u)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function W6t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],p=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+p*p);let h=1/r[0],d=1/r[1],b=1/r[2],g=i*h,x=a*d,E=o*b,S=s*h,F=u*d,D=c*b,j=l*h,k=f*d,N=p*b,C=g+F+N,I=0;return C>0?(I=Math.sqrt(C+1)*2,e[3]=.25*I,e[0]=(D-k)/I,e[1]=(j-E)/I,e[2]=(x-S)/I):g>F&&g>N?(I=Math.sqrt(1+g-F-N)*2,e[3]=(D-k)/I,e[0]=.25*I,e[1]=(x+S)/I,e[2]=(j+E)/I):F>N?(I=Math.sqrt(1+F-g-N)*2,e[3]=(j-E)/I,e[0]=(x+S)/I,e[1]=.25*I,e[2]=(D+k)/I):(I=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/I,e[0]=(j+E)/I,e[1]=(D+k)/I,e[2]=.25*I),e}function V6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,p=i*c,h=i*l,d=a*c,b=a*l,g=o*l,x=s*u,E=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(d+g))*F,e[1]=(p+S)*F,e[2]=(h-E)*F,e[3]=0,e[4]=(p-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(h+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+d))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function K6t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,p=a*c,h=a*l,d=a*f,b=o*l,g=o*f,x=s*f,E=u*c,S=u*l,F=u*f,D=n[0],j=n[1],k=n[2],N=i[0],C=i[1],I=i[2],P=(1-(b+x))*D,U=(h+F)*D,Y=(d-S)*D,J=(h-F)*j,re=(1-(p+x))*j,ee=(g+E)*j,ge=(d+S)*k,ye=(g-E)*k,he=(1-(p+b))*k;return e[0]=P,e[1]=U,e[2]=Y,e[3]=0,e[4]=J,e[5]=re,e[6]=ee,e[7]=0,e[8]=ge,e[9]=ye,e[10]=he,e[11]=0,e[12]=r[0]+N-(P*N+J*C+ge*I),e[13]=r[1]+C-(U*N+re*C+ye*I),e[14]=r[2]+I-(Y*N+ee*C+he*I),e[15]=1,e}function D7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[1]=l+x,e[2]=p-g,e[3]=0,e[4]=l-x,e[5]=1-c-d,e[6]=h+b,e[7]=0,e[8]=p+g,e[9]=h-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function F7(e,t,r,n,i,a,o){let s=1/(r-t),u=1/(i-n),c=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function r1e(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=(i+n)*o,e[14]=2*i*n*o}else e[10]=-1,e[14]=-2*n;return e}var k7=r1e;function $6t(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=i*o,e[14]=i*n*o}else e[10]=-1,e[14]=-n;return e}function Y6t(e,t,r,n){let i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((o-s)*u*.5),e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function n1e(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e}var B7=n1e;function J6t(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=a*c,e[15]=1,e}function O7(e,t,r,n){let i,a,o,s,u,c,l,f,p,h,d=t[0],b=t[1],g=t[2],x=n[0],E=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(d-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?Zxe(e):(f=d-F,p=b-D,h=g-j,i=1/Math.sqrt(f*f+p*p+h*h),f*=i,p*=i,h*=i,a=E*h-S*p,o=S*f-x*h,s=x*p-E*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=p*s-h*o,c=h*a-f*s,l=f*o-p*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*d+o*b+s*g),e[13]=-(u*d+c*b+l*g),e[14]=-(f*d+p*b+h*g),e[15]=1,e)}function X6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],p=o-r[2],h=l*l+f*f+p*p;h>0&&(h=1/Math.sqrt(h),l*=h,f*=h,p*=h);let d=u*p-c*f,b=c*l-s*p,g=s*f-u*l;return h=d*d+b*b+g*g,h>0&&(h=1/Math.sqrt(h),d*=h,b*=h,g*=h),e[0]=d,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-p*b,e[5]=p*d-l*g,e[6]=l*b-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=p,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function Q6t(e){return"mat4(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3],", ").concat(e[4],", ").concat(e[5],", ").concat(e[6],", ").concat(e[7],", ").concat(e[8],", ").concat(e[9],", ").concat(e[10],", ").concat(e[11],", ").concat(e[12],", ").concat(e[13],", ").concat(e[14],", ").concat(e[15],")")}function Z6t(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function e3t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function i1e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function t3t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function r3t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function n3t(e,t){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]}function i3t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],p=e[10],h=e[11],d=e[12],b=e[13],g=e[14],x=e[15],E=t[0],S=t[1],F=t[2],D=t[3],j=t[4],k=t[5],N=t[6],C=t[7],I=t[8],P=t[9],U=t[10],Y=t[11],J=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-S)<=1e-6*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-F)<=1e-6*Math.max(1,Math.abs(i),Math.abs(F))&&Math.abs(a-D)<=1e-6*Math.max(1,Math.abs(a),Math.abs(D))&&Math.abs(o-j)<=1e-6*Math.max(1,Math.abs(o),Math.abs(j))&&Math.abs(s-k)<=1e-6*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(u-N)<=1e-6*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(p-U)<=1e-6*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(h-Y)<=1e-6*Math.max(1,Math.abs(h),Math.abs(Y))&&Math.abs(d-J)<=1e-6*Math.max(1,Math.abs(d),Math.abs(J))&&Math.abs(b-re)<=1e-6*Math.max(1,Math.abs(b),Math.abs(re))&&Math.abs(g-ee)<=1e-6*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(x-ge)<=1e-6*Math.max(1,Math.abs(x),Math.abs(ge))}var a3t=t_,o3t=i1e;function s3t(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function a1e(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function o1e(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function s1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function u1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function c1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function l1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function f1e(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function p1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function h1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,p=c*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=l*c+h*-o+f*-u-p*-s,e[1]=f*c+h*-s+p*-o-l*-u,e[2]=p*c+h*-u+l*-s-f*-o,e[3]=t[3],e}var evr=function(){let e=s3t();return function(t,r,n,i,a,o){let s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var R7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(R7||(R7={}));var c3t=45*Math.PI/180,l3t=1,I7=.1,P7=500,f3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends vv{static get IDENTITY(){return h3t()}static get ZERO(){return p3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return R7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=p,this[12]=h,this[13]=d,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=h,this[4]=r,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=p,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(f3t)}fromObject(t){return this.check()}fromQuaternion(t){return D7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return s===1/0?d3t(this,r,n,i,a,o):F7(this,r,n,i,a,o,s),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return O7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return B7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=c3t,aspect:n=l3t,focalDistance:i=1,near:a=I7,far:o=P7}=t;d1e(r);let s=r/2,u=i*Math.tan(s),c=u*n;return this.ortho({left:-c,right:c,bottom:-u,top:u,near:a,far:o})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:a=500}=t;return d1e(r),k7(this,r,n,i,a),this.check()}determinant(){return _7(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-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],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*a,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*a,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*a,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*a,t[8]=this[10]*o,t}transpose(){return y7(this,this),this.check()}invert(){return x7(this,this),this.check()}multiplyLeft(t){return t_(this,t,this),this.check()}multiplyRight(t){return t_(this,this,t),this.check()}rotateX(t){return S7(this,this,t),this.check()}rotateY(t){return T7(this,this,t),this.check()}rotateZ(t){return C7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return A7(this,this,t,r),this.check()}scale(t){return E7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return w7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=p1e(r||[-0,-0,-0,-0],t,this),yp(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=c8(r||[-0,-0],t,this);break;case 3:i=kd(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yp(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=l8(r||[-0,-0],t,this);break;case 3:n=f8(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yp(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},x8,_8;function p3t(){return x8||(x8=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(x8)),x8}function h3t(){return _8||(_8=new Kr,Object.freeze(_8)),_8}function d1e(e){if(e>Math.PI*2)throw Error("expected radians")}function d3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,p=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}function m1e(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function g1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function j7(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function L7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function v1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function b1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function y1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function x1e(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function r_(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],p,h,d,b,g;return p=i*u+a*c+o*l+s*f,p<0&&(p=-p,u=-u,c=-c,l=-l,f=-f),1-p>1e-6?(h=Math.acos(p),g=Math.sin(h),d=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(d=1-n,b=n),e[0]=d*i+b*u,e[1]=d*a+b*c,e[2]=d*o+b*l,e[3]=d*s+b*f,e}function _1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function w1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function M7(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var E1e=a1e;var A1e=o1e,S1e=l1e,T1e=f1e,C1e=s1e;var D1e=u1e;var F1e=c1e;var k1e=function(){let e=h8(),t=d8(1,0,0),r=d8(0,1,0);return function(n,i,a){let o=Q1(i,a);return o<-.999999?(Fd(e,t,i),d7(e)<1e-6&&Fd(e,r,i),c7(e,e),j7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Fd(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,F1e(n,n))}}(),dvr=function(){let e=m1e(),t=m1e();return function(r,n,i,a,o,s){return r_(e,n,o,s),r_(t,i,a,s),r_(r,e,t,2*s*(1-s)),r}}(),mvr=function(){let e=Vxe();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],F1e(t,M7(t,e))}}();var m3t=[0,0,0,1],ds=class extends bp{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return M7(this,t),this.check()}fromAxisRotation(t,r){return j7(this,t,r),this.check()}identity(){return g1e(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}len(){return C1e(this)}lengthSquared(){return D1e(this)}dot(t){return S1e(this,t)}rotationTo(t,r){return k1e(this,t,r),this.check()}add(t){return E1e(this,this,t),this.check()}calculateW(){return x1e(this,this),this.check()}conjugate(){return w1e(this,this),this.check()}invert(){return _1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(T1e(this,t,r,n),this.check())}multiplyRight(t){return L7(this,this,t),this.check()}multiplyLeft(t){return L7(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return v1e(this,this,t),this.check()}rotateY(t){return b1e(this,this,t),this.check()}rotateZ(t){return y1e(this,this,t),this.check()}scale(t){return A1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=m3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return r_(this,i,a,o),this.check()}transformVector4(t,r=new hs){return h1e(r,t,this),yp(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var pu={};fa(pu,{EPSILON1:()=>g3t,EPSILON10:()=>S3t,EPSILON11:()=>T3t,EPSILON12:()=>C3t,EPSILON13:()=>D3t,EPSILON14:()=>F3t,EPSILON15:()=>k3t,EPSILON16:()=>B3t,EPSILON17:()=>O3t,EPSILON18:()=>I3t,EPSILON19:()=>P3t,EPSILON2:()=>v3t,EPSILON20:()=>R3t,EPSILON3:()=>b3t,EPSILON4:()=>y3t,EPSILON5:()=>x3t,EPSILON6:()=>_3t,EPSILON7:()=>w3t,EPSILON8:()=>E3t,EPSILON9:()=>A3t,PI_OVER_FOUR:()=>L3t,PI_OVER_SIX:()=>M3t,PI_OVER_TWO:()=>j3t,TWO_PI:()=>q3t});var g3t=.1,v3t=.01,b3t=.001,y3t=1e-4,x3t=1e-5,_3t=1e-6,w3t=1e-7,E3t=1e-8,A3t=1e-9,S3t=1e-10,T3t=1e-11,C3t=1e-12,D3t=1e-13,F3t=1e-14,k3t=1e-15,B3t=1e-16,O3t=1e-17,I3t=1e-18,P3t=1e-19,R3t=1e-20,j3t=Math.PI/2,L3t=Math.PI/4,M3t=Math.PI/6,q3t=Math.PI*2;var Dl=6356752314245179e-9,N3t={radii:[6378137,6378137,Dl],radiiSquared:[6378137*6378137,6378137*6378137,Dl*Dl],oneOverRadii:[1/6378137,1/6378137,1/Dl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dl*Dl)],maximumRadius:Math.max(6378137,6378137,Dl),centerToleranceSquared:.1};function w8(e){return e}var Vvr=new ce;function U3t(e,t=[],r=w8){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function B1e(e,t=[]){return U3t(e,t,Sn._cartographicRadians?w8:a7)}function G3t(e,t,r=w8){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function O1e(e,t){return G3t(e,t,Sn._cartographicRadians?w8:o7)}var I1e=1e-14,z3t=new ce,P1e={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"}},q7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},n_={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},H3t=new ce,W3t=new ce,V3t=new ce;function N7(e,t,r,n,i,a){let o=P1e[t]&&P1e[t][r];aa(o&&(!n||n===o));let s,u,c,l=z3t.copy(i);if(Oo(l.x,0,I1e)&&Oo(l.y,0,I1e)){let p=Math.sign(l.z);s=H3t.fromArray(q7[t]),t!=="east"&&t!=="west"&&s.scale(p),u=W3t.fromArray(q7[r]),r!=="east"&&r!=="west"&&u.scale(p),c=V3t.fromArray(q7[n]),n!=="east"&&n!=="west"&&c.scale(p)}else{let{up:p,east:h,north:d}=n_;h.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),d.copy(p).cross(h);let{down:b,west:g,south:x}=n_;b.copy(p).scale(-1),g.copy(h).scale(-1),x.copy(d).scale(-1),s=n_[t],u=n_[r],c=n_[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=c.x,a[9]=c.y,a[10]=c.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var bv=new ce,K3t=new ce,$3t=new ce;function R1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;bv.from(e);let o=bv.x,s=bv.y,u=bv.z,c=n.x,l=n.y,f=n.z,p=o*o*c*c,h=s*s*l*l,d=u*u*f*f,b=p+h+d,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=K3t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=$3t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*bv.len()/(.5*D.len()),k=0,N,C,I,P;do{j-=k,N=1/(1+j*E),C=1/(1+j*S),I=1/(1+j*F);let U=N*N,Y=C*C,J=I*I,re=U*N,ee=Y*C,ge=J*I;P=p*U+h*Y+d*J-1;let he=-2*(p*re*E+h*ee*S+d*ge*F);k=P/he}while(Math.abs(P)>pu.EPSILON12);return bv.scale([N,C,I]).to(r)}var E8=new ce,j1e=new ce,X3t=new ce,hu=new ce,Q3t=new ce,A8=new ce,or=class{constructor(t=0,r=0,n=0){zt(this,"radii",void 0),zt(this,"radiiSquared",void 0),zt(this,"radiiToTheFourth",void 0),zt(this,"oneOverRadii",void 0),zt(this,"oneOverRadiiSquared",void 0),zt(this,"minimumRadius",void 0),zt(this,"maximumRadius",void 0),zt(this,"centerToleranceSquared",pu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),aa(t>=0),aa(r>=0),aa(n>=0),this.radii=new ce(t,r,n),this.radiiSquared=new ce(t*t,r*r,n*n),this.radiiToTheFourth=new ce(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new ce(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new ce(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=j1e,i=X3t,[,,a]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);let o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(a),i.add(n),i.to(r)}cartesianToCartographic(t,r=[0,0,0]){A8.from(t);let n=this.scaleToGeodeticSurface(A8,hu);if(!n)return;let i=this.geodeticSurfaceNormal(n,j1e),a=Q3t;a.copy(A8).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(gv.dot(a,A8))*gv.length(a);return O1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return N7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return N7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return E8.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=B1e(t),i=n[0],a=n[1],o=Math.cos(a);return E8.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),E8.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return E8.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return R1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){hu.from(t);let n=hu.x,i=hu.y,a=hu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return hu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){aa(Oo(this.radii.x,this.radii.y,pu.EPSILON15)),aa(this.radii.z>0),hu.from(t);let i=hu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return hu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Dl));var oa={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var hbr=new ce,dbr=new ce;var i_=new ce,L1e=new ce,Ja=class{constructor(t=[0,0,0],r=0){zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new ce,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=i_.from(r),this.center=new ce().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Ja(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=i_.copy(i).subtract(r),s=o.magnitude();if(n>=s+a)return this.clone();if(a>=s+n)return t.clone();let u=(n+s+a)*.5;return L1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(L1e),this.radius=u,this}expand(t){let n=i_.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=y8.getScaling(i_,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=i_.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,a=t.normal.dot(r)+t.distance;return a<-n?oa.OUTSIDE:a<n?oa.INTERSECTING:oa.INSIDE}};var Z3t=new ce,eCt=new ce,S8=new ce,T8=new ce,C8=new ce,tCt=new ce,rCt=new ce,Fl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},sa=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=new ce().from(t),this.halfAxes=new Rr(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new ce(t).len(),new ce(r).len(),new ce(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new ce(t).normalize(),a=new ce(r).normalize(),o=new ce(n).normalize();return new ds().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new ds(n),a=new Rr().fromQuaternion(i);return a[0]=a[0]*r[0],a[1]=a[1]*r[0],a[2]=a[2]*r[0],a[3]=a[3]*r[1],a[4]=a[4]*r[1],a[5]=a[5]*r[1],a[6]=a[6]*r[2],a[7]=a[7]*r[2],a[8]=a[8]*r[2],this.center=new ce().from(t),this.halfAxes=a,this}clone(){return new sa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ja){let r=this.halfAxes,n=r.getColumn(0,S8),i=r.getColumn(1,T8),a=r.getColumn(2,C8),o=Z3t.copy(n).add(i).add(a);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,i=this.halfAxes,a=n.x,o=n.y,s=n.z,u=Math.abs(a*i[Fl.COLUMN0ROW0]+o*i[Fl.COLUMN0ROW1]+s*i[Fl.COLUMN0ROW2])+Math.abs(a*i[Fl.COLUMN1ROW0]+o*i[Fl.COLUMN1ROW1]+s*i[Fl.COLUMN1ROW2])+Math.abs(a*i[Fl.COLUMN2ROW0]+o*i[Fl.COLUMN2ROW1]+s*i[Fl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?oa.OUTSIDE:c>=u?oa.INSIDE:oa.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=eCt.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,S8),a=n.getColumn(1,T8),o=n.getColumn(2,C8),s=i.magnitude(),u=a.magnitude(),c=o.magnitude();i.normalize(),a.normalize(),o.normalize();let l=0,f;return f=Math.abs(r.dot(i))-s,f>0&&(l+=f*f),f=Math.abs(r.dot(a))-u,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),l}computePlaneDistances(t,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=this.center,s=this.halfAxes,u=s.getColumn(0,S8),c=s.getColumn(1,T8),l=s.getColumn(2,C8),f=tCt.copy(u).add(c).add(l).add(o),p=rCt.copy(f).subtract(t),h=r.dot(p);return i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,S8);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,T8);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,C8);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var M1e=new ce,q1e=new ce,kl=class{constructor(t=[0,0,1],r=0){zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new ce,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return aa(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=M1e.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,i){return this.normal.set(t,r,n),aa(Oo(this.normal.len(),1)),this.distance=i,this}clone(){return new kl(this.normal,this.distance)}equals(t){return Oo(this.distance,t.distance)&&Oo(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=q1e.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=M1e.from(t),i=this.getPointDistance(n),a=q1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var N1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],U1e=new ce,nCt=new ce,ms=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*N1e.length;let r=t.center,n=t.radius,i=0;for(let a of N1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new kl),s||(s=this.planes[i+1]=new kl);let u=U1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=U1e.copy(a).scale(n).add(r),l=nCt.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=oa.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case oa.OUTSIDE:return oa.OUTSIDE;case oa.INTERSECTING:r=oa.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(aa(Number.isFinite(r),"parentPlaneMask is required."),r===ms.MASK_OUTSIDE||r===ms.MASK_INSIDE)return r;let n=ms.MASK_INSIDE,i=this.planes;for(let a=0;a<this.planes.length;++a){let o=a<31?1<<a:0;if(a<31&&!(r&o))continue;let s=i[a],u=t.intersectPlane(s);if(u===oa.OUTSIDE)return ms.MASK_OUTSIDE;u===oa.INTERSECTING&&(n|=o)}return n}};zt(ms,"MASK_OUTSIDE",4294967295);zt(ms,"MASK_INSIDE",0);zt(ms,"MASK_INDETERMINATE",2147483647);var Lbr=new ce,Mbr=new ce,qbr=new ce,Nbr=new ce,Ubr=new ce;var aCt=new ce,oCt=new ce,sCt=new ce,uCt=new ce,cCt=new ce,lCt=new ce,fCt=new ce,yv=new ce,pCt=new ce,hCt=new ce,dCt=new ce,mCt=new ce;function U7(e,t=new Ja){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=fCt.copy(e[0]),n=aCt.copy(r),i=oCt.copy(r),a=sCt.copy(r),o=uCt.copy(r),s=cCt.copy(r),u=lCt.copy(r);for(let j of e){r.copy(j);let k=r.x,N=r.y,C=r.z;k<n.x&&n.copy(r),k>o.x&&o.copy(r),N<i.y&&i.copy(r),N>s.y&&s.copy(r),C<a.z&&a.copy(r),C>u.z&&u.copy(r)}let c=yv.copy(o).subtract(n).magnitudeSquared(),l=yv.copy(s).subtract(i).magnitudeSquared(),f=yv.copy(u).subtract(a).magnitudeSquared(),p=n,h=o,d=c;l>d&&(d=l,p=i,h=s),f>d&&(d=f,p=a,h=u);let b=pCt;b.x=(p.x+h.x)*.5,b.y=(p.y+h.y)*.5,b.z=(p.z+h.z)*.5;let g=yv.copy(h).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=hCt;E.x=n.x,E.y=i.y,E.z=a.z;let S=dCt;S.x=o.x,S.y=s.y,S.z=u.z;let F=mCt.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=yv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=yv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let I=C-x;b.x=(x*b.x+I*r.x)/C,b.y=(x*b.y+I*r.y)/C,b.z=(x*b.z+I*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var yc=new Rr,gCt=new Rr,vCt=new Rr,D8=new Rr,G1e=new Rr;function H7(e,t={}){let r=pu.EPSILON20,n=10,i=0,a=0,o=gCt,s=vCt;o.identity(),s.copy(e);let u=r*bCt(s);for(;a<n&&yCt(s)>u;)xCt(s,D8),G1e.copy(D8).transpose(),s.multiplyRight(D8),s.multiplyLeft(G1e),o.multiplyRight(D8),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function bCt(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var G7=[1,0,0],z7=[2,2,1];function yCt(e){let t=0;for(let r=0;r<3;++r){let n=e[yc.getElementIndex(z7[r],G7[r])];t+=2*n*n}return Math.sqrt(t)}function xCt(e,t){let r=pu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[yc.getElementIndex(z7[c],G7[c])]);l>n&&(i=c,n=l)}let a=G7[i],o=z7[i],s=1,u=0;if(Math.abs(e[yc.getElementIndex(o,a)])>r){let c=e[yc.getElementIndex(o,o)],l=e[yc.getElementIndex(a,a)],f=e[yc.getElementIndex(o,a)],p=(c-l)/2/f,h;p<0?h=-1/(-p+Math.sqrt(1+p*p)):h=1/(p+Math.sqrt(1+p*p)),s=1/Math.sqrt(1+h*h),u=h*s}return Rr.IDENTITY.to(t),t[yc.getElementIndex(a,a)]=t[yc.getElementIndex(o,o)]=s,t[yc.getElementIndex(o,a)]=u,t[yc.getElementIndex(a,o)]=-u,t}var _p=new ce,wCt=new ce,ECt=new ce,ACt=new ce,SCt=new ce,TCt=new Rr,CCt={diagonal:new Rr,unitary:new Rr};function a_(e,t=new sa){if(!e||e.length===0)return t.halfAxes=new Rr([0,0,0,0,0,0,0,0,0]),t.center=new ce,t;let r=e.length,n=new ce(0,0,0);for(let C of e)n.add(C);let i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,u=0,c=0,l=0;for(let C of e){let I=_p.copy(C).subtract(n);a+=I.x*I.x,o+=I.x*I.y,s+=I.x*I.z,u+=I.y*I.y,c+=I.y*I.z,l+=I.z*I.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=TCt;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:p}=H7(f,CCt),h=t.halfAxes.copy(p),d=h.getColumn(0,ECt),b=h.getColumn(1,ACt),g=h.getColumn(2,SCt),x=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)_p.copy(C),x=Math.max(_p.dot(d),x),E=Math.max(_p.dot(b),E),S=Math.max(_p.dot(g),S),F=Math.min(_p.dot(d),F),D=Math.min(_p.dot(b),D),j=Math.min(_p.dot(g),j);d=d.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(d).add(b).add(g);let k=wCt.set(x-F,E-D,S-j).multiplyByScalar(.5),N=new Rr([k[0],0,0,0,k[1],0,0,0,k[2]]);return t.halfAxes.multiplyRight(N),t}function V1e(e){return e!=null}var xyr=new ce,DCt=new ce,FCt=new ce,kCt=new ce,Bd=new ce,z1e=new ce,H1e=new ce,W1e=new ce;function F8(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return K1e(e.box,t,r);if(e.region)return OCt(e.region);if(e.sphere)return BCt(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function K1e(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(e.length===10){let c=e.slice(3,6),l=new ds;l.fromArray(e,6);let f=new ce([1,0,0]),p=new ce([0,1,0]),h=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),p.transformByQuaternion(l),p.scale(c[1]),h.transformByQuaternion(l),h.scale(c[2]),i=[...f.toArray(),...p.toArray(),...h.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),u=new Rr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return V1e(r)?(r.center=n,r.halfAxes=u,r):new sa(n,u)}function BCt(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(DCt),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return V1e(r)?(r.center=n,r.radius=o,r):new Ja(n,o)}function OCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Cl(t),Cl(i),a],FCt),u=or.WGS84.cartographicToCartesian([Cl(n),Cl(r),o],kCt),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Bd),or.WGS84.cartographicToCartesian([Cl(n),Bd[1],Bd[2]],z1e),or.WGS84.cartographicToCartesian([Bd[0],Cl(i),Bd[2]],H1e),or.WGS84.cartographicToCartesian([Bd[0],Bd[1],o],W1e),K1e([...c,...z1e.subtract(c),...H1e.subtract(c),...W1e.subtract(c)],new Kr)}var xv="4.0.6";var gs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Syr=Object.keys(gs),wp={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function W7(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function $1e(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var k8="4.0.6";var ICt={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},Y1e={name:"Draco",id:"draco",module:"draco",version:k8,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:ICt};function X1e(e,t,r){let n=Q1e(t.metadata),i=[],a=PCt(t.attributes);for(let o in e){let s=e[o],u=J1e(o,s,a[o]);i.push(u)}if(r){let o=J1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function PCt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function J1e(e,t,r){let n=r?Q1e(r.metadata):void 0;return n7(e,t,n)}function Q1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Z1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},RCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},jCt=4,o_=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=r7(u.attributes),l=X1e(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:c},...u,schema:l}}finally{this.draco.destroy(n),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:a}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let a=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[a.unique_id()]={unique_id:a.unique_id(),attribute_type:a.attribute_type(),data_type:a.data_type(),num_components:a.num_components(),byte_offset:a.byte_offset(),byte_stride:a.byte_stride(),normalized:a.normalized(),attribute_index:i,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(n[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(n[a.unique_id()].octahedron_transform=u)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,n);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);i[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return i}_getTriangleListIndices(t){let n=t.num_faces()*3,i=n*jCt,a=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,a),new Uint32Array(this.draco.HEAPF32.buffer,a,n).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),qCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=RCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=LCt(this.draco,n),c,l=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,l),c=new n(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===n)return o;let i=t.attribute_type;for(let o in Z1e)if(this.draco[o]===i)return Z1e[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let a=this.metadataQuerier.GetEntryName(t,i);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=MCt(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let a of i)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(s=>o.min_value(s))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function LCt(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function MCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function qCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var NCt="1.5.6",UCt="1.4.1",V7=`https://www.gstatic.com/draco/versioned/decoders/${NCt}`,ai={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Ep={[ai.DECODER]:`${V7}/${ai.DECODER}`,[ai.DECODER_WASM]:`${V7}/${ai.DECODER_WASM}`,[ai.FALLBACK_DECODER]:`${V7}/${ai.FALLBACK_DECODER}`,[ai.ENCODER]:`https://raw.githubusercontent.com/google/draco/${UCt}/javascript/${ai.ENCODER}`},s_;async function e_e(e){let t=e.modules||{};return t.draco3d?s_=s_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):s_=s_||GCt(e),await s_}async function GCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Zu(Ep[ai.FALLBACK_DECODER],"draco",e,ai.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Zu(Ep[ai.DECODER],"draco",e,ai.DECODER),await Zu(Ep[ai.DECODER_WASM],"draco",e,ai.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await zCt(t,r)}function zCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var K7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:k8,worker:!0,options:{draco:{},source:null}};var _v={...Y1e,parse:HCt};async function HCt(e,t){let{draco:r}=await e_e(t),n=new o_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var WCt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ht={...WCt,...bi};var $7={[bi.DOUBLE]:Float64Array,[bi.FLOAT]:Float32Array,[bi.UNSIGNED_SHORT]:Uint16Array,[bi.UNSIGNED_INT]:Uint32Array,[bi.UNSIGNED_BYTE]:Uint8Array,[bi.BYTE]:Int8Array,[bi.SHORT]:Int16Array,[bi.INT]:Int32Array},VCt={DOUBLE:bi.DOUBLE,FLOAT:bi.FLOAT,UNSIGNED_SHORT:bi.UNSIGNED_SHORT,UNSIGNED_INT:bi.UNSIGNED_INT,UNSIGNED_BYTE:bi.UNSIGNED_BYTE,BYTE:bi.BYTE,SHORT:bi.SHORT,INT:bi.INT},Y7="Failed to convert GL type",qa=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in $7)if($7[r]===t)return r;throw new Error(Y7)}static fromName(t){let r=VCt[t];if(!r)throw new Error(Y7);return r}static getArrayType(t){switch(t){case bi.UNSIGNED_SHORT_5_6_5:case bi.UNSIGNED_SHORT_4_4_4_4:case bi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=$7[t];if(!r)throw new Error(Y7);return r}}static getByteSize(t){return qa.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(qa.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/qa.getByteSize(t));let a=qa.getArrayType(t);return new a(r,n,i)}};function t_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function J7(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Zyr=1/256;var exr=new Dd,txr=new ce,rxr=new Dd,nxr=new Dd,ixr=new Uint8Array(1);function r_e(e,t=255){return s7(e,0,t)/t*2-1}function n_e(e){return e<0?-1:1}function i_e(e,t,r,n){if(t_e(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=r_e(e,r),n.y=r_e(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*n_e(i),n.y=(1-Math.abs(i))*n_e(n.y)}return n.normalize()}function X7(e,t,r){return i_e(e,t,255,r)}function Od(e){return(e%1+1)%1}var Bl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Ht.UNSIGNED_INT,n=1){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,i.byteOffset):i}getPropertyArray(t,r,n){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=qa.fromName(i.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,r,i)}getProperty(t,r,n,i,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,n);if(n===1)return s[i];for(let u=0;u<n;++u)a[u]=s[n*i+u];return a}_getTypedArrayFromBinary(t,r,n,i,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=qa.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,i*n),o[t]=s),s}_getTypedArrayFromArray(t,r,n){let i=this._cachedTypedArrays,a=i[t];return a||(a=qa.createTypedArray(r,n),i[t]=a),a}};var KCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$Ct={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},YCt={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function a_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?qa.fromName(i):i,o=KCt[e.type],s=$Ct[e.type],u=YCt[e.type];return r+=e.byteOffset,{values:qa.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var xc=e=>e!==void 0;function o_e(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?JCt(n,r):null}function JCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;xc(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(xc(u))for(xc(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),l=0,r=0;r<a;++r)f[r]=l,l+=u[r];xc(c)&&xc(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let p=o.length;for(r=0;r<p;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let h=new Array(p).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],d[r]=h[n],++h[n];let b={classes:o,classIds:s,classIndexes:d,parentCounts:u,parentIndexes:f,parentIds:c};return ZCt(b),b}function wv(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?XCt(e,t,r):QCt(e,t,r)}function XCt(e,t,r){let n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);let c=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;){if(t=l.pop(),u[t]===c)continue;u[t]=c;let f=r(e,t);if(xc(f))return f;let p=i[t],h=o[t];for(let d=0;d<p;++d){let b=a[h+d];b!==t&&l.push(b)}}return null}function QCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(xc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function ZCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)s_e(e,i,stack)}function s_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!xc(i))return;assert(t<s,`Parent index ${t} exceeds the total number of instances: ${s}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let u=xc(n)?n[t]:1,c=xc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&s_e(e,f,r)}r.pop(t)}function mo(e){return e!=null}var B8=(e,t)=>e,e8t={HIERARCHY:!0,extensions:!0,extras:!0},Id=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Qt(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)e8t[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=o_e(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._hierarchy){let n=wv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return mo(n)}return!1}isExactClass(t,r){return Qt(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),Qt(typeof r=="string",r),mo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=mo(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(mo(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(mo(n))return B8(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(mo(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let a=this._properties[r];mo(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=B8(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(t=t||{},t[r]=i)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;Qt(this.binary,`Property ${t} requires a batch table binary.`),Qt(n.type,`Property ${t} requires a type.`);let i=a_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=wv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return mo(s[r])});return mo(n)}_getPropertyNamesInHierarchy(t,r){wv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return wv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return mo(u)?mo(u.typedArray)?this._getBinaryProperty(u,s):B8(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=wv(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return mo(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),mo(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=B8(i,!0),!0):!1});return mo(a)}};var Q7=4;function Ap(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=Q7,e.version=n.getUint32(r,!0),r+=Q7,e.byteLength=n.getUint32(r,!0),r+=Q7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Ev=4,u_e="b3dm tile in legacy format.";function Av(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=Ev;let o=n.getUint32(r,!0);r+=Ev;let s=n.getUint32(r,!0);r+=Ev;let u=n.getUint32(r,!0);return r+=Ev,s>=570425344?(r-=Ev*2,i=a,s=o,u=0,a=0,o=0,console.warn(u_e)):u>=570425344&&(r-=Ev,i=s,s=a,u=o,a=0,o=0,console.warn(u_e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Sv(e,t,r,n){return r=t8t(e,t,r,n),r=r8t(e,t,r,n),r}function t8t(e,t,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let s=W7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function r8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=W7(t,r,i);e.batchTableJson=JSON.parse(o),r+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function Z7(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:a=0}=e;if(n&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=n[s],l=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&i){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=J7(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ht.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var c_e=new ce;function l_e(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)X7(t[n*2],t[n*2+1],c_e),c_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function f_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,n8t(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function n8t(e,t){let r=new ce,n=new Float32Array(e.pointCount*3);for(let i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}async function p_e(e,t,r,n,i){r=Ap(e,t,r),r=Av(e,t,r),r=Sv(e,t,r,n),i8t(e);let{featureTable:a,batchTable:o}=a8t(e);return await l8t(e,a,o,n,i),o8t(e,a,n),s8t(e,a,o),u8t(e,a),r}function i8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function a8t(e){let t=new Bl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let n=c8t(e,t);return{featureTable:t,batchTable:n}}function o8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ht.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=f_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function s8t(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",Ht.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Ht.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Ht.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Z7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function u8t(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Ht.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Ht.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=l_e(e,r)}}function c8t(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ht.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:a}=e;r=new Id(i,a,n)}return r}async function l8t(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,p=c.byteLength;if(!o||!Number.isFinite(f)||!p)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+p),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await f8t(e,l,n,i)}async function f8t(e,t,r,n){if(!n)return;let i={...r,draco:{...r==null?void 0:r.draco,extraAttributes:t.batchTableProperties||{}}};delete i["3d-tiles"];let a=await To(t.buffer,_v,i,n),o=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,u=a.attributes.NORMAL&&a.attributes.NORMAL.value,c=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=o&&a.attributes.POSITION.value.quantization,f=u&&a.attributes.NORMAL.value.quantization;if(l){let h=a.POSITION.data.quantization,d=h.range;e.quantizedVolumeScale=new ce(d,d,d),e.quantizedVolumeOffset=new ce(h.minValues),e.quantizedRange=(1<<h.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let p={};if(t.batchTableProperties)for(let h of Object.keys(t.batchTableProperties))a.attributes[h]&&a.attributes[h].value&&(p[h.toLowerCase()]=a.attributes[h].value);e.attributes={positions:o,colors:Z7(e,s,void 0),normals:u,batchIds:c,...p}}var uq={};fa(uq,{decode:()=>J8t,name:()=>G8});var O8="4.0.6";var h_e,p8t=(h_e=globalThis.loaders)==null?void 0:h_e.parseImageNode,eq=typeof Image<"u",tq=typeof ImageBitmap<"u",h8t=Boolean(p8t),rq=gn?!0:h8t;function d_e(e){switch(e){case"auto":return tq||eq||rq;case"imagebitmap":return tq;case"image":return eq;case"data":return rq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function m_e(){if(tq)return"imagebitmap";if(eq)return"image";if(rq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function g_e(e){let t=d8t(e);if(!t)throw new Error("Not an image");return t}function nq(e){return Tv(e)}function Tv(e){switch(g_e(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function d8t(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var m8t=/^data:image\/svg\+xml/,g8t=/\.svg((\?|#).*)?$/;function I8(e){return e&&(m8t.test(e)||g8t.test(e))}function v_e(e,t){if(I8(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return iq(e,t)}function iq(e,t){if(I8(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function P8(e,t,r){let n=v_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await v8t(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function v8t(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=a=>{let o=a instanceof Error?a.message:"error";i(new Error(o))}}catch(a){i(a)}})}var b8t={},b_e=!0;async function y_e(e,t,r){let n;I8(r)?n=await P8(e,t,r):n=iq(e,r);let i=t&&t.imagebitmap;return await y8t(n,i)}async function y8t(e,t=null){if((x8t(t)||!b_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),b_e=!1}return await createImageBitmap(e)}function x8t(e){for(let t in e||b8t)return!1;return!0}function x_e(e){return!A8t(e,"ftyp",4)||!(e[8]&96)?null:_8t(e)}function _8t(e){switch(w8t(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function w8t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function E8t(e){return[...e].map(t=>t.charCodeAt(0))}function A8t(e,t,r=0){let n=E8t(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var _c=!1,u_=!0;function Pd(e){let t=c_(e);return T8t(t)||F8t(t)||C8t(t)||D8t(t)||S8t(t)}function S8t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=x_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function T8t(e){let t=c_(e);return t.byteLength>=24&&t.getUint32(0,_c)===2303741511?{mimeType:"image/png",width:t.getUint32(16,_c),height:t.getUint32(20,_c)}:null}function C8t(e){let t=c_(e);return t.byteLength>=10&&t.getUint32(0,_c)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,u_),height:t.getUint16(8,u_)}:null}function D8t(e){let t=c_(e);return t.byteLength>=14&&t.getUint16(0,_c)===16973&&t.getUint32(2,u_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,u_),height:t.getUint32(22,u_)}:null}function F8t(e){let t=c_(e);if(!(t.byteLength>=3&&t.getUint16(0,_c)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=k8t(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,_c);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,_c),width:t.getUint16(a+7,_c)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,_c)}return null}function k8t(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function c_(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function __e(e,t){var i;let{mimeType:r}=Pd(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function w_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=B8t(i),s;switch(o){case"imagebitmap":s=await y_e(e,t,a);break;case"image":s=await P8(e,t,a);break;case"data":s=await __e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Tv(s)),s}function B8t(e){switch(e){case"auto":case"data":return m_e();default:return d_e(e),e}}var O8t=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],I8t=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],P8t={image:{type:"auto",decode:!0}},Cv={id:"image",module:"images",name:"Images",version:O8,mimeTypes:I8t,extensions:O8t,parse:w_e,tests:[e=>Boolean(Pd(new DataView(e)))],options:P8t};var S_e,E_e=(S_e=globalThis.loaders)==null?void 0:S_e.encodeImageNode;async function T_e(e,t){return t=t||{},t.image=t.image||{},E_e?E_e(e,{type:t.image.mimeType}):R8t(e,t)}var A_e=!0;async function R8t(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=nq(e),o=document.createElement("canvas");o.width=i,o.height=a,j8t(e,o);let s=await new Promise(u=>{if(n&&A_e)try{o.toBlob(u,r,n);return}catch{A_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function j8t(e,t,r=0,n=0){if(r===0&&n===0&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let i=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return i.putImageData(o,0,0),t}return i.drawImage(e,0,0),t}var aq={name:"Images",id:"image",module:"images",version:O8,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:T_e};var oq={};function sq(e){if(oq[e]===void 0){let t=gn?M8t(e):L8t(e);oq[e]=t}return oq[e]}function L8t(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=((i=globalThis.loaders)==null?void 0:i.imageFormatsNode)||t,n=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return Boolean(n)&&r.includes(e)}function M8t(e){switch(e){case"image/avif":case"image/webp":return q8t(e);default:return!0}}function q8t(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ui(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var R8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var N8t=1.33,C_e=["SCALAR","VEC2","VEC3","VEC4"],U8t=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],G8t=new Map(U8t),z8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H8t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},W8t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function L8(e){return C_e[e-1]||C_e[0]}function Dv(e){let t=G8t.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Fv(e,t){let r=W8t[e.componentType],n=z8t[e.type],i=H8t[e.componentType],a=e.count*n,o=e.count*n*i;Ui(o>=0&&o<=t.byteLength);let s=j8[e.componentType],u=R8[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function l_(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(o=>o.bufferView);r=r.filter(o=>!n.includes(o));let i=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:c}=s.image;return o+u*c},0);return i+Math.ceil(4*a*N8t)}function D_e(e,t,r){let n=e.bufferViews[r];Ui(n);let i=n.buffer,a=t[i];Ui(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function F_e(e,t,r){var b,g;let n=typeof r=="number"?(b=e.accessors)==null?void 0:b[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let i=(g=e.bufferViews)==null?void 0:g[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:u,length:c,componentByteSize:l,numberOfComponentsInElement:f}=Fv(n,i),p=l*f,h=i.byteStride||p;if(typeof i.byteStride>"u"||i.byteStride===p)return new u(a,s,c);let d=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*h,f);d.set(E,x*f)}return d}function V8t(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var qr=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:(t==null?void 0:t.json)||V8t(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.getRequiredExtensions().find(i=>i===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];Ui(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return F_e(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),i=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(i,a,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let i=t.extensions||{};i[r]=n}removeObjectExtension(t,r){let n=(t==null?void 0:t.extensions)||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(t,r={}){return Ui(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ui(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)!=null&&r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:i,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(n){let u=this._addIndices(n);s.primitives[0].indices=u}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Pd(t),i=r||(n==null?void 0:n.mimeType),o={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let i=t.byteLength;Ui(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Do(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:L8(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:Dv(t),count:Math.round(t.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var a,o;this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;for(let s of this.sourceBuffers||[])i=HI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};var k_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},K8t={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},B_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function f_(e,t){return B_e[t]*k_e[e]}function kv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=Bv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function Bv(e,t,r,n=1){let i=k_e[t],a=K8t[r],o=B_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Ov(e,t,r){var c,l,f,p,h;let n=`TEXCOORD_${t.texCoord||0}`,i=r.attributes[n],a=e.getTypedArrayForAccessor(i),o=e.gltf.json,s=t.index,u=(l=(c=o.textures)==null?void 0:c[s])==null?void 0:l.source;if(typeof u<"u"){let d=(p=(f=o.images)==null?void 0:f[u])==null?void 0:p.mimeType,b=(h=e.gltf.images)==null?void 0:h[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=$8t(b,d,a,x,t.channels);g.push(E)}return g}}return[]}function M8(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(p=>p===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Dv(o),count:o.length});i.attributes[t]=c}function $8t(e,t,r,n,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],s=r[n+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let c=Y8t(o,s,e,u),l=0;for(let f of i){let p=typeof f=="number"?Object.values(a)[f]:a[f],h=c+p.offset,d=Tv(e);if(d.data.length<=h)throw new Error(`${d.data.length} <= ${h}`);let b=d.data[h];l|=b<<p.shift}return l}function Y8t(e,t,r,n=1){let i=r.width,a=Od(e)*(i-1),o=Math.round(a),s=r.height,u=Od(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function q8(e,t,r,n,i){let a=[];for(let o=0;o<t;o++){let s=r[o],u=r[o+1]-r[o];if(u+s>n)break;let c=s/i,l=u/i;a.push(e.slice(c,c+l))}return a}function N8(e,t,r){let n=[];for(let i=0;i<t;i++){let a=i*r;n.push(e.slice(a,a+r))}return n}function U8(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],a=new TextDecoder("utf8"),o=0;for(let s=0;s<e;s++){let u=n[s+1]-n[s];if(u+o<=t.length){let c=t.subarray(o,u+o),l=a.decode(c);i.push(l),o+=u}}return i}return[]}var O_e="EXT_mesh_features",G8=O_e;async function J8t(e,t){let r=new qr(e);X8t(r,t)}function X8t(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)Q8t(e,i,t)}function Q8t(e,t,r){var a,o,s;if(!((a=r==null?void 0:r.gltf)!=null&&a.loadBuffers))return;let n=(o=t.extensions)==null?void 0:o[O_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Ov(e,u.texture,t):c=[];u.data=c}}var fq={};fa(fq,{decode:()=>Z8t,name:()=>Ol});var cq="EXT_structural_metadata",Ol=cq;async function Z8t(e,t){let r=new qr(e);eDt(r,t)}function eDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(cq);r&&((i=t.gltf)!=null&&i.loadImages&&tDt(e,r),rDt(e,r))}function tDt(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let a of i.primitives)iDt(e,r,a,t)}function rDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.propertyTables;if(n&&i)for(let a in n){let o=nDt(i,a);o&&oDt(e,r,o)}}function nDt(e,t){for(let r of e)if(r.class===t)return r;return null}function iDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[cq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];aDt(e,u,r,n)}}function aDt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Ov(e,u,r);l!==null&&(M8(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function oDt(e,t,r){var a,o;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=sDt(e,t,u,i,c);c.data=l}}}function sDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=uDt(e,r,i,n),c=cDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=lDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=U8(n,s,u,c);break}case"ENUM":{a=fDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function uDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?kv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function cDt(e,t,r){return typeof t.stringOffsets<"u"?kv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function lDt(e,t,r,n){let i=e.array,a=e.count,o=f_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=Bv(r,e.type,e.componentType,s):u=r,i?n?q8(u,t,n,r.length,o):a?N8(u,t,a):[]:u}function fDt(e,t,r,n,i){var f;let a=t.enumType;if(!a)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=(f=e.enums)==null?void 0:f[a];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||"UINT16",u=f_(t.type,s),c=n.byteLength/u,l=Bv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return pDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let p=t.count;return p?hDt(l,r,p,o):[]}return lq(l,0,r,o)}function pDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,p=l/a,h=lq(t,f,p,o);s.push(h)}return s}function hDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=lq(e,o,r,n);i.push(s)}return i}function lq(e,t,r,n){let i=[];for(let a=0;a<r;a++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)i.push("");else{let o=e[t+a],s=dDt(n,o);s?i.push(s.name):i.push("")}return i}function dDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var pq={};fa(pq,{decode:()=>mDt,name:()=>vs});var I_e="EXT_feature_metadata",vs=I_e;async function mDt(e,t){let r=new qr(e);gDt(r,t)}function gDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(I_e);r&&((i=t.gltf)!=null&&i.loadImages&&vDt(e,r),bDt(e,r))}function vDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:i}=t;if(n&&i)for(let a in n){let o=n[a],s=xDt(i,a);s&&wDt(e,s,o)}}function bDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.featureTables;if(n&&i)for(let a in n){let o=yDt(i,a);o&&_Dt(e,r,o)}}function yDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function xDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function _Dt(e,t,r){var a,o;if(!r.class)return;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=EDt(e,t,u,i,c);c.data=l}}}function wDt(e,t,r){var i;let n=t.class;for(let a in r.properties){let o=(i=t==null?void 0:t.properties)==null?void 0:i[a];if(o){let s=DDt(e,o,n);o.data=s}}}function EDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=ADt(e,r,i,n),c=SDt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=U8(n,s,u,c):TDt(r)&&(a=CDt(r,n,s,u)),a}function ADt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?kv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function SDt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?kv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function TDt(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function CDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=f_(o,s),c=r.byteLength/u,l=Bv(r,o,s,c);return i?n?q8(l,t,n,r.length,u):a?N8(l,t,a):[]:l}function DDt(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let i=[];for(let a of n.meshes)for(let o of a.primitives)FDt(e,r,t,i,o);return i}function FDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Ov(e,a,i);o&&M8(e,t,o,n,i)}var z8="4.0.6";var Iv="4.0.6";var wc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},hq;async function mq(e){let t=e.modules||{};return t.basis?t.basis:(hq=hq||kDt(e),await hq)}async function kDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.TRANSCODER,"textures",e),await Zu(wc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await BDt(t,r)}function BDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,initializeBasis:o}=i;o(),n({BasisFile:a})})})}var dq;async function gq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(dq=dq||ODt(e),await dq)}async function ODt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.ENCODER,"textures",e),await Zu(wc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await IDt(t,r)}function IDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=i;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var ke={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 PDt=["","WEBKIT_","MOZ_"],P_e={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"},H8=null;function p_(e){if(!H8){e=e||RDt()||void 0,H8=new Set;for(let t of PDt)for(let r in P_e)if(e&&e.getExtension(`${t}${r}`)){let n=P_e[r];H8.add(n)}}return H8}function RDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var V_e=Wt(H_e(),1);function Pv(e,t){let r=new Array(t.mipMapLevels),n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=MDt(t,n,i,e,o),u=LDt(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function LDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function MDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var qDt={131:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ke.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ke.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ke.COMPRESSED_RED_RGTC1_EXT,140:ke.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ke.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ke.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ke.COMPRESSED_RGB8_ETC2,148:ke.COMPRESSED_SRGB8_ETC2,149:ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ke.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ke.COMPRESSED_RGBA8_ETC2_EAC,152:ke.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ke.COMPRESSED_R11_EAC,154:ke.COMPRESSED_SIGNED_R11_EAC,155:ke.COMPRESSED_RG11_EAC,156:ke.COMPRESSED_SIGNED_RG11_EAC,157:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ke.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ke.COMPRESSED_RGBA_ASTC_12x12_KHR};function W_e(e){return qDt[e]}var Io=[171,75,84,88,32,50,48,187,13,10,26,10];function Y8(e){let t=new Uint8Array(e);return!(t.byteLength<Io.length||t[0]!==Io[0]||t[1]!==Io[1]||t[2]!==Io[2]||t[3]!==Io[3]||t[4]!==Io[4]||t[5]!==Io[5]||t[6]!==Io[6]||t[7]!==Io[7]||t[8]!==Io[8]||t[9]!==Io[9]||t[10]!==Io[10]||t[11]!==Io[11])}function K_e(e){let t=new Uint8Array(e),r=(0,V_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=W_e(r.vkFormat);return Pv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var NDt={etc1:{basisFormat:0,compressed:!0,format:ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ke.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:ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ke.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 d_(e,t){if(t.basis.containerFormat==="auto"){if(Y8(e)){let n=await gq(t);return $_e(n.KTX2File,e,t)}let{BasisFile:r}=await mq(t);return _q(r,e,t)}switch(t.basis.module){case"encoder":let r=await gq(t);switch(t.basis.containerFormat){case"ktx2":return $_e(r.KTX2File,e,t);case"basis":default:return _q(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await mq(t);return _q(n,e,t)}}function _q(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),a=[];for(let o=0;o<i;o++){let s=n.getNumLevels(o),u=[];for(let c=0;c<s;c++)u.push(UDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function UDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=Y_e(n,o),l=e.getImageTranscodedSizeInBytes(t,r,c),f=new Uint8Array(l);if(!e.transcodeImage(f,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function $_e(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),a=[];for(let o=0;o<i;o++){a.push(GDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function GDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=Y_e(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,u),l=new Uint8Array(c);if(!e.transcodeImage(l,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:i,data:l,compressed:o,levelSize:c,hasAlpha:n,format:s}}function Y_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Rv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),NDt[r]}function Rv(){let e=p_();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var J_e={name:"Basis",id:"basis",module:"textures",version:Iv,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"}}},Rd={...J_e,parse:d_};var Po={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},zDt={DXT1:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ke.COMPRESSED_RGB_ATC_WEBGL,ATCA:ke.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ke.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},HDt=Z_e,WDt=J8,VDt=J8,KDt={DXT1:Z_e,DXT3:J8,DXT5:J8,"ATC ":HDt,ATCA:WDt,ATCI:VDt};function X_e(e){return new Uint32Array(e,0,Po.HEADER_LENGTH)[Po.MAGIC_NUMBER_INDEX]===Po.MAGIC_NUMBER}function Q_e(e){let t=new Int32Array(e,0,Po.HEADER_LENGTH),r=t[Po.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[Po.HEADER_PF_FLAGS_INDEX]&Po.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=$Dt(r),i=zDt[n],a=KDt[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Po.HEADER_FLAGS_INDEX]&Po.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Po.MIPMAPCOUNT_INDEX]));let s=t[Po.HEADER_WIDTH_INDEX],u=t[Po.HEADER_HEIGHT_INDEX],c=t[Po.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Pv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function Z_e(e,t){return(e+3>>2)*(t+3>>2)*8}function J8(e,t){return(e+3>>2)*(t+3>>2)*16}function $Dt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bs={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},YDt={0:[ke.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ke.COMPRESSED_RGB_ETC1_WEBGL],7:[ke.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ke.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ke.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ke.COMPRESSED_RGB8_ETC2],23:[ke.COMPRESSED_RGBA8_ETC2_EAC],24:[ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ke.COMPRESSED_R11_EAC],26:[ke.COMPRESSED_RG11_EAC],27:[ke.COMPRESSED_RGBA_ASTC_4X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ke.COMPRESSED_RGBA_ASTC_5X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ke.COMPRESSED_RGBA_ASTC_5X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ke.COMPRESSED_RGBA_ASTC_6X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ke.COMPRESSED_RGBA_ASTC_6X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ke.COMPRESSED_RGBA_ASTC_8X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ke.COMPRESSED_RGBA_ASTC_8X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ke.COMPRESSED_RGBA_ASTC_8X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ke.COMPRESSED_RGBA_ASTC_10X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ke.COMPRESSED_RGBA_ASTC_10X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ke.COMPRESSED_RGBA_ASTC_10X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ke.COMPRESSED_RGBA_ASTC_10X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ke.COMPRESSED_RGBA_ASTC_12X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ke.COMPRESSED_RGBA_ASTC_12X12_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},JDt={0:e2e,1:e2e,2:t2e,3:t2e,6:m_,7:m_,9:g_,11:g_,22:m_,23:g_,24:m_,25:m_,26:g_,27:g_,28:XDt,29:QDt,30:ZDt,31:eFt,32:tFt,33:rFt,34:nFt,35:iFt,36:aFt,37:oFt,38:sFt,39:uFt,40:cFt};function r2e(e){let r=new Uint32Array(e,0,bs.HEADER_LENGTH)[bs.MAGIC_NUMBER_INDEX];return r===bs.MAGIC_NUMBER||r===bs.MAGIC_NUMBER_EXTRA}function n2e(e){let t=new Uint32Array(e,0,bs.HEADER_LENGTH),r=t[bs.PIXEL_FORMAT_INDEX],n=t[bs.COLOUR_SPACE_INDEX],i=YDt[r]||[],a=i.length>1&&n?i[1]:i[0],o=JDt[r],s=t[bs.MIPMAPCOUNT_INDEX],u=t[bs.WIDTH_INDEX],c=t[bs.HEIGHT_INDEX],l=bs.HEADER_SIZE+t[bs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Pv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function e2e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function t2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function m_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function g_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function XDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function QDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function ZDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function eFt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function tFt(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function rFt(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function nFt(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function iFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function aFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function oFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function sFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function uFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function cFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function i2e(e){if(Y8(e))return K_e(e);if(X_e(e))return Q_e(e);if(r2e(e))return n2e(e);throw new Error("Texture container format not recognized")}var a2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Iv,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}}},X8={...a2e,parse:async(e,t)=>{var r;return(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},(await d_(e,t))[0]):i2e(e)}};var wq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:Iv,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var jv=!0,o2e=1735152710,Sq=12,Q8=8,lFt=1313821514,fFt=5130562,pFt=0,hFt=0,dFt=1;function mFt(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function s2e(e,t=0,r={}){let n=new DataView(e),{magic:i=o2e}=r,a=n.getUint32(t,!1);return a===i||a===o2e}function u2e(e,t,r=0,n={}){let i=new DataView(t),a=mFt(i,r+0),o=i.getUint32(r+4,jv),s=i.getUint32(r+8,jv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Sq,e.version){case 1:return gFt(e,i,r);case 2:return vFt(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function gFt(e,t,r){Qt(e.header.byteLength>Sq+Q8);let n=t.getUint32(r+0,jv),i=t.getUint32(r+4,jv);return r+=Q8,Qt(i===pFt),Eq(e,t,r,n),r+=n,r+=Aq(e,t,r,e.header.byteLength),r}function vFt(e,t,r,n){return Qt(e.header.byteLength>Sq+Q8),bFt(e,t,r,n),r+e.header.byteLength}function bFt(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,jv),a=t.getUint32(r+4,jv);switch(r+=Q8,a){case lFt:Eq(e,t,r,i);break;case fFt:Aq(e,t,r,i);break;case hFt:n.strict||Eq(e,t,r,i);break;case dFt:n.strict||Aq(e,t,r,i);break;default:break}r+=Do(i,4)}return r}function Eq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Do(n,4)}function Aq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Do(n,4)}function Tq(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var Dq={};fa(Dq,{decode:()=>kFt,name:()=>FFt});var yFt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",xFt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",_Ft=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),wFt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),EFt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},AFt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function c2e(e,t,r,n,i,a="NONE"){let o=await SFt();DFt(o,o.exports[AFt[i]],e,t,r,n,o.exports[EFt[a||"NONE"]])}var Cq;async function SFt(){return Cq||(Cq=TFt()),Cq}async function TFt(){let e=yFt;WebAssembly.validate(_Ft)&&(e=xFt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(CFt(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function CFt(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);t[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?wFt[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function DFt(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let p=t(c,n,i,l,a.length);if(p===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),p!==0)throw new Error(`Malformed buffer data: ${p}`)}var Z8="EXT_meshopt_compression",FFt=Z8;async function kFt(e,t){var i,a;let r=new qr(e);if(!((i=t==null?void 0:t.gltf)!=null&&i.decompressMeshes)||!((a=t.gltf)!=null&&a.loadBuffers))return;let n=[];for(let o of e.json.bufferViews||[])n.push(BFt(r,o));await Promise.all(n),r.removeExtension(Z8)}async function BFt(e,t){let r=e.getObjectExtension(t,Z8);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),p=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await c2e(p,o,a,f,s,u),e.removeObjectExtension(t,Z8)}}var Fq={};fa(Fq,{name:()=>OFt,preprocess:()=>IFt});var Lv="EXT_texture_webp",OFt=Lv;function IFt(e,t){let r=new qr(e);if(!sq("image/webp")){if(r.getRequiredExtensions().includes(Lv))throw new Error(`gltf: Required extension ${Lv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,Lv);a&&(i.source=a.source),r.removeObjectExtension(i,Lv)}r.removeExtension(Lv)}var kq={};fa(kq,{name:()=>PFt,preprocess:()=>RFt});var eD="KHR_texture_basisu",PFt=eD;function RFt(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,eD);a&&(i.source=a.source,r.removeObjectExtension(i,eD))}r.removeExtension(eD)}var Oq={};fa(Oq,{decode:()=>NFt,encode:()=>UFt,name:()=>MFt,preprocess:()=>qFt});function l2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Bq(n);t[r]=i}}return t}function Bq(e){let{buffer:t,size:r,count:n}=jFt(e);return{value:t,size:r,byteOffset:0,count:n,type:L8(r),componentType:Dv(t)}}function jFt(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=LFt(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function LFt(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Sp="KHR_draco_mesh_compression",MFt=Sp;function qFt(e,t,r){let n=new qr(e);for(let i of f2e(n))n.getObjectExtension(i,Sp)}async function NFt(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)!=null&&a.decompressMeshes))return;let n=new qr(e),i=[];for(let o of f2e(n))n.getObjectExtension(o,Sp)&&i.push(GFt(n,o,t,r));await Promise.all(i),n.removeExtension(Sp)}function UFt(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])zFt(n,t),r.addRequiredExtension(Sp)}async function GFt(e,t,r,n){let i=e.getObjectExtension(t,Sp);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Hh(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await To(o,_v,s,n),c=l2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let p=t.attributes[l],h=e.getAccessor(p);h!=null&&h.min&&(h!=null&&h.max)&&(f.min=h.min,f.max=h.max)}t.attributes=c,u.indices&&(t.indices=Bq(u.indices)),e.removeObjectExtension(t,Sp),HFt(t)}function zFt(e,t,r=4,n,i){var l;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=n.DracoWriter.encodeSync({attributes:e}),o=(l=i==null?void 0:i.parseSync)==null?void 0:l.call(i,{attributes:e}),s=n._addFauxAttributes(o.attributes),u=n.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Sp]:{bufferView:u,attributes:s}}}]}}function HFt(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*f2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Pq={};fa(Pq,{decode:()=>$Ft,name:()=>WFt});var Iq="KHR_texture_transform",WFt=Iq,tD=new ce,VFt=new Rr,KFt=new Rr;async function $Ft(e,t){var a;if(!new qr(e).hasExtension(Iq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)YFt(o,e)}function YFt(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&v_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&v_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&v_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&v_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&v_(t,e,u,r)}function v_(e,t,r,n){let i=JFt(r,n);if(!i)return;let a=e.json.meshes||[];for(let o of a)for(let s of o.primitives){let u=s.material;Number.isFinite(u)&&t===u&&XFt(e,s,i)}}function JFt(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Iq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=e4t(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function XFt(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:p}=e.buffers[l.buffer],h=(p||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:d,length:b}=Fv(c,l),g=j8[c.componentType],x=R8[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new d(f,h+F*E,2);tD.set(D[0],D[1],1),tD.transformByMatrix3(a),S.set([tD[0],tD[1]],F*x)}n===i?QFt(c,l,e.buffers,S):ZFt(i,c,t,e,S)}}}}function QFt(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function ZFt(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let a=n.json.bufferViews;if(!a)return;a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:(a==null?void 0:a.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=o.length-1)}function e4t(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Rr().set(1,0,0,0,1,0,t[0],t[1],1),a=VFt.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=KFt.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Rq={};fa(Rq,{decode:()=>r4t,encode:()=>n4t,name:()=>t4t});var jd="KHR_lights_punctual",t4t=jd;async function r4t(e){let t=new qr(e),{json:r}=t,n=t.getExtension(jd);n&&(t.json.lights=n.lights,t.removeExtension(jd));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,jd);a&&(i.light=a.light),t.removeObjectExtension(i,jd)}}async function n4t(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(jd);Ui(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let i=n.node;t.addObjectExtension(i,jd,n)}delete t.json.lights}}var jq={};fa(jq,{decode:()=>a4t,encode:()=>o4t,name:()=>i4t});var b_="KHR_materials_unlit",i4t=b_;async function a4t(e){let t=new qr(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,b_);t.removeExtension(b_)}function o4t(e){let t=new qr(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,b_,{}),t.addExtension(b_))}var Lq={};fa(Lq,{decode:()=>u4t,encode:()=>c4t,name:()=>s4t});var y_="KHR_techniques_webgl",s4t=y_;async function u4t(e){let t=new qr(e),{json:r}=t,n=t.getExtension(y_);if(n){let i=l4t(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,y_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=f4t(a.technique,t)),t.removeObjectExtension(a,y_)}t.removeExtension(y_)}}async function c4t(e,t){}function l4t(e,t){let{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=a.decode(t.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=r[o.program]}),i}function f4t(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var p2e=[fq,uq,Dq,Fq,kq,Oq,Rq,jq,Lq,Pq,pq];function h2e(e,t={},r){var i;let n=p2e.filter(a=>m2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function d2e(e,t={},r){var i;let n=p2e.filter(a=>m2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function m2e(e,t){var i;let r=((i=t==null?void 0:t.gltf)==null?void 0:i.excludeExtensions)||{};return!(e in r&&!r[e])}var Mq="KHR_binary_glTF";function g2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Mq);i&&Object.assign(n,i),t.removeObjectExtension(n,Mq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Mq)}var v2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},h4t={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},qq=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),g2e(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in v2e)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let i in n){let a=n[i];a.id=a.id||i;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][i]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in v2e)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:i,material:a}=r;for(let o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let i in n){let a=n[i],o=this._convertIdToIndex(a,i);n[i]=o}}_convertIdToIndex(t,r){let n=h4t[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return i}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,n,i;for(let a of t.materials){a.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let o=((r=a.values)==null?void 0:r.tex)||((n=a.values)==null?void 0:n.texture2d_0)||((i=a.values)==null?void 0:i.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function b2e(e,t={}){return new qq().normalize(e,t)}async function y2e(e,t,r=0,n,i){var a,o,s;return d4t(e,t,r,n),b2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),h2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await m4t(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await g4t(e,n,i),await d2e(e,n,i),e}function d4t(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!s2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=zI(t);else if(t instanceof ArrayBuffer){let o={};r=u2e(o,t,r,n.glb),Ui(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ui(!1,"GLTF: must be ArrayBuffer or string");let i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:o}=e._glb;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}let a=e.json.images||[];e.images=new Array(a.length).fill({})}async function m4t(e,t,r){var i,a;let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:u}=r;Ui(u);let c=Tq(s.uri,t),l=await((i=r==null?void 0:r.fetch)==null?void 0:i.call(r,c)),f=await((a=l==null?void 0:l.arrayBuffer)==null?void 0:a.call(l));e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function g4t(e,t,r){let n=v4t(e),i=e.json.images||[],a=[];for(let o of n)a.push(b4t(e,i[o],o,t,r));return await Promise.all(a)}function v4t(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function b4t(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Tq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=D_e(e.json,e.buffers,t.bufferView);a=Hh(s.buffer,s.byteOffset,s.byteLength)}Ui(a,"glTF image has no data");let o=await To(a,[Cv,Rd],{...n,mimeType:t.mimeType,basis:n.basis||{format:Rv()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),e.images=e.images||[],e.images[r]=o}var Il={name:"glTF",id:"gltf",module:"gltf",version:z8,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:y4t,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function y4t(e,t={},r){t={...Il.options,...t},t.gltf={...Il.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await y2e({},e,n,t,r)}var x4t=1179937895,_4t=1313821514,w4t=5130562,Ec=!0;function x2e(e,t,r=0,n={}){let{magic:i=x4t,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,Ec),t.setUint32(r+4,a,Ec),t.setUint32(r+8,0,Ec));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,_4t,Ec)),r+=8;let f=JSON.stringify(o);if(r=Om(t,r,f,4),t){let p=r-l-8;t.setUint32(l+0,p,Ec)}if(s){let p=r;if(t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,w4t,Ec)),r+=8,r=OA(t,r,s,4),t){let h=r-p-8;t.setUint32(p+0,h,Ec)}}if(t){let p=r-u;t.setUint32(c,p,Ec)}return r}function Nq(e,t,r,n){return E4t(e),x2e(e,t,r,n)}function E4t(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Uq={name:"glTF",id:"gltf",module:"gltf",version:z8,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,options:{gltf:{}},encode:async(e,t={})=>_2e(e,t),encodeSync:_2e};function _2e(e,t={}){let{byteOffset:r=0}=t,n=Nq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Nq(e,a,r,t),i}var A4t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},S4t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ys={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},T4t={magFilter:ys.TEXTURE_MAG_FILTER,minFilter:ys.TEXTURE_MIN_FILTER,wrapS:ys.TEXTURE_WRAP_S,wrapT:ys.TEXTURE_WRAP_T},C4t={[ys.TEXTURE_MAG_FILTER]:ys.LINEAR,[ys.TEXTURE_MIN_FILTER]:ys.NEAREST_MIPMAP_LINEAR,[ys.TEXTURE_WRAP_S]:ys.REPEAT,[ys.TEXTURE_WRAP_T]:ys.REPEAT};function D4t(){return{id:"default-sampler",parameters:C4t}}function F4t(e){return S4t[e]}function k4t(e){return A4t[e]}var Gq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ui(n),this.baseUri=o,this.buffers=i,this.images=a,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((i,a)=>this._resolveBufferView(i,a))),t.images&&(n.images=t.images.map((i,a)=>this._resolveImage(i,a))),t.samplers&&(n.samplers=t.samplers.map((i,a)=>this._resolveSampler(i,a))),t.textures&&(n.textures=t.textures.map((i,a)=>this._resolveTexture(i,a))),t.accessors&&(n.accessors=t.accessors.map((i,a)=>this._resolveAccessor(i,a))),t.materials&&(n.materials=t.materials.map((i,a)=>this._resolveMaterial(i,a))),t.meshes&&(n.meshes=t.meshes.map((i,a)=>this._resolveMesh(i,a))),t.nodes&&(n.nodes=t.nodes.map((i,a)=>this._resolveNode(i,a)),n.nodes=n.nodes.map((i,a)=>this._resolveNodeChildren(i))),t.skins&&(n.skins=t.skins.map((i,a)=>this._resolveSkin(i,a))),t.scenes&&(n.scenes=t.scenes.map((i,a)=>this._resolveScene(i,a))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:(t==null?void 0:t.id)||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((i,a)=>{let o=this.getMesh(a);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(i=>{let a={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return i.indices!==void 0&&(a.indices=this.getAccessor(i.indices)),i.material!==void 0&&(a.material=this.getMaterial(i.material)),a})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=F4t(t.componentType),i=k4t(t.type),a=n*i,o={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:c}=Fv(o,o.bufferView),l=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(l,l+c);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,l,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_getValueFromInterleavedBuffer(t,r,n,i,a){let o=new Uint8Array(a*i);for(let s=0;s<a;s++){let u=r+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+i)),s*i)}return o.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):D4t(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let i in n){let a=this._enumSamplerParameter(i);a!==void 0&&(n.parameters[a]=n[i])}return n}_enumSamplerParameter(t){return T4t[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(t,r){let n=t.buffer,i=this.buffers[n].arrayBuffer,a=this.buffers[n].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,a,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function x_(e,t){return new Gq().postProcess(e,t)}var rD={URI:0,EMBEDDED:1};function nD(e,t,r,n){e.rotateYtoZ=!0;let i=(e.byteOffset||0)+(e.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Hh(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function iD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(B4t(e,t,r),i.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:a}=n,o=await a(e.gltfUrl,r);e.gltfArrayBuffer=await o.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let a=await To(e.gltfArrayBuffer,Il,r,n);e.gltf=x_(a),e.gpuMemoryUsageInBytes=l_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function B4t(e,t,r){switch(t){case rD.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case rD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function w2e(e,t,r,n,i){var o;r=O4t(e,t,r,n,i),await iD(e,rD.EMBEDDED,n,i);let a=(o=e==null?void 0:e.gltf)==null?void 0:o.extensions;return a&&a.CESIUM_RTC&&(e.rtcCenter=a.CESIUM_RTC.center),r}function O4t(e,t,r,n,i){r=Ap(e,t,r),r=Av(e,t,r),r=Sv(e,t,r,n),r=nD(e,t,r,n);let a=new Bl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function E2e(e,t,r,n,i){return r=I4t(e,t,r,n,i),await iD(e,e.gltfFormat||0,n,i),r}function I4t(e,t,r,n,i){var c;if(r=Ap(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Av(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Sv(e,t,r,n),r=nD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Bl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let u=new Id(e.batchTableJson,e.batchTableBinary,s);return P4t(e,o,u,s),r}function P4t(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Rr,l=new ds,f=new ce,p={},h=new Kr,d=[],b=[],g=[],x=[];for(let E=0;E<n;E++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Ht.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3,E,a);let I=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3);if(!I)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let U=65535;for(let Y=0;Y<3;Y++)S[Y]=S[Y]/U*P[Y]+I[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),p.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,d),e.normalRight=t.getProperty("NORMAL_RIGHT",Ht.FLOAT,3,E,b);let F=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ht.UNSIGNED_SHORT,2,E,d),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ht.UNSIGNED_SHORT,2,E,b),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(or.WGS84.eastNorthUpToFixedFrame(a,h),h.getRotationMatrix3(c)):c.identity()}F&&(u.copy(o).cross(s).normalize(),c.setColumn(0,o),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),p.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Ht.FLOAT,1,E,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Ht.FLOAT,3,E,d);j&&f.scale(j),p.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(p.rotation);h.identity(),h.translate(p.translation),h.multiplyRight(N),h.scale(p.scale);let C=h.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function A2e(e,t,r,n,i,a){r=Ap(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={shape:"tile3d"};e.tiles.push(s),r=await a(t,r,n,i,s)}return r}async function S2e(e,t,r,n){var i,a;if(e.rotateYtoZ=!0,e.gltfUpAxis=(i=r==null?void 0:r["3d-tiles"])!=null&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(a=r==null?void 0:r["3d-tiles"])!=null&&a.loadGLTF){if(!n)return t.byteLength;let o=await To(t,Il,r,n);e.gltf=x_(o),e.gpuMemoryUsageInBytes=l_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function zq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=$1e(e,t),i.type){case gs.COMPOSITE:return await A2e(i,e,t,r,n,zq);case gs.BATCHED_3D_MODEL:return await w2e(i,e,t,r,n);case gs.GLTF:return await S2e(i,e,r,n);case gs.INSTANCED_3D_MODEL:return await E2e(i,e,t,r,n);case gs.POINT_CLOUD:return await p_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Hq(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let a=T2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=T2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await aD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let p of c.contentAvailability)await aD(c,p,f,r);else await aD(c,c.contentAvailability,f,r);return await aD(c,c.childSubtreeAvailability,f,r),c}async function aD(e,t,r,n){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!="number")return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){let s=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,c=await(await n.fetch(s)).arrayBuffer();t.explicitBitstream=new Uint8Array(c,a.byteOffset,a.byteLength);return}t.explicitBitstream=new Uint8Array(r,a.byteOffset,a.byteLength)}function T2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var oD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:xv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Hq,options:{}};function Wq(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function du(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Wq()}var R4t=globalThis.self||globalThis.window||globalThis.global,Mv=globalThis.window||globalThis.self||globalThis.global,j4t=globalThis.document||{},Ld=globalThis.process||{},L4t=globalThis.console,Qwr=globalThis.navigator||{};var sD="4.0.6",tEr=du();function M4t(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var uD=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=M4t(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function C2e(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function D2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function cD(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var lD;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(lD||(lD={}));var q4t=10;function F2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),lD[e]||lD.WHITE)}function k2e(e,t,r){if(!du&&typeof e=="string"){if(t){let n=F2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=F2e(r);e="\x1B[".concat(n+q4t,"m").concat(e,"\x1B[49m")}}return e}function B2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function qv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Md(){let e;if(du()&&Mv.performance){var t,r;e=Mv===null||Mv===void 0||(t=Mv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Ld){var n;let i=Ld===null||Ld===void 0||(n=Ld.hrtime)===null||n===void 0?void 0:n.call(Ld);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Nv={debug:du()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},N4t={enabled:!0,level:0};function xs(){}var O2e={},I2e={once:!0},__=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=sD,this._startTs=Md(),this._deltaTs=Md(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new uD("__probe-".concat(this.id,"__"),N4t),this.timeStamp("".concat(this.id," started")),B2e(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Md()-this._startTs).toPrecision(10))}getDelta(){return Number((Md()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){qv(t,r)}warn(t){return this._getLogFunction(0,t,Nv.warn,arguments,I2e)}error(t){return this._getLogFunction(0,t,Nv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Nv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Nv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Nv.debug||Nv.info,arguments,I2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||xs,n&&[n],{tag:H4t(r)}):xs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?du()?z4t({image:i,message:a,scale:o}):G4t({image:i,message:a,scale:o}):xs}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||xs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=P2e({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||xs)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=R2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=P2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,qv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Md();let o=a.tag||a.message;if(a.once&&o)if(!O2e[o])O2e[o]=Md();else return xs;return r=U4t(this.id,a.message,a),n.bind(console,r,...a.args)}return xs}};__.VERSION=sD;function R2e(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return qv(Number.isFinite(t)&&t>=0),t}function P2e(e){let{logLevel:t,message:r}=e;e.logLevel=R2e(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return qv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function U4t(e,t,r){if(typeof t=="string"){let n=r.time?D2e(C2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=k2e(t,r.color,r.background)}return t}function G4t(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),xs}function z4t(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=cD(a,r,n);console.log(...o)},a.src=t,xs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...cD(t,r,n)),xs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...cD(a,r,n)),a.src=t.toDataURL(),xs}return xs}function H4t(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Vq=new __({id:"@probe.gl/log"});var _s=null;try{_s=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function kn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}kn.prototype.__isLong__;Object.defineProperty(kn.prototype,"__isLong__",{value:!0});function Na(e){return(e&&e.__isLong__)===!0}function j2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Na;var L2e={},M2e={};function qd(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=M2e[e],n)?n:(r=$r(e,0,!0),i&&(M2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=L2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(L2e[e]=r),r))}kn.fromInt=qd;function ws(e,t){if(isNaN(e))return t?Pl:mu;if(t){if(e<0)return Pl;if(e>=G2e)return W2e}else{if(e<=-N2e)return go;if(e+1>=N2e)return H2e}return e<0?ws(-e,t).neg():$r(e%Gv|0,e/Gv|0,t)}kn.fromNumber=ws;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var fD=Math.pow;function $q(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?Pl:mu;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return $q(e.substring(1),t,r).neg();for(var i=ws(fD(r,8)),a=mu,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var c=ws(fD(r,s));a=a.mul(c).add(ws(u))}else a=a.mul(i),a=a.add(ws(u))}return a.unsigned=t,a}kn.fromString=$q;function gu(e,t){return typeof e=="number"?ws(e,t):typeof e=="string"?$q(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=gu;var q2e=1<<16,W4t=1<<24,Gv=q2e*q2e,G2e=Gv*Gv,N2e=G2e/2,U2e=qd(W4t),mu=qd(0);kn.ZERO=mu;var Pl=qd(0,!0);kn.UZERO=Pl;var Uv=qd(1);kn.ONE=Uv;var z2e=qd(1,!0);kn.UONE=z2e;var Kq=qd(-1);kn.NEG_ONE=Kq;var H2e=$r(-1,2147483647,!1);kn.MAX_VALUE=H2e;var W2e=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=W2e;var go=$r(0,-2147483648,!1);kn.MIN_VALUE=go;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Gv+(this.low>>>0):this.high*Gv+(this.low>>>0)};Ke.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(go)){var r=ws(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=ws(fD(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),c=o.sub(u.mul(a)).toInt()>>>0,l=c.toString(t);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};Ke.getHighBits=function(){return this.high};Ke.getHighBitsUnsigned=function(){return this.high>>>0};Ke.getLowBits=function(){return this.low};Ke.getLowBitsUnsigned=function(){return this.low>>>0};Ke.getNumBitsAbs=function(){if(this.isNegative())return this.eq(go)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};Ke.isZero=function(){return this.high===0&&this.low===0};Ke.eqz=Ke.isZero;Ke.isNegative=function(){return!this.unsigned&&this.high<0};Ke.isPositive=function(){return this.unsigned||this.high>=0};Ke.isOdd=function(){return(this.low&1)===1};Ke.isEven=function(){return(this.low&1)===0};Ke.equals=function(t){return Na(t)||(t=gu(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};Ke.eq=Ke.equals;Ke.notEquals=function(t){return!this.eq(t)};Ke.neq=Ke.notEquals;Ke.ne=Ke.notEquals;Ke.lessThan=function(t){return this.comp(t)<0};Ke.lt=Ke.lessThan;Ke.lessThanOrEqual=function(t){return this.comp(t)<=0};Ke.lte=Ke.lessThanOrEqual;Ke.le=Ke.lessThanOrEqual;Ke.greaterThan=function(t){return this.comp(t)>0};Ke.gt=Ke.greaterThan;Ke.greaterThanOrEqual=function(t){return this.comp(t)>=0};Ke.gte=Ke.greaterThanOrEqual;Ke.ge=Ke.greaterThanOrEqual;Ke.compare=function(t){if(Na(t)||(t=gu(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};Ke.comp=Ke.compare;Ke.negate=function(){return!this.unsigned&&this.eq(go)?go:this.not().add(Uv)};Ke.neg=Ke.negate;Ke.add=function(t){Na(t)||(t=gu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,p=0,h=0;return h+=a+c,p+=h>>>16,h&=65535,p+=i+u,f+=p>>>16,p&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(p<<16|h,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Na(t)||(t=gu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Na(t)||(t=gu(t)),_s){var r=_s.mul(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Pl:mu;if(this.eq(go))return t.isOdd()?go:mu;if(t.eq(go))return this.isOdd()?go:mu;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(U2e)&&t.lt(U2e))return ws(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,p=0,h=0,d=0;return d+=o*l,h+=d>>>16,d&=65535,h+=a*l,p+=h>>>16,h&=65535,h+=o*c,p+=h>>>16,h&=65535,p+=i*l,f+=p>>>16,p&=65535,p+=a*c,f+=p>>>16,p&=65535,p+=o*u,f+=p>>>16,p&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(h<<16|d,f<<16|p,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Na(t)||(t=gu(t)),t.isZero())throw Error("division by zero");if(_s){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?_s.div_u:_s.div_s)(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Pl:mu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Pl;if(t.gt(this.shru(1)))return z2e;a=Pl}else{if(this.eq(go)){if(t.eq(Uv)||t.eq(Kq))return go;if(t.eq(go))return Uv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(mu)?t.isNegative()?Uv:Kq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(go))return this.unsigned?Pl:mu;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=mu}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:fD(2,s-48),c=ws(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=ws(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Uv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Na(t)||(t=gu(t)),_s){var r=(this.unsigned?_s.rem_u:_s.rem_s)(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return $r(~this.low,~this.high,this.unsigned)};Ke.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};Ke.clz=Ke.countLeadingZeros;Ke.countTrailingZeros=function(){return this.low?j2e(this.low):j2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Na(t)||(t=gu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Na(t)||(t=gu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Na(t)||(t=gu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$r(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?$r(this.high,0,this.unsigned):$r(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,$r(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};Ke.rotl=Ke.rotateLeft;Ke.rotateRight=function(t){var r;return Na(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,$r(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?$r(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:$r(this.low,this.high,!0)};Ke.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};Ke.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};Ke.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};kn.fromBytes=function(t,r,n){return n?kn.fromBytesLE(t,r):kn.fromBytesBE(t,r)};kn.fromBytesLE=function(t,r){return new kn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};kn.fromBytesBE=function(t,r){return new kn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var zv=kn;var V4t=16;function w_(e){e==="X"&&(e="");let t=e.padEnd(V4t,"0");return zv.fromString(t,!0,16)}function Yq(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-a.length).join("0")+a}function Jq(e,t){let r=K4t(e).shiftRightUnsigned(2);return e.add(zv.fromNumber(2*t+1-4).multiply(r))}function K4t(e){return e.and(e.not().add(1))}var $4t=3,Y4t=30,J4t=2*Y4t+1,V2e=180/Math.PI;function $2e(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0];for(let s=i-1;s>=0;s--){a=i-s;let u=n[s],c=0,l=0;u==="1"?l=1:u==="2"?(c=1,l=1):u==="3"&&(c=1);let f=Math.pow(2,a-1);X4t(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(r%2===1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function Y2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<$4t+J4t;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=zv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=zv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function Xq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function K2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Qq(e){return[K2e(e[0]),K2e(e[1])]}function Zq(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function eN([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*V2e,n*V2e]}function X4t(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let i=t[0];t[0]=t[1],t[1]=i}}function J2e(e){let t=Xq(e.ij,e.level,[.5,.5]),r=Qq(t),n=Zq(e.face,r);return eN(n)}var Q4t=100;function tN(e){let{face:t,ij:r,level:n}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(Q4t*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],p=(f[0]-l[0])/a,h=(f[1]-l[1])/a;for(let d=0;d<a;d++){l[0]+=p,l[1]+=h;let b=Xq(r,n,l),g=Qq(b),x=Zq(t,g),E=eN(x);Math.abs(E[1])>89.999&&(E[0]=u);let S=E[0]-u;E[0]+=S>180?-360:S<-180?360:0,o[s++]=E[0],o[s++]=E[1],u=E[0]}}return o[s++]=o[0],o[s++]=o[1],o}function Hv(e){let t=Z4t(e);return $2e(t)}function Z4t(e){if(e.indexOf("/")>0)return e;let t=w_(e);return Y2e(t)}function rN(e){let t=Hv(e);return J2e(t)}function Q2e(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let i=0;i<4;i++){let a=`${e.face}/${i}`,o=Hv(a),s=tN(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=X2e(r)}else{let r=tN(e);t=X2e(r)}return t}function X2e(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function nN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=Hv(e),a=Q2e(i),o=a.west,s=a.south,u=a.east,c=a.north,l=[];return l.push(new ce(o,c,r)),l.push(new ce(u,c,r)),l.push(new ce(u,s,r)),l.push(new ce(o,s,r)),l.push(new ce(o,c,n)),l.push(new ce(u,c,n)),l.push(new ce(u,s,n)),l.push(new ce(o,s,n)),l}function pD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=nN(t,r),i=rN(t),a=i[0],o=i[1],s=or.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new ce(s[0],s[1],s[2]);n.push(u);let c=a_(n);return[...c.center,...c.halfAxes]}var ekt=4,tkt=8,rkt={QUADTREE:ekt,OCTREE:tkt};function nkt(e,t,r){if(e!=null&&e.box){let n=w_(e.s2VolumeInfo.token),i=Jq(n,t),a=Yq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,p=c.minimumHeight+l/2;c.minimumHeight=p-f,c.maximumHeight=p+f;break;default:break}return{box:pD(o),s2VolumeInfo:o}}}async function aN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a,loaderOptions:o}=e,{subtree:s,level:u=0}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:p,subtreesUriTemplate:h,basePath:d}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Vq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${p} won't be loaded...`),b;let g=u+i.level;if(g>f)return b;let x=rkt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**u-1)/(x-1),k=Nd(r.mortonIndex,n,E),N=j+k,C=Nd(r.x,S,1),I=Nd(r.y,F,1),P=Nd(r.z,D,1),U=!1;u>=l&&(U=iN(s.childSubtreeAvailability,k));let Y=Nd(i.x,C,u*E),J=Nd(i.y,I,u*E),re=Nd(i.z,P,u*E);if(U){let Te=`${d}/${h}`,$e=hD(Te,g,Y,J,re);s=await An($e,oD,o),i.mortonIndex=k,i.x=C,i.y=I,i.z=P,i.level=u,k=0,N=0,C=0,I=0,P=0,u=0}if(!iN(s.tileAvailability,N))return b;iN(s.contentAvailability,N)&&(b.contentUrl=hD(p,g,Y,J,re));let ye=u+1,he={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=nkt(a,Te,c),We=await aN({subtree:s,implicitOptions:t,loaderOptions:o,parentData:he,childIndex:Te,level:ye,globalData:{...i},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=ikt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,a);b.children.push(ne)}}return b}function iN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Vq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?skt(t,r.explicitBitstream):!1}function ikt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,p=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),h=l/2**t,d=i!=null&&i.box?{box:i.box}:f,b=akt(t,d,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:p},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:b}}function akt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,p=2**e,h=(u-o)/p,d=(c-s)/p,b=(f-l)/p,[g,x]=[o+h*n,o+h*(n+1)],[E,S]=[s+d*i,s+d*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,E,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Nd(e,t,r){return(e<<r)+t}function hD(e,t,r,n,i){let a=okt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function okt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function skt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function sN(e,t=""){if(!t)return"empty";let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return"pointcloud";case"i3dm":case"b3dm":case"glb":case"gltf":return"scenegraph";default:return n||"empty"}}function uN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function oN(e="",t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return tu.resolve(t,e)}function Z2e(e,t){var i;if(!e)return null;let r;if(e.content){let a=e.content.uri||((i=e.content)==null?void 0:i.url);r=oN(a,t)}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:sN(e,r),refine:uN(e.refine)}}async function rwe(e,t,r){let n=null,i=twe(e.root);i&&e.root?n=await ewe(e.root,e,t,i,r):n=Z2e(e.root,t);let a=[];for(a.push(n);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let c of s){let l=twe(c),f;l?f=await ewe(c,e,t,l,r):f=Z2e(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function ewe(e,t,r,n,i){var S,F,D;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=hD(c,0,0,0,0),f=oN(l,r),p=await An(f,oD,i),h=oN((S=e.content)==null?void 0:S.uri,r),d=(F=t==null?void 0:t.root)==null?void 0:F.refine,b=e.geometricError,g=(D=e.boundingVolume.extensions)==null?void 0:D["3DTILES_bounding_volume_S2"];if(g){let k={box:pD(g),s2VolumeInfo:g};e.boundingVolume=k}let x=e.boundingVolume,E={contentUrlTemplate:h,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:d,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:b,rootBoundingVolume:x,getTileType:sN,getRefine:uN};return await ukt(e,r,p,E,i)}async function ukt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await aN({subtree:r,implicitOptions:n,loaderOptions:i}),s,u=null;return o&&(s=o,u={uri:o.replace(`${t}/`,"")}),{...e,id:s,contentUrl:s,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:sN(e,s),refine:uN(e.refine),content:u||e.content,children:a}}function twe(e){var t;return((t=e==null?void 0:e.extensions)==null?void 0:t["3DTILES_implicit_tiling"])||(e==null?void 0:e.implicitTiling)}var Ac={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:xv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ckt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ckt(e,t={},r){let n=t["3d-tiles"]||{},i;return n.isTileset==="auto"?i=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?lkt(e,t,r):fkt(e,t,r)}async function lkt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=pkt(i),o=await rwe(n,a,t||{});return{...n,shape:"tileset3d",loader:Ac,url:i,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||n.root,type:"TILES3D",lodMetricType:"geometricError",lodMetricValue:((u=n.root)==null?void 0:u.geometricError)||0}}async function fkt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await zq(e,0,t,r,n.content),n.content}function pkt(e){return tu.dirname(e)}var nwe="https://api.cesium.com/v1/assets";async function iwe(e,t){if(!t){let a=await hkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await dkt(e,t),{type:n,url:i}=r;return Qt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function hkt(e){Qt(e);let t=nwe,r={Authorization:`Bearer ${e}`},n=await ko(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function dkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${nwe}/${t}`,i=await ko(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await ko(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function mkt(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let i=e.match(/\/([0-9]+)\/tileset.json/);n=i&&i[1]}return iwe(r,n)}var dD={...Ac,id:"cesium-ion",name:"Cesium Ion",preload:mkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=dD,Ac.parse(e,t,r)),options:{"cesium-ion":{...Ac.options["3d-tiles"],accessToken:null}}};var pTe=Wt(YU(),1),RIt="4.0.6",JU={id:"zip",module:"zip",name:"Zip Archive",version:RIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:jIt};async function jIt(e,t={}){let r=[],n={};try{let i=new pTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=LIt(i,u,t).then(l=>{n[o]=l});r.push(c)}),await Promise.all(r),n}catch(i){throw t.log.error(`Unable to read zip archive: ${i}`),i}}async function LIt(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(n){return r.log.error(`Unable to read ${t} from zip archive: ${n}`),n}}var a2=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let i=e.length-4n;i>-1;i--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(i),r.every((a,o)=>a===t[o])){n=i;break}return n};var MIt=new Uint8Array([80,75,5,6]),qIt=new Uint8Array([80,75,6,7]),NIt=new Uint8Array([80,75,6,6]),UIt=8n,GIt=16n,zIt=8n,HIt=24n,WIt=48n,hTe=async e=>{let t=await a2(e,MIt),r=BigInt(await e.getUint16(t+UIt)),n=BigInt(await e.getUint32(t+GIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!ec(a,qIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+zIt),s=await e.slice(o,o+4n);if(!ec(s,NIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+HIt),n=await e.getBigUint64(o+WIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var VIt=20n,KIt=24n,$It=28n,YIt=30n,JIt=32n,XIt=42n,XU=46n,aF=new Uint8Array([80,75,1,2]),o2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,aF.buffer))return null;let n=BigInt(await t.getUint32(e+VIt)),i=BigInt(await t.getUint32(e+KIt)),a=await t.getUint16(e+YIt),o=BigInt(await t.getUint16(e+JIt)),s=await t.getUint16(e+$It),u=await t.slice(e+XU,e+XU+BigInt(s)),c=new TextDecoder().decode(u),l=e+XU+BigInt(s),f=await t.getUint32(e+XIt),p=BigInt(f),h=new DataView(await t.slice(l,l+BigInt(a))),d={uncompressedSize:i,compressedSize:n,localHeaderOffset:p,startDisk:o},b=QIt(d,h);return{...d,...b,extraFieldLength:a,fileNameLength:s,fileName:c,extraOffset:l}};async function*oF(e){let{cdStartOffset:t}=await hTe(e),r=await o2(t,e);for(;r;)yield r,r=await o2(r.extraOffset+BigInt(r.extraFieldLength),e)}var dTe=(...e)=>e[0]+e[1]*16,QIt=(e,t)=>{let r=ZIt(e),n={};if(r.length>0){let i=r.reduce((s,u)=>s+u.length,0),a=new Uint8Array(t.buffer).findIndex((s,u,c)=>dTe(c[u],c[u+1])===1&&dTe(c[u+2],c[u+3])===i),o=0;for(let s of r){let u=o;n[s.name]=t.getBigUint64(a+4+u,!0),o=u+s.length}}return n},ZIt=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var ePt=8n,tPt=18n,rPt=22n,nPt=26n,iPt=28n,sF=30n,mTe=new Uint8Array([80,75,3,4]),t0=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,mTe))return null;let n=await t.getUint16(e+nPt),i=new TextDecoder().decode(await t.slice(e+sF,e+sF+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+iPt),o=e+sF+BigInt(n+a),s=await t.getUint16(e+ePt),u=BigInt(await t.getUint32(e+tPt)),c=BigInt(await t.getUint32(e+rPt)),l=e+sF+BigInt(n),f=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(l+f),f+=8n),u===BigInt(4294967295)&&(u=await t.getBigUint64(l+f),f+=8n),o===BigInt(4294967295)&&(o=await t.getBigUint64(l+f)),{fileNameLength:n,fileName:i,extraFieldLength:a,fileDataOffset:o,compressedSize:u,compressionMethod:s}};function QU(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let i=t.getBigUint64(n+16,!0),a=aPt(e,n,16);r[a]=i}return r}function aPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var gb=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Wh(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var s2=class extends gb{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var r0=Wt(jU(),1),Wl=Wt(require("zlib"),1);var n0=class extends gb{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Im(Wl.default.gzip)(t):await Im(Wl.default.deflate)(t);return fl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Im(Wl.default.gunzip)(t):await Im(Wl.default.inflate)(t);return fl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gzipSync(t):Wl.default.deflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?r0.default.deflateRaw:r0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gunzipSync(t):Wl.default.inflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?r0.default.inflateRaw:r0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new r0.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new r0.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of r){let s=new Uint8Array(o);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=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[t]}`}};var oPt={0:async e=>e,8:async e=>await new n0({raw:!0}).decompress(e)},u2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new Px(t);else throw new Error("Cannot open file for random access in a WEB browser");else XI(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=oF(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=await this.getCDFileHeader(t),n=await t0(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=oPt[n.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(n.fileDataOffset,n.fileDataOffset+n.compressedSize),o=await i(a),s=new Response(o);return Object.defineProperty(s,"url",{value:`${this.fileName||""}/${t}`}),s}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=oF(this.fileProvider),n=null;for await(let i of r)if(i.fileName===t){n=i;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var sPt={0:e=>new s2().decompress(e),8:e=>new n0({raw:!0}).decompress(e)},uF=class{fileProvider;hashTable;constructor(t,r){this.fileProvider=t,this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r=new TextEncoder().encode(t).buffer,n=await new Rx().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await t0(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=sPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var c2=class extends u2{hashTable;constructor(t){super(t)}async fetch(t){let r=this.fileProvider;if(!r)throw new Error("No data detected in the zip archive");if(await this.parseHashTable(),this.hashTable){let i=await new uF(r,this.hashTable).getFile(t),a=new Response(i);return Object.defineProperty(a,"url",{value:`${this.fileName||""}/${t}`}),a}return super.fetch(t)}async parseHashTable(){if(this.hashTable!==void 0)return;let t=this.fileProvider;if(!t)throw new Error("No data detected in the zip archive");let r=await a2(t,aF),n=await o2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await t0(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=QU(o)}else this.hashTable=null}};function Lp(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Qt(Array.isArray(i)&&Number.isFinite(a)&&Number.isFinite(o)),t.setUint8(r+0,i[0]),t.setUint8(r+1,i[1]),t.setUint8(r+2,i[2]),t.setUint8(r+3,i[3]),t.setUint32(r+4,a,!0),t.setUint32(r+8,o,!0),r+=12,r}function Mp(e,t,r){e&&e.setUint32(t+8,r,!0)}function gTe(e,t,r,n,i){e={magic:wp.COMPOSITE,tiles:[],...e};let a=r;r+=Lp(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let o=0;o<e.tiles.length;++o)r+=i(e.tiles[o],t,r,n);return Mp(t,a,r-a),r}function vTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Do(s.length,8),l=u?Do(u.length,8):0;e={magic:wp.BATCHED_MODEL,...e};let f=r;r=Lp(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r+=16,r=Om(t,r,s,8),a&&(r=Om(t,r,u,8));let p=e.gltfEncoded;return p&&(r=Ox(t,r,p,p.byteLength)),Mp(t,f,r-f),r}function bTe(e,t,r,n){let{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,u={INSTANCES_LENGTH:i,POSITION:new Array(i*3).fill(0)},c=JSON.stringify(u),l=c.length;e={magic:wp.INSTANCED_MODEL,...e};let f=r;return r=Lp(e,t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=Bm(t,r,c,l),r+=Bm(t,r,o,s),Mp(t,f,r-f),r}var uPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function yTe(e,t,r,n){let{featureTableJson:i=uPt}=e,a=JSON.stringify(i);a=WI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:wp.POINT_CLOUD,...e};let c=r;return r+=Lp(e,t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,u,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Bm(t,r,a,o),r+=Ox(t,r,s,u),Mp(t,c,r-c),r}function eG(e,t){let r=ZU(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return ZU(e,i,0,t),n}function ZU(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case gs.COMPOSITE:return gTe(e,t,r,n,ZU);case gs.POINT_CLOUD:return yTe(e,t,r,n);case gs.BATCHED_3D_MODEL:return vTe(e,t,r,n);case gs.INSTANCED_3D_MODEL:return bTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var tG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:xv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>xTe(e,t),encodeSync:xTe};function xTe(e,t){return eG(e,t)}var Ga=require("path");var _Te=Wt(require("crypto")),lF=new Uint8Array(256),cF=lF.length;function rG(){return cF>lF.length-16&&(_Te.default.randomFillSync(lF),cF=0),lF.slice(cF,cF+=16)}var Aa=[];for(let e=0;e<256;++e)Aa.push((e+256).toString(16).slice(1));function wTe(e,t=0){return(Aa[e[t+0]]+Aa[e[t+1]]+Aa[e[t+2]]+Aa[e[t+3]]+"-"+Aa[e[t+4]]+Aa[e[t+5]]+"-"+Aa[e[t+6]]+Aa[e[t+7]]+"-"+Aa[e[t+8]]+Aa[e[t+9]]+"-"+Aa[e[t+10]]+Aa[e[t+11]]+Aa[e[t+12]]+Aa[e[t+13]]+Aa[e[t+14]]+Aa[e[t+15]]).toLowerCase()}var ETe=Wt(require("crypto")),nG={randomUUID:ETe.default.randomUUID};function cPt(e,t,r){if(nG.randomUUID&&!t&&!e)return nG.randomUUID();e=e||{};let n=e.random||(e.rng||rG)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return wTe(n)}var Oc=cPt;var F0=Wt(require("process"),1),ak=Wt(wu(),1),$W=Wt(sG(),1);var Xb=require("path"),Eke=Wt(wu(),1);var PTe=()=>({folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}});var Yb=require("fs"),Jb=require("path");var yke=require("zlib"),xke=require("path"),uw=require("fs"),RVt=Wt(bke(),1);var jVt=Wt(YU(),1);var LVt=Wt(iG(),1);function $4(e){let t=`${e}.gz`,r=(0,yke.createGzip)(),n=(0,uw.createReadStream)(e),i=(0,uw.createWriteStream)(t);return new Promise((a,o)=>{n.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),n.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),n.pipe(r).pipe(i)})}async function _ke(e,t,r,n,i){process.platform==="win32"?await qVt(e,t,r,n,i):await MVt(e,t,r,n)}async function MVt(e,t,r=0,n="."){let i=cw(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function qVt(e,t,r=0,n=(0,xke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=cw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function ki(e,t,r="index.json"){let n;t instanceof Promise?n=new Uint8Array(await t):t instanceof ArrayBuffer?n=new Uint8Array(t):n=t,await Yb.promises.mkdir(e,{recursive:!0});let i=(0,Jb.join)(e,r);try{await Yb.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function qc(e,t,r="index.json",n=!0,i){let a=await ki(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await $4(a);return await PW(a),o}}return a}async function Y4(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,Jb.join)(e,t);An(o,$I).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function wke(e){try{return await Yb.promises.stat(e),!0}catch{return!1}}function lw(e){return Yb.promises.rm(e,{recursive:!0})}function PW(e){return Yb.promises.unlink(e)}function cw(e){return(0,Jb.isAbsolute)(e)?e:(0,Jb.join)(process.cwd(),e)}var eo=class{nodesPerPage;nodesCounter;writeFile;converter;nodePages;length=0;constructor(t,r,n){this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=n,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,n;return this.converter.options.slpk?(r=(0,Xb.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,Xb.join)(this.converter.layers0Path,"nodepages",t.toString()),n="index.json"),{filePath:r,fileName:n}}async loadNodePage(t){let{filePath:r,fileName:n}=this.getNodePageFileName(t),i=(0,Xb.join)(r,n);return await wke(i)?(console.log(`load ${i}.`),await Y4(r,n)):{nodes:[]}}getPageIndexByNodeId(t){return Math.floor(t/this.nodesPerPage)}async getPageByNodeId(t){let r=this.getPageIndexByNodeId(t);return this.converter.options.instantNodeWriting?await this.loadNodePage(r):this.nodePages[r]}async getNodeById(t,r){let n=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[n]}async addChildRelation(t,r){var i;if(t==null)return;let n=await this.getNodeById(t);(i=n.children)==null||i.push(r),await this.saveNode(n)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let n=this.nodePages[this.nodePages.length-1];n.nodes.length===this.nodesPerPage&&(n={nodes:[]},this.nodePages.push(n)),n.nodes.push(t)}return await this.addChildRelation(r,t.index),eo.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),n=await this.getPageByNodeId(t.index),{filePath:i,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,n);o?eo.updateAll(o,t):n.nodes.push(t);let s=JSON.stringify(n);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(i,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,s)},!0)}else return}async saveMetadata(){let t=(0,Eke.default)({nodeCount:this.nodesCounter},PTe()),r=!1;await this.converter.writeQueue.enqueue({archiveKey:"metadata.json",writePromise:()=>this.writeFile(this.converter.layers0Path,JSON.stringify(t),"metadata.json",r)})}async save(){if(this.converter.options.instantNodeWriting){await this.saveMetadata();return}if(this.converter.options.slpk){for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Xb.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(i,n,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,Xb.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,n)})}}static updateResourceInMesh(t){t.mesh&&isFinite(t.index)&&(t.mesh.geometry.resource=t.index)}static updateAll(t,r){return Object.assign(t,r,{index:t.index}),eo.updateResourceInMesh(t),t}static updateMaterialByNodeId(t,r){t.mesh&&(t.mesh.material={definition:r,resource:t.index})}static updateVertexCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.vertexCount=r)}static updateNodeAttributeByNodeId(t){!t.mesh||!t.index||(t.mesh.attribute.resource=t.index)}static updateFeatureCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.featureCount=r)}static updateTexelCountHintByNodeId(t,r){!t.mesh||!t.mesh.material||(t.mesh.material.texelCountHint=r)}};var fw=require("path"),J4=require("fs");function Qb(e){if(typeof e=="number"){let r=Math.floor(e/1e3),n=e-r*1e3;return Ake(r,n)}else{let r=e[0],n=e[1]/1e6;return Ake(r,n)}}function Ake(e,t){let r=Math.floor(e/3600);e=e-r*3600;let n=Math.floor(e/60);e=e-n*60;let i=Math.floor(e),a="";return r&&(a+=`${r}h `),n&&(a+=`${n}m `),i&&(a+=`${i}s`),a||(a+=`${t}ms`),a}async function X4(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=cw(r);try{if(t){let s=(0,fw.join)(i,`${n}.slpk`);return(await J4.promises.stat(s)).size}let a=(0,fw.join)(i,n);return await Ske(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function Ske(e){let t=0,r=await J4.promises.readdir(e);for(let n of r){let i=await J4.promises.stat((0,fw.join)(e,n));i.isDirectory()?t+=await Ske((0,fw.join)(e,n)):t+=i.size}return t}var zke=Wt(sG(),1);var D0=3,Zb=9;function Cke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Zb;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i,uvRegions:a};let u=NVt(o),c=UVt({...u,...e}),l=GVt(c);return zVt(l,u.featureCount)}function NVt(e){let t=1,r=1,n=Tke(e.slice(0,D0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=D0;c<e.length;c+=D0){let l=Tke(e.slice(c,c+D0));n!==l&&(i[t]=c/D0-1,i[t+1]=c/D0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/D0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Tke(e){let t={},r=e[0],n=1;for(let i of e)t[i]=(t[i]||0)+1,n=n>t[i]?n:t[i],r=n>t[i]?r:i;return r}function UVt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),p=new Float32Array(o),h=new Uint16Array(a),d=0,b=0,g=0,x=0,E=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=pw("positions",F,D),k=pw("normals",F,D),N=pw("colors",F,D),C=pw("uvRegions",F,D),I=pw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(d,d+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:h.subarray(x,x+C),texCoords:p.subarray(E,E+I)}),d+=j,b+=k,g+=N,x+=C,E+=I}return u}function pw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Zb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function GVt(e){let t=[];for(let n of e){let i=t.find(a=>a.featureId===n.featureId);i?i.attributes.push(n):t.push({featureId:n.featureId,attributes:[n]})}let r=[];for(let n of t){let i=Dke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function zVt(e,t){let n=[e[0].featureId||0],i=[0],a=0,o=0;for(let c=1;c<e.length;c++){let l=e[c];n.push(l.featureId||0);let f=e[a];i.push(f.positions.length/Zb-1+o),i.push(f.positions.length/Zb+o),o+=f.positions.length/Zb,a+=1}let s=Dke(e);return i.push(s.positions.length/Zb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function Dke(e){let t=e.map(({positions:f})=>f),r=t.length>1?Co(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?Co(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?Co(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?Co(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?Co(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function RW(e,t){let r,n,i,a=or.WGS84.cartesianToCartographic(e.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof sa?(n=e.halfSize,r=new ce(n[0],n[1],n[2]).len(),i=e.quaternion):(r=e.radius,n=[r,r,r],i=new ds().fromMatrix3(new Rr([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:n,quaternion:i}}}function Fke(e,t){let r=HVt(e),n=a_(r),i=U7(r),a=or.WGS84.cartesianToCartographic(i.center,new ce),o=or.WGS84.cartesianToCartographic(n.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function HVt(e){let t=[];for(let r=0;r<e.length;r+=3){let n=new ce([e[r],e[r+1],e[r+2]]);t.push(n)}return t}function kke(e){let t;e instanceof Ja?t=e:t=e.getBoundingSphere();let r=t.center,n=t.radius,i=or.WGS84.cartesianToCartographic(new ce(r[0]+n,r[1]+n,r[2]+n),new ce),a=or.WGS84.cartesianToCartographic(new ce(r[0]-n,r[1]-n,r[2]-n),new ce);return{xmin:Math.min(a[0],i[0]),xmax:Math.max(a[0],i[0]),ymin:Math.min(a[1],i[1]),ymax:Math.max(a[1],i[1]),zmin:Math.min(a[2],i[2]),zmax:Math.max(a[2],i[2])}}function jW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Rr([t,0,0,0,t,0,0,0,t]);return new sa(r,n)}function Bke(e,t,r){var s,u,c,l,f,p,h,d;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((p=e.gltf)==null?void 0:p.nodes)||[],i=((d=(h=e.gltf)==null?void 0:h.images)==null?void 0:d.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let E=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(E.length);return S.set(E),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];Oke(n);let{cartographicOrigin:a,modelMatrix:o}=VVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function WVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function VVt(e,t,r){let{rtcCenter:n,gltfUpAxis:i}=e,{center:a}=r,o=new Kr(t);switch(n&&o.translate(n),i){case"Z":break;case"Y":let c=new Kr().rotateX(Math.PI/2);o=o.multiplyRight(c);break;case"X":let l=new Kr().rotateY(-Math.PI/2);o=o.multiplyRight(l);break;default:break}let s=new ce(a),u=or.WGS84.cartesianToCartographic(s,new ce);return{modelMatrix:o,cartographicOrigin:u}}function Oke(e){var t;for(let r=0;r<e.length;r++){let n=e[r];n.mesh&&(e[r]={...n,mesh:{...n.mesh,primitives:(t=n.mesh)==null?void 0:t.primitives.map(i=>{var a,o,s;return{...i,indices:{value:(a=i==null?void 0:i.indices)==null?void 0:a.value},attributes:WVt(i.attributes),material:{id:(o=i==null?void 0:i.material)==null?void 0:o.id,uniqueId:(s=i==null?void 0:i.material)==null?void 0:s.uniqueId}}})}}),n.children&&Oke(n.children)}}function Ike(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[vs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function Pke(e,t,r,n){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[a,o]of Object.entries(i||{}))switch(a){case vs:return $Vt(e,o,r,n);case G8:return KVt(e,o);default:return[]}return[]}function KVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function $Vt(e,t,r,n){var o,s,u,c,l,f,p;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let h=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return YVt(h,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let d=`TEXCOORD_${((p=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:p.texCoord)||0}`,b=e[d].value;return JVt(a,b,r)}return n?e[n].value:[]}function YVt(e,t=0,r=0){let n=[];if(r>0){let i=t,a=r;for(let o=0;o<e;o++)n.push(i),a-=1,a===0&&(i++,a=r)}else n=Array(e).fill(t,0,e);return n}function JVt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let p=0;p<t.length;p+=2){let h=t[p],d=t[p+1],b=Math.min(Od(h)*o.width|0,o.width-1),x=(Math.min(Od(d)*o.height|0,o.height-1)*o.width+b)*o.components+u,E=new Uint8Array(o.data)[x];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function Rke(e,t){let r={};for(let n in t){let i=t[n];r[n]=XVt(i,e)}return r}function XVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function jke(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}function QVt(e){return typeof e=="string"||typeof e=="bigint"?Ln.STRING_TYPE:typeof e=="number"?Number.isInteger(e)?Ln.SHORT_INT_TYPE:Ln.DOUBLE_TYPE:Ln.STRING_TYPE}function Lke(e){let t={};for(let r in e){let n=e[r][0],i=QVt(n);t[r]=i}return t}var Mke=(e,t)=>{var a,o,s,u,c,l,f,p;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[vs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let h in n.properties){let d=n.properties[h],b=ZVt(d);r[h]=b}return r}let i=(p=(f=(l=(c=e.extensions)==null?void 0:c[Ol])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:p[t];if(i){for(let h in i.properties){let d=i.properties[h],b=eKt(d);r[h]=b}return r}return null},ZVt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t},eKt=e=>{let t;if(e.array)t=Ln.STRING_TYPE;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t};var Q4=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var tKt=1,rKt=1,Au=3,hw=2,nKt=4,iKt="string",aKt="Int32",oKt="Float64",sKt="Oid32",qke=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],bh=new ce;async function LW(e,t,r,n,i,a,o,s,u,c,l,f,p){var S;let h=u,d=await wKt((S=e.gltf)==null?void 0:S.materials,c),b=Bke(e,t,r),g=Ike(e,p),x=await lKt(b,d,h,g);u&&uKt(x,l);let E=[];for(let F of d){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:k,texture:N}=F,C=await n();E.push(await cKt({convertedAttributes:j,material:k,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return E.length?E:null}function uKt(e,t){for(let r of e.values()){let n=Fke(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Au){let o=r.positions.subarray(a,a+Au);or.WGS84.cartesianToCartographic(Array.from(o),bh),bh[2]=bh[2]-t.getHeight(bh[1],bh[0]),bh=bh.subtract(i),r.positions.set(bh,a)}}}async function cKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var I;let l=e.boundingVolumes,f=e.positions.length/Au,{faceRange:p,featureIds:h,positions:d,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=Cke(e),F={};o&&(F=IKt(h,e.featureIndices,a,o));let D=new Uint32Array(2),j=GKt(h);D.set([f,S],0);let k=new Uint8Array(tc(D.buffer,d.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,p.buffer)),N=u?zKt(f,e,{positions:d,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:h,faceRange:p},c):null,C=[];return s&&o&&(C=LKt(h,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:DKt(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function lKt(e,t,r,n){let{nodes:i,images:a,cartographicOrigin:o,cartesianModelMatrix:s}=e,u=new Map;for(let c of t){let l={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let f of c.mergedMaterials)u.set(f.originalMaterialId,l)}Hke(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,p)=>f.concat(p)),delete l.featureIndicesGroups)}}return u}function Hke(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){if(e)for(let u of e)pKt(u,t,r,n,i,a,o,s)}function fKt(e,t){let r=t,{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),o&&(r=r.translate(o)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),r}function pKt(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){let u=fKt(e,o),c=e.mesh;c&&hKt(c,t,r,n,i,a,u,s),Hke(e.children||[],t,r,n,i,a,u,s)}function hKt(e,t,r,n,i,a=!1,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){var u;for(let c of e.primitives){let l=null,f;c.material?(l=i.get(c.material.id),f=(u=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:d})=>{var b;return d===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Qt(l!==null,"Primitive - material mapping failed"),Qt(c.mode===void 0||c.mode===Ht.TRIANGLES||c.mode===Ht.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let p=c.attributes;if(!l)continue;let h=dKt(c);l.positions=Co(l.positions,Nke({vertices:p.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:mKt,useCartesianPositions:a})),l.normals=Co(l.normals,Nke({vertices:p.NORMAL&&p.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:gKt,useCartesianPositions:!1})),l.texCoords=Co(l.texCoords,vKt(p.TEXCOORD_0&&p.TEXCOORD_0.value,h)),l.colors=Co(l.colors,bKt(p.COLOR_0,h)),f&&(l.uvRegions=Co(l.uvRegions,yKt(f,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(xKt(_Kt(p,c,t,s),h))}}function dKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return Q4(n.length/Au)}if(t&&e.mode===Ht.TRIANGLE_STRIP){let n=t.constructor,i=new n((t.length-2)*3),a=0,o=t.slice(0,3);i.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2===0?i.set(o,a):i.set(o.reverse(),a);t=i}return t}function Nke(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Au);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Au,s=t.subarray(o,o+Au),u=new ce(Array.from(s));u=n(u,e),i[a*Au]=u.x,i[a*Au+1]=u.y,i[a*Au+2]=u.z}return i}function mKt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a||(or.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n)),e}function gKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function vKt(e,t){let r=new Float32Array(t.length*hw);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*hw,a=e.subarray(i,i+hw);r[n*hw]=a[0],r[n*hw+1]=a[1]}return r}function bKt(e,t){let r=(e==null?void 0:e.components)||nKt,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;let i=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=i.subarray(o,o+r),u=new Uint8Array(r);for(let c=0;c<s.length;c++)u[c]=s[c]*255;n.set(u,a*r)}return n}function yKt(e,t){let r=new Uint16Array(t.length*4);for(let n=0;n<r.length;n+=4)r.set(e,n);return r}function xKt(e,t){if(!e.length||!t.length)return[];let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(e[i])}return r}function _Kt(e,t,r,n){let i=Pke(e,t,r,n);if(i.length)return i;for(let a=0;a<qke.length;a++){let o=qke[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function wKt(e=[],t){let r=[];for(let n of e)r.push(SKt(n));return t&&(r=await EKt(r)),r}async function EKt(e){var r,n;let t=[];for(;e.length>0;){let i=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(i.texture&&s.texture||!i.texture&&!s.texture)&&(i=await AKt(i,s),a.push(o))}if(i.texture&&a.length){let o=(r=i.mergedMaterials)==null?void 0:r.reduce((c,{textureSize:l})=>c+((l==null?void 0:l.width)||0),0),s=(n=i.mergedMaterials)==null?void 0:n.reduce((c,{textureSize:l})=>Math.max(c,(l==null?void 0:l.height)||0),0),u=-1;for(let c of i.mergedMaterials)if(c.textureSize){let l=u+1+c.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;c.uvRegion=new Uint16Array([u+1,0,l,c.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=l}i.texture.image.width=o,i.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(i)}return t.length||t.push({material:CKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function AKt(e,t){var r,n;if((r=e.texture)!=null&&r.bufferView&&((n=t.texture)!=null&&n.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let i=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([i,a],{direction:"horizontal"});e.texture.bufferView.data=await s.toFormat(e.texture.mimeType==="image/png"?"png":"jpeg").toBuffer()}catch(o){throw console.log("Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)"),o}e.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId=1}return e.mergedMaterials=e.mergedMaterials.concat(t.mergedMaterials),e}function SKt(e){var i,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(i=e.emissiveFactor)==null?void 0:i.map(c=>Math.round(c*255)),alphaMode:TKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||tKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||rKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Oc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function TKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function CKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function DKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=FKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function FKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=BKt(r.texture,t));let{baseColorFactor:i,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=i;return(!i||i[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:kKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function kKt(e,t=1){let r=.00015686274509803922,n=new hs(0,0,0,1),i=new hs(1,1,1,1),a=new hs(r,r,r,0),o=new hs(e),s=i.subtract(a).multiply(o),u=s.lerp(s,n,t);a[3]=1;let c=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:c.toArray(),renderMode:"solid"}}}function BKt(e,t){var r,n,i,a;return{encoding:(r=e==null?void 0:e.source)!=null&&r.mimeType?[e.source.mimeType]:void 0,images:[{id:OKt(e,t),size:(n=e.source)==null?void 0:n.image.width,length:(i=e.source)!=null&&i.image.data.length?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function OKt(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,p=n-1<<0,h=c+l+f+p;return BigInt(`0b${h.toString(2)}${u}`).toString()}function IKt(e,t,r,n){let i=PKt(e,n,r);return Uke(t,i),Uke(e,i),i}function PKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=jKt(i,t,r);n[a.toString()]=o}return n}function RKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function jKt(e,t,r){let n=RKt(t,e),i=(0,zke.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function Uke(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function LKt(e,t,r,n){let i=[],o=jke(e,r)?Rke(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=qKt(u,n);if(c){let l=s[u],f=MKt(c,l);i.push(f)}}return i}function MKt(e,t){let r;switch(e){case sKt:case aKt:r=NKt(t);break;case oKt:r=UKt(t);break;case iKt:r=Gke(t);break;default:r=Gke(t)}return r}function qKt(e,t){let r=t.find(n=>n.name===e);return r?r.attributeValues?r.attributeValues.valueType:(console.error(`attributeValues is null, attribute=${r}`),""):(console.error(`attribute is null, key=${e}, attributeStorageInfo=${JSON.stringify(t,null,2)}`),"")}function NKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return tc(t.buffer,r.buffer)}function UKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return tc(t.buffer,r.buffer,n.buffer)}function Gke(e){let t=new Uint32Array([e.length]),r=0,n=new Uint32Array(e.length),i=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),c=u.length;r+=c,n[o]=c,i.push(u)}let a=new Uint32Array([r]);return tc(t.buffer,a.buffer,n.buffer,...i)}function GKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function zKt(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let p=new Uint32Array(t.featureIndices.length?t.featureIndices:e),h=HKt(p,l),d={positions:i,normals:a,colors:s,"feature-index":h};o.length&&(d.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(d["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),hv({attributes:d,indices:f},K7,{...K7.options,reuseWorkers:!0,_nodeWorkers:!0,modules:n,useLocalLibraries:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:b},["draco-writer"]:{workerUrl:"./modules/draco/dist/draco-writer-worker-node.js"}})}function HKt(e,t){let r=new Uint32Array(e.length),n=0,i=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Au;r.fill(n,i,o),n++,i=o+1}return r}function Wke(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=KKt(e);switch(i){case Ol:return r=WKt(a,t),r;case vs:return r=VKt(a,t),r;default:return null}}function WKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return Z4(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return Z4(r)}return null}function VKt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return Z4(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return Z4(n)}return null}function Z4(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function KKt(e){var a,o,s,u;let t=[vs,Ol];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let n="";for(let c of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(c)){n=c;break}if(!n)return{extensionName:null,extension:null};let i=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[n];return{extensionName:n,extension:i}}var Kke=Wt(wu(),1),$ke=require("path");var Vke=()=>({serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}});async function Yke(e,t,r){let n={serviceItemId:Oc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,Kke.default)(n,Vke()),a=(0,$ke.join)(r,"SceneServer");await ki(a,JSON.stringify(i))}var MW=16;function Jke(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*MW/i},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return n.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function qW(e){var n,i;let t=(n=e.lodSelection)==null?void 0:n.find(a=>a.metricType==="maxScreenThreshold"),r=t==null?void 0:t.maxError;if(!r){let a=(i=e.lodSelection)==null?void 0:i.find(o=>o.metricType==="maxScreenThresholdSQ");a&&(r=Math.sqrt(a.maxError/(Math.PI*.25)))}return r||(r=MW),e.mbs[3]*2*MW/r}var $Kt=240,YKt=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],JKt=372,XKt=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],QKt=372,ZKt=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],e$t=12,NW=(3+1)*(3+2)/2,t$t=2,ey=class{constructor(t){zt(this,"_v00",0),zt(this,"_v01",0),zt(this,"_v10",0),zt(this,"_v11",0),zt(this,"_t",[]),zt(this,"_ix",void 0),zt(this,"_iy",void 0),zt(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,r){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(r))return NaN;let n=r$t(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,p=new Array(NW);if(o===this._ix&&s===this._iy)this.options.cubic?p=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let d=[this._rawval(o,s-1),this._rawval(o+1,s-1),this._rawval(o-1,s),this._rawval(o,s),this._rawval(o+1,s),this._rawval(o+2,s),this._rawval(o-1,s+1),this._rawval(o,s+1),this._rawval(o+1,s+1),this._rawval(o+2,s+1),this._rawval(o,s+2),this._rawval(o+1,s+2)],b=XKt;s!==0&&(b=s===this.options._height-2?ZKt:YKt);let g=JKt;s!==0&&(g=s===this.options._height-2?QKt:$Kt);for(let x=0;x<NW;++x){p[x]=0;for(let E=0;E<e$t;++E)p[x]+=d[E]*b[NW*E+x];p[x]/=g}}if(!this.options.cubic){let d=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*d+a*b,x=this.options._offset+this.options._scale*g;return this._ix=o,this._iy=s,this._v00=u,this._v01=c,this._v10=l,this._v11=f,x}let h=p[0]+i*(p[1]+i*(p[3]+i*p[6]))+a*(p[2]+i*(p[4]+i*p[7])+a*(p[5]+i*p[8]+a*p[9]));return h=this.options._offset+this.options._scale*h,this._ix=o,this._iy=s,this._t=p,h}_rawval(t,r){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(r<0||r>=this.options._height)&&(r=r<0?-r:2*(this.options._height-1)-r,t+=(t<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+t$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function r$t(e,t){t=Math.abs(t);let r=Xke(e,t);return 2*Math.abs(r)===t?r-=Xke(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Xke(e,t){return e-Math.floor(e/t)*t}var n$t=10,i$t=65535;function UW(e,t){let r=a$t(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,p=null,h=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let E=x.split(" "),S=E[0],F=E[1];if(S!=="#"||!F)continue;let D=E.length>2?E.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!E[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(E[2],10)}else if(F==="Scale"){if(!E[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(E[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(E[2]))&&(o=parseFloat(E[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(E[2]))&&(s=parseFloat(E[2]))}else{let E=x.split(" ");if(E=E.filter(S=>S!==""),l=parseInt(E[0],10),f=parseInt(E[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(d!==i$t)throw new Error("Geoid model file: Incorrect value of maxval");if(p=n.value.offset,h=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(a===0)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(f<2||l<2)throw new Error("Geoid model file: Raster size too small");if(l&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");let b=l/360,g=(f-1)/180;return new ey({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:h,_datastart:p,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*a$t(e){let t=0;do{let r=e.indexOf(n$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:Qke(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Qke(n)}}}while(t<e.length);return{offset:t,line:""}}function Qke(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var o$t="4.0.6";var ek={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:o$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>UW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var ty=Wt(wu(),1);var Zke={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}};var s$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),u$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),c$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),l$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),eBe=()=>({version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>(0,ty.default)(e,s$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,ty.default)(e,Zke)},fullExtent:{path:"fullExtent",transform:e=>(0,ty.default)(e,l$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,ty.default)(e,u$t())},nodePages:{path:"nodePages",transform:e=>(0,ty.default)(e,c$t())},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"geometryDefinitions",default:[]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}});var GW=Wt(wu(),1),f$t=()=>({offset:{default:8},position:{default:{type:"Float32",component:3}},normal:{default:{type:"Float32",component:3}},uv0:{path:"hasTexture",transform:e=>e&&{type:"Float32",component:2}||!1,omitValues:[!1]},color:{default:{type:"UInt8",component:4}},uvRegion:{path:"hasUvRegions",transform:e=>e&&{type:"UInt16",component:4}||!1,omitValues:[!1]},featureId:{default:{binding:"per-feature",type:"UInt64",component:1}},faceRange:{default:{binding:"per-feature",type:"UInt32",component:2}}}),p$t=()=>({"compressedAttributes.encoding":{default:"draco"},"compressedAttributes.attributes":{path:"geometryConfig",transform:e=>{let t=["position","normal"];return e.hasTexture&&t.push("uv0"),t.push("color"),e.hasUvRegions&&t.push("uv-region"),t.push("feature-index"),t}}}),tBe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,GW.default)(e,f$t())];return e.draco&&t.push((0,GW.default)({geometryConfig:e},p$t())),t}}});var dw=Wt(wu(),1),h$t=()=>({renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1]},diffuse:{path:"diffuse",default:[1,1,1]},specular:{path:"specular",default:[0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}}),d$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,dw.default)(r,h$t())}}),m$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),g$t=()=>({encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(n=>(0,dw.default)(n,m$t()))}}),rBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:v$t},textureDefinitions:{path:"textureDefinitionInfos",transform:b$t}});function v$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,dw.default)(a,d$t());return n}function b$t(e,t,r){if(!e)return null;let n={};for(let[i,a]of e.entries()){let o=`${r.nodePath}${i}`;a.imageIndex=o,n[o]=(0,dw.default)(a,g$t())}return n}var y$t=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]);function iBe(e){var r,n;if(!((r=e==null?void 0:e.parentNode)!=null&&r.obb)||!((n=e==null?void 0:e.parentNode)!=null&&n.mbs))return[];let t=[];return x$t(t,e),_$t(t,e),t}function x$t(e,t){var o;let r=w$t(t.parentNode.obb),n=E$t(t);if(A$t(r,n))return;let a=`OBB of Tile (${t.id}) doesn't fit into Parent (${(o=t.parentNode)==null?void 0:o.id}) tile OBB`;e.push(a)}function _$t(e,t){var a;let r=nBe(t.mbs),n=nBe(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){let o=`MBS of Tile (${t.id}) doesn't fit into Parent (${(a=t.parentNode)==null?void 0:a.id}) tile MBS`;e.push(o)}}function nBe(e){return new Ja([e[0],e[1],e[2]],e[3])}function w$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new sa().fromCenterHalfSizeQuaternion(t,r,n)}function E$t(e){let t=e.obb.halfSize,r=y$t,n=or.WGS84.cartographicToCartesian(e.obb.center),i=[];for(let a=0;a<r.length;a+=3){let s=new ce(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(n);i=i.concat(s)}return i}function A$t(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){let i=[t[n],t[n+1],t[n+2]],a=or.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}var tk=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var aBe=Wt(require("process"),1),S$t=4*1024*1024*1024,ry=class extends tk{intervalId;writePromise=null;fileMap={};listeningInterval;writeConcurrency;constructor(t=2e3,r=400){super(),this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:n,writePromise:i}=t,a=await i();n&&a&&(this.fileMap[n]=a)}else super.enqueue(t),aBe.default.memoryUsage().rss>S$t&&await this.startWrite()}startListening(){this.intervalId=setInterval(this.startWrite.bind(this),this.listeningInterval)}stopListening(){this.intervalId&&clearInterval(this.intervalId)}async startWrite(){this.writePromise||(this.writePromise=this.doWrite()),await this.writePromise,this.writePromise=null}async finalize(){this.stopListening(),await this.startWrite()}async doWrite(){for(;this.length;){let t=[],r=[];for(let i=0;i<this.writeConcurrency;i++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let n=await Promise.allSettled(t);this.updateFileMap(r,n)}}updateFileMap(t,r){for(let n=0;n<t.length;n++){let i=t[n];i&&"value"in r[n]&&(this.fileMap[i]=r[n].value)}}};var ny="Tile converter does not work in browser, only in node js environment";var HW=require("path"),WW=Wt(wu(),1);var oBe=Wt(wu(),1),sBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),T$t=()=>({href:{path:"href"}}),C$t=()=>({id:{path:"id"},...T$t(),...sBe()}),zW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...sBe(),lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>(0,oBe.default)(e,C$t()),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});var Su=class{id;inPageId;data=null;children=[];converter;_finalized=!1;get finalized(){return this._finalized}constructor(t,r){this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}async addData(t){return this.converter.options.instantNodeWriting?await this.write(t):this.data=t,this}async addChildren(t){let r=[];for(let i of t){let a=await i.load();r.push({id:i.id,href:`../${i.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let n=this.data;this.converter.options.instantNodeWriting&&(n=await this.load()),n&&(n.children=n.children??[],n.children=n.children.concat(r)),this.converter.options.instantNodeWriting&&n&&await this.write(n)}async addNeighbors(){var r;if(this.finalized)return;let t=await this.load();for(let n of this.children){let i=await n.load();if(i.neighbors=i.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])n.id!==a.id&&i.neighbors.push({...a});else console.warn(`Node ${n.id}: neighbors attribute is omited because of large number of neigbors`),delete i.neighbors;this.converter.options.instantNodeWriting&&i&&await n.write(i),await n.save()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,HW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>qc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>ki(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,HW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await Y4(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Su.createRootNodeIndexDocument(t);return await new Su(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Su.createNodeIndexDocument(t,r,n,i,a);return await new Su(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Oc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,WW.default)(r,zW())}static async createNodeIndexDocument(t,r,n,i,a){var p,h;let{texture:o,attributes:s}=a,u=i.index,c=await t.load(),l={version:c.version,id:u.toString(),level:c.level+1,...r,lodSelection:n,parentNode:{id:t.id,href:`../${t.id}`,mbs:c.mbs,obb:c.obb},children:[],neighbors:[]},f=(0,WW.default)(l,zW());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((h=(p=t.converter.layers0)==null?void 0:p.attributeStorageInfo)!=null&&h.length))){f.attributeData=[];let d=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<d;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var VW=async(e,t,r)=>{let n=mw(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await rk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},KW=async(e,t,r)=>{let n=mw(t);if(!e||!t.contentUrl||n)return null;let i={...r,[e.loader.id]:{...r[e.loader.id]||{},isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}};return await rk(t.contentUrl,e.loader,i)};async function rk(e,t,r){let n=e.split(".3tz"),i;if(n.length===1)i=null;else if(n.length===2)i=n[1].slice(1),i===""&&(i="tileset.json");else throw new Error("Unexpected URL format");if(i){let a=`${n[0]}.3tz`,o=new c2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function mw(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var nk=async(e,t,r,n,i,a=0)=>{if(i&&a>i)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await nk(u,s,r,n,i,a+1);n&&await n(o,t)};var D$t=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],uBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Bo(e.gltfArrayBuffer,Il,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=F$t(n),a=k$t(n);return{meshTopologyTypes:i,metadataClasses:a}},F$t=e=>{let t=new Set;for(let r of e.meshes||[])for(let n of r.primitives){let{mode:i}=n;typeof i!="number"&&(i=4),t.add(D$t[i])}return t},k$t=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[vs])==null?void 0:a.schema)==null?void 0:o.classes;if(r)for(let l of Object.keys(r))t.add(l);let n=(c=(u=(s=e.extensions)==null?void 0:s[Ol])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},cBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var lBe=Wt(require("process"),1);var B$t=.2,ik=class{_stepsTotal=0;_stepsDone=0;startTime=0;stopTime=0;timeOfUpdatingStepsDone=0;milliSecForOneStep=0;trust=!1;numberOfDigitsInPercentage=0;threshold;getTime;constructor(t={}){this.getTime=t.getTime||lBe.default.hrtime.bigint,this.threshold=t.threshold||B$t}get stepsTotal(){return this._stepsTotal}set stepsTotal(t){this._stepsTotal=t,this.numberOfDigitsInPercentage=this.stepsTotal>100?Math.ceil(Math.log10(this.stepsTotal))-2:0}get stepsDone(){return this._stepsDone}set stepsDone(t){if(this._stepsDone=t,this.timeOfUpdatingStepsDone=this.getCurrentTimeInMilliSeconds(),this._stepsDone){let n=(this.timeOfUpdatingStepsDone-this.startTime)/this._stepsDone;this.trust=this.isVelocityTrust(n,this.milliSecForOneStep),this.milliSecForOneStep=n}}startMonitoring(){this.startTime=this.getCurrentTimeInMilliSeconds(),this.milliSecForOneStep=0,this.trust=!1,this.timeOfUpdatingStepsDone=0,this.stopTime=0,this.stepsDone=0}stopMonitoring(){this.stopTime=this.getCurrentTimeInMilliSeconds()}getPercent(){return this._stepsTotal?this._stepsDone/this._stepsTotal*100:null}getPercentString(){let t=this.getPercent();return t!==null?t.toFixed(this.numberOfDigitsInPercentage):""}getTimeCurrentlyElapsed(){return(this.stopTime?this.stopTime:this.getCurrentTimeInMilliSeconds())-this.startTime}getTimeRemaining(){return!this._stepsDone||!this.startTime?null:{timeRemaining:(this._stepsTotal-this._stepsDone)*this.milliSecForOneStep,trust:this.trust}}getTimeRemainingString(){let t=this.getTimeRemaining();return t!=null&&t.trust?Qb(t.timeRemaining):""}isVelocityTrust(t,r){return r?Math.abs((t-r)/r)<this.threshold:!1}getCurrentTimeInMilliSeconds(){return Number(this.getTime()/BigInt(1e6))}};var pBe,O$t=(pBe=F0.default.env)==null?void 0:pBe.IonToken,fBe=64,I$t="3DTILES",P$t="3DObject",R$t=1800,j$t="https://",yh="phase1-count",iy=class{attributeMetadataInfo;nodePages;options;layers0Path;materialMap;materialDefinitions;geometryMap;geometryConfigs;vertexCounter;layers0;featuresHashArray;refinementCounter;validate;boundingVolumeWarnings=[];conversionStartTime=[0,0];refreshTokenTime=[0,0];sourceTileset=null;loadOptions={_nodeWorkers:!0,reuseWorkers:!0,useLocalLibraries:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{},modules:{}};geoidHeightModel=null;Loader=Ac;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ry;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};progresses={};constructor(){this.attributeMetadataInfo=new XC,this.nodePages=new eo(ki,fBe,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(gn)return console.log(ny),ny;this.conversionStartTime=F0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:p,generateBoundingVolumes:h,instantNodeWriting:d=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:E=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:d,mergeMaterials:b,inquirer:g,metadataClass:x},this.progresses[yh]=new ik,this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(j$t)!==-1?dD:Ac,this.generateTextures=Boolean(p),this.generateBoundingVolumes=Boolean(h),this.writeQueue=new ry,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,ek),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(qc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await rk(F,this.Loader,this.loadOptions),(this.Loader===Ac||E?await this.preprocessConversion():!0)&&!E&&await this.selectMetadataClass()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(n),outputPath:s,tilesetName:r}))}catch(S){throw S}finally{await this.writeQueue.finalize(),La.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await nk(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r,metadataClasses:n}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`Tile count: ${this.progresses[yh].stepsTotal}`),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),n.size?console.log(`Feature metadata classes have been found: ${Array.from(n).join(", ")}`):console.log("Feature metadata classes have not been found"),console.log("------------------------------------------------"),!r.has("TRIANGLES")&&!r.has("TRIANGLE_STRIP")?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(mw(t))return await VW(this.sourceTileset,t,this.loadOptions),null;t.id&&(this.progresses[yh].stepsTotal+=1,console.log(`[analyze]: ${t.id}`));let i=null;try{i=await KW(this.sourceTileset,t,{...this.loadOptions,"3d-tiles":{...this.loadOptions["3d-tiles"],loadGLTF:!1}})}catch{console.log(`[warning]: Failed to load ${t.contentUrl}. An I3S tile with empty content will be added to the output tileset`)}let a=await uBe(i);return cBe(this.preprocessData,a),null}async selectMetadataClass(){var r;let{metadataClasses:t}=this.preprocessData;if(t.size>1)if((r=this.options.metadataClass)!=null&&r.length)console.log(`${this.options.metadataClass} has been selected`);else if(this.options.inquirer){let n=await this.options.inquirer.prompt([{name:"metadataClass",type:"list",message:"Select feature metadata data class to convert...",choices:Array.from(t)}]);this.options.metadataClass=n.metadataClass,console.log(`${n.metadataClass} has been selected`)}else return console.log(`A feature metadata class has not been selected. Start the converter with option "--metadata-class". For example, "npx tile-converter ... --metadata-class ${Array.from(t)[0]}"`),console.log("------------------------------------------------"),!1;return!0}async _createAndSaveTileset(t,r){var u,c,l;let n=(0,Ga.join)(`${t}`,`${r}`);try{await lw(n)}catch{}this.layers0Path=(0,Ga.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=F8(i.boundingVolume,new Kr(i.transform),null);this._formLayers0(r,a,(l=(c=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:c.boundingVolume)==null?void 0:l.region);let o=RW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]}),this.progresses[yh].startMonitoring();let s=await Su.createRootNode(o,this);await nk(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.progresses[yh].stopMonitoring(),console.log("[finalizing conversion]"),this.layers0.attributeStorageInfo=this.attributeMetadataInfo.attributeStorageInfo,this.layers0.fields=this.attributeMetadataInfo.fields,this.layers0.popupInfo=this.attributeMetadataInfo.popupInfo,this.attributeMetadataInfo.attributeStorageInfo.length&&(this.layers0.layerType=P$t),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,ak.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),tBe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Yke(r,this.layers0,n);for(let f of this.compressList||[])await $4(f),await PW(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r,n){var s;if(!((s=this.sourceTileset)!=null&&s.root))return;let i=kke(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Oc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Oc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:fBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,ak.default)(o,eBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>qc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>ki(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Ga.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await _ke(r,n,0,".",this.options.sevenZipExe);try{await lw(t)}catch{}}}async convertTile(t,r){let n=mw(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await VW(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:a}=r,o=a.clone();t.transform&&(o=o.multiplyRight(t.transform));let s=i[0],u=await this._createNode(s,t,o);await s.addChildren(u);let c={transform:o,parentNodes:u};if(t.id){this.progresses[yh].stepsDone+=1;let l="Calculating time left...",f=this.progresses[yh].getTimeRemainingString();f&&(l=`${f} left`);let p=this.progresses[yh].getPercentString();console.log(`[converted ${p}%, ${l}]: ${t.id}`)}return c}async finalizeTile(t,r){for(let n of t)for(let i of n.parentNodes)await i.addNeighbors();for(let n of r.parentNodes)await n.save()}async _createNode(t,r,n){this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let i=null;try{i=await KW(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=F8(r.boundingVolume,n,null),o=RW(a,this.geoidHeightModel),s=Wke(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],p={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let h of u||[p]){this.layersHasTexture=this.layersHasTexture||Boolean(h.texture),this.generateBoundingVolumes&&h.boundingVolumes&&(o=h.boundingVolumes);let d=Jke(r,o),b=d.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,h),x=await Su.createNodeIndexDocument(t,o,d,g,h),E=await new Su(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(h,E.id),this.validate&&(this.boundingVolumeWarnings=iBe(x),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),l.push(g.index),f.push(g)}return c}async _convertResources(t,r,n,i,a,o){if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await LW(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,this.attributeMetadataInfo.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,p={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(p.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let h=a.nodeId,d;if(h?d=await this.nodePages.getNodeById(h):d=await this.nodePages.push(p,i),p.mesh||console.log(`[warning]: node ${d.index} is created with empty content`),eo.updateAll(d,p),o&&eo.updateMaterialByNodeId(d,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;eo.updateTexelCountHintByNodeId(d,b)}return u&&(this.vertexCounter+=u,eo.updateVertexCountByNodeId(d,u)),eo.updateNodeAttributeByNodeId(d),c&&eo.updateFeatureCountByNodeId(d,c),this.nodePages.saveNode(d),d}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Ga.join)(this.layers0Path,"nodes",r),c=(0,Ga.join)("nodes",r);await this._writeGeometries(n,i,u,c),await this._writeShared(o,u,c,r),await this._writeTexture(a,u,c),await this._writeAttributes(s,u,c)}async _writeGeometries(t,r,n,i){if(this.options.slpk){let a=(0,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>qc(a,t,"0.bin")})}else{let a=(0,Ga.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>ki(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>qc(a,r,"1.bin")})}else{let a=(0,Ga.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>ki(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,ak.default)(t,rBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Ga.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>qc(s,o,"sharedResource.json")})}else{let s=(0,Ga.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>ki(s,o)})}}async _writeTexture(t,r,n){if(t){let i=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(i){case"jpg":case"png":{if(a.push({name:"0",format:i}),await this.writeTextureFile(o,"0",i,r,n),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),c=hv({...t.image,data:u},wq,{...wq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=hv(t.image.data[0],aq);await this.writeTextureFile(s,"0","jpg",r,n)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,n,i,a){if(this.options.slpk){let o=(0,Ga.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>qc(o,t,`${r}.${n}`,s)})}else{let o=(0,Ga.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>ki(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){if(t!=null&&t.length&&this.attributeMetadataInfo.attributeStorageInfo.length){let i=t.length<this.attributeMetadataInfo.attributeStorageInfo.length?t.length:this.attributeMetadataInfo.attributeStorageInfo.length;for(let a=0;a<i;a++){let o=this.attributeMetadataInfo.attributeStorageInfo[a].key,s=new Uint8Array(t[a]);if(this.options.slpk){let u=(0,Ga.join)(r,"attributes",o);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${o}.bin.gz`,writePromise:()=>qc(u,s,"0.bin")})}else{let u=(0,Ga.join)(r,`attributes/${o}/0`);await this.writeQueue.enqueue({writePromise:()=>ki(u,s,"index.bin")})}}}}_getFormatByMimeType(t){switch(t){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(t){let r=(0,$W.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let n=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,n),n}findOrCreateGeometryDefinition(t,r){let n={hasTexture:t,hasUvRegions:r},i=(0,$W.default)(JSON.stringify(n));if(this.geometryMap.has(i))return this.geometryMap.get(i)||0;let a=this.geometryConfigs.push(n)-1;return this.geometryMap.set(i,a),a}createAttributeStorageInfo(t,r){let n=null;this.options.metadataClass?!this.attributeMetadataInfo.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=Mke(t.gltf,this.options.metadataClass)):r&&(n=Lke(r)),n&&this.attributeMetadataInfo.addMetadataInfo(n)}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await X4(t),o=F0.default.hrtime(this.conversionStartTime),s=Qb(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${I$t}`),console.log(`Total conversion time: ${s}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",a," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',i,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||O$t}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=F0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(F0.default.hrtime(this.refreshTokenTime)[0]<R$t)return;this.refreshTokenTime=F0.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch={...this.loadOptions.fetch,headers:r.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){t.refine===1&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){return["b3dm","glTF","scenegraph"].includes(t.type||"")}};var RBe=require("path"),ZW=Wt(require("process"),1),jBe=Wt(wu(),1);function YW(e){switch(e){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: ${e}`)}}var hBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function ay(e){switch(e){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: ${e}`)}}var dBe="String",mBe="Oid32",gBe="Float64",vBe="Int16";function ok(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function oy(e,t=null){return t?`${e}?token=${t}`:e}function bBe(e,t){let{attributeData:r=[]}=t,n=[];for(let i=0;i<r.length;i++){let a=r[i].href.replace("./","");n.push(`${e}/${a}`)}return n}function yBe(e,t,r){let n=[],{attributeStorageInfo:i=[]}=e;for(let a=0;a<i.length;a++){let o=i[a].key;n.push(`${t}/nodes/${r}/attributes/${o}/0`)}return n}var sk=new ce([0,0,0]);function M$t(e){switch(e){case"ktx-etc2":case"dds":return X8;case"ktx2":return Rd;case"jpg":case"png":default:return Cv}}var q$t="i3s-attribute-type";async function EBe(e,t,r,n,i){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Kr,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=oy(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=M$t(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Cv){let p={...t.textureLoaderOptions,image:{type:"data"}};try{let h=await To(f,[],p,i);a.texture=h}catch{let d=await Bo(f,u,p,i);a.texture=d}}else if(u===X8||u===Rd){let p=await An(f,u,t.textureLoaderOptions);u===Rd&&(p=p[0]),a.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else a.texture=f}return a.material=$$t(t.materialDefinition,a.texture),a.material&&(a.texture=null),await N$t(e,a,t,r,n)}async function N$t(e,t,r,n,i){var f,p;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let h=await Bo(e,_v,{draco:{attributeNameEntry:q$t}});s=h.header.vertexCount,l=(f=h.indices)==null?void 0:f.value;let{POSITION:d,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=h.attributes;o={position:d,normal:b,color:g,uv0:x,uvRegion:S,id:E},U$t(o,h);let F=Q$t(E);F&&X$t(o,F)}else{let{vertexAttributes:h,ordering:d,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=z$t(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=_Be(e,u,h,s,d),{attributes:F}=_Be(e,S,b,c,g);J$t(F),o=G$t(E,F)}if(!((p=i==null?void 0:i.i3s)!=null&&p.coordinateSystem)||i.i3s.coordinateSystem===2){let h=W$t(o.position,r);t.modelMatrix=h.invert(),t.coordinateSystem=2}else t.modelMatrix=K$t(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:xBe(o.color),texCoords:o.uv0,uvRegions:xBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let h in t.attributes)t.attributes[h]||delete t.attributes[h];return t.vertexCount=s,t.byteLength=a,t}function U$t(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function G$t(e,t){return{...e,...t}}function xBe(e){return e&&(e.normalized=!0,e)}function z$t(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=YW(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=ay(o);break;case"featureCount":i=new s(e,4,4)[0],r+=ay(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function _Be(e,t,r,n,i){let a={};for(let o of i)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+n*u*ay(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=H$t(c,n*u,ay(s));else{let f=YW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:hBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*ay(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function H$t(e,t,r){let n=[],i=new DataView(e),a=0;for(let o=0;o<t;o++){let s=i.getUint32(a,!0),u=i.getUint32(a+4,!0),c=s+2**32*u;n.push(c),a+=r}return new Uint32Array(n)}function W$t(e,t){let r=t.mbs,n=e.value,i=e.metadata,a=new Kr,o=new ce(r[0],r[1],r[2]),s=new ce;return or.WGS84.cartographicToCartesian(o,s),or.WGS84.eastNorthUpToFixedFrame(s,a),e.value=V$t(n,i,o),a}function V$t(e,t={},r){let n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let o=0;o<n.length;o+=3)n[o]=e[o]*i+r.x,n[o+1]=e[o+1]*a+r.y,n[o+2]=e[o+2]+r.z;for(let o=0;o<n.length;o+=3)or.WGS84.cartographicToCartesian(n.subarray(o,o+3),sk),n[o]=sk.x,n[o+1]=sk.y,n[o+2]=sk.z;return n}function K$t(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,n=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,i=new Kr;return i[0]=r,i[5]=n,i}function $$t(e,t){let r;return e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?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=wBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=wBe(r.pbrMetallicRoughness.baseColorFactor)),t&&Y$t(r,t),r}function wBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function Y$t(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function J$t(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],p=i[c-1],h=f-p+1,d=u+h*3;o.fill(l,u,d),s++,u=d}e.id.value=o}function X$t(e,t){let r=e.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function Q$t(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var Z$t="4.0.6",ABe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Z$t,mimeTypes:["application/octet-stream"],parse:eYt,extensions:["bin"],options:{"i3s-content":{}}};async function eYt(e,t,r){let{tile:n,_tileOptions:i,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=i||n,u=o||a;return!s||!u?null:await EBe(e,s,u,t,r)}var tYt="4.0.6",SBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:tYt,mimeTypes:["application/json"],parse:rYt,extensions:["json"],options:{i3s:{}}};async function rYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var gw=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(t,r="",n){var i,a;this.tileset={...t},this.url=r,this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(a=t.nodePages)==null?void 0:a.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var i;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=oy(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,SBe,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=t%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(t){let r=await this.getNodeById(t),n=[],i=[];for(let h of r.children||[])i.push(this.getNodeById(h));let a=await Promise.all(i);for(let h of a)n.push({id:h.index.toString(),obb:h.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:d}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=h,f=d;let{textureData:b,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,c=b.format||c,b.name&&(s=`${this.url}/nodes/${r.mesh.material.resource}/textures/${b.name}`),this.tileset.attributeStorageInfo&&(l=yBe(this.tileset,this.url,r.mesh.attribute.resource))}let p=this.getLodSelection(r);return JW({id:t.toString(),lodSelection:p,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Rv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=p_();r.has("etc2")&&t.push("ktx-etc2"),r.has("dxt")&&t.push("dds"),t.push("ktx2")}return t.push("jpg"),t.push("png"),t}};function TBe(e,t){let r=t.url||"",n;e.geometryData&&(n=`${r}/${e.geometryData[0].href}`);let i;e.textureData&&(i=`${r}/${e.textureData[0].href}`);let a;e.attributeData&&(a=bBe(r,e));let o=e.children||[];return JW({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function JW(e){var s,u;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...or.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...or.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let l=new sa().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...l.center,l.radius],r=[...e.obb.center,l.radius]}let n=(s=e.lodSelection)==null?void 0:s[0].metricType,i=(u=e.lodSelection)==null?void 0:u[0].maxError,a="mesh",o=2;return{...e,mbs:r,boundingVolume:t,lodMetricType:n,lodMetricValue:i,type:a,refine:o}}async function CBe(e,t,r){let n=ok(r.url||""),i,a;if(e.nodePages)i=new gw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=oy(`${n}/nodes/root`,o.token);a=await An(s,Zl,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:Zl,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var nYt="4.0.6",iYt=/layers\/[0-9]+$/,aYt=/nodes\/([0-9-]+|root)$/,oYt="504b0304",sYt="PointCloud",Zl={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:nYt,mimeTypes:["application/octet-stream"],parse:uYt,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:2}}};async function uYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},pYt(e)===oYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=ok(n),o;t.i3s.isTileset==="auto"?o=iYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=aYt.test(a):s=t.i3s.isTileHeader,o?e=await lYt(e,t,r):s?e=await fYt(e,r):e=await cYt(e,t),e}async function cYt(e,t){return await Bo(e,ABe,t)}async function lYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===sYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await CBe(n,t,r)}async function fYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),TBe(e,t)}function pYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function FBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?hYt(n,e):null}:{}}function hYt(e,t){switch(e){case dBe:return gYt(t);case mBe:return DBe(t);case gBe:return mYt(t);case vBe:return dYt(t);default:return DBe(t)}}function DBe(e){return new Uint32Array(e,4)}function dYt(e){return new Int16Array(e,4)}function mYt(e){return new Float64Array(e,8)}function gYt(e){let i=[];try{let a=new DataView(e,0,4).getUint32(0,!0),o=new Uint32Array(e,8,a),s=8+a*4;for(let u of o){let c=new TextDecoder("utf-8"),l=new Uint8Array(e,s,u);i.push(c.decode(l)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return i}var vYt="4.0.6";var XW={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:vYt,mimeTypes:["application/binary"],parse:async(e,t)=>FBe(e,t),extensions:["bin"],options:{},binary:!0};function QW(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=or.WGS84.cartographicToCartesian(r,new ce),i=new sa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var uk=Wt(wu(),1),bYt=()=>({version:{path:"version",default:"1.0"}}),kBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,uk.default)(t,kBe()))}}),BBe=()=>({asset:{path:"asset",transform:e=>(0,uk.default)(e,bYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,uk.default)(e,kBe())}});function OBe(e,t){let r=new Float32Array(e.length),n=xYt(t);for(let i=0;i<e.length;i+=2){let a=e.subarray(i,i+2),o=n.slice(i*2,i*2+4),s=yYt([a[0],a[1]]),u=[o[2]-o[0],o[3]-o[1]],c=[s[0]*u[0],s[1]*u[1]],l=[c[0]+o[0],c[1]+o[1]];r[i]=l[0],r[i+1]=l[1]}return r}function yYt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function xYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var _Yt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),IBe=new ce,vw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return s8({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},tG)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),p=this._convertI3sMaterialToGLTFMaterial(o,f),h=l.addMaterial(p),d=s.positions,b=d.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=OBe(s.texCoords.value,s.uvRegions.value));let g=new ce(a),x=or.WGS84.cartesianToCartographic(g,new ce);s.positions.value=this._normalizePositions(b,g,x,c),this._createBatchIds(n,r),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let E=u||Q4(b.length/d.size),S=l.addMesh({attributes:s,indices:E,material:h,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),s8(l.gltf,Uq)}async _addI3sTextureToGLTF(t,r,n){let{texture:i,material:a,attributes:o}=t,s=null,u=i;if(!i&&a&&(u=a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.texture.source.image),u){let c=this._deduceMimeTypeFromFormat(r),l=n.addImage(u,c);s=n.addTexture({imageIndex:l}),delete o.colors}return s}_normalizePositions(t,r,n,i){let a=new Float32Array(t.length);for(let o=0;o<t.length;o+=3){let s=t.subarray(o,o+3),u=new ce(r),c=new ce(Array.from(s)).transform(i).add(n);or.WGS84.cartographicToCartesian(c,IBe),c=IBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(_Yt)}_createBatchIds(t,r){let{featureIds:n}=t,{OBJECTID:i}=r||{};if(!(!n||!i)){for(let a=0;a<n.length;a++){let o=n[a],s=i.indexOf(o);n[a]=s}t.attributes._BATCHID={size:1,byteOffset:0,value:n}}}_deduceMimeTypeFromFormat(t){switch(t){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${t}`),"image/jpeg"}}_convertI3sMaterialToGLTFMaterial(t,r){let n=r!==null;return t?(r!==null&&(t=this._setGLTFTexture(t,r)),t):(t={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},n?t.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],t)}_setGLTFTexture(t,r){let n={...t,pbrMetallicRoughness:{...t.pbrMetallicRoughness}};return t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?n.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.emissiveTexture?n.emissiveTexture={index:r,texCoord:0}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?n.pbrMetallicRoughness.metallicRoughnessTexture={index:r,texCoord:0}:t.normalTexture?n.normalTexture={index:r,texCoord:0}:t.occlusionTexture&&(n.occlusionTexture={index:r,texCoord:0}),n}_getFeaturesLength(t){if(!t)return 0;let r=Object.keys(t)[0];return r?t[r].length:0}_checkNormals(t){return t.find(r=>r)}};var PBe=async(e,t,r)=>{if(!e||!t.contentUrl)return null;let n={...r,i3s:{...r.i3s,isTileset:!1,isTileHeader:!1,_tileOptions:{attributeUrls:t.attributeUrls,textureUrl:t.textureUrl,textureFormat:t.textureFormat,textureLoaderOptions:t.textureLoaderOptions,materialDefinition:t.materialDefinition,isDracoGeometry:t.isDracoGeometry,mbs:t.mbs},_tilesetOptions:{store:e.store,attributeStorageInfo:e.attributeStorageInfo,fields:e.fields}}};return await An(t.contentUrl,Zl,n)};var wYt="I3S",sy=class{options;tilesetPath;vertexCounter;conversionStartTime;geoidHeightModel;sourceTileset;attributeStorageInfo;workerSource={};loaderOptions={_nodeWorkers:!0,reuseWorkers:!0,worker:!1,i3s:{coordinateSystem:3,decodeTextures:!1},"i3s-content":{workerUrl:"./modules/i3s/dist/i3s-content-worker-node.js"}};constructor(){this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null,this.workerSource={}}async convert(t){var f;if(gn)return console.log(ny),ny;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=ZW.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,ek),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,Zl,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=jW(s.mbs)),this.tilesetPath=(0,RBe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await lw(this.tilesetPath)}catch{}let u={boundingVolume:{box:QW(s.obb,this.geoidHeightModel)},geometricError:qW(s),children:[]};await this._addChildren(s,u,1);let c=(0,jBe.default)({root:u},BBe());await ki(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),La.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await PBe(this.sourceTileset,a,this.loaderOptions);if(!o){await this._addChildren(a,r,n+1);return}this.vertexCounter+=(o==null?void 0:o.vertexCount)||0;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.obb||(a.obb=jW(a.mbs));let u={box:QW(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:qW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},p=await new vw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await ki(this.tilesetPath,new Uint8Array(p),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(!(this.options.maxDepth&&n>this.options.maxDepth))for(let i of t.children||[])await this.convertChildNode(t,r,n,i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await An(a,Zl,o)}return n}_relativeUrlToFullUrl(t="",r){let n=t.split("/"),i=r.split("/");for(let a of i)switch(a){case".":continue;case"..":n=n.slice(0,-1);break;default:n.push(a)}return n.join("/")}async _loadChildAttributes(t,r){let n=[],{attributeUrls:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o],u=r[o],c={attributeName:u.name,attributeType:this._getAttributeType(u)};n.push(An(s,XW,c))}let a=await Promise.all(n);return this._replaceNestedArrays(a),Object.assign({},...a)}_getAttributeType(t){return t.attributeValues?t.attributeValues.valueType:t.objectIds?"Oid32":""}_replaceNestedArrays(t){for(let r=0;r<t.length;r++){let n=t[r];for(let i in n)n[i]=Array.from(n[i])}}async _finishConversion(t){let r=await X4(t),n=ZW.default.hrtime(this.conversionStartTime),i=Qb(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${wYt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var ck=require("path");var EYt="4.0.6",AYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",lk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(AYt,JU,{}),n=process.cwd();t&&(n=(0,ck.join)(n,t)),await ki(n,new Uint8Array(r["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader" worker'),await this.installFromNpm("i3s","i3s-content-worker-node.js"),console.log('Installing "Draco Loader" worker'),await this.installFromNpm("draco","draco-worker-node.js"),console.log('Installing "Draco Writer" worker'),await this.installFromNpm("draco","draco-writer-worker-node.js"),console.log('Installing "Basis Loader" worker'),await this.installFromNpm("textures","basis-worker-node.js"),console.log('Installing "KTX2 Basis Writer" worker'),await this.installFromNpm("textures","ktx2-basis-writer-worker-node.js"),console.log('Installing "Draco decoder" library'),await this.installFromUrl(Ep[ai.DECODER],"draco",ai.DECODER),await this.installFromUrl(Ep[ai.DECODER_WASM],"draco",ai.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Ep[ai.ENCODER],"draco",ai.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",wc.TRANSCODER,"libs"),await this.installFromNpm("textures",wc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",wc.ENCODER,"libs"),await this.installFromNpm("textures",wc.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new ll().start({command:process.platform==="win32"?"npm.cmd":"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installFromNpm(t,r,n=""){let a=await(await ko(`https://unpkg.com/@loaders.gl/${t}@${EYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,ck.join)(process.cwd(),"modules",t,"dist",n);await ki(o,a,r)}async installFromUrl(t,r,n){let a=await(await ko(t)).arrayBuffer();if(!a)return;let o=(0,ck.join)(process.cwd(),"modules",r,"dist","libs");await ki(o,a,n)}};function Tu(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function LBe(e,t){let r=Tu(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function MBe(e){return e.reduce((t,r)=>{let n=r.indexOf("="),i=r.slice(0,n),a=r.slice(n+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(i,a):t.concat(r)},[])}function qBe(e,t){let r=Tu(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Tu(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var eV={I3S:"I3S",_3DTILES:"3DTILES"};async function SYt(){let[,,...e]=process.argv;e.length===0&&tV();let t=MBe(e),r=DYt(t);if(r.installDependencies){new lk().install("deps");return}let n=CYt(r);await TYt(n)}SYt().catch(e=>{console.log(e),process.exit(1)});function tV(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--instant-node-writing [Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed]"),console.log("--split-nodes [Prevent to merge similar materials that could lead to incorrect visualization (I3S to 3DTiles conversion only)]"),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]"),console.log("--analyze [Analyze the input tileset content without conversion, default: false]"),console.log('--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'),console.log("--validate [Enable validation]"),process.exit(0)}async function TYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case eV.I3S:await new sy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case eV._3DTILES:await new iy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,mergeMaterials:e.mergeMaterials,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate,instantNodeWriting:e.instantNodeWriting,metadataClass:e.metadataClass,analyze:e.analyze,inquirer:UBe.default});break;default:tV()}}function CYt(e){let t={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:n=>Boolean(n)||Boolean(e.analyze)},output:{getMessage:()=>console.log("Missed: --output [Output path name]")},sevenZipExe:{getMessage:()=>console.log("Missed: --7zExe [7z archiver executable path]")},egm:{getMessage:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]")},tileset:{getMessage:()=>console.log("Missed: --tileset [tileset.json file]")},inputType:{getMessage:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]"),condition:n=>Boolean(n)&&Object.values(eV).includes(n.toUpperCase())}},r=[];for(let n in t){let i=e[n],a=t[n].condition;(a?a(i):i)||r.push(t[n].getMessage)}return r.length&&(r.forEach(n=>n()),process.exit(1)),e}function DYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,NBe.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Tu(n,e);break;case"--tileset":t.tileset=LBe(n,e);break;case"--name":t.name=Tu(n,e);break;case"--output":t.output=Tu(n,e);break;case"--instant-node-writing":t.instantNodeWriting=Nc(n,e);break;case"--split-nodes":t.mergeMaterials=Nc(n,e);break;case"--max-depth":t.maxDepth=qBe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Tu(n,e);break;case"--egm":t.egm=Tu(n,e);break;case"--token":t.token=Tu(n,e);break;case"--no-draco":t.draco=Nc(n,e);break;case"--validate":t.validate=Nc(n,e);break;case"--install-dependencies":t.installDependencies=Nc(n,e);break;case"--generate-textures":t.generateTextures=Nc(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Nc(n,e);break;case"--analyze":t.analyze=Nc(n,e);break;case"--metadata-class":t.metadataClass=Tu(n,e);break;case"--help":tV();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
180
180
|
/*! Bundled license information:
|
|
181
181
|
|
|
182
182
|
is-buffer/index.js:
|