@loaders.gl/i3s 4.3.2 → 4.3.4

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.
@@ -91,12 +91,12 @@ caused by: `+Br.fullStack(r):e.stack};Br.errorFromList=function(e){return wt.arr
91
91
  `,a(o),a(n.body),a(`\r
92
92
  `)}),a("--"+t.boundary+"--"),t.request.postambleCRLF&&a(`\r
93
93
  `),i};wu.prototype.onRequest=function(e){var r=this,t=r.isChunked(e),i=e.data||e;r.setHeaders(t),r.chunked=t,r.body=r.build(i,t)};i4.Multipart=wu});var c4=B(s4=>{"use strict";var o4=require("url"),KN=/^https?:/;function hp(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}hp.prototype.onRequest=function(e){var r=this;e.maxRedirects!==void 0&&(r.maxRedirects=e.maxRedirects),typeof e.followRedirect=="function"&&(r.allowRedirect=e.followRedirect),e.followRedirect!==void 0&&(r.followRedirects=!!e.followRedirect),e.followAllRedirects!==void 0&&(r.followAllRedirects=e.followAllRedirects),(r.followRedirects||r.followAllRedirects)&&(r.redirects=r.redirects||[]),e.removeRefererHeader!==void 0&&(r.removeRefererHeader=e.removeRefererHeader),e.followOriginalHttpMethod!==void 0&&(r.followOriginalHttpMethod=e.followOriginalHttpMethod)};hp.prototype.redirectTo=function(e){var r=this,t=r.request,i=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var a=e.caseless.get("location");if(t.debug("redirect",a),r.followAllRedirects)i=a;else if(r.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:i=a;break}}else if(e.statusCode===401){var n=t._auth.onResponse(e);n&&(t.setHeader("authorization",n),i=t.uri)}return i};hp.prototype.onResponse=function(e){var r=this,t=r.request,i=r.redirectTo(e);if(!i||!r.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",i),e.resume&&e.resume(),r.redirectsFollowed>=r.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;r.redirectsFollowed+=1,KN.test(i)||(i=o4.resolve(t.uri.href,i));var a=t.uri;return t.uri=o4.parse(i),t.uri.protocol!==a.protocol&&delete t.agent,r.redirects.push({statusCode:e.statusCode,redirectUri:i}),r.followAllRedirects&&t.method!=="HEAD"&&e.statusCode!==401&&e.statusCode!==307&&(t.method=r.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,e.statusCode!==401&&e.statusCode!==307&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),r.removeRefererHeader||t.setHeader("referer",a.href),t.emit("redirect"),t.init(),!0};s4.Redirect=hp});var p4=B(tc=>{"use strict";var nee=require("net"),$N=require("tls"),Dg=require("http"),u4=require("https"),WN=require("events"),XN=require("assert"),YN=require("util"),QN=As().Buffer;tc.httpOverHttp=JN;tc.httpsOverHttp=ZN;tc.httpOverHttps=eU;tc.httpsOverHttps=rU;function JN(e){var r=new $i(e);return r.request=Dg.request,r}function ZN(e){var r=new $i(e);return r.request=Dg.request,r.createSocket=l4,r.defaultPort=443,r}function eU(e){var r=new $i(e);return r.request=u4.request,r}function rU(e){var r=new $i(e);return r.request=u4.request,r.createSocket=l4,r.defaultPort=443,r}function $i(e){var r=this;r.options=e||{},r.proxyOptions=r.options.proxy||{},r.maxSockets=r.options.maxSockets||Dg.Agent.defaultMaxSockets,r.requests=[],r.sockets=[],r.on("free",function(i,a,n){for(var o=0,s=r.requests.length;o<s;++o){var c=r.requests[o];if(c.host===a&&c.port===n){r.requests.splice(o,1),c.request.onSocket(i);return}}i.destroy(),r.removeSocket(i)})}YN.inherits($i,WN.EventEmitter);$i.prototype.addRequest=function(r,t){var i=this;if(typeof t=="string"&&(t={host:t,port:arguments[2],path:arguments[3]}),i.sockets.length>=this.maxSockets){i.requests.push({host:t.host,port:t.port,request:r});return}i.createConnection({host:t.host,port:t.port,request:r})};$i.prototype.createConnection=function(r){var t=this;t.createSocket(r,function(i){i.on("free",a),i.on("close",n),i.on("agentRemove",n),r.request.onSocket(i);function a(){t.emit("free",i,r.host,r.port)}function n(o){t.removeSocket(i),i.removeListener("free",a),i.removeListener("close",n),i.removeListener("agentRemove",n)}})};$i.prototype.createSocket=function(r,t){var i=this,a={};i.sockets.push(a);var n=f4({},i.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:!1});n.proxyAuth&&(n.headers=n.headers||{},n.headers["Proxy-Authorization"]="Basic "+QN.from(n.proxyAuth).toString("base64")),zo("making CONNECT request");var o=i.request(n);o.useChunkedEncodingByDefault=!1,o.once("response",s),o.once("upgrade",c),o.once("connect",u),o.once("error",l),o.end();function s(h){h.upgrade=!0}function c(h,p,d){process.nextTick(function(){u(h,p,d)})}function u(h,p,d){if(o.removeAllListeners(),p.removeAllListeners(),h.statusCode===200)XN.equal(d.length,0),zo("tunneling connection has established"),i.sockets[i.sockets.indexOf(a)]=p,t(p);else{zo("tunneling socket could not be established, statusCode=%d",h.statusCode);var v=new Error("tunneling socket could not be established, statusCode="+h.statusCode);v.code="ECONNRESET",r.request.emit("error",v),i.removeSocket(a)}}function l(h){o.removeAllListeners(),zo(`tunneling socket could not be established, cause=%s
94
- `,h.message,h.stack);var p=new Error("tunneling socket could not be established, cause="+h.message);p.code="ECONNRESET",r.request.emit("error",p),i.removeSocket(a)}};$i.prototype.removeSocket=function(r){var t=this.sockets.indexOf(r);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createConnection(i)}};function l4(e,r){var t=this;$i.prototype.createSocket.call(t,e,function(i){var a=$N.connect(0,f4({},t.options,{servername:e.host,socket:i}));t.sockets[t.sockets.indexOf(i)]=a,r(a)})}function f4(e){for(var r=1,t=arguments.length;r<t;++r){var i=arguments[r];if(typeof i=="object")for(var a=Object.keys(i),n=0,o=a.length;n<o;++n){var s=a[n];i[s]!==void 0&&(e[s]=i[s])}}return e}var zo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?zo=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:zo=function(){};tc.debug=zo});var g4=B(m4=>{"use strict";var tU=require("url"),aU=p4(),h4=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],d4=["proxy-authorization"];function iU(e){var r=e.port,t=e.protocol,i=e.hostname+":";return r?i+=r:t==="https:"?i+="443":i+="80",i}function nU(e,r){var t=r.reduce(function(i,a){return i[a.toLowerCase()]=!0,i},{});return Object.keys(e).filter(function(i){return t[i.toLowerCase()]}).reduce(function(i,a){return i[a]=e[a],i},{})}function oU(e,r){var t=e.proxy,i={proxy:{host:t.hostname,port:+t.port,proxyAuth:t.auth,headers:r},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return i}function sU(e,r){var t=e.protocol==="https:"?"https":"http",i=r.protocol==="https:"?"Https":"Http";return[t,i].join("Over")}function cU(e){var r=e.uri,t=e.proxy,i=sU(r,t);return aU[i]}function ku(e){this.request=e,this.proxyHeaderWhiteList=h4,this.proxyHeaderExclusiveList=[],typeof e.tunnel<"u"&&(this.tunnelOverride=e.tunnel)}ku.prototype.isEnabled=function(){var e=this,r=e.request;return typeof e.tunnelOverride<"u"?e.tunnelOverride:r.uri.protocol==="https:"};ku.prototype.setup=function(e){var r=this,t=r.request;if(e=e||{},typeof t.proxy=="string"&&(t.proxy=tU.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(r.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(r.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var i=r.proxyHeaderExclusiveList.concat(d4),a=r.proxyHeaderWhiteList.concat(i),n=nU(t.headers,a);n.host=iU(t.uri),i.forEach(t.removeHeader,t);var o=cU(t),s=oU(t,n);return t.agent=o(s),!0};ku.defaultProxyHeaderWhiteList=h4;ku.defaultProxyHeaderExclusiveList=d4;m4.Tunnel=ku});var y4=B((v4,Su)=>{(function(){var e,r,t,i,a,n;typeof performance<"u"&&performance!==null&&performance.now?Su.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Su.exports=function(){return(e()-a)/1e6},r=process.hrtime,e=function(){var o;return o=r(),o[0]*1e9+o[1]},i=e(),n=process.uptime()*1e9,a=i-n):Date.now?(Su.exports=function(){return Date.now()-t},t=Date.now()):(Su.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(v4)});var R4=B((cee,T4)=>{"use strict";var uU=require("http"),w4=require("https"),Eu=require("url"),zg=require("util"),mp=require("stream"),dp=require("zlib"),qg=nw(),lU=dw(),fU=iS(),pU=zf(),k4=Nf(),b4=hS(),hU=NS(),dU=Dl(),x4=tg(),mU=$S().strict,ic=Hl(),gU=hm(),vU=YS(),yU=cE().Querystring,bU=M8().Har,xU=G8().Auth,_U=t4().OAuth,wU=a4(),kU=n4().Multipart,SU=c4().Redirect,Ng=g4().Tunnel,ac=y4(),Au=As().Buffer,_4=ic.safeStringify,EU=ic.isReadStream,AU=ic.toBase64,jU=ic.defer,S4=ic.copy,TU=ic.version,E4=gU.jar(),A4={};function RU(e,r){var t={};for(var i in r){var a=e.indexOf(i)===-1;a&&(t[i]=r[i])}return t}function PU(e,r){var t={};for(var i in r){var a=e.indexOf(i)!==-1,n=typeof r[i]=="function";a&&n||(t[i]=r[i])}return t}function j4(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function OU(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:j4.call(e.request)}}function Sr(e){var r=this;e.har&&(r._har=new bU(r),e=r._har.options(e)),mp.Stream.call(r);var t=Object.keys(Sr.prototype),i=RU(t,e);dU(r,i),e=PU(t,e),r.readable=!0,r.writable=!0,e.method&&(r.explicitMethod=!0),r._qs=new yU(r),r._auth=new xU(r),r._oauth=new _U(r),r._multipart=new kU(r),r._redirect=new SU(r),r._tunnel=new Ng(r),r.init(e)}zg.inherits(Sr,mp.Stream);Sr.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function zt(){Sr.debug&&console.error("REQUEST %s",zg.format.apply(zg,arguments))}Sr.prototype.debug=zt;Sr.prototype.init=function(e){var r=this;e||(e={}),r.headers=r.headers?S4(r.headers):{};for(var t in r.headers)typeof r.headers[t]>"u"&&delete r.headers[t];if(k4.httpify(r,r.headers),r.method||(r.method=e.method||"GET"),r.localAddress||(r.localAddress=e.localAddress),r._qs.init(e),zt(e),!r.pool&&r.pool!==!1&&(r.pool=A4),r.dests=r.dests||[],r.__isRequestRequest=!0,!r._callback&&r.callback&&(r._callback=r.callback,r.callback=function(){r._callbackCalled||(r._callbackCalled=!0,r._callback.apply(r,arguments))},r.on("error",r.callback.bind()),r.on("complete",r.callback.bind(r,null))),!r.uri&&r.url&&(r.uri=r.url,delete r.url),r.baseUrl){if(typeof r.baseUrl!="string")return r.emit("error",new Error("options.baseUrl must be a string"));if(typeof r.uri!="string")return r.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(r.uri.indexOf("//")===0||r.uri.indexOf("://")!==-1)return r.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var i=r.baseUrl.lastIndexOf("/")===r.baseUrl.length-1,a=r.uri.indexOf("/")===0;i&&a?r.uri=r.baseUrl+r.uri.slice(1):i||a?r.uri=r.baseUrl+r.uri:r.uri===""?r.uri=r.baseUrl:r.uri=r.baseUrl+"/"+r.uri,delete r.baseUrl}if(!r.uri)return r.emit("error",new Error("options.uri is a required argument"));if(typeof r.uri=="string"&&(r.uri=Eu.parse(r.uri)),r.uri.href||(r.uri.href=Eu.format(r.uri)),r.uri.protocol==="unix:")return r.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(r.uri.host==="unix"&&r.enableUnixSocket(),r.strictSSL===!1&&(r.rejectUnauthorized=!1),r.uri.pathname||(r.uri.pathname="/"),!(r.uri.host||r.uri.hostname&&r.uri.port)&&!r.uri.isUnix){var n=Eu.format(r.uri),o='Invalid URI "'+n+'"';return Object.keys(e).length===0&&(o+=". This can be caused by a crappy redirection."),r.abort(),r.emit("error",new Error(o))}if(r.hasOwnProperty("proxy")||(r.proxy=vU(r.uri)),r.tunnel=r._tunnel.isEnabled(),r.proxy&&r._tunnel.setup(e),r._redirect.onRequest(e),r.setHost=!1,!r.hasHeader("host")){var s=r.originalHostHeaderName||"host";r.setHeader(s,r.uri.host),r.uri.port&&(r.uri.port==="80"&&r.uri.protocol==="http:"||r.uri.port==="443"&&r.uri.protocol==="https:")&&r.setHeader(s,r.uri.hostname),r.setHost=!0}if(r.jar(r._jar||e.jar),r.uri.port||(r.uri.protocol==="http:"?r.uri.port=80:r.uri.protocol==="https:"&&(r.uri.port=443)),r.proxy&&!r.tunnel?(r.port=r.proxy.port,r.host=r.proxy.hostname):(r.port=r.uri.port,r.host=r.uri.hostname),e.form&&r.form(e.form),e.formData){var c=e.formData,u=r.form(),l=function(P,C){C&&C.hasOwnProperty("value")&&C.hasOwnProperty("options")?u.append(P,C.value,C.options):u.append(P,C)};for(var h in c)if(c.hasOwnProperty(h)){var p=c[h];if(p instanceof Array)for(var d=0;d<p.length;d++)l(h,p[d]);else l(h,p)}}if(e.qs&&r.qs(e.qs),r.uri.path?r.path=r.uri.path:r.path=r.uri.pathname+(r.uri.search||""),r.path.length===0&&(r.path="/"),e.aws&&r.aws(e.aws),e.hawk&&r.hawk(e.hawk),e.httpSignature&&r.httpSignature(e.httpSignature),e.auth&&(Object.prototype.hasOwnProperty.call(e.auth,"username")&&(e.auth.user=e.auth.username),Object.prototype.hasOwnProperty.call(e.auth,"password")&&(e.auth.pass=e.auth.password),r.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)),r.gzip&&!r.hasHeader("accept-encoding")&&r.setHeader("accept-encoding","gzip, deflate"),r.uri.auth&&!r.hasHeader("authorization")){var v=r.uri.auth.split(":").map(function(P){return r._qs.unescape(P)});r.auth(v[0],v.slice(1).join(":"),!0)}if(!r.tunnel&&r.proxy&&r.proxy.auth&&!r.hasHeader("proxy-authorization")){var x=r.proxy.auth.split(":").map(function(P){return r._qs.unescape(P)}),y="Basic "+AU(x.join(":"));r.setHeader("proxy-authorization",y)}r.proxy&&!r.tunnel&&(r.path=r.uri.protocol+"//"+r.uri.host+r.path),e.json&&r.json(e.json),e.multipart&&r.multipart(e.multipart),e.time&&(r.timing=!0,r.elapsedTime=r.elapsedTime||0);function E(){if(mU(r.body)&&(r.body=Au.from(r.body)),!r.hasHeader("content-length")){var P;typeof r.body=="string"?P=Au.byteLength(r.body):Array.isArray(r.body)?P=r.body.reduce(function(C,I){return C+I.length},0):P=r.body.length,P?r.setHeader("content-length",P):r.emit("error",new Error("Argument error, options.body."))}}r.body&&!x4(r.body)&&E(),e.oauth?r.oauth(e.oauth):r._oauth.params&&r.hasHeader("authorization")&&r.oauth(r._oauth.params);var A=r.proxy&&!r.tunnel?r.proxy.protocol:r.uri.protocol,S={"http:":uU,"https:":w4},R=r.httpModules||{};if(r.httpModule=R[A]||S[A],!r.httpModule)return r.emit("error",new Error("Invalid protocol: "+A));if(e.ca&&(r.ca=e.ca),!r.agent)if(e.agentOptions&&(r.agentOptions=e.agentOptions),e.agentClass)r.agentClass=e.agentClass;else if(e.forever){var j=TU();j.major===0&&j.minor<=10?r.agentClass=A==="http:"?b4:b4.SSL:(r.agentClass=r.httpModule.Agent,r.agentOptions=r.agentOptions||{},r.agentOptions.keepAlive=!0)}else r.agentClass=r.httpModule.Agent;r.pool===!1?r.agent=!1:r.agent=r.agent||r.getNewAgent(),r.on("pipe",function(P){if(r.ntick&&r._started&&r.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),r.src=P,EU(P))r.hasHeader("content-type")||r.setHeader("content-type",pU.lookup(P.path));else{if(P.headers)for(var C in P.headers)r.hasHeader(C)||r.setHeader(C,P.headers[C]);r._json&&!r.hasHeader("content-type")&&r.setHeader("content-type","application/json"),P.method&&!r.explicitMethod&&(r.method=P.method)}}),jU(function(){if(!r._aborted){var P=function(){if(r._form&&(r._auth.hasAuth?r._auth.hasAuth&&r._auth.sentAuth&&r._form.pipe(r):r._form.pipe(r)),r._multipart&&r._multipart.chunked&&r._multipart.body.pipe(r),r.body)x4(r.body)?r.body.pipe(r):(E(),Array.isArray(r.body)?r.body.forEach(function(C){r.write(C)}):r.write(r.body),r.end());else if(r.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),r.requestBodyStream.pipe(r);else if(!r.src){if(r._auth.hasAuth&&!r._auth.sentAuth){r.end();return}r.method!=="GET"&&typeof r.method<"u"&&r.setHeader("content-length",0),r.end()}};r._form&&!r.hasHeader("content-length")?(r.setHeader(r._form.getHeaders(),!0),r._form.getLength(function(C,I){!C&&!isNaN(I)&&r.setHeader("content-length",I),P()})):P(),r.ntick=!0}})};Sr.prototype.getNewAgent=function(){var e=this,r=e.agentClass,t={};if(e.agentOptions)for(var i in e.agentOptions)t[i]=e.agentOptions[i];e.ca&&(t.ca=e.ca),e.ciphers&&(t.ciphers=e.ciphers),e.secureProtocol&&(t.secureProtocol=e.secureProtocol),e.secureOptions&&(t.secureOptions=e.secureOptions),typeof e.rejectUnauthorized<"u"&&(t.rejectUnauthorized=e.rejectUnauthorized),e.cert&&e.key&&(t.key=e.key,t.cert=e.cert),e.pfx&&(t.pfx=e.pfx),e.passphrase&&(t.passphrase=e.passphrase);var a="";r!==e.httpModule.Agent&&(a+=r.name);var n=e.proxy;typeof n=="string"&&(n=Eu.parse(n));var o=n&&n.protocol==="https:"||this.uri.protocol==="https:";return o&&(t.ca&&(a&&(a+=":"),a+=t.ca),typeof t.rejectUnauthorized<"u"&&(a&&(a+=":"),a+=t.rejectUnauthorized),t.cert&&(a&&(a+=":"),a+=t.cert.toString("ascii")+t.key.toString("ascii")),t.pfx&&(a&&(a+=":"),a+=t.pfx.toString("ascii")),t.ciphers&&(a&&(a+=":"),a+=t.ciphers),t.secureProtocol&&(a&&(a+=":"),a+=t.secureProtocol),t.secureOptions&&(a&&(a+=":"),a+=t.secureOptions)),e.pool===A4&&!a&&Object.keys(t).length===0&&e.httpModule.globalAgent?e.httpModule.globalAgent:(a=e.uri.protocol+a,e.pool[a]||(e.pool[a]=new r(t),e.pool.maxSockets&&(e.pool[a].maxSockets=e.pool.maxSockets)),e.pool[a])};Sr.prototype.start=function(){var e=this;if(e.timing)var r=new Date().getTime(),t=ac();if(!e._aborted){e._started=!0,e.method=e.method||"GET",e.href=e.uri.href,e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")&&e.setHeader("content-length",e.src.stat.size),e._aws&&e.aws(e._aws,!0);var i=S4(e);delete i.auth,zt("make request",e.uri.href),delete i.timeout;try{e.req=e.httpModule.request(i)}catch(n){e.emit("error",n);return}e.timing&&(e.startTime=r,e.startTimeNow=t,e.timings={});var a;e.timeout&&!e.timeoutTimer&&(e.timeout<0?a=0:typeof e.timeout=="number"&&isFinite(e.timeout)&&(a=e.timeout)),e.req.on("response",e.onRequestResponse.bind(e)),e.req.on("error",e.onRequestError.bind(e)),e.req.on("drain",function(){e.emit("drain")}),e.req.on("socket",function(n){var o=n._connecting||n.connecting;if(e.timing&&(e.timings.socket=ac()-e.startTimeNow,o)){var s=function(){e.timings.lookup=ac()-e.startTimeNow},c=function(){e.timings.connect=ac()-e.startTimeNow};n.once("lookup",s),n.once("connect",c),e.req.once("error",function(){n.removeListener("lookup",s),n.removeListener("connect",c)})}var u=function(){e.req.setTimeout(a,function(){if(e.req){e.abort();var h=new Error("ESOCKETTIMEDOUT");h.code="ESOCKETTIMEDOUT",h.connect=!1,e.emit("error",h)}})};if(a!==void 0)if(o){var l=function(){n.removeListener("connect",l),e.clearTimeout(),u()};n.on("connect",l),e.req.on("error",function(h){n.removeListener("connect",l)}),e.timeoutTimer=setTimeout(function(){n.removeListener("connect",l),e.abort();var h=new Error("ETIMEDOUT");h.code="ETIMEDOUT",h.connect=!0,e.emit("error",h)},a)}else u();e.emit("socket",n)}),e.emit("request",e.req)}};Sr.prototype.onRequestError=function(e){var r=this;if(!r._aborted){if(r.req&&r.req._reusedSocket&&e.code==="ECONNRESET"&&r.agent.addRequestNoreuse){r.agent={addRequest:r.agent.addRequestNoreuse.bind(r.agent)},r.start(),r.req.end();return}r.clearTimeout(),r.emit("error",e)}};Sr.prototype.onRequestResponse=function(e){var r=this;if(r.timing&&(r.timings.response=ac()-r.startTimeNow),zt("onRequestResponse",r.uri.href,e.statusCode,e.headers),e.on("end",function(){r.timing&&(r.timings.end=ac()-r.startTimeNow,e.timingStart=r.startTime,r.timings.socket||(r.timings.socket=0),r.timings.lookup||(r.timings.lookup=r.timings.socket),r.timings.connect||(r.timings.connect=r.timings.lookup),r.timings.response||(r.timings.response=r.timings.connect),zt("elapsed time",r.timings.end),r.elapsedTime+=Math.round(r.timings.end),e.elapsedTime=r.elapsedTime,e.timings=r.timings,e.timingPhases={wait:r.timings.socket,dns:r.timings.lookup-r.timings.socket,tcp:r.timings.connect-r.timings.lookup,firstByte:r.timings.response-r.timings.connect,download:r.timings.end-r.timings.response,total:r.timings.end}),zt("response end",r.uri.href,e.statusCode,e.headers)}),r._aborted){zt("aborted",r.uri.href),e.resume();return}if(r.response=e,e.request=r,e.toJSON=OU,r.httpModule===w4&&r.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){zt("strict ssl error",r.uri.href);var t=e.hasOwnProperty("socket")?e.socket.authorizationError:r.uri.href+" does not support SSL";r.emit("error",new Error("SSL Error: "+t));return}r.originalHost=r.getHeader("host"),r.originalHostHeaderName||(r.originalHostHeaderName=r.hasHeader("host")),r.setHost&&r.removeHeader("host"),r.clearTimeout();var i=r._jar&&r._jar.setCookie?r._jar:E4,a=function(l){try{i.setCookie(l,r.uri.href,{ignoreError:!0})}catch(h){r.emit("error",h)}};if(e.caseless=k4(e.headers),e.caseless.has("set-cookie")&&!r._disableCookies){var n=e.caseless.has("set-cookie");Array.isArray(e.headers[n])?e.headers[n].forEach(a):a(e.headers[n])}if(!r._redirect.onResponse(e)){{e.on("close",function(){r._ended||r.response.emit("end")}),e.once("end",function(){r._ended=!0});var o=function(l){return r.method==="HEAD"||l>=100&&l<200||l===204||l===304},s;if(r.gzip&&!o(e.statusCode)){var c=e.headers["content-encoding"]||"identity";c=c.trim().toLowerCase();var u={flush:dp.Z_SYNC_FLUSH,finishFlush:dp.Z_SYNC_FLUSH};c==="gzip"?(s=dp.createGunzip(u),e.pipe(s)):c==="deflate"?(s=dp.createInflate(u),e.pipe(s)):(c!=="identity"&&zt("ignoring unrecognized Content-Encoding "+c),s=e)}else s=e;r.encoding&&(r.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):s.setEncoding(r.encoding)),r._paused&&s.pause(),r.responseContent=s,r.emit("response",e),r.dests.forEach(function(l){r.pipeDest(l)}),s.on("data",function(l){r.timing&&!r.responseStarted&&(r.responseStartTime=new Date().getTime(),e.responseStartTime=r.responseStartTime),r._destdata=!0,r.emit("data",l)}),s.once("end",function(l){r.emit("end",l)}),s.on("error",function(l){r.emit("error",l)}),s.on("close",function(){r.emit("close")}),r.callback?r.readResponseBody(e):r.on("end",function(){if(r._aborted){zt("aborted",r.uri.href);return}r.emit("complete",e)})}zt("finish init function",r.uri.href)}};Sr.prototype.readResponseBody=function(e){var r=this;zt("reading response's body");var t=[],i=0,a=[];r.on("data",function(n){Au.isBuffer(n)?n.length&&(i+=n.length,t.push(n)):a.push(n)}),r.on("end",function(){if(zt("end event",r.uri.href),r._aborted){zt("aborted",r.uri.href),t=[],i=0;return}if(i?(zt("has body",r.uri.href,i),e.body=Au.concat(t,i),r.encoding!==null&&(e.body=e.body.toString(r.encoding)),t=[],i=0):a.length&&(r.encoding==="utf8"&&a[0].length>0&&a[0][0]==="\uFEFF"&&(a[0]=a[0].substring(1)),e.body=a.join("")),r._json)try{e.body=JSON.parse(e.body,r._jsonReviver)}catch{zt("invalid JSON received",r.uri.href)}zt("emitting complete",r.uri.href),typeof e.body>"u"&&!r._json&&(e.body=r.encoding===null?Au.alloc(0):""),r.emit("complete",e,e.body)})};Sr.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")};Sr.prototype.pipeDest=function(e){var r=this,t=r.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var i=t.caseless.has("content-type");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}if(t.caseless.has("content-length")){var a=t.caseless.has("content-length");e.setHeader?e.setHeader(a,t.headers[a]):e.headers[a]=t.headers[a]}}if(e.setHeader&&!e.headersSent){for(var n in t.headers)(!r.gzip||n!=="content-encoding")&&e.setHeader(n,t.headers[n]);e.statusCode=t.statusCode}r.pipefilter&&r.pipefilter(t,e)};Sr.prototype.qs=function(e,r){var t=this,i;!r&&t.uri.query?i=t._qs.parse(t.uri.query):i={};for(var a in e)i[a]=e[a];var n=t._qs.stringify(i);return n===""||(t.uri=Eu.parse(t.uri.href.split("?")[0]+"?"+n),t.url=t.uri,t.path=t.uri.path,t.uri.host==="unix"&&t.enableUnixSocket()),t};Sr.prototype.form=function(e){var r=this;return e?(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))||r.setHeader("content-type","application/x-www-form-urlencoded"),r.body=typeof e=="string"?r._qs.rfc3986(e.toString("utf8")):r._qs.stringify(e).toString("utf8"),r):(r._form=new hU,r._form.on("error",function(t){t.message="form-data: "+t.message,r.emit("error",t),r.abort()}),r._form)};Sr.prototype.multipart=function(e){var r=this;return r._multipart.onRequest(e),r._multipart.chunked||(r.body=r._multipart.body),r};Sr.prototype.json=function(e){var r=this;return r.hasHeader("accept")||r.setHeader("accept","application/json"),typeof r.jsonReplacer=="function"&&(r._jsonReplacer=r.jsonReplacer),r._json=!0,typeof e=="boolean"?r.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))?r.body=r._qs.rfc3986(r.body):r.body=_4(r.body,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")):(r.body=_4(e,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")),typeof r.jsonReviver=="function"&&(r._jsonReviver=r.jsonReviver),r};Sr.prototype.getHeader=function(e,r){var t=this,i,a,n;return r||(r=t.headers),Object.keys(r).forEach(function(o){o.length===e.length&&(a=new RegExp(e,"i"),n=o.match(a),n&&(i=r[o]))}),i};Sr.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),r=e[0],t=e[1];this.socketPath=r,this.uri.pathname=t,this.uri.path=t,this.uri.host=r,this.uri.hostname=r,this.uri.isUnix=!0};Sr.prototype.auth=function(e,r,t,i){var a=this;return a._auth.onRequest(e,r,t,i),a};Sr.prototype.aws=function(e,r){var t=this;if(!r)return t._aws=e,t;if(e.sign_version===4||e.sign_version==="4"){var i={host:t.uri.host,path:t.uri.path,method:t.method,headers:t.headers,body:t.body};e.service&&(i.service=e.service);var a=lU.sign(i,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});t.setHeader("authorization",a.headers.Authorization),t.setHeader("x-amz-date",a.headers["X-Amz-Date"]),a.headers["X-Amz-Security-Token"]&&t.setHeader("x-amz-security-token",a.headers["X-Amz-Security-Token"])}else{var n=new Date;t.setHeader("date",n.toUTCString());var o={key:e.key,secret:e.secret,verb:t.method.toUpperCase(),date:n,contentType:t.getHeader("content-type")||"",md5:t.getHeader("content-md5")||"",amazonHeaders:qg.canonicalizeHeaders(t.headers)},s=t.uri.path;e.bucket&&s?o.resource="/"+e.bucket+s:e.bucket&&!s?o.resource="/"+e.bucket:!e.bucket&&s?o.resource=s:!e.bucket&&!s&&(o.resource="/"),o.resource=qg.canonicalizeResource(o.resource),t.setHeader("authorization",qg.authorization(o))}return t};Sr.prototype.httpSignature=function(e){var r=this;return fU.signRequest({getHeader:function(t){return r.getHeader(t,r.headers)},setHeader:function(t,i){r.setHeader(t,i)},method:r.method,path:r.path},e),zt("httpSignature authorization",r.getHeader("authorization")),r};Sr.prototype.hawk=function(e){var r=this;r.setHeader("Authorization",wU.header(r.uri,r.method,e))};Sr.prototype.oauth=function(e){var r=this;return r._oauth.onRequest(e),r};Sr.prototype.jar=function(e){var r=this,t;if(r._redirect.redirectsFollowed===0&&(r.originalCookieHeader=r.getHeader("cookie")),!e)t=!1,r._disableCookies=!0;else{var i=e.getCookieString?e:E4,a=r.uri.href;i&&(t=i.getCookieString(a))}return t&&t.length&&(r.originalCookieHeader?r.setHeader("cookie",r.originalCookieHeader+"; "+t):r.setHeader("cookie",t)),r._jar=e,r};Sr.prototype.pipe=function(e,r){var t=this;if(t.response)if(t._destdata)t.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(t._ended)t.emit("error",new Error("You cannot pipe after the response has been ended."));else return mp.Stream.prototype.pipe.call(t,e,r),t.pipeDest(e),e;else return t.dests.push(e),mp.Stream.prototype.pipe.call(t,e,r),e};Sr.prototype.write=function(){var e=this;if(!e._aborted&&(e._started||e.start(),e.req))return e.req.write.apply(e.req,arguments)};Sr.prototype.end=function(e){var r=this;r._aborted||(e&&r.write(e),r._started||r.start(),r.req&&r.req.end())};Sr.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0};Sr.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1};Sr.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()};Sr.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)};Sr.defaultProxyHeaderWhiteList=Ng.defaultProxyHeaderWhiteList.slice();Sr.defaultProxyHeaderExclusiveList=Ng.defaultProxyHeaderExclusiveList.slice();Sr.prototype.toJSON=j4;T4.exports=Sr});var C4=B((uee,O4)=>{"use strict";var ju=Dl(),P4=hm(),CU=Hl(),BU=CU.paramsHaveRequestBody;function gp(e,r,t){typeof r=="function"&&(t=r);var i={};return r!==null&&typeof r=="object"?ju(i,r,{uri:e}):typeof e=="string"?ju(i,{uri:e}):ju(i,e),i.callback=t||i.callback,i}function dt(e,r,t){if(typeof e>"u")throw new Error("undefined is not a valid uri or options object.");var i=gp(e,r,t);if(i.method==="HEAD"&&BU(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new dt.Request(i)}function fo(e){var r=e.toUpperCase();return function(t,i,a){var n=gp(t,i,a);return n.method=r,dt(n,n.callback)}}dt.get=fo("get");dt.head=fo("head");dt.options=fo("options");dt.post=fo("post");dt.put=fo("put");dt.patch=fo("patch");dt.del=fo("delete");dt.delete=fo("delete");dt.jar=function(e){return P4.jar(e)};dt.cookie=function(e){return P4.parse(e)};function Ug(e,r,t,i){return function(a,n,o){var s=gp(a,n,o),c={};return ju(!0,c,r,s),c.pool=s.pool||r.pool,i&&(c.method=i.toUpperCase()),typeof t=="function"&&(e=t),e(c,c.callback)}}dt.defaults=function(e,r){var t=this;e=e||{},typeof e=="function"&&(r=e,e={});var i=Ug(t,e,r),a=["get","head","post","put","patch","del","delete"];return a.forEach(function(n){i[n]=Ug(t[n],e,r,n)}),i.cookie=Ug(t.cookie,e,r),i.jar=t.jar,i.defaults=t.defaults,i};dt.forever=function(e,r){var t={};return r&&ju(t,r),e&&(t.agentOptions=e),t.forever=!0,dt.defaults(t)};O4.exports=dt;dt.Request=R4();dt.initParams=gp;Object.defineProperty(dt,"debug",{enumerable:!0,get:function(){return dt.Request.debug},set:function(e){dt.Request.debug=e}})});var F4=B((lee,B4)=>{B4.exports=FU;function FU(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var r=e.indexOf(",");if(r===-1||r<=4)throw new TypeError("malformed data: URI");for(var t=e.substring(5,r).split(";"),i=!1,a="US-ASCII",n=0;n<t.length;n++)t[n]=="base64"?i=!0:t[n].indexOf("charset=")==0&&(a=t[n].substring(8));var o=unescape(e.substring(r+1)),s=i?"base64":"ascii",c=new Buffer(o,s);return c.type=t[0]||"text/plain",c.charset=a,c}});var L4=B((fee,M4)=>{var IU=F4();function MU(e){return{mimeType:DU(LU(e)),data:IU(e)}}function LU(e){return e.substring(5,e.indexOf(";"))}var I4=/^(\w+\/)+/;function DU(e){e=e.toLowerCase();var r=e.match(I4);return!r||!(r=r[1])?e:e.replace(I4,r)}M4.exports=MU});var q4=B((hee,D4)=>{"use strict";var Tu=Bc(),pee=require("path"),qU=a2().PNG,zU=xd(),NU=c2(),UU=l2().GifReader,HU=m2(),VU=require("fs"),GU=C4(),KU=zf(),$U=L4();function WU(e,r){var t=new qU;t.parse(e,function(i,a){if(i){r(i);return}r(null,Tu(new Uint8Array(a.data),[a.width|0,a.height|0,4],[4,4*a.width|0,1],0))})}function XU(e,r){var t;try{t=zU.decode(e)}catch(n){r(n);return}if(!t){r(new Error("Error decoding jpeg"));return}var i=[t.height,t.width,4],a=Tu(t.data,i);r(null,a.transpose(1,0))}function YU(e,r){var t;try{t=new UU(e)}catch(s){r(s);return}if(t.numFrames()>0){var i=[t.numFrames(),t.height,t.width,4];try{var a=new Uint8Array(i[0]*i[1]*i[2]*i[3])}catch(s){r(s);return}var n=Tu(a,i);try{for(var o=0;o<t.numFrames();++o)t.decodeAndBlitFrameRGBA(o,a.subarray(n.index(o,0,0,0),n.index(o+1,0,0,0)))}catch(s){r(s);return}r(null,n.transpose(0,2,1))}else{var i=[t.height,t.width,4],a=new Uint8Array(i[0]*i[1]*i[2]),n=Tu(a,i);try{t.decodeAndBlitFrameRGBA(0,a)}catch(l){r(l);return}r(null,n.transpose(1,0))}}function QU(e,r){var t=new HU(e);try{t.init()}catch(s){r(s);return}var i=t.getData(),a=[i.getHeight(),i.getWidth(),4],n=new Uint8Array(a[0]*a[1]*a[2]),o=Tu(n,a);NU(i,o),r(null,o.transpose(1,0))}function vp(e,r,t){switch(e){case"image/png":WU(r,t);break;case"image/jpg":case"image/jpeg":XU(r,t);break;case"image/gif":YU(r,t);break;case"image/bmp":QU(r,t);break;default:t(new Error("Unsupported file type: "+e))}}D4.exports=function(r,t,i){if(i||(i=t,t=""),Buffer.isBuffer(r)){if(!t){i(new Error("Invalid file type"));return}vp(t,r,i)}else if(r.indexOf("data:")===0)try{var a=$U(r);a?process.nextTick(function(){vp(t||a.mimeType,a.data,i)}):process.nextTick(function(){i(new Error("Error parsing data URI"))})}catch(n){process.nextTick(function(){i(n)})}else r.indexOf("http://")===0||r.indexOf("https://")===0?GU({url:r,encoding:null},function(n,o,s){if(n){i(n);return}if(t=t,t||(o.getHeader!==void 0?t=o.getHeader("content-type"):o.headers!==void 0&&(t=o.headers["content-type"])),!t){i(new Error("Invalid content-type"));return}vp(t,s,i)}):VU.readFile(r,function(n,o){if(n){i(n);return}if(t=t||KU.lookup(r),!t){i(new Error("Invalid file type"));return}vp(t,o,i)})}});var ay=typeof process!="object"||String(process)!=="[object process]"||process.browser;var iy={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"]=iy||{};function hr(e,r,t){return r<=e&&e<=t}function eR(e,r){return e.indexOf(r)!==-1}var cn=Math.floor;function wl(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function rR(e){for(var r=String(e),t=r.length,i=0,a=[];i<t;){var n=r.charCodeAt(i);if(n<55296||n>57343)a.push(n);else if(56320<=n&&n<=57343)a.push(65533);else if(55296<=n&&n<=56319)if(i===t-1)a.push(65533);else{var o=r.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=n&1023,c=o&1023;a.push(65536+(s<<10)+c),i+=1}else a.push(65533)}i+=1}return a}function tR(e){for(var r="",t=0;t<e.length;++t){var i=e[t];i<=65535?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return r}function za(e){return 0<=e&&e<=127}var qa=za,jr=-1;function Nh(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Nh.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():jr},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.shift());else this.tokens.unshift(e)}};var Hr=-1;function Ar(e,r){if(e)throw TypeError("Decoder error");return r||65533}function oi(e){throw TypeError("The code point "+e+" could not be encoded.")}function aR(){}aR.prototype={handler:function(e,r){}};function iR(){}iR.prototype={handler:function(e,r){}};function qh(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(zh,e)?zh[e]:null}var ny=[{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"}],zh={};ny.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){zh[t]=r})})});var ma={},ga={};function hs(e,r){return r&&r[e]||null}function ds(e,r){var t=r.indexOf(e);return t===-1?null:t}function sa(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 nR(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[0]<=e)r=n[0],t=n[1];else break}return t+e-r}function oR(e){if(e===59335)return 7457;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[1]<=e)r=n[1],t=n[0];else break}return t+e-r}function sR(e){Lh=Lh||sa("jis0208").map(function(t,i){return hr(i,8272,8835)?null:t});var r=Lh;return r.indexOf(e)}var Lh;function cR(e){Dh=Dh||sa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Dh;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):ds(e,r)}var Dh,oy="utf-8";function wo(e,r){if(!(this instanceof wo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):oy,r=wl(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=qh(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ga[t.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=t,Boolean(r.fatal)&&(i._error_mode="fatal"),Boolean(r.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(wo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(wo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(wo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));wo.prototype.decode=function(r,t){var i;typeof r=="object"&&r instanceof ArrayBuffer?i=new Uint8Array(r):typeof r=="object"&&"buffer"in r&&r.buffer instanceof ArrayBuffer?i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):i=new Uint8Array(0),t=wl(t),this._do_not_flush||(this._decoder=ga[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new Nh(i),n=[],o;;){var s=a.read();if(s===jr||(o=this._decoder.handler(a,s),o===Hr))break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(a,a.read()),o===Hr)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function c(u){return eR(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(u.length>0&&u[0]===65279?(this._BOMseen=!0,u.shift()):u.length>0&&(this._BOMseen=!0)),tR(u)}return c.call(this,n)};function Sc(e,r){if(!(this instanceof Sc))throw TypeError("Called as a function. Did you forget 'new'?");r=wl(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var t=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):oy;var i=qh(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ma[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=qh("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=t._encoding.name.toLowerCase()),t}Object.defineProperty&&Object.defineProperty(Sc.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Sc.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=wl(t),this._do_not_flush||(this._encoder=ma[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new Nh(rR(r)),a=[],n;;){var o=i.read();if(o===jr||(n=this._encoder.handler(i,o),n===Hr))break;Array.isArray(n)?a.push.apply(a,n):a.push(n)}if(!this._do_not_flush){for(;n=this._encoder.handler(i,i.read()),n!==Hr;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function uR(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,c){if(c===jr&&a!==0)return a=0,Ar(r);if(c===jr)return Hr;if(a===0){if(hr(c,0,127))return c;if(hr(c,194,223))a=1,t=c&31;else if(hr(c,224,239))c===224&&(n=160),c===237&&(o=159),a=2,t=c&15;else if(hr(c,240,244))c===240&&(n=144),c===244&&(o=143),a=3,t=c&7;else return Ar(r);return null}if(!hr(c,n,o))return t=a=i=0,n=128,o=191,s.prepend(c),Ar(r);if(n=128,o=191,t=t<<6|c&63,i+=1,i!==a)return null;var u=t;return t=a=i=0,u}}function lR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a,n;hr(i,128,2047)?(a=1,n=192):hr(i,2048,65535)?(a=2,n=224):hr(i,65536,1114111)&&(a=3,n=240);for(var o=[(i>>6*a)+n];a>0;){var s=i>>6*(a-1);o.push(128|s&63),a-=1}return o}}ma["UTF-8"]=function(e){return new lR(e)};ga["UTF-8"]=function(e){return new uR(e)};function fR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(za(a))return a;var n=e[a-128];return n===null?Ar(t):n}}function pR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;var n=ds(a,e);return n===null&&oi(a),n+128}}(function(){"encoding-indexes"in globalThis&&ny.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=sa(t.toLowerCase());ga[t]=function(a){return new fR(i,a)},ma[t]=function(a){return new pR(i,a)}})})})();ga.GBK=function(e){return new sy(e)};ma.GBK=function(e){return new cy(e,!0)};function sy(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===jr&&t===0&&i===0&&a===0)return Hr;o===jr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,Ar(r));var s;if(a!==0){s=null,hr(o,48,57)&&(s=nR((((t-129)*10+i-48)*126+a-129)*10+o-48));var c=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(c),Ar(r)):s}if(i!==0)return hr(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,Ar(r));if(t!==0){if(hr(o,48,57))return i=o,null;var u=t,l=null;t=0;var h=o<127?64:65;return(hr(o,64,126)||hr(o,128,254))&&(l=(u-129)*190+(o-h)),s=l===null?null:hs(l,sa("gb18030")),s===null&&za(o)&&n.prepend(o),s===null?Ar(r):s}return za(o)?o:o===128?8364:hr(o,129,254)?(t=o,null):Ar(r)}}function cy(e,r){var t=e.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;if(a===58853)return oi(a);if(r&&a===8364)return 128;var n=ds(a,sa("gb18030"));if(n!==null){var o=cn(n/190)+129,s=n%190,c=s<63?64:65;return[o,s+c]}if(r)return oi(a);n=oR(a);var u=cn(n/10/126/10);n=n-u*10*126*10;var l=cn(n/10/126);n=n-l*10*126;var h=cn(n/10),p=n-h*10;return[u+129,l+48,h+129,p+48]}}ma.gb18030=function(e){return new cy(e)};ga.gb18030=function(e){return new sy(e)};function hR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((hr(a,64,126)||hr(a,161,254))&&(o=(n-129)*157+(a-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=o===null?null:hs(o,sa("big5"));return c===null&&za(a)&&i.prepend(a),c===null?Ar(r):c}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function dR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=cR(i);if(a===null)return oi(i);var n=cn(a/157)+129;if(n<161)return oi(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}ma.Big5=function(e){return new dR(e)};ga.Big5=function(e){return new hR(e)};function mR(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===jr&&i!==0)return i=0,Ar(r);if(n===jr&&i===0)return Hr;if(i===142&&hr(n,161,223))return i=0,65377-161+n;if(i===143&&hr(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return hr(o,161,254)&&hr(n,161,254)&&(s=hs((o-161)*94+(n-161),sa(t?"jis0212":"jis0208"))),t=!1,hr(n,161,254)||a.prepend(n),s===null?Ar(r):s}return za(n)?n:n===142||n===143||hr(n,161,254)?(i=n,null):Ar(r)}}function gR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=ds(i,sa("jis0208"));if(a===null)return oi(i);var n=cn(a/94)+161,o=a%94+161;return[n,o]}}ma["EUC-JP"]=function(e){return new gR(e)};ga["EUC-JP"]=function(e){return new mR(e)};function vR(e){var r=e.fatal,t={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=t.ASCII,a=t.ASCII,n=0,o=!1;this.handler=function(s,c){switch(i){default:case t.ASCII:return c===27?(i=t.EscapeStart,null):hr(c,0,127)&&c!==14&&c!==15&&c!==27?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Roman:return c===27?(i=t.EscapeStart,null):c===92?(o=!1,165):c===126?(o=!1,8254):hr(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Katakana:return c===27?(i=t.EscapeStart,null):hr(c,33,95)?(o=!1,65377-33+c):c===jr?Hr:(o=!1,Ar(r));case t.LeadByte:return c===27?(i=t.EscapeStart,null):hr(c,33,126)?(o=!1,n=c,i=t.TrailByte,null):c===jr?Hr:(o=!1,Ar(r));case t.TrailByte:if(c===27)return i=t.EscapeStart,Ar(r);if(hr(c,33,126)){i=t.LeadByte;var u=(n-33)*94+c-33,l=hs(u,sa("jis0208"));return l===null?Ar(r):l}return c===jr?(i=t.LeadByte,s.prepend(c),Ar(r)):(i=t.LeadByte,Ar(r));case t.EscapeStart:return c===36||c===40?(n=c,i=t.Escape,null):(s.prepend(c),o=!1,i=a,Ar(r));case t.Escape:var h=n;n=0;var p=null;if(h===40&&c===66&&(p=t.ASCII),h===40&&c===74&&(p=t.Roman),h===40&&c===73&&(p=t.Katakana),h===36&&(c===64||c===66)&&(p=t.LeadByte),p!==null){i=i=p;var d=o;return o=!0,d?Ar(r):null}return s.prepend([h,c]),o=!1,i=a,Ar(r)}}}function yR(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===jr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===jr&&i===t.ASCII)return Hr;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return oi(65533);if(i===t.ASCII&&qa(n))return n;if(i===t.Roman&&(qa(n)&&n!==92&&n!==126||n==165||n==8254)){if(qa(n))return n;if(n===165)return 92;if(n===8254)return 126}if(qa(n)&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if((n===165||n===8254)&&i!==t.Roman)return a.prepend(n),i=t.Roman,[27,40,74];n===8722&&(n=65293);var o=ds(n,sa("jis0208"));if(o===null)return oi(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=cn(o/94)+33,c=o%94+33;return[s,c]}}ma["ISO-2022-JP"]=function(e){return new yR(e)};ga["ISO-2022-JP"]=function(e){return new vR(e)};function bR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,c=n<160?129:193;if((hr(a,64,126)||hr(a,128,252))&&(o=(n-c)*188+a-s),hr(o,8836,10715))return 57344-8836+o;var u=o===null?null:hs(o,sa("jis0208"));return u===null&&za(a)&&i.prepend(a),u===null?Ar(r):u}return za(a)||a===128?a:hr(a,161,223)?65377-161+a:hr(a,129,159)||hr(a,224,252)?(t=a,null):Ar(r)}}function xR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=sR(i);if(a===null)return oi(i);var n=cn(a/188),o=n<31?129:193,s=a%188,c=s<63?64:65;return[n+o,s+c]}}ma.Shift_JIS=function(e){return new xR(e)};ga.Shift_JIS=function(e){return new bR(e)};function _R(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0,hr(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:hs(o,sa("euc-kr"));return o===null&&za(a)&&i.prepend(a),s===null?Ar(r):s}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function wR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=ds(i,sa("euc-kr"));if(a===null)return oi(i);var n=cn(a/190)+129,o=a%190+65;return[n,o]}}ma["EUC-KR"]=function(e){return new wR(e)};ga["EUC-KR"]=function(e){return new _R(e)};function _l(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function uy(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===jr&&(i!==null||a!==null))return Ar(t);if(o===jr&&i===null&&a===null)return Hr;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var c=a;return a=null,hr(s,56320,57343)?65536+(c-55296)*1024+(s-56320):(n.prepend(_l(s,e)),Ar(t))}return hr(s,55296,56319)?(a=s,null):hr(s,56320,57343)?Ar(t):s}}function ly(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(hr(a,0,65535))return _l(a,e);var n=_l((a-65536>>10)+55296,e),o=_l((a-65536&1023)+56320,e);return n.concat(o)}}ma["UTF-16BE"]=function(e){return new ly(!0,e)};ga["UTF-16BE"]=function(e){return new uy(!0,e)};ma["UTF-16LE"]=function(e){return new ly(!1,e)};ga["UTF-16LE"]=function(e){return new uy(!1,e)};function kR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:za(i)?i:63360+i-128}}function SR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:qa(i)?i:hr(i,63360,63487)?i-63360+128:oi(i)}}ma["x-user-defined"]=function(e){return new SR(e)};ga["x-user-defined"]=function(e){return new kR(e)};function Ec(e){return Buffer.from(e).toString("base64")}function Uh(e){return Buffer.from(e,"base64").toString("ascii")}var o_=Xt(i_(),1),s_=Xt(Bc(),1);function n_(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function D9(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,s_.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,o_.default)(i,t,r)}function c_(e,r){let t=D9(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(n_(n))})})}var z4=Xt(q4(),1),Hg=["image/png","image/jpeg","image/gif"];async function Vg(e,r){if(!r)throw new Error("MIMEType is required to parse image under Node.js");let t=e instanceof Buffer?e:Buffer.from(e);return await JU(t,r)}function JU(e,r){return new Promise(t=>(0,z4.default)(e,r,(i,a)=>{if(i)throw i;let n=[...a.shape],o=a.shape.length===4?a.shape.shift():1,s=a.data instanceof Buffer?new Uint8Array(a.data):a.data;t({shape:n,data:s,width:a.shape[0],height:a.shape[1],components:a.shape[2],layers:o?[o]:[]})}))}async function Gg(e,r,t,i){return i._parse(e,r,t,i)}function ki(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var Wi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ZU=Wi.self||Wi.window||Wi.global||{},eH=Wi.window||Wi.self||Wi.global||{},rH=Wi.global||Wi.self||Wi.window||{},tH=Wi.document||{};var No=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var N4=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),aH=N4&&parseFloat(N4[1])||0;var yp=globalThis,iH=globalThis.document||{},bp=globalThis.process||{},nH=globalThis.console,yee=globalThis.navigator||{};function U4(e){var i,a;if(typeof window<"u"&&((i=window.process)==null?void 0:i.type)==="renderer"||typeof process<"u"&&Boolean((a=process.versions)==null?void 0:a.electron))return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return Boolean(t&&t.indexOf("Electron")>=0)}function Uo(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||U4()}var Kg="4.0.7";function sH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var xp=class{constructor(r,t,i="sessionStorage"){this.storage=sH(i),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function H4(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function V4(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var _p;(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"})(_p||(_p={}));var cH=10;function G4(e){return typeof e!="string"?e:(e=e.toUpperCase(),_p[e]||_p.WHITE)}function K4(e,r,t){return!Uo&&typeof e=="string"&&(r&&(e=`\x1B[${G4(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${G4(t)+cH}m${e}\x1B[49m`)),e}function $4(e,r=["constructor"]){let t=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(t),a=e;for(let n of i){let o=a[n];typeof o=="function"&&(r.find(s=>n===s)||(a[n]=o.bind(e)))}}function Ru(e,r){if(!e)throw new Error(r||"Assertion failed")}function Ho(){var r,t,i,a,n;let e;if(Uo()&&yp.performance)e=(i=(t=(r=yp)==null?void 0:r.performance)==null?void 0:t.now)==null?void 0:i.call(t);else if("hrtime"in bp){let o=(n=(a=bp)==null?void 0:a.hrtime)==null?void 0:n.call(a);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var nc={debug:Uo()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},uH={enabled:!0,level:0};function oc(){}var W4={},X4={once:!0},Xi=class{constructor({id:r}={id:""}){this.VERSION=Kg,this._startTs=Ho(),this._deltaTs=Ho(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new xp(`__probe-${this.id}__`,uH),this.timeStamp(`${this.id} started`),$4(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ho()-this._startTs).toPrecision(10))}getDelta(){return Number((Ho()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,t){this._storage.setConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r){return this._getLogFunction(0,r,nc.warn,arguments,X4)}error(r){return this._getLogFunction(0,r,nc.error,arguments)}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t){return this._getLogFunction(r,t,nc.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,nc.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,nc.debug||nc.info,arguments,X4)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||oc,i&&[i],{tag:fH(t)}):oc}time(r,t){return this._getLogFunction(r,t,console.time?console.time:console.info)}timeEnd(r,t){return this._getLogFunction(r,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,t){return this._getLogFunction(r,t,console.timeStamp||oc)}group(r,t,i={collapsed:!1}){let a=Y4({logLevel:r,message:t,opts:i}),{collapsed:n}=i;return a.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}groupCollapsed(r,t,i={}){return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||oc)}withGroup(r,t,i){this.group(r,t)();try{i()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=Q4(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=Y4({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,Ru(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=Ho();let o=n.tag||n.message;if(n.once&&o)if(!W4[o])W4[o]=Ho();else return oc;return t=lH(this.id,n.message,n),i.bind(console,t,...n.args)}return oc}};Xi.VERSION=Kg;function Q4(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Ru(Number.isFinite(r)&&r>=0),r}function Y4(e){let{logLevel:r,message:t}=e;e.logLevel=Q4(r);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&i.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let a=typeof e.message;return Ru(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function lH(e,r,t){if(typeof r=="string"){let i=t.time?V4(H4(t.total)):"";r=t.time?`${e}: ${i} ${r}`:`${e}: ${r}`,r=K4(r,t.color,t.background)}return r}function fH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe={};var Hee=new Xi({id:"@probe.gl/log"});var $g="4.3.1",pH=$g[0]>="0"&&$g[0]<="9"?`v${$g}`:"";function hH(){let e=new Xi({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=pH,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var Wg=hH();function Xg(e,r){return J4(e||{},r)}function J4(e,r,t=0){if(t>3)return r;let i={...e};for(let[a,n]of Object.entries(r))n&&typeof n=="object"&&!Array.isArray(n)?i[a]=J4(i[a]||{},r[a],t+1):i[a]=r[a];return i}function Yg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Qg(e){var t,i;return((i=(t=globalThis.loaders)==null?void 0:t.modules)==null?void 0:i[e])||null}var Z4="latest";function dH(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.1"),globalThis._loadersgl_.version}var Pu=dH();function Wt(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var Yi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Zee=Yi.self||Yi.window||Yi.global||{},ere=Yi.window||Yi.self||Yi.global||{},rre=Yi.global||Yi.self||Yi.window||{},tre=Yi.document||{};var Nt=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ou=typeof importScripts=="function",r5=typeof window<"u"&&typeof window.orientation<"u",e5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),are=e5&&parseFloat(e5[1])||0;var Cu=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(r,t){this.name=r,this.workerThread=t,this.result=new Promise((i,a)=>{this._resolve=i,this._reject=a})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){Wt(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){Wt(this.isRunning),this.isRunning=!1,this._reject(r)}};var po={};xl(po,{NodeWorker:()=>Fu,parentPort:()=>Jg});var Bu=Xt(require("worker_threads"),1);kc(po,require("worker_threads"));var Jg=Bu==null?void 0:Bu.parentPort,Fu=Bu.Worker;var Zg=new Map;function t5(e){Wt(e.source&&!e.url||!e.source&&e.url);let r=Zg.get(e.source||e.url);return r||(e.url&&(r=mH(e.url),Zg.set(e.url,r)),e.source&&(r=a5(e.source),Zg.set(e.source,r))),Wt(r),r}function mH(e){if(!e.startsWith("http"))return e;let r=gH(e);return a5(r)}function a5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function gH(e){return`try {
94
+ `,h.message,h.stack);var p=new Error("tunneling socket could not be established, cause="+h.message);p.code="ECONNRESET",r.request.emit("error",p),i.removeSocket(a)}};$i.prototype.removeSocket=function(r){var t=this.sockets.indexOf(r);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createConnection(i)}};function l4(e,r){var t=this;$i.prototype.createSocket.call(t,e,function(i){var a=$N.connect(0,f4({},t.options,{servername:e.host,socket:i}));t.sockets[t.sockets.indexOf(i)]=a,r(a)})}function f4(e){for(var r=1,t=arguments.length;r<t;++r){var i=arguments[r];if(typeof i=="object")for(var a=Object.keys(i),n=0,o=a.length;n<o;++n){var s=a[n];i[s]!==void 0&&(e[s]=i[s])}}return e}var zo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?zo=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:zo=function(){};tc.debug=zo});var g4=B(m4=>{"use strict";var tU=require("url"),aU=p4(),h4=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],d4=["proxy-authorization"];function iU(e){var r=e.port,t=e.protocol,i=e.hostname+":";return r?i+=r:t==="https:"?i+="443":i+="80",i}function nU(e,r){var t=r.reduce(function(i,a){return i[a.toLowerCase()]=!0,i},{});return Object.keys(e).filter(function(i){return t[i.toLowerCase()]}).reduce(function(i,a){return i[a]=e[a],i},{})}function oU(e,r){var t=e.proxy,i={proxy:{host:t.hostname,port:+t.port,proxyAuth:t.auth,headers:r},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return i}function sU(e,r){var t=e.protocol==="https:"?"https":"http",i=r.protocol==="https:"?"Https":"Http";return[t,i].join("Over")}function cU(e){var r=e.uri,t=e.proxy,i=sU(r,t);return aU[i]}function ku(e){this.request=e,this.proxyHeaderWhiteList=h4,this.proxyHeaderExclusiveList=[],typeof e.tunnel<"u"&&(this.tunnelOverride=e.tunnel)}ku.prototype.isEnabled=function(){var e=this,r=e.request;return typeof e.tunnelOverride<"u"?e.tunnelOverride:r.uri.protocol==="https:"};ku.prototype.setup=function(e){var r=this,t=r.request;if(e=e||{},typeof t.proxy=="string"&&(t.proxy=tU.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(r.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(r.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var i=r.proxyHeaderExclusiveList.concat(d4),a=r.proxyHeaderWhiteList.concat(i),n=nU(t.headers,a);n.host=iU(t.uri),i.forEach(t.removeHeader,t);var o=cU(t),s=oU(t,n);return t.agent=o(s),!0};ku.defaultProxyHeaderWhiteList=h4;ku.defaultProxyHeaderExclusiveList=d4;m4.Tunnel=ku});var y4=B((v4,Su)=>{(function(){var e,r,t,i,a,n;typeof performance<"u"&&performance!==null&&performance.now?Su.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Su.exports=function(){return(e()-a)/1e6},r=process.hrtime,e=function(){var o;return o=r(),o[0]*1e9+o[1]},i=e(),n=process.uptime()*1e9,a=i-n):Date.now?(Su.exports=function(){return Date.now()-t},t=Date.now()):(Su.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(v4)});var R4=B((cee,T4)=>{"use strict";var uU=require("http"),w4=require("https"),Eu=require("url"),zg=require("util"),mp=require("stream"),dp=require("zlib"),qg=nw(),lU=dw(),fU=iS(),pU=zf(),k4=Nf(),b4=hS(),hU=NS(),dU=Dl(),x4=tg(),mU=$S().strict,ic=Hl(),gU=hm(),vU=YS(),yU=cE().Querystring,bU=M8().Har,xU=G8().Auth,_U=t4().OAuth,wU=a4(),kU=n4().Multipart,SU=c4().Redirect,Ng=g4().Tunnel,ac=y4(),Au=As().Buffer,_4=ic.safeStringify,EU=ic.isReadStream,AU=ic.toBase64,jU=ic.defer,S4=ic.copy,TU=ic.version,E4=gU.jar(),A4={};function RU(e,r){var t={};for(var i in r){var a=e.indexOf(i)===-1;a&&(t[i]=r[i])}return t}function PU(e,r){var t={};for(var i in r){var a=e.indexOf(i)!==-1,n=typeof r[i]=="function";a&&n||(t[i]=r[i])}return t}function j4(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function OU(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:j4.call(e.request)}}function Sr(e){var r=this;e.har&&(r._har=new bU(r),e=r._har.options(e)),mp.Stream.call(r);var t=Object.keys(Sr.prototype),i=RU(t,e);dU(r,i),e=PU(t,e),r.readable=!0,r.writable=!0,e.method&&(r.explicitMethod=!0),r._qs=new yU(r),r._auth=new xU(r),r._oauth=new _U(r),r._multipart=new kU(r),r._redirect=new SU(r),r._tunnel=new Ng(r),r.init(e)}zg.inherits(Sr,mp.Stream);Sr.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function zt(){Sr.debug&&console.error("REQUEST %s",zg.format.apply(zg,arguments))}Sr.prototype.debug=zt;Sr.prototype.init=function(e){var r=this;e||(e={}),r.headers=r.headers?S4(r.headers):{};for(var t in r.headers)typeof r.headers[t]>"u"&&delete r.headers[t];if(k4.httpify(r,r.headers),r.method||(r.method=e.method||"GET"),r.localAddress||(r.localAddress=e.localAddress),r._qs.init(e),zt(e),!r.pool&&r.pool!==!1&&(r.pool=A4),r.dests=r.dests||[],r.__isRequestRequest=!0,!r._callback&&r.callback&&(r._callback=r.callback,r.callback=function(){r._callbackCalled||(r._callbackCalled=!0,r._callback.apply(r,arguments))},r.on("error",r.callback.bind()),r.on("complete",r.callback.bind(r,null))),!r.uri&&r.url&&(r.uri=r.url,delete r.url),r.baseUrl){if(typeof r.baseUrl!="string")return r.emit("error",new Error("options.baseUrl must be a string"));if(typeof r.uri!="string")return r.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(r.uri.indexOf("//")===0||r.uri.indexOf("://")!==-1)return r.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var i=r.baseUrl.lastIndexOf("/")===r.baseUrl.length-1,a=r.uri.indexOf("/")===0;i&&a?r.uri=r.baseUrl+r.uri.slice(1):i||a?r.uri=r.baseUrl+r.uri:r.uri===""?r.uri=r.baseUrl:r.uri=r.baseUrl+"/"+r.uri,delete r.baseUrl}if(!r.uri)return r.emit("error",new Error("options.uri is a required argument"));if(typeof r.uri=="string"&&(r.uri=Eu.parse(r.uri)),r.uri.href||(r.uri.href=Eu.format(r.uri)),r.uri.protocol==="unix:")return r.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(r.uri.host==="unix"&&r.enableUnixSocket(),r.strictSSL===!1&&(r.rejectUnauthorized=!1),r.uri.pathname||(r.uri.pathname="/"),!(r.uri.host||r.uri.hostname&&r.uri.port)&&!r.uri.isUnix){var n=Eu.format(r.uri),o='Invalid URI "'+n+'"';return Object.keys(e).length===0&&(o+=". This can be caused by a crappy redirection."),r.abort(),r.emit("error",new Error(o))}if(r.hasOwnProperty("proxy")||(r.proxy=vU(r.uri)),r.tunnel=r._tunnel.isEnabled(),r.proxy&&r._tunnel.setup(e),r._redirect.onRequest(e),r.setHost=!1,!r.hasHeader("host")){var s=r.originalHostHeaderName||"host";r.setHeader(s,r.uri.host),r.uri.port&&(r.uri.port==="80"&&r.uri.protocol==="http:"||r.uri.port==="443"&&r.uri.protocol==="https:")&&r.setHeader(s,r.uri.hostname),r.setHost=!0}if(r.jar(r._jar||e.jar),r.uri.port||(r.uri.protocol==="http:"?r.uri.port=80:r.uri.protocol==="https:"&&(r.uri.port=443)),r.proxy&&!r.tunnel?(r.port=r.proxy.port,r.host=r.proxy.hostname):(r.port=r.uri.port,r.host=r.uri.hostname),e.form&&r.form(e.form),e.formData){var c=e.formData,u=r.form(),l=function(P,C){C&&C.hasOwnProperty("value")&&C.hasOwnProperty("options")?u.append(P,C.value,C.options):u.append(P,C)};for(var h in c)if(c.hasOwnProperty(h)){var p=c[h];if(p instanceof Array)for(var d=0;d<p.length;d++)l(h,p[d]);else l(h,p)}}if(e.qs&&r.qs(e.qs),r.uri.path?r.path=r.uri.path:r.path=r.uri.pathname+(r.uri.search||""),r.path.length===0&&(r.path="/"),e.aws&&r.aws(e.aws),e.hawk&&r.hawk(e.hawk),e.httpSignature&&r.httpSignature(e.httpSignature),e.auth&&(Object.prototype.hasOwnProperty.call(e.auth,"username")&&(e.auth.user=e.auth.username),Object.prototype.hasOwnProperty.call(e.auth,"password")&&(e.auth.pass=e.auth.password),r.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)),r.gzip&&!r.hasHeader("accept-encoding")&&r.setHeader("accept-encoding","gzip, deflate"),r.uri.auth&&!r.hasHeader("authorization")){var v=r.uri.auth.split(":").map(function(P){return r._qs.unescape(P)});r.auth(v[0],v.slice(1).join(":"),!0)}if(!r.tunnel&&r.proxy&&r.proxy.auth&&!r.hasHeader("proxy-authorization")){var x=r.proxy.auth.split(":").map(function(P){return r._qs.unescape(P)}),y="Basic "+AU(x.join(":"));r.setHeader("proxy-authorization",y)}r.proxy&&!r.tunnel&&(r.path=r.uri.protocol+"//"+r.uri.host+r.path),e.json&&r.json(e.json),e.multipart&&r.multipart(e.multipart),e.time&&(r.timing=!0,r.elapsedTime=r.elapsedTime||0);function E(){if(mU(r.body)&&(r.body=Au.from(r.body)),!r.hasHeader("content-length")){var P;typeof r.body=="string"?P=Au.byteLength(r.body):Array.isArray(r.body)?P=r.body.reduce(function(C,I){return C+I.length},0):P=r.body.length,P?r.setHeader("content-length",P):r.emit("error",new Error("Argument error, options.body."))}}r.body&&!x4(r.body)&&E(),e.oauth?r.oauth(e.oauth):r._oauth.params&&r.hasHeader("authorization")&&r.oauth(r._oauth.params);var A=r.proxy&&!r.tunnel?r.proxy.protocol:r.uri.protocol,S={"http:":uU,"https:":w4},R=r.httpModules||{};if(r.httpModule=R[A]||S[A],!r.httpModule)return r.emit("error",new Error("Invalid protocol: "+A));if(e.ca&&(r.ca=e.ca),!r.agent)if(e.agentOptions&&(r.agentOptions=e.agentOptions),e.agentClass)r.agentClass=e.agentClass;else if(e.forever){var j=TU();j.major===0&&j.minor<=10?r.agentClass=A==="http:"?b4:b4.SSL:(r.agentClass=r.httpModule.Agent,r.agentOptions=r.agentOptions||{},r.agentOptions.keepAlive=!0)}else r.agentClass=r.httpModule.Agent;r.pool===!1?r.agent=!1:r.agent=r.agent||r.getNewAgent(),r.on("pipe",function(P){if(r.ntick&&r._started&&r.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),r.src=P,EU(P))r.hasHeader("content-type")||r.setHeader("content-type",pU.lookup(P.path));else{if(P.headers)for(var C in P.headers)r.hasHeader(C)||r.setHeader(C,P.headers[C]);r._json&&!r.hasHeader("content-type")&&r.setHeader("content-type","application/json"),P.method&&!r.explicitMethod&&(r.method=P.method)}}),jU(function(){if(!r._aborted){var P=function(){if(r._form&&(r._auth.hasAuth?r._auth.hasAuth&&r._auth.sentAuth&&r._form.pipe(r):r._form.pipe(r)),r._multipart&&r._multipart.chunked&&r._multipart.body.pipe(r),r.body)x4(r.body)?r.body.pipe(r):(E(),Array.isArray(r.body)?r.body.forEach(function(C){r.write(C)}):r.write(r.body),r.end());else if(r.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),r.requestBodyStream.pipe(r);else if(!r.src){if(r._auth.hasAuth&&!r._auth.sentAuth){r.end();return}r.method!=="GET"&&typeof r.method<"u"&&r.setHeader("content-length",0),r.end()}};r._form&&!r.hasHeader("content-length")?(r.setHeader(r._form.getHeaders(),!0),r._form.getLength(function(C,I){!C&&!isNaN(I)&&r.setHeader("content-length",I),P()})):P(),r.ntick=!0}})};Sr.prototype.getNewAgent=function(){var e=this,r=e.agentClass,t={};if(e.agentOptions)for(var i in e.agentOptions)t[i]=e.agentOptions[i];e.ca&&(t.ca=e.ca),e.ciphers&&(t.ciphers=e.ciphers),e.secureProtocol&&(t.secureProtocol=e.secureProtocol),e.secureOptions&&(t.secureOptions=e.secureOptions),typeof e.rejectUnauthorized<"u"&&(t.rejectUnauthorized=e.rejectUnauthorized),e.cert&&e.key&&(t.key=e.key,t.cert=e.cert),e.pfx&&(t.pfx=e.pfx),e.passphrase&&(t.passphrase=e.passphrase);var a="";r!==e.httpModule.Agent&&(a+=r.name);var n=e.proxy;typeof n=="string"&&(n=Eu.parse(n));var o=n&&n.protocol==="https:"||this.uri.protocol==="https:";return o&&(t.ca&&(a&&(a+=":"),a+=t.ca),typeof t.rejectUnauthorized<"u"&&(a&&(a+=":"),a+=t.rejectUnauthorized),t.cert&&(a&&(a+=":"),a+=t.cert.toString("ascii")+t.key.toString("ascii")),t.pfx&&(a&&(a+=":"),a+=t.pfx.toString("ascii")),t.ciphers&&(a&&(a+=":"),a+=t.ciphers),t.secureProtocol&&(a&&(a+=":"),a+=t.secureProtocol),t.secureOptions&&(a&&(a+=":"),a+=t.secureOptions)),e.pool===A4&&!a&&Object.keys(t).length===0&&e.httpModule.globalAgent?e.httpModule.globalAgent:(a=e.uri.protocol+a,e.pool[a]||(e.pool[a]=new r(t),e.pool.maxSockets&&(e.pool[a].maxSockets=e.pool.maxSockets)),e.pool[a])};Sr.prototype.start=function(){var e=this;if(e.timing)var r=new Date().getTime(),t=ac();if(!e._aborted){e._started=!0,e.method=e.method||"GET",e.href=e.uri.href,e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")&&e.setHeader("content-length",e.src.stat.size),e._aws&&e.aws(e._aws,!0);var i=S4(e);delete i.auth,zt("make request",e.uri.href),delete i.timeout;try{e.req=e.httpModule.request(i)}catch(n){e.emit("error",n);return}e.timing&&(e.startTime=r,e.startTimeNow=t,e.timings={});var a;e.timeout&&!e.timeoutTimer&&(e.timeout<0?a=0:typeof e.timeout=="number"&&isFinite(e.timeout)&&(a=e.timeout)),e.req.on("response",e.onRequestResponse.bind(e)),e.req.on("error",e.onRequestError.bind(e)),e.req.on("drain",function(){e.emit("drain")}),e.req.on("socket",function(n){var o=n._connecting||n.connecting;if(e.timing&&(e.timings.socket=ac()-e.startTimeNow,o)){var s=function(){e.timings.lookup=ac()-e.startTimeNow},c=function(){e.timings.connect=ac()-e.startTimeNow};n.once("lookup",s),n.once("connect",c),e.req.once("error",function(){n.removeListener("lookup",s),n.removeListener("connect",c)})}var u=function(){e.req.setTimeout(a,function(){if(e.req){e.abort();var h=new Error("ESOCKETTIMEDOUT");h.code="ESOCKETTIMEDOUT",h.connect=!1,e.emit("error",h)}})};if(a!==void 0)if(o){var l=function(){n.removeListener("connect",l),e.clearTimeout(),u()};n.on("connect",l),e.req.on("error",function(h){n.removeListener("connect",l)}),e.timeoutTimer=setTimeout(function(){n.removeListener("connect",l),e.abort();var h=new Error("ETIMEDOUT");h.code="ETIMEDOUT",h.connect=!0,e.emit("error",h)},a)}else u();e.emit("socket",n)}),e.emit("request",e.req)}};Sr.prototype.onRequestError=function(e){var r=this;if(!r._aborted){if(r.req&&r.req._reusedSocket&&e.code==="ECONNRESET"&&r.agent.addRequestNoreuse){r.agent={addRequest:r.agent.addRequestNoreuse.bind(r.agent)},r.start(),r.req.end();return}r.clearTimeout(),r.emit("error",e)}};Sr.prototype.onRequestResponse=function(e){var r=this;if(r.timing&&(r.timings.response=ac()-r.startTimeNow),zt("onRequestResponse",r.uri.href,e.statusCode,e.headers),e.on("end",function(){r.timing&&(r.timings.end=ac()-r.startTimeNow,e.timingStart=r.startTime,r.timings.socket||(r.timings.socket=0),r.timings.lookup||(r.timings.lookup=r.timings.socket),r.timings.connect||(r.timings.connect=r.timings.lookup),r.timings.response||(r.timings.response=r.timings.connect),zt("elapsed time",r.timings.end),r.elapsedTime+=Math.round(r.timings.end),e.elapsedTime=r.elapsedTime,e.timings=r.timings,e.timingPhases={wait:r.timings.socket,dns:r.timings.lookup-r.timings.socket,tcp:r.timings.connect-r.timings.lookup,firstByte:r.timings.response-r.timings.connect,download:r.timings.end-r.timings.response,total:r.timings.end}),zt("response end",r.uri.href,e.statusCode,e.headers)}),r._aborted){zt("aborted",r.uri.href),e.resume();return}if(r.response=e,e.request=r,e.toJSON=OU,r.httpModule===w4&&r.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){zt("strict ssl error",r.uri.href);var t=e.hasOwnProperty("socket")?e.socket.authorizationError:r.uri.href+" does not support SSL";r.emit("error",new Error("SSL Error: "+t));return}r.originalHost=r.getHeader("host"),r.originalHostHeaderName||(r.originalHostHeaderName=r.hasHeader("host")),r.setHost&&r.removeHeader("host"),r.clearTimeout();var i=r._jar&&r._jar.setCookie?r._jar:E4,a=function(l){try{i.setCookie(l,r.uri.href,{ignoreError:!0})}catch(h){r.emit("error",h)}};if(e.caseless=k4(e.headers),e.caseless.has("set-cookie")&&!r._disableCookies){var n=e.caseless.has("set-cookie");Array.isArray(e.headers[n])?e.headers[n].forEach(a):a(e.headers[n])}if(!r._redirect.onResponse(e)){{e.on("close",function(){r._ended||r.response.emit("end")}),e.once("end",function(){r._ended=!0});var o=function(l){return r.method==="HEAD"||l>=100&&l<200||l===204||l===304},s;if(r.gzip&&!o(e.statusCode)){var c=e.headers["content-encoding"]||"identity";c=c.trim().toLowerCase();var u={flush:dp.Z_SYNC_FLUSH,finishFlush:dp.Z_SYNC_FLUSH};c==="gzip"?(s=dp.createGunzip(u),e.pipe(s)):c==="deflate"?(s=dp.createInflate(u),e.pipe(s)):(c!=="identity"&&zt("ignoring unrecognized Content-Encoding "+c),s=e)}else s=e;r.encoding&&(r.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):s.setEncoding(r.encoding)),r._paused&&s.pause(),r.responseContent=s,r.emit("response",e),r.dests.forEach(function(l){r.pipeDest(l)}),s.on("data",function(l){r.timing&&!r.responseStarted&&(r.responseStartTime=new Date().getTime(),e.responseStartTime=r.responseStartTime),r._destdata=!0,r.emit("data",l)}),s.once("end",function(l){r.emit("end",l)}),s.on("error",function(l){r.emit("error",l)}),s.on("close",function(){r.emit("close")}),r.callback?r.readResponseBody(e):r.on("end",function(){if(r._aborted){zt("aborted",r.uri.href);return}r.emit("complete",e)})}zt("finish init function",r.uri.href)}};Sr.prototype.readResponseBody=function(e){var r=this;zt("reading response's body");var t=[],i=0,a=[];r.on("data",function(n){Au.isBuffer(n)?n.length&&(i+=n.length,t.push(n)):a.push(n)}),r.on("end",function(){if(zt("end event",r.uri.href),r._aborted){zt("aborted",r.uri.href),t=[],i=0;return}if(i?(zt("has body",r.uri.href,i),e.body=Au.concat(t,i),r.encoding!==null&&(e.body=e.body.toString(r.encoding)),t=[],i=0):a.length&&(r.encoding==="utf8"&&a[0].length>0&&a[0][0]==="\uFEFF"&&(a[0]=a[0].substring(1)),e.body=a.join("")),r._json)try{e.body=JSON.parse(e.body,r._jsonReviver)}catch{zt("invalid JSON received",r.uri.href)}zt("emitting complete",r.uri.href),typeof e.body>"u"&&!r._json&&(e.body=r.encoding===null?Au.alloc(0):""),r.emit("complete",e,e.body)})};Sr.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")};Sr.prototype.pipeDest=function(e){var r=this,t=r.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var i=t.caseless.has("content-type");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}if(t.caseless.has("content-length")){var a=t.caseless.has("content-length");e.setHeader?e.setHeader(a,t.headers[a]):e.headers[a]=t.headers[a]}}if(e.setHeader&&!e.headersSent){for(var n in t.headers)(!r.gzip||n!=="content-encoding")&&e.setHeader(n,t.headers[n]);e.statusCode=t.statusCode}r.pipefilter&&r.pipefilter(t,e)};Sr.prototype.qs=function(e,r){var t=this,i;!r&&t.uri.query?i=t._qs.parse(t.uri.query):i={};for(var a in e)i[a]=e[a];var n=t._qs.stringify(i);return n===""||(t.uri=Eu.parse(t.uri.href.split("?")[0]+"?"+n),t.url=t.uri,t.path=t.uri.path,t.uri.host==="unix"&&t.enableUnixSocket()),t};Sr.prototype.form=function(e){var r=this;return e?(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))||r.setHeader("content-type","application/x-www-form-urlencoded"),r.body=typeof e=="string"?r._qs.rfc3986(e.toString("utf8")):r._qs.stringify(e).toString("utf8"),r):(r._form=new hU,r._form.on("error",function(t){t.message="form-data: "+t.message,r.emit("error",t),r.abort()}),r._form)};Sr.prototype.multipart=function(e){var r=this;return r._multipart.onRequest(e),r._multipart.chunked||(r.body=r._multipart.body),r};Sr.prototype.json=function(e){var r=this;return r.hasHeader("accept")||r.setHeader("accept","application/json"),typeof r.jsonReplacer=="function"&&(r._jsonReplacer=r.jsonReplacer),r._json=!0,typeof e=="boolean"?r.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))?r.body=r._qs.rfc3986(r.body):r.body=_4(r.body,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")):(r.body=_4(e,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")),typeof r.jsonReviver=="function"&&(r._jsonReviver=r.jsonReviver),r};Sr.prototype.getHeader=function(e,r){var t=this,i,a,n;return r||(r=t.headers),Object.keys(r).forEach(function(o){o.length===e.length&&(a=new RegExp(e,"i"),n=o.match(a),n&&(i=r[o]))}),i};Sr.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),r=e[0],t=e[1];this.socketPath=r,this.uri.pathname=t,this.uri.path=t,this.uri.host=r,this.uri.hostname=r,this.uri.isUnix=!0};Sr.prototype.auth=function(e,r,t,i){var a=this;return a._auth.onRequest(e,r,t,i),a};Sr.prototype.aws=function(e,r){var t=this;if(!r)return t._aws=e,t;if(e.sign_version===4||e.sign_version==="4"){var i={host:t.uri.host,path:t.uri.path,method:t.method,headers:t.headers,body:t.body};e.service&&(i.service=e.service);var a=lU.sign(i,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});t.setHeader("authorization",a.headers.Authorization),t.setHeader("x-amz-date",a.headers["X-Amz-Date"]),a.headers["X-Amz-Security-Token"]&&t.setHeader("x-amz-security-token",a.headers["X-Amz-Security-Token"])}else{var n=new Date;t.setHeader("date",n.toUTCString());var o={key:e.key,secret:e.secret,verb:t.method.toUpperCase(),date:n,contentType:t.getHeader("content-type")||"",md5:t.getHeader("content-md5")||"",amazonHeaders:qg.canonicalizeHeaders(t.headers)},s=t.uri.path;e.bucket&&s?o.resource="/"+e.bucket+s:e.bucket&&!s?o.resource="/"+e.bucket:!e.bucket&&s?o.resource=s:!e.bucket&&!s&&(o.resource="/"),o.resource=qg.canonicalizeResource(o.resource),t.setHeader("authorization",qg.authorization(o))}return t};Sr.prototype.httpSignature=function(e){var r=this;return fU.signRequest({getHeader:function(t){return r.getHeader(t,r.headers)},setHeader:function(t,i){r.setHeader(t,i)},method:r.method,path:r.path},e),zt("httpSignature authorization",r.getHeader("authorization")),r};Sr.prototype.hawk=function(e){var r=this;r.setHeader("Authorization",wU.header(r.uri,r.method,e))};Sr.prototype.oauth=function(e){var r=this;return r._oauth.onRequest(e),r};Sr.prototype.jar=function(e){var r=this,t;if(r._redirect.redirectsFollowed===0&&(r.originalCookieHeader=r.getHeader("cookie")),!e)t=!1,r._disableCookies=!0;else{var i=e.getCookieString?e:E4,a=r.uri.href;i&&(t=i.getCookieString(a))}return t&&t.length&&(r.originalCookieHeader?r.setHeader("cookie",r.originalCookieHeader+"; "+t):r.setHeader("cookie",t)),r._jar=e,r};Sr.prototype.pipe=function(e,r){var t=this;if(t.response)if(t._destdata)t.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(t._ended)t.emit("error",new Error("You cannot pipe after the response has been ended."));else return mp.Stream.prototype.pipe.call(t,e,r),t.pipeDest(e),e;else return t.dests.push(e),mp.Stream.prototype.pipe.call(t,e,r),e};Sr.prototype.write=function(){var e=this;if(!e._aborted&&(e._started||e.start(),e.req))return e.req.write.apply(e.req,arguments)};Sr.prototype.end=function(e){var r=this;r._aborted||(e&&r.write(e),r._started||r.start(),r.req&&r.req.end())};Sr.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0};Sr.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1};Sr.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()};Sr.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)};Sr.defaultProxyHeaderWhiteList=Ng.defaultProxyHeaderWhiteList.slice();Sr.defaultProxyHeaderExclusiveList=Ng.defaultProxyHeaderExclusiveList.slice();Sr.prototype.toJSON=j4;T4.exports=Sr});var C4=B((uee,O4)=>{"use strict";var ju=Dl(),P4=hm(),CU=Hl(),BU=CU.paramsHaveRequestBody;function gp(e,r,t){typeof r=="function"&&(t=r);var i={};return r!==null&&typeof r=="object"?ju(i,r,{uri:e}):typeof e=="string"?ju(i,{uri:e}):ju(i,e),i.callback=t||i.callback,i}function dt(e,r,t){if(typeof e>"u")throw new Error("undefined is not a valid uri or options object.");var i=gp(e,r,t);if(i.method==="HEAD"&&BU(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new dt.Request(i)}function fo(e){var r=e.toUpperCase();return function(t,i,a){var n=gp(t,i,a);return n.method=r,dt(n,n.callback)}}dt.get=fo("get");dt.head=fo("head");dt.options=fo("options");dt.post=fo("post");dt.put=fo("put");dt.patch=fo("patch");dt.del=fo("delete");dt.delete=fo("delete");dt.jar=function(e){return P4.jar(e)};dt.cookie=function(e){return P4.parse(e)};function Ug(e,r,t,i){return function(a,n,o){var s=gp(a,n,o),c={};return ju(!0,c,r,s),c.pool=s.pool||r.pool,i&&(c.method=i.toUpperCase()),typeof t=="function"&&(e=t),e(c,c.callback)}}dt.defaults=function(e,r){var t=this;e=e||{},typeof e=="function"&&(r=e,e={});var i=Ug(t,e,r),a=["get","head","post","put","patch","del","delete"];return a.forEach(function(n){i[n]=Ug(t[n],e,r,n)}),i.cookie=Ug(t.cookie,e,r),i.jar=t.jar,i.defaults=t.defaults,i};dt.forever=function(e,r){var t={};return r&&ju(t,r),e&&(t.agentOptions=e),t.forever=!0,dt.defaults(t)};O4.exports=dt;dt.Request=R4();dt.initParams=gp;Object.defineProperty(dt,"debug",{enumerable:!0,get:function(){return dt.Request.debug},set:function(e){dt.Request.debug=e}})});var F4=B((lee,B4)=>{B4.exports=FU;function FU(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var r=e.indexOf(",");if(r===-1||r<=4)throw new TypeError("malformed data: URI");for(var t=e.substring(5,r).split(";"),i=!1,a="US-ASCII",n=0;n<t.length;n++)t[n]=="base64"?i=!0:t[n].indexOf("charset=")==0&&(a=t[n].substring(8));var o=unescape(e.substring(r+1)),s=i?"base64":"ascii",c=new Buffer(o,s);return c.type=t[0]||"text/plain",c.charset=a,c}});var L4=B((fee,M4)=>{var IU=F4();function MU(e){return{mimeType:DU(LU(e)),data:IU(e)}}function LU(e){return e.substring(5,e.indexOf(";"))}var I4=/^(\w+\/)+/;function DU(e){e=e.toLowerCase();var r=e.match(I4);return!r||!(r=r[1])?e:e.replace(I4,r)}M4.exports=MU});var q4=B((hee,D4)=>{"use strict";var Tu=Bc(),pee=require("path"),qU=a2().PNG,zU=xd(),NU=c2(),UU=l2().GifReader,HU=m2(),VU=require("fs"),GU=C4(),KU=zf(),$U=L4();function WU(e,r){var t=new qU;t.parse(e,function(i,a){if(i){r(i);return}r(null,Tu(new Uint8Array(a.data),[a.width|0,a.height|0,4],[4,4*a.width|0,1],0))})}function XU(e,r){var t;try{t=zU.decode(e)}catch(n){r(n);return}if(!t){r(new Error("Error decoding jpeg"));return}var i=[t.height,t.width,4],a=Tu(t.data,i);r(null,a.transpose(1,0))}function YU(e,r){var t;try{t=new UU(e)}catch(s){r(s);return}if(t.numFrames()>0){var i=[t.numFrames(),t.height,t.width,4];try{var a=new Uint8Array(i[0]*i[1]*i[2]*i[3])}catch(s){r(s);return}var n=Tu(a,i);try{for(var o=0;o<t.numFrames();++o)t.decodeAndBlitFrameRGBA(o,a.subarray(n.index(o,0,0,0),n.index(o+1,0,0,0)))}catch(s){r(s);return}r(null,n.transpose(0,2,1))}else{var i=[t.height,t.width,4],a=new Uint8Array(i[0]*i[1]*i[2]),n=Tu(a,i);try{t.decodeAndBlitFrameRGBA(0,a)}catch(l){r(l);return}r(null,n.transpose(1,0))}}function QU(e,r){var t=new HU(e);try{t.init()}catch(s){r(s);return}var i=t.getData(),a=[i.getHeight(),i.getWidth(),4],n=new Uint8Array(a[0]*a[1]*a[2]),o=Tu(n,a);NU(i,o),r(null,o.transpose(1,0))}function vp(e,r,t){switch(e){case"image/png":WU(r,t);break;case"image/jpg":case"image/jpeg":XU(r,t);break;case"image/gif":YU(r,t);break;case"image/bmp":QU(r,t);break;default:t(new Error("Unsupported file type: "+e))}}D4.exports=function(r,t,i){if(i||(i=t,t=""),Buffer.isBuffer(r)){if(!t){i(new Error("Invalid file type"));return}vp(t,r,i)}else if(r.indexOf("data:")===0)try{var a=$U(r);a?process.nextTick(function(){vp(t||a.mimeType,a.data,i)}):process.nextTick(function(){i(new Error("Error parsing data URI"))})}catch(n){process.nextTick(function(){i(n)})}else r.indexOf("http://")===0||r.indexOf("https://")===0?GU({url:r,encoding:null},function(n,o,s){if(n){i(n);return}if(t=t,t||(o.getHeader!==void 0?t=o.getHeader("content-type"):o.headers!==void 0&&(t=o.headers["content-type"])),!t){i(new Error("Invalid content-type"));return}vp(t,s,i)}):VU.readFile(r,function(n,o){if(n){i(n);return}if(t=t||KU.lookup(r),!t){i(new Error("Invalid file type"));return}vp(t,o,i)})}});var ay=typeof process!="object"||String(process)!=="[object process]"||process.browser;var iy={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"]=iy||{};function hr(e,r,t){return r<=e&&e<=t}function eR(e,r){return e.indexOf(r)!==-1}var cn=Math.floor;function wl(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function rR(e){for(var r=String(e),t=r.length,i=0,a=[];i<t;){var n=r.charCodeAt(i);if(n<55296||n>57343)a.push(n);else if(56320<=n&&n<=57343)a.push(65533);else if(55296<=n&&n<=56319)if(i===t-1)a.push(65533);else{var o=r.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=n&1023,c=o&1023;a.push(65536+(s<<10)+c),i+=1}else a.push(65533)}i+=1}return a}function tR(e){for(var r="",t=0;t<e.length;++t){var i=e[t];i<=65535?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return r}function za(e){return 0<=e&&e<=127}var qa=za,jr=-1;function Nh(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Nh.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():jr},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.shift());else this.tokens.unshift(e)}};var Hr=-1;function Ar(e,r){if(e)throw TypeError("Decoder error");return r||65533}function oi(e){throw TypeError("The code point "+e+" could not be encoded.")}function aR(){}aR.prototype={handler:function(e,r){}};function iR(){}iR.prototype={handler:function(e,r){}};function qh(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(zh,e)?zh[e]:null}var ny=[{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"}],zh={};ny.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){zh[t]=r})})});var ma={},ga={};function hs(e,r){return r&&r[e]||null}function ds(e,r){var t=r.indexOf(e);return t===-1?null:t}function sa(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 nR(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[0]<=e)r=n[0],t=n[1];else break}return t+e-r}function oR(e){if(e===59335)return 7457;var r=0,t=0,i=sa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[1]<=e)r=n[1],t=n[0];else break}return t+e-r}function sR(e){Lh=Lh||sa("jis0208").map(function(t,i){return hr(i,8272,8835)?null:t});var r=Lh;return r.indexOf(e)}var Lh;function cR(e){Dh=Dh||sa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Dh;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):ds(e,r)}var Dh,oy="utf-8";function wo(e,r){if(!(this instanceof wo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):oy,r=wl(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=qh(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ga[t.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=t,Boolean(r.fatal)&&(i._error_mode="fatal"),Boolean(r.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(wo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(wo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(wo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));wo.prototype.decode=function(r,t){var i;typeof r=="object"&&r instanceof ArrayBuffer?i=new Uint8Array(r):typeof r=="object"&&"buffer"in r&&r.buffer instanceof ArrayBuffer?i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):i=new Uint8Array(0),t=wl(t),this._do_not_flush||(this._decoder=ga[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new Nh(i),n=[],o;;){var s=a.read();if(s===jr||(o=this._decoder.handler(a,s),o===Hr))break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(a,a.read()),o===Hr)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function c(u){return eR(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(u.length>0&&u[0]===65279?(this._BOMseen=!0,u.shift()):u.length>0&&(this._BOMseen=!0)),tR(u)}return c.call(this,n)};function Sc(e,r){if(!(this instanceof Sc))throw TypeError("Called as a function. Did you forget 'new'?");r=wl(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var t=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):oy;var i=qh(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ma[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=qh("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=t._encoding.name.toLowerCase()),t}Object.defineProperty&&Object.defineProperty(Sc.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Sc.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=wl(t),this._do_not_flush||(this._encoder=ma[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new Nh(rR(r)),a=[],n;;){var o=i.read();if(o===jr||(n=this._encoder.handler(i,o),n===Hr))break;Array.isArray(n)?a.push.apply(a,n):a.push(n)}if(!this._do_not_flush){for(;n=this._encoder.handler(i,i.read()),n!==Hr;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function uR(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,c){if(c===jr&&a!==0)return a=0,Ar(r);if(c===jr)return Hr;if(a===0){if(hr(c,0,127))return c;if(hr(c,194,223))a=1,t=c&31;else if(hr(c,224,239))c===224&&(n=160),c===237&&(o=159),a=2,t=c&15;else if(hr(c,240,244))c===240&&(n=144),c===244&&(o=143),a=3,t=c&7;else return Ar(r);return null}if(!hr(c,n,o))return t=a=i=0,n=128,o=191,s.prepend(c),Ar(r);if(n=128,o=191,t=t<<6|c&63,i+=1,i!==a)return null;var u=t;return t=a=i=0,u}}function lR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a,n;hr(i,128,2047)?(a=1,n=192):hr(i,2048,65535)?(a=2,n=224):hr(i,65536,1114111)&&(a=3,n=240);for(var o=[(i>>6*a)+n];a>0;){var s=i>>6*(a-1);o.push(128|s&63),a-=1}return o}}ma["UTF-8"]=function(e){return new lR(e)};ga["UTF-8"]=function(e){return new uR(e)};function fR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(za(a))return a;var n=e[a-128];return n===null?Ar(t):n}}function pR(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;var n=ds(a,e);return n===null&&oi(a),n+128}}(function(){"encoding-indexes"in globalThis&&ny.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=sa(t.toLowerCase());ga[t]=function(a){return new fR(i,a)},ma[t]=function(a){return new pR(i,a)}})})})();ga.GBK=function(e){return new sy(e)};ma.GBK=function(e){return new cy(e,!0)};function sy(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===jr&&t===0&&i===0&&a===0)return Hr;o===jr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,Ar(r));var s;if(a!==0){s=null,hr(o,48,57)&&(s=nR((((t-129)*10+i-48)*126+a-129)*10+o-48));var c=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(c),Ar(r)):s}if(i!==0)return hr(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,Ar(r));if(t!==0){if(hr(o,48,57))return i=o,null;var u=t,l=null;t=0;var h=o<127?64:65;return(hr(o,64,126)||hr(o,128,254))&&(l=(u-129)*190+(o-h)),s=l===null?null:hs(l,sa("gb18030")),s===null&&za(o)&&n.prepend(o),s===null?Ar(r):s}return za(o)?o:o===128?8364:hr(o,129,254)?(t=o,null):Ar(r)}}function cy(e,r){var t=e.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(qa(a))return a;if(a===58853)return oi(a);if(r&&a===8364)return 128;var n=ds(a,sa("gb18030"));if(n!==null){var o=cn(n/190)+129,s=n%190,c=s<63?64:65;return[o,s+c]}if(r)return oi(a);n=oR(a);var u=cn(n/10/126/10);n=n-u*10*126*10;var l=cn(n/10/126);n=n-l*10*126;var h=cn(n/10),p=n-h*10;return[u+129,l+48,h+129,p+48]}}ma.gb18030=function(e){return new cy(e)};ga.gb18030=function(e){return new sy(e)};function hR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((hr(a,64,126)||hr(a,161,254))&&(o=(n-129)*157+(a-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=o===null?null:hs(o,sa("big5"));return c===null&&za(a)&&i.prepend(a),c===null?Ar(r):c}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function dR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=cR(i);if(a===null)return oi(i);var n=cn(a/157)+129;if(n<161)return oi(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}ma.Big5=function(e){return new dR(e)};ga.Big5=function(e){return new hR(e)};function mR(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===jr&&i!==0)return i=0,Ar(r);if(n===jr&&i===0)return Hr;if(i===142&&hr(n,161,223))return i=0,65377-161+n;if(i===143&&hr(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return hr(o,161,254)&&hr(n,161,254)&&(s=hs((o-161)*94+(n-161),sa(t?"jis0212":"jis0208"))),t=!1,hr(n,161,254)||a.prepend(n),s===null?Ar(r):s}return za(n)?n:n===142||n===143||hr(n,161,254)?(i=n,null):Ar(r)}}function gR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=ds(i,sa("jis0208"));if(a===null)return oi(i);var n=cn(a/94)+161,o=a%94+161;return[n,o]}}ma["EUC-JP"]=function(e){return new gR(e)};ga["EUC-JP"]=function(e){return new mR(e)};function vR(e){var r=e.fatal,t={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=t.ASCII,a=t.ASCII,n=0,o=!1;this.handler=function(s,c){switch(i){default:case t.ASCII:return c===27?(i=t.EscapeStart,null):hr(c,0,127)&&c!==14&&c!==15&&c!==27?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Roman:return c===27?(i=t.EscapeStart,null):c===92?(o=!1,165):c===126?(o=!1,8254):hr(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(o=!1,c):c===jr?Hr:(o=!1,Ar(r));case t.Katakana:return c===27?(i=t.EscapeStart,null):hr(c,33,95)?(o=!1,65377-33+c):c===jr?Hr:(o=!1,Ar(r));case t.LeadByte:return c===27?(i=t.EscapeStart,null):hr(c,33,126)?(o=!1,n=c,i=t.TrailByte,null):c===jr?Hr:(o=!1,Ar(r));case t.TrailByte:if(c===27)return i=t.EscapeStart,Ar(r);if(hr(c,33,126)){i=t.LeadByte;var u=(n-33)*94+c-33,l=hs(u,sa("jis0208"));return l===null?Ar(r):l}return c===jr?(i=t.LeadByte,s.prepend(c),Ar(r)):(i=t.LeadByte,Ar(r));case t.EscapeStart:return c===36||c===40?(n=c,i=t.Escape,null):(s.prepend(c),o=!1,i=a,Ar(r));case t.Escape:var h=n;n=0;var p=null;if(h===40&&c===66&&(p=t.ASCII),h===40&&c===74&&(p=t.Roman),h===40&&c===73&&(p=t.Katakana),h===36&&(c===64||c===66)&&(p=t.LeadByte),p!==null){i=i=p;var d=o;return o=!0,d?Ar(r):null}return s.prepend([h,c]),o=!1,i=a,Ar(r)}}}function yR(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===jr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===jr&&i===t.ASCII)return Hr;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return oi(65533);if(i===t.ASCII&&qa(n))return n;if(i===t.Roman&&(qa(n)&&n!==92&&n!==126||n==165||n==8254)){if(qa(n))return n;if(n===165)return 92;if(n===8254)return 126}if(qa(n)&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if((n===165||n===8254)&&i!==t.Roman)return a.prepend(n),i=t.Roman,[27,40,74];n===8722&&(n=65293);var o=ds(n,sa("jis0208"));if(o===null)return oi(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=cn(o/94)+33,c=o%94+33;return[s,c]}}ma["ISO-2022-JP"]=function(e){return new yR(e)};ga["ISO-2022-JP"]=function(e){return new vR(e)};function bR(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,c=n<160?129:193;if((hr(a,64,126)||hr(a,128,252))&&(o=(n-c)*188+a-s),hr(o,8836,10715))return 57344-8836+o;var u=o===null?null:hs(o,sa("jis0208"));return u===null&&za(a)&&i.prepend(a),u===null?Ar(r):u}return za(a)||a===128?a:hr(a,161,223)?65377-161+a:hr(a,129,159)||hr(a,224,252)?(t=a,null):Ar(r)}}function xR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(hr(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=sR(i);if(a===null)return oi(i);var n=cn(a/188),o=n<31?129:193,s=a%188,c=s<63?64:65;return[n+o,s+c]}}ma.Shift_JIS=function(e){return new xR(e)};ga.Shift_JIS=function(e){return new bR(e)};function _R(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===jr&&t!==0)return t=0,Ar(r);if(a===jr&&t===0)return Hr;if(t!==0){var n=t,o=null;t=0,hr(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:hs(o,sa("euc-kr"));return o===null&&za(a)&&i.prepend(a),s===null?Ar(r):s}return za(a)?a:hr(a,129,254)?(t=a,null):Ar(r)}}function wR(e){var r=e.fatal;this.handler=function(t,i){if(i===jr)return Hr;if(qa(i))return i;var a=ds(i,sa("euc-kr"));if(a===null)return oi(i);var n=cn(a/190)+129,o=a%190+65;return[n,o]}}ma["EUC-KR"]=function(e){return new wR(e)};ga["EUC-KR"]=function(e){return new _R(e)};function _l(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function uy(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===jr&&(i!==null||a!==null))return Ar(t);if(o===jr&&i===null&&a===null)return Hr;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var c=a;return a=null,hr(s,56320,57343)?65536+(c-55296)*1024+(s-56320):(n.prepend(_l(s,e)),Ar(t))}return hr(s,55296,56319)?(a=s,null):hr(s,56320,57343)?Ar(t):s}}function ly(e,r){var t=r.fatal;this.handler=function(i,a){if(a===jr)return Hr;if(hr(a,0,65535))return _l(a,e);var n=_l((a-65536>>10)+55296,e),o=_l((a-65536&1023)+56320,e);return n.concat(o)}}ma["UTF-16BE"]=function(e){return new ly(!0,e)};ga["UTF-16BE"]=function(e){return new uy(!0,e)};ma["UTF-16LE"]=function(e){return new ly(!1,e)};ga["UTF-16LE"]=function(e){return new uy(!1,e)};function kR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:za(i)?i:63360+i-128}}function SR(e){var r=e.fatal;this.handler=function(t,i){return i===jr?Hr:qa(i)?i:hr(i,63360,63487)?i-63360+128:oi(i)}}ma["x-user-defined"]=function(e){return new SR(e)};ga["x-user-defined"]=function(e){return new kR(e)};function Ec(e){return Buffer.from(e).toString("base64")}function Uh(e){return Buffer.from(e,"base64").toString("ascii")}var o_=Xt(i_(),1),s_=Xt(Bc(),1);function n_(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function D9(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,s_.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,o_.default)(i,t,r)}function c_(e,r){let t=D9(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(n_(n))})})}var z4=Xt(q4(),1),Hg=["image/png","image/jpeg","image/gif"];async function Vg(e,r){if(!r)throw new Error("MIMEType is required to parse image under Node.js");let t=e instanceof Buffer?e:Buffer.from(e);return await JU(t,r)}function JU(e,r){return new Promise(t=>(0,z4.default)(e,r,(i,a)=>{if(i)throw i;let n=[...a.shape],o=a.shape.length===4?a.shape.shift():1,s=a.data instanceof Buffer?new Uint8Array(a.data):a.data;t({shape:n,data:s,width:a.shape[0],height:a.shape[1],components:a.shape[2],layers:o?[o]:[]})}))}async function Gg(e,r,t,i){return i._parse(e,r,t,i)}function ki(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var Wi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ZU=Wi.self||Wi.window||Wi.global||{},eH=Wi.window||Wi.self||Wi.global||{},rH=Wi.global||Wi.self||Wi.window||{},tH=Wi.document||{};var No=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var N4=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),aH=N4&&parseFloat(N4[1])||0;var yp=globalThis,iH=globalThis.document||{},bp=globalThis.process||{},nH=globalThis.console,yee=globalThis.navigator||{};function U4(e){var i,a;if(typeof window<"u"&&((i=window.process)==null?void 0:i.type)==="renderer"||typeof process<"u"&&Boolean((a=process.versions)==null?void 0:a.electron))return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return Boolean(t&&t.indexOf("Electron")>=0)}function Uo(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||U4()}var Kg="4.0.7";function sH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var xp=class{constructor(r,t,i="sessionStorage"){this.storage=sH(i),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function H4(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function V4(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var _p;(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"})(_p||(_p={}));var cH=10;function G4(e){return typeof e!="string"?e:(e=e.toUpperCase(),_p[e]||_p.WHITE)}function K4(e,r,t){return!Uo&&typeof e=="string"&&(r&&(e=`\x1B[${G4(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${G4(t)+cH}m${e}\x1B[49m`)),e}function $4(e,r=["constructor"]){let t=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(t),a=e;for(let n of i){let o=a[n];typeof o=="function"&&(r.find(s=>n===s)||(a[n]=o.bind(e)))}}function Ru(e,r){if(!e)throw new Error(r||"Assertion failed")}function Ho(){var r,t,i,a,n;let e;if(Uo()&&yp.performance)e=(i=(t=(r=yp)==null?void 0:r.performance)==null?void 0:t.now)==null?void 0:i.call(t);else if("hrtime"in bp){let o=(n=(a=bp)==null?void 0:a.hrtime)==null?void 0:n.call(a);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var nc={debug:Uo()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},uH={enabled:!0,level:0};function oc(){}var W4={},X4={once:!0},Xi=class{constructor({id:r}={id:""}){this.VERSION=Kg,this._startTs=Ho(),this._deltaTs=Ho(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new xp(`__probe-${this.id}__`,uH),this.timeStamp(`${this.id} started`),$4(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ho()-this._startTs).toPrecision(10))}getDelta(){return Number((Ho()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,t){this._storage.setConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r){return this._getLogFunction(0,r,nc.warn,arguments,X4)}error(r){return this._getLogFunction(0,r,nc.error,arguments)}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t){return this._getLogFunction(r,t,nc.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,nc.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,nc.debug||nc.info,arguments,X4)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||oc,i&&[i],{tag:fH(t)}):oc}time(r,t){return this._getLogFunction(r,t,console.time?console.time:console.info)}timeEnd(r,t){return this._getLogFunction(r,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,t){return this._getLogFunction(r,t,console.timeStamp||oc)}group(r,t,i={collapsed:!1}){let a=Y4({logLevel:r,message:t,opts:i}),{collapsed:n}=i;return a.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}groupCollapsed(r,t,i={}){return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||oc)}withGroup(r,t,i){this.group(r,t)();try{i()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=Q4(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=Y4({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,Ru(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=Ho();let o=n.tag||n.message;if(n.once&&o)if(!W4[o])W4[o]=Ho();else return oc;return t=lH(this.id,n.message,n),i.bind(console,t,...n.args)}return oc}};Xi.VERSION=Kg;function Q4(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Ru(Number.isFinite(r)&&r>=0),r}function Y4(e){let{logLevel:r,message:t}=e;e.logLevel=Q4(r);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&i.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let a=typeof e.message;return Ru(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function lH(e,r,t){if(typeof r=="string"){let i=t.time?V4(H4(t.total)):"";r=t.time?`${e}: ${i} ${r}`:`${e}: ${r}`,r=K4(r,t.color,t.background)}return r}function fH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe={};var Hee=new Xi({id:"@probe.gl/log"});var $g="4.3.3",pH=$g[0]>="0"&&$g[0]<="9"?`v${$g}`:"";function hH(){let e=new Xi({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=pH,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var Wg=hH();function Xg(e,r){return J4(e||{},r)}function J4(e,r,t=0){if(t>3)return r;let i={...e};for(let[a,n]of Object.entries(r))n&&typeof n=="object"&&!Array.isArray(n)?i[a]=J4(i[a]||{},r[a],t+1):i[a]=r[a];return i}function Yg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Qg(e){var t,i;return((i=(t=globalThis.loaders)==null?void 0:t.modules)==null?void 0:i[e])||null}var Z4="latest";function dH(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.3"),globalThis._loadersgl_.version}var Pu=dH();function Wt(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var Yi={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Zee=Yi.self||Yi.window||Yi.global||{},ere=Yi.window||Yi.self||Yi.global||{},rre=Yi.global||Yi.self||Yi.window||{},tre=Yi.document||{};var Nt=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ou=typeof importScripts=="function",r5=typeof window<"u"&&typeof window.orientation<"u",e5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),are=e5&&parseFloat(e5[1])||0;var Cu=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(r,t){this.name=r,this.workerThread=t,this.result=new Promise((i,a)=>{this._resolve=i,this._reject=a})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){Wt(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){Wt(this.isRunning),this.isRunning=!1,this._reject(r)}};var po={};xl(po,{NodeWorker:()=>Fu,parentPort:()=>Jg});var Bu=Xt(require("worker_threads"),1);kc(po,require("worker_threads"));var Jg=Bu==null?void 0:Bu.parentPort,Fu=Bu.Worker;var Zg=new Map;function t5(e){Wt(e.source&&!e.url||!e.source&&e.url);let r=Zg.get(e.source||e.url);return r||(e.url&&(r=mH(e.url),Zg.set(e.url,r)),e.source&&(r=a5(e.source),Zg.set(e.source,r))),Wt(r),r}function mH(e){if(!e.startsWith("http"))return e;let r=gH(e);return a5(r)}function a5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function gH(e){return`try {
95
95
  importScripts('${e}');
96
96
  } catch (error) {
97
97
  console.error(error);
98
98
  throw error;
99
- }`}function Iu(e,r=!0,t){let i=t||new Set;if(e){if(i5(e))i.add(e);else if(i5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Iu(e[a],r,i)}}return t===void 0?Array.from(i):[]}function i5(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}var ev=()=>{},ho=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Nt||typeof Fu<"u"&&!Nt}constructor(r){let{name:t,source:i,url:a}=r;Wt(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=ev,this.onError=n=>console.log(n),this.worker=Nt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=ev,this.onError=ev,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Iu(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=t5({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;r=new Fu(i,{eval:!1})}else if(this.source)r=new Fu(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var Mu=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return ho.isSupported()}constructor(r){this.source=r.source,this.url=r.url,this.setProps(r)}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(a,n,o)=>a.done(o),i=(a,n)=>a.error(n)){let a=new Promise(n=>(this.jobQueue.push({name:r,onMessage:t,onError:i,onStart:n}),this));return this._startQueuedJob(),await a}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let i=new Cu(t.name,r);r.onMessage=a=>t.onMessage(i,a.type,a.payload),r.onError=a=>t.onError(i,a),t.onStart(i);try{await i.result}catch(a){console.error(`Worker exception: ${a}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!Nt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new ho({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return r5?this.maxMobileConcurrency:this.maxConcurrency}};var vH={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Vo=class{props;workerPools=new Map;static isSupported(){return ho.isSupported()}static getWorkerFarm(r={}){return Vo._workerFarm=Vo._workerFarm||new Vo({}),Vo._workerFarm.setProps(r),Vo._workerFarm}constructor(r){this.props={...vH},this.setProps(r),this.workerPools=new Map}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:i,url:a}=r,n=this.workerPools.get(t);return n||(n=new Mu({name:t,source:i,url:a}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},mo=Vo;ty(mo,"_workerFarm");async function Go(){return Jg}var rv=new Map,Ca=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await Go())}static set onmessage(r){async function t(i){let a=await Go(),{type:n,payload:o}=a?i:i.data;r(n,o)}Go().then(i=>{i?(i.on("message",a=>{t(a)}),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=rv.get(r);t||(t=async a=>{if(!yH(a))return;let n=await Go(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await Go()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=rv.get(r);rv.delete(r),await Go()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Iu(t),n=await Go();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function yH(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function tv(e,r={}){let t=r[e.id]||{},i=Nt?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(Nt?a=`modules/${e.module}/dist/${i}`:a=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!a){let n=e.version;n==="latest"&&(n=Z4);let o=n?`@${n}`:"";a=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return Wt(a),a}function av(e,r=Pu){Wt(e,"no worker provided");let t=e.version;return!(!r||!t)}var iv={};async function Qi(e,r=null,t={},i=null){return r&&(e=n5(e,r,t,i)),iv[e]=iv[e]||bH(e),await iv[e]}function n5(e,r,t={},i=null){if(!t.useLocalLibraries&&e.startsWith("http"))return e;i=i||e;let a=t.modules||{};return a[i]?a[i]:Nt?t.CDN?(Wt(t.CDN.startsWith("http")),`${t.CDN}/${r}@${Pu}/dist/libs/${i}`):Ou?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function bH(e){if(e.endsWith("wasm"))return await _H(e);if(!Nt)try{let{requireFromFile:t}=globalThis.loaders||{};return await(t==null?void 0:t(e))}catch(t){return console.error(t),null}if(Ou)return importScripts(e);let r=await wH(e);return xH(r,e)}function xH(e,r){if(!Nt){let{requireFromString:i}=globalThis.loaders||{};return i==null?void 0:i(e,r)}if(Ou)return eval.call(globalThis,e),null;let t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}async function _H(e){let{readFileAsArrayBuffer:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await r(e)}async function wH(e){let{readFileAsText:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).text():await r(e)}var kH=0;async function nv(e){await Ca.inWorkerThread()&&(Ca.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await EH({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:SH}});Ca.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Ca.postMessage("error",{error:a})}break;default:}})}function SH(e,r,t,i){return new Promise((a,n)=>{let o=kH++,s=(u,l)=>{if(l.id===o)switch(u){case"done":Ca.removeEventListener(s),a(l.result);break;case"error":Ca.removeEventListener(s),n(l.error);break;default:}};Ca.addEventListener(s);let c={id:o,input:e,options:t};Ca.postMessage("process",c)})}async function EH({loader:e,arrayBuffer:r,options:t,context:i}){let a,n;if(e.parseSync||e.parse)a=r,n=e.parseSync||e.parse;else if(e.parseTextSync)a=new TextDecoder().decode(r),n=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await n(a,{...t},i,e)}function ov(e,r){return!mo.isSupported()||!Nt&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function sv(e,r,t,i,a){let n=e.id,o=tv(e,t),c=mo.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let u=await c.startJob("process-on-worker",AH.bind(null,a));return u.postMessage("process",{input:r,options:t,context:i}),await(await u.result).result}async function AH(e,r,t,i){switch(t){case"done":r.done(i);break;case"error":r.error(new Error(i.error));break;case"process":let{id:a,input:n,options:o}=i;try{let s=await e(n,o);r.postMessage("done",{id:a,result:s})}catch(s){let c=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function cv(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let i=new Uint8Array(e),a=new Uint8Array(r);for(let n=0;n<i.length;++n)if(i[n]!==a[n])return!1;return!0}function uv(...e){return o5(e)}function o5(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}async function Lu(e){let r=[];for await(let t of e)r.push(t);return uv(...r)}var jH="",s5={};function Ko(e){for(let r in s5)if(e.startsWith(r)){let t=s5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${jH}${e}`),e}function c5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function u5(e){return e&&typeof e=="object"&&e.isBuffer}function wp(e){if(u5(e))return c5(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 r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var $o={};xl($o,{dirname:()=>PH,filename:()=>RH,join:()=>OH,resolve:()=>CH});function l5(){var r;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(r=window.location)==null?void 0:r.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function RH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function PH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function OH(...e){let r="/";return e=e.map((t,i)=>(i&&(t=t.replace(new RegExp(`^${r}`),"")),i!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function CH(...e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n];let t="",i=!1,a;for(let n=r.length-1;n>=-1&&!i;n--){let o;n>=0?o=r[n]:(a===void 0&&(a=l5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Du)}return t=BH(t,!i),i?`/${t}`:t.length>0?t:"."}var Du=47,lv=46;function BH(e,r){let t="",i=-1,a=0,n,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===Du)break;n=Du}if(n===Du){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==lv||t.charCodeAt(t.length-2)!==lv){if(t.length>2){let c=t.length-1,u=c;for(;u>=0&&t.charCodeAt(u)!==Du;--u);if(u!==c){t=u===-1?"":t.slice(0,u),i=s,a=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",i=s,a=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{let c=e.slice(i+1,s);t.length>0?t+=`/${c}`:t=c,o=!1}i=s,a=0}else n===lv&&a!==-1?++a:a=-1}return t}var En=Xt(require("fs"),1),Wo=class{handle;size;bigsize;url;constructor(r,t,i){r=Ko(r),this.handle=En.default.openSync(r,t,i);let a=En.default.fstatSync(this.handle,{bigint:!0});this.size=Number(a.size),this.bigsize=a.size,this.url=r}async close(){return new Promise((r,t)=>{En.default.close(this.handle,i=>i?t(i):r())})}async truncate(r){return new Promise((t,i)=>{En.default.ftruncate(this.handle,r,a=>{a?i(a):(this.bigsize=BigInt(r),this.size=Number(this.bigsize),t())})})}async append(r){return new Promise((t,i)=>{En.default.appendFile(this.handle,r,a=>{a?i(a):(this.bigsize=this.bigsize+BigInt(r.length),this.size=Number(this.bigsize),t())})})}async stat(){return await new Promise((r,t)=>En.default.fstat(this.handle,{bigint:!0},(i,a)=>{let n={size:Number(a.size),bigsize:a.size,isDirectory:a.isDirectory()};i?t(i):r(n)}))}async read(r,t){let i=new ArrayBuffer(t),a=BigInt(r),n=0,o=new Uint8Array(i),s;for(;t>0;){let c=await FH(this.handle,o,0,t,a);if(c===0)break;n+=c,a+=BigInt(c),t-=c,s!==void 0&&(s+=c)}return n<t?i.slice(0,n):i}async write(r,t=0,i=r.byteLength){return new Promise((a,n)=>{let o=Number(t),s=new Uint8Array(r,Number(t),i);En.default.write(this.handle,s,0,i,o,(c,u)=>c?n(c):a(u))})}};async function FH(e,r,t,i,a){return await new Promise((n,o)=>En.default.read(e,r,t,i,a,(s,c)=>s?o(s):n(c)))}var Ap=Xt(require("fs/promises"),1);var pv=Xt(require("fs"),1),fv=require("stream");var kp=Xt(require("zlib"),1),IH=e=>e&&e instanceof ArrayBuffer,MH=e=>e&&e instanceof Buffer;function Sp(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(kp.default.createBrotliDecompress());case"gzip":return e.pipe(kp.default.createGunzip());case"deflate":return e.pipe(kp.default.createDeflate());default:return e}}async function f5(e){let r=[];return await new Promise((t,i)=>{e.on("error",a=>i(a)),e.on("readable",()=>e.read()),e.on("data",a=>{typeof a=="string"&&i(new Error("Read stream not binary")),r.push(DH(a))}),e.on("end",()=>{let a=LH(r);t(a)})})}function LH(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}function DH(e){if(IH(e))return e;if(MH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var qH=e=>typeof e=="boolean",p5=e=>typeof e=="function",zH=e=>e!==null&&typeof e=="object",NH=e=>zH(e)&&p5(e.read)&&p5(e.pipe)&&qH(e.readable);async function Ep(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=Ko(i);let a=new Headers;e.endsWith(".gz")&&(a["content-encoding"]="gzip"),e.endsWith(".br")&&(a["content-encoding"]="br");try{let n=await new Promise((h,p)=>{let d=pv.default.createReadStream(i,{encoding:null});d.once("readable",()=>h(d)),d.on("error",v=>p(v))}),o=n;NH(n)?o=Sp(n,a):typeof n=="string"?o=fv.Readable.from([new TextEncoder().encode(n)]):o=fv.Readable.from([n||new ArrayBuffer(0)]);let s=200,c="OK",u=UH(i),l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}catch(n){let o=n.message,s=400,c=o,u={},l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}}function UH(e){let r={};if(!r["content-length"]){let t=pv.default.statSync(e);r["content-length"]=t.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip"),new Headers(r)}var jp=class{readable=!0;writable=!0;constructor(){}async readdir(r=".",t){return await Ap.default.readdir(r,t)}async stat(r){let t=await Ap.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Ap.default.unlink(r)}async fetch(r,t){return await Ep(r,t)}async openReadableFile(r,t="r"){return new Wo(r,t)}async openWritableFile(r,t="w",i){return new Wo(r,t,i)}};var qu=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let c of r)i.push(c),yield c;let a=await this.concatenate(i),n=await this.hash(a,t);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:n})}async concatenate(r){return await Lu(r)}};var zu=Xt(require("crypto"),1),Tp=class extends qu{name="crypto-node";options;_algorithm;_hash;constructor(r){var t,i;if(super(),this.options=r,!((i=(t=this.options)==null?void 0:t.crypto)!=null&&i.algorithm))throw new Error(this.name)}async hash(r,t){var a,n,o,s;let i=(o=(n=(a=this.options)==null?void 0:a.crypto)==null?void 0:n.algorithm)==null?void 0:o.toLowerCase();try{if(!zu.createHash)throw new Error("crypto.createHash not available");let c=(s=zu.createHash)==null?void 0:s(i),u=new Uint8Array(r);return c.update(u).digest("base64")}catch(c){throw Error(`${i} hash not available. ${c}`)}}async*hashBatches(r,t="base64"){var n,o,s,c,u,l,h;if(!zu.createHash)throw new Error("crypto.createHash not available");let i=(c=zu.createHash)==null?void 0:c((s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let p of r){let d=new Uint8Array(p);i.update(d),yield p}let a=i.digest(t);(h=(l=(u=this.options)==null?void 0:u.crypto)==null?void 0:l.onEnd)==null||h.call(l,{hash:a})}};var VA=require("node:process");var h5=Xt(require("stream"),1),hv=class{},HH=h5.Readable||hv;function mv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new dv(t,r)}var dv=class extends HH{_pulling;_bytesMode;_iterator;constructor(r,t){super(t),this._iterator=r,this._pulling=!1,this._bytesMode=!t||!t.objectMode}async _read(r){this._pulling||(this._pulling=!0,this._pulling=await this._pull(r,this._iterator))}async _destroy(r,t){var i,a,n,o;this._iterator&&(r?await((a=(i=this._iterator)==null?void 0:i.throw)==null?void 0:a.call(i,r)):await((o=(n=this._iterator)==null?void 0:n.return)==null?void 0:o.call(n,r)),t==null||t(null))}async _pull(r,t){var n;let i=this._bytesMode,a=null;for(;this.readable&&!(a=await t.next()).done&&(r!==null&&(r-=i&&ArrayBuffer.isView(a.value)?a.value.byteLength:1),!(!this.push(new Uint8Array(a.value))||r<=0)););return(a!=null&&a.done||!this.readable)&&(this.push(null)||!0)&&((n=t==null?void 0:t.return)==null||n.call(t)),!this.readable}};function Ku(){}function mt(e){return typeof e=="object"&&e!==null||typeof e=="function"}var B5=Ku;function Pr(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch{}}var Iv=Promise,VH=Promise.resolve.bind(Iv),GH=Promise.prototype.then,KH=Promise.reject.bind(Iv),$H=VH;function kt(e){return new Iv(e)}function Or(e){return kt(r=>r(e))}function $e(e){return KH(e)}function rn(e,r,t){return GH.call(e,r,t)}function wa(e,r,t){rn(rn(e,r,t),void 0,B5)}function gv(e,r){wa(e,r)}function Ev(e,r){wa(e,void 0,r)}function On(e,r,t){return rn(e,r,t)}function dc(e){rn(e,void 0,B5)}var es=e=>{if(typeof queueMicrotask=="function")es=queueMicrotask;else{let r=Or(void 0);es=t=>rn(r,t)}return es(e)};function rs(e,r,t){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function Bn(e,r,t){try{return Or(rs(e,r,t))}catch(i){return $e(i)}}var ka=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(r){let t=this._back,i=t;t._elements.length===16383&&(i={_elements:[],_next:void 0}),t._elements.push(r),i!==t&&(this._back=i,t._next=i),++this._size}shift(){let r=this._front,t=r,i=this._cursor,a=i+1,n=r._elements,o=n[i];return a===16384&&(t=r._next,a=0),--this._size,this._cursor=a,r!==t&&(this._front=t),n[i]=void 0,o}forEach(r){let t=this._cursor,i=this._front,a=i._elements;for(;!(t===a.length&&i._next===void 0||t===a.length&&(i=i._next,a=i._elements,t=0,a.length===0));)r(a[t]),++t}peek(){let r=this._front,t=this._cursor;return r._elements[t]}},F5=Symbol("[[AbortSteps]]"),I5=Symbol("[[ErrorSteps]]"),Mv=Symbol("[[CancelSteps]]"),Lv=Symbol("[[PullSteps]]"),Dv=Symbol("[[ReleaseSteps]]");function M5(e,r){e._ownerReadableStream=r,r._reader=e,r._state==="readable"?Av(e):r._state==="closed"?function(t){Av(t),D5(t)}(e):L5(e,r._storedError)}function qv(e,r){return Si(e._ownerReadableStream,r)}function Pn(e){let r=e._ownerReadableStream;r._state==="readable"?zv(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){L5(t,i)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[Dv](),r._reader=void 0,e._ownerReadableStream=void 0}function Hp(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Av(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t})}function L5(e,r){Av(e),zv(e,r)}function zv(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function D5(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var d5=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},WH=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function tn(e,r){if(e!==void 0&&typeof(t=e)!="object"&&typeof t!="function")throw new TypeError(`${r} is not an object.`);var t}function Ja(e,r){if(typeof e!="function")throw new TypeError(`${r} is not a function.`)}function q5(e,r){if(!function(t){return typeof t=="object"&&t!==null||typeof t=="function"}(e))throw new TypeError(`${r} is not an object.`)}function Cn(e,r,t){if(e===void 0)throw new TypeError(`Parameter ${r} is required in '${t}'.`)}function jv(e,r,t){if(e===void 0)throw new TypeError(`${r} is required in '${t}'.`)}function Nv(e){return Number(e)}function m5(e){return e===0?0:e}function Uv(e,r){let t=Number.MAX_SAFE_INTEGER,i=Number(e);if(i=m5(i),!d5(i))throw new TypeError(`${r} is not a finite number`);if(i=function(a){return m5(WH(a))}(i),i<0||i>t)throw new TypeError(`${r} is outside the accepted range of 0 to ${t}, inclusive`);return d5(i)&&i!==0?i:0}function Hv(e,r){if(!go(e))throw new TypeError(`${r} is not a ReadableStream.`)}function uc(e){return new An(e)}function z5(e,r){e._reader._readRequests.push(r)}function Vv(e,r,t){let i=e._reader._readRequests.shift();t?i._closeSteps():i._chunkSteps(r)}function Qp(e){return e._reader._readRequests.length}function N5(e){let r=e._reader;return r!==void 0&&!!vo(r)}var An=class{constructor(r){if(Cn(r,1,"ReadableStreamDefaultReader"),Hv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");M5(this,r),this._readRequests=new ka}get closed(){return vo(this)?this._closedPromise:$e(Rp("closed"))}cancel(r=void 0){return vo(this)?this._ownerReadableStream===void 0?$e(Hp("cancel")):qv(this,r):$e(Rp("cancel"))}read(){if(!vo(this))return $e(Rp("read"));if(this._ownerReadableStream===void 0)return $e(Hp("read from"));let r,t,i=kt((a,n)=>{r=a,t=n});return $u(this,{_chunkSteps:a=>r({value:a,done:!1}),_closeSteps:()=>r({value:void 0,done:!0}),_errorSteps:a=>t(a)}),i}releaseLock(){if(!vo(this))throw Rp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");U5(r,t)}(this)}};function vo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof An}function $u(e,r){let t=e._ownerReadableStream;t._disturbed=!0,t._state==="closed"?r._closeSteps():t._state==="errored"?r._errorSteps(t._storedError):t._readableStreamController[Lv](r)}function U5(e,r){let t=e._readRequests;e._readRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Rp(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var vv,yv,bv;function Uu(e){return e.slice()}function H5(e,r,t,i,a){new Uint8Array(e).set(new Uint8Array(t,i,a),r)}Object.defineProperties(An.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(An.prototype.cancel,"cancel"),Pr(An.prototype.read,"read"),Pr(An.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(An.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var ts=e=>(ts=typeof e.transfer=="function"?r=>r.transfer():typeof structuredClone=="function"?r=>structuredClone(r,{transfer:[r]}):r=>r,ts(e)),as=e=>(as=typeof e.detached=="boolean"?r=>r.detached:r=>r.byteLength===0,as(e));function V5(e,r,t){if(e.slice)return e.slice(r,t);let i=t-r,a=new ArrayBuffer(i);return H5(a,0,e,r,i),a}function Hu(e,r){let t=e[r];if(t!=null){if(typeof t!="function")throw new TypeError(`${String(r)} is not a function`);return t}}function g5(e){try{let r=e.done,t=e.value;return rn($H(t),i=>({done:r,value:i}))}catch(r){return $e(r)}}var rl=(bv=(vv=Symbol.asyncIterator)!==null&&vv!==void 0?vv:(yv=Symbol.for)===null||yv===void 0?void 0:yv.call(Symbol,"Symbol.asyncIterator"))!==null&&bv!==void 0?bv:"@@asyncIterator";function G5(e,r="sync",t){if(t===void 0)if(r==="async"){if((t=Hu(e,rl))===void 0)return function(a){let n={next(){let o;try{o=K5(a)}catch(s){return $e(s)}return g5(o)},return(o){let s;try{let c=Hu(a.iterator,"return");if(c===void 0)return Or({done:!0,value:o});s=rs(c,a.iterator,[o])}catch(c){return $e(c)}return mt(s)?g5(s):$e(new TypeError("The iterator.return() method must return an object"))}};return{iterator:n,nextMethod:n.next,done:!1}}(G5(e,"sync",Hu(e,Symbol.iterator)))}else t=Hu(e,Symbol.iterator);if(t===void 0)throw new TypeError("The object is not iterable");let i=rs(t,e,[]);if(!mt(i))throw new TypeError("The iterator method must return an object");return{iterator:i,nextMethod:i.next,done:!1}}function K5(e){let r=rs(e.nextMethod,e.iterator,[]);if(!mt(r))throw new TypeError("The iterator.next() method must return an object");return r}var Vp=class{constructor(r,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=r,this._preventCancel=t}next(){let r=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?On(this._ongoingPromise,r,r):r(),this._ongoingPromise}return(r){let t=()=>this._returnSteps(r);return this._ongoingPromise?On(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let r=this._reader,t,i,a=kt((n,o)=>{t=n,i=o});return $u(r,{_chunkSteps:n=>{this._ongoingPromise=void 0,es(()=>t({value:n,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),t({value:void 0,done:!0})},_errorSteps:n=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),i(n)}}),a}_returnSteps(r){if(this._isFinished)return Promise.resolve({value:r,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let i=qv(t,r);return Pn(t),On(i,()=>({value:r,done:!0}))}return Pn(t),Or({value:r,done:!0})}},$5={next(){return v5(this)?this._asyncIteratorImpl.next():$e(y5("next"))},return(e){return v5(this)?this._asyncIteratorImpl.return(e):$e(y5("return"))},[rl](){return this}};function v5(e){if(!mt(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof Vp}catch{return!1}}function y5(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty($5,rl,{enumerable:!1});var W5=Number.isNaN||function(e){return e!=e};function b5(e){let r=V5(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Tv(e){let r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function Gv(e,r,t){if(typeof(i=t)!="number"||W5(i)||i<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var i;e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function xo(e){e._queue=new ka,e._queueTotalSize=0}function X5(e){return e===DataView}var yo=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!xv(this))throw _v("view");return this._view}respond(r){if(!xv(this))throw _v("respond");if(Cn(r,1,"respond"),r=Uv(r,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");qp(this._associatedReadableByteStreamController,r)}respondWithNewView(r){if(!xv(this))throw _v("respondWithNewView");if(Cn(r,1,"respondWithNewView"),!ArrayBuffer.isView(r))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(r.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");zp(this._associatedReadableByteStreamController,r)}};Object.defineProperties(yo.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Pr(yo.prototype.respond,"respond"),Pr(yo.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yo.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Zi=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Jo(this))throw Nu("byobRequest");return Ov(this)}get desiredSize(){if(!Jo(this))throw Nu("desiredSize");return nA(this)}close(){if(!Jo(this))throw Nu("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be closed`);Vu(this)}enqueue(r){if(!Jo(this))throw Nu("enqueue");if(Cn(r,1,"enqueue"),!ArrayBuffer.isView(r))throw new TypeError("chunk must be an array buffer view");if(r.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(r.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Dp(this,r)}error(r=void 0){if(!Jo(this))throw Nu("error");Qa(this,r)}[Mv](r){Y5(this),xo(this);let t=this._cancelAlgorithm(r);return Jp(this),t}[Lv](r){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void iA(this,r);let i=this._autoAllocateChunkSize;if(i!==void 0){let a;try{a=new ArrayBuffer(i)}catch(o){return void r._errorSteps(o)}let n={buffer:a,bufferByteLength:i,byteOffset:0,byteLength:i,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}z5(t,r),os(this)}[Dv](){if(this._pendingPullIntos.length>0){let r=this._pendingPullIntos.peek();r.readerType="none",this._pendingPullIntos=new ka,this._pendingPullIntos.push(r)}}};function Jo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Zi}function xv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof yo}function os(e){if(function(t){let i=t._controlledReadableByteStream;return i._state!=="readable"||t._closeRequested||!t._started?!1:!!(N5(i)&&Qp(i)>0||$v(i)&&cA(i)>0||nA(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,os(e)),null),t=>(Qa(e,t),null))}}function Y5(e){Kv(e),e._pendingPullIntos=new ka}function Rv(e,r){let t=!1;e._state==="closed"&&(t=!0);let i=Q5(r);r.readerType==="default"?Vv(e,i,t):function(a,n,o){let s=a._reader,c=s._readIntoRequests.shift();o?c._closeSteps(n):c._chunkSteps(n)}(e,i,t)}function Q5(e){let r=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/t)}function Lp(e,r,t,i){e._queue.push({buffer:r,byteOffset:t,byteLength:i}),e._queueTotalSize+=i}function J5(e,r,t,i){let a;try{a=V5(r,t,t+i)}catch(n){throw Qa(e,n),n}Lp(e,a,0,i)}function Z5(e,r){r.bytesFilled>0&&J5(e,r.buffer,r.byteOffset,r.bytesFilled),lc(e)}function eA(e,r){let t=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),i=r.bytesFilled+t,a=t,n=!1,o=i-i%r.elementSize;o>=r.minimumFill&&(a=o-r.bytesFilled,n=!0);let s=e._queue;for(;a>0;){let c=s.peek(),u=Math.min(a,c.byteLength),l=r.byteOffset+r.bytesFilled;H5(r.buffer,l,c.buffer,c.byteOffset,u),c.byteLength===u?s.shift():(c.byteOffset+=u,c.byteLength-=u),e._queueTotalSize-=u,rA(e,u,r),a-=u}return n}function rA(e,r,t){t.bytesFilled+=r}function tA(e){e._queueTotalSize===0&&e._closeRequested?(Jp(e),tl(e._controlledReadableByteStream)):os(e)}function Kv(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Pv(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let r=e._pendingPullIntos.peek();eA(e,r)&&(lc(e),Rv(e._controlledReadableByteStream,r))}}function XH(e,r,t,i){let a=e._controlledReadableByteStream,n=r.constructor,o=function(p){return X5(p)?1:p.BYTES_PER_ELEMENT}(n),{byteOffset:s,byteLength:c}=r,u=t*o,l;try{l=ts(r.buffer)}catch(p){return void i._errorSteps(p)}let h={buffer:l,bufferByteLength:l.byteLength,byteOffset:s,byteLength:c,bytesFilled:0,minimumFill:u,elementSize:o,viewConstructor:n,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(h),void x5(a,i);if(a._state!=="closed"){if(e._queueTotalSize>0){if(eA(e,h)){let p=Q5(h);return tA(e),void i._chunkSteps(p)}if(e._closeRequested){let p=new TypeError("Insufficient bytes to fill elements in the given buffer");return Qa(e,p),void i._errorSteps(p)}}e._pendingPullIntos.push(h),x5(a,i),os(e)}else{let p=new n(h.buffer,h.byteOffset,0);i._closeSteps(p)}}function aA(e,r){let t=e._pendingPullIntos.peek();Kv(e),e._controlledReadableByteStream._state==="closed"?function(i,a){a.readerType==="none"&&lc(i);let n=i._controlledReadableByteStream;if($v(n))for(;cA(n)>0;)Rv(n,lc(i))}(e,t):function(i,a,n){if(rA(0,a,n),n.readerType==="none")return Z5(i,n),void Pv(i);if(n.bytesFilled<n.minimumFill)return;lc(i);let o=n.bytesFilled%n.elementSize;if(o>0){let s=n.byteOffset+n.bytesFilled;J5(i,n.buffer,s-o,o)}n.bytesFilled-=o,Rv(i._controlledReadableByteStream,n),Pv(i)}(e,r,t),os(e)}function lc(e){return e._pendingPullIntos.shift()}function Jp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Vu(e){let r=e._controlledReadableByteStream;if(!e._closeRequested&&r._state==="readable")if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){let i=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Qa(e,i),i}}Jp(e),tl(r)}}function Dp(e,r){let t=e._controlledReadableByteStream;if(e._closeRequested||t._state!=="readable")return;let{buffer:i,byteOffset:a,byteLength:n}=r;if(as(i))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let o=ts(i);if(e._pendingPullIntos.length>0){let s=e._pendingPullIntos.peek();if(as(s.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Kv(e),s.buffer=ts(s.buffer),s.readerType==="none"&&Z5(e,s)}N5(t)?(function(s){let c=s._controlledReadableByteStream._reader;for(;c._readRequests.length>0;){if(s._queueTotalSize===0)return;iA(s,c._readRequests.shift())}}(e),Qp(t)===0?Lp(e,o,a,n):(e._pendingPullIntos.length>0&&lc(e),Vv(t,new Uint8Array(o,a,n),!1))):$v(t)?(Lp(e,o,a,n),Pv(e)):Lp(e,o,a,n),os(e)}function Qa(e,r){let t=e._controlledReadableByteStream;t._state==="readable"&&(Y5(e),xo(e),Jp(e),TA(t,r))}function iA(e,r){let t=e._queue.shift();e._queueTotalSize-=t.byteLength,tA(e);let i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);r._chunkSteps(i)}function Ov(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let r=e._pendingPullIntos.peek(),t=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),i=Object.create(yo.prototype);(function(a,n,o){a._associatedReadableByteStreamController=n,a._view=o})(i,e,t),e._byobRequest=i}return e._byobRequest}function nA(e){let r=e._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function qp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=ts(t.buffer),aA(e,r)}function zp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=r.byteLength;t.buffer=ts(r.buffer),aA(e,i)}function oA(e,r,t,i,a,n,o){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,xo(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,r._autoAllocateChunkSize=o,r._pendingPullIntos=new ka,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,os(r),null),s=>(Qa(r,s),null))}function _v(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Nu(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function YH(e,r){if((e=`${e}`)!="byob")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function sA(e){return new jn(e)}function x5(e,r){e._reader._readIntoRequests.push(r)}function cA(e){return e._reader._readIntoRequests.length}function $v(e){let r=e._reader;return r!==void 0&&!!Zo(r)}Object.defineProperties(Zi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Zi.prototype.close,"close"),Pr(Zi.prototype.enqueue,"enqueue"),Pr(Zi.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Zi.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var jn=class{constructor(r){if(Cn(r,1,"ReadableStreamBYOBReader"),Hv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Jo(r._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");M5(this,r),this._readIntoRequests=new ka}get closed(){return Zo(this)?this._closedPromise:$e(Pp("closed"))}cancel(r=void 0){return Zo(this)?this._ownerReadableStream===void 0?$e(Hp("cancel")):qv(this,r):$e(Pp("cancel"))}read(r,t={}){if(!Zo(this))return $e(Pp("read"));if(!ArrayBuffer.isView(r))return $e(new TypeError("view must be an array buffer view"));if(r.byteLength===0)return $e(new TypeError("view must have non-zero byteLength"));if(r.buffer.byteLength===0)return $e(new TypeError("view's buffer must have non-zero byteLength"));if(as(r.buffer))return $e(new TypeError("view's buffer has been detached"));let i;try{i=function(c,u){var l;return tn(c,u),{min:Uv((l=c==null?void 0:c.min)!==null&&l!==void 0?l:1,`${u} has member 'min' that`)}}(t,"options")}catch(c){return $e(c)}let a=i.min;if(a===0)return $e(new TypeError("options.min must be greater than 0"));if(function(c){return X5(c.constructor)}(r)){if(a>r.byteLength)return $e(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(a>r.length)return $e(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return $e(Hp("read from"));let n,o,s=kt((c,u)=>{n=c,o=u});return uA(this,r,a,{_chunkSteps:c=>n({value:c,done:!1}),_closeSteps:c=>n({value:c,done:!0}),_errorSteps:c=>o(c)}),s}releaseLock(){if(!Zo(this))throw Pp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");lA(r,t)}(this)}};function Zo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof jn}function uA(e,r,t,i){let a=e._ownerReadableStream;a._disturbed=!0,a._state==="errored"?i._errorSteps(a._storedError):XH(a._readableStreamController,r,t,i)}function lA(e,r){let t=e._readIntoRequests;e._readIntoRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Pp(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Wu(e,r){let{highWaterMark:t}=e;if(t===void 0)return r;if(W5(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function Gp(e){let{size:r}=e;return r||(()=>1)}function Kp(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark,i=e==null?void 0:e.size;return{highWaterMark:t===void 0?void 0:Nv(t),size:i===void 0?void 0:QH(i,`${r} has member 'size' that`)}}function QH(e,r){return Ja(e,r),t=>Nv(e(t))}function JH(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function ZH(e,r,t){return Ja(e,t),()=>Bn(e,r,[])}function eV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function rV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function fA(e,r){if(!cc(e))throw new TypeError(`${r} is not a WritableStream.`)}Object.defineProperties(jn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(jn.prototype.cancel,"cancel"),Pr(jn.prototype.read,"read"),Pr(jn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(jn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var tV=typeof AbortController=="function",Tn=class{constructor(r={},t={}){r===void 0?r=null:q5(r,"First parameter");let i=Kp(t,"Second parameter"),a=function(o,s){tn(o,s);let c=o==null?void 0:o.abort,u=o==null?void 0:o.close,l=o==null?void 0:o.start,h=o==null?void 0:o.type,p=o==null?void 0:o.write;return{abort:c===void 0?void 0:JH(c,o,`${s} has member 'abort' that`),close:u===void 0?void 0:ZH(u,o,`${s} has member 'close' that`),start:l===void 0?void 0:eV(l,o,`${s} has member 'start' that`),write:p===void 0?void 0:rV(p,o,`${s} has member 'write' that`),type:h}}(r,"First parameter");if(hA(this),a.type!==void 0)throw new RangeError("Invalid type is specified");let n=Gp(i);(function(o,s,c,u){let l=Object.create(is.prototype),h,p,d,v;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.write!==void 0?x=>s.write(x,l):()=>Or(void 0),d=s.close!==void 0?()=>s.close():()=>Or(void 0),v=s.abort!==void 0?x=>s.abort(x):()=>Or(void 0),xA(o,l,h,p,d,v,c,u)})(this,a,Wu(i,1),n)}get locked(){if(!cc(this))throw Cp("locked");return fc(this)}abort(r=void 0){return cc(this)?fc(this)?$e(new TypeError("Cannot abort a stream that already has a writer")):$p(this,r):$e(Cp("abort"))}close(){return cc(this)?fc(this)?$e(new TypeError("Cannot close a stream that already has a writer")):an(this)?$e(new TypeError("Cannot close an already-closing stream")):dA(this):$e(Cp("close"))}getWriter(){if(!cc(this))throw Cp("getWriter");return pA(this)}};function pA(e){return new Ji(e)}function hA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new ka,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function cc(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Tn}function fc(e){return e._writer!==void 0}function $p(e,r){var t;if(e._state==="closed"||e._state==="errored")return Or(void 0);e._writableStreamController._abortReason=r,(t=e._writableStreamController._abortController)===null||t===void 0||t.abort(r);let i=e._state;if(i==="closed"||i==="errored")return Or(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let a=!1;i==="erroring"&&(a=!0,r=void 0);let n=kt((o,s)=>{e._pendingAbortRequest={_promise:void 0,_resolve:o,_reject:s,_reason:r,_wasAlreadyErroring:a}});return e._pendingAbortRequest._promise=n,a||Wv(e,r),n}function dA(e){let r=e._state;if(r==="closed"||r==="errored")return $e(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));let t=kt((n,o)=>{let s={_resolve:n,_reject:o};e._closeRequest=s}),i=e._writer;var a;return i!==void 0&&e._backpressure&&r==="writable"&&Zv(i),Gv(a=e._writableStreamController,bA,0),Zp(a),t}function Cv(e,r){e._state!=="writable"?Xv(e):Wv(e,r)}function Wv(e,r){let t=e._writableStreamController;e._state="erroring",e._storedError=r;let i=e._writer;i!==void 0&&gA(i,r),!function(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}(e)&&t._started&&Xv(e)}function Xv(e){e._state="errored",e._writableStreamController[I5]();let r=e._storedError;if(e._writeRequests.forEach(i=>{i._reject(r)}),e._writeRequests=new ka,e._pendingAbortRequest===void 0)return void Op(e);let t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(r),void Op(e);wa(e._writableStreamController[F5](t._reason),()=>(t._resolve(),Op(e),null),i=>(t._reject(i),Op(e),null))}function an(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Op(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let r=e._writer;r!==void 0&&Jv(r,e._storedError)}function Yv(e,r){let t=e._writer;t!==void 0&&r!==e._backpressure&&(r?function(i){eh(i)}(t):Zv(t)),e._backpressure=r}Object.defineProperties(Tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Pr(Tn.prototype.abort,"abort"),Pr(Tn.prototype.close,"close"),Pr(Tn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});var Ji=class{constructor(r){if(Cn(r,1,"WritableStreamDefaultWriter"),fA(r,"First parameter"),fc(r))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=r,r._writer=this;let t=r._state;if(t==="writable")!an(r)&&r._backpressure?eh(this):_5(this),Np(this);else if(t==="erroring")Bv(this,r._storedError),Np(this);else if(t==="closed")_5(this),Np(i=this),SA(i);else{let a=r._storedError;Bv(this,a),kA(this,a)}var i}get closed(){return Xo(this)?this._closedPromise:$e(Yo("closed"))}get desiredSize(){if(!Xo(this))throw Yo("desiredSize");if(this._ownerWritableStream===void 0)throw Gu("desiredSize");return function(r){let t=r._ownerWritableStream,i=t._state;return i==="errored"||i==="erroring"?null:i==="closed"?0:_A(t._writableStreamController)}(this)}get ready(){return Xo(this)?this._readyPromise:$e(Yo("ready"))}abort(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Gu("abort")):function(t,i){return $p(t._ownerWritableStream,i)}(this,r):$e(Yo("abort"))}close(){if(!Xo(this))return $e(Yo("close"));let r=this._ownerWritableStream;return r===void 0?$e(Gu("close")):an(r)?$e(new TypeError("Cannot close an already-closing stream")):mA(this)}releaseLock(){if(!Xo(this))throw Yo("releaseLock");this._ownerWritableStream!==void 0&&vA(this)}write(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Gu("write to")):yA(this,r):$e(Yo("write"))}};function Xo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Ji}function mA(e){return dA(e._ownerWritableStream)}function aV(e,r){e._closedPromiseState==="pending"?Jv(e,r):function(t,i){kA(t,i)}(e,r)}function gA(e,r){e._readyPromiseState==="pending"?EA(e,r):function(t,i){Bv(t,i)}(e,r)}function vA(e){let r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");gA(e,t),aV(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function yA(e,r){let t=e._ownerWritableStream,i=t._writableStreamController,a=function(s,c){try{return s._strategySizeAlgorithm(c)}catch(u){return Xu(s,u),1}}(i,r);if(t!==e._ownerWritableStream)return $e(Gu("write to"));let n=t._state;if(n==="errored")return $e(t._storedError);if(an(t)||n==="closed")return $e(new TypeError("The stream is closing or closed and cannot be written to"));if(n==="erroring")return $e(t._storedError);let o=function(s){return kt((c,u)=>{let l={_resolve:c,_reject:u};s._writeRequests.push(l)})}(t);return function(s,c,u){try{Gv(s,c,u)}catch(h){return void Xu(s,h)}let l=s._controlledWritableStream;!an(l)&&l._state==="writable"&&Yv(l,Qv(s)),Zp(s)}(i,r,a),o}Object.defineProperties(Ji.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Pr(Ji.prototype.abort,"abort"),Pr(Ji.prototype.close,"close"),Pr(Ji.prototype.releaseLock,"releaseLock"),Pr(Ji.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ji.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var bA={},is=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!wv(this))throw kv("abortReason");return this._abortReason}get signal(){if(!wv(this))throw kv("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(r=void 0){if(!wv(this))throw kv("error");this._controlledWritableStream._state==="writable"&&wA(this,r)}[F5](r){let t=this._abortAlgorithm(r);return Wp(this),t}[I5](){xo(this)}};function wv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof is}function xA(e,r,t,i,a,n,o,s){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._abortReason=void 0,r._abortController=function(){if(tV)return new AbortController}(),r._started=!1,r._strategySizeAlgorithm=s,r._strategyHWM=o,r._writeAlgorithm=i,r._closeAlgorithm=a,r._abortAlgorithm=n;let c=Qv(r);Yv(e,c),wa(Or(t()),()=>(r._started=!0,Zp(r),null),u=>(r._started=!0,Cv(e,u),null))}function Wp(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function _A(e){return e._strategyHWM-e._queueTotalSize}function Zp(e){let r=e._controlledWritableStream;if(!e._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring")return void Xv(r);if(e._queue.length===0)return;let t=e._queue.peek().value;t===bA?function(i){let a=i._controlledWritableStream;(function(o){o._inFlightCloseRequest=o._closeRequest,o._closeRequest=void 0})(a),Tv(i);let n=i._closeAlgorithm();Wp(i),wa(n,()=>(function(o){o._inFlightCloseRequest._resolve(void 0),o._inFlightCloseRequest=void 0,o._state==="erroring"&&(o._storedError=void 0,o._pendingAbortRequest!==void 0&&(o._pendingAbortRequest._resolve(),o._pendingAbortRequest=void 0)),o._state="closed";let s=o._writer;s!==void 0&&SA(s)}(a),null),o=>(function(s,c){s._inFlightCloseRequest._reject(c),s._inFlightCloseRequest=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._reject(c),s._pendingAbortRequest=void 0),Cv(s,c)}(a,o),null))}(e):function(i,a){let n=i._controlledWritableStream;(function(s){s._inFlightWriteRequest=s._writeRequests.shift()})(n);let o=i._writeAlgorithm(a);wa(o,()=>{(function(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0})(n);let s=n._state;if(Tv(i),!an(n)&&s==="writable"){let c=Qv(i);Yv(n,c)}return Zp(i),null},s=>(n._state==="writable"&&Wp(i),function(c,u){c._inFlightWriteRequest._reject(u),c._inFlightWriteRequest=void 0,Cv(c,u)}(n,s),null))}(e,t)}function Xu(e,r){e._controlledWritableStream._state==="writable"&&wA(e,r)}function Qv(e){return _A(e)<=0}function wA(e,r){let t=e._controlledWritableStream;Wp(e),Wv(t,r)}function Cp(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function kv(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Yo(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Gu(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Np(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function kA(e,r){Np(e),Jv(e,r)}function Jv(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function SA(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function eh(e){e._readyPromise=kt((r,t)=>{e._readyPromise_resolve=r,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function Bv(e,r){eh(e),EA(e,r)}function _5(e){eh(e),Zv(e)}function EA(e,r){e._readyPromise_reject!==void 0&&(dc(e._readyPromise),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Zv(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(is.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(is.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var w5=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:void 0,iV=function(){let e=w5==null?void 0:w5.DOMException;return function(r){if(typeof r!="function"&&typeof r!="object"||r.name!=="DOMException")return!1;try{return new r,!0}catch{return!1}}(e)?e:void 0}()||function(){let e=function(r,t){this.message=r||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Pr(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function k5(e,r,t,i,a,n){let o=uc(e),s=pA(r);e._disturbed=!0;let c=!1,u=Or(void 0);return kt((l,h)=>{let p;if(n!==void 0){if(p=()=>{let j=n.reason!==void 0?n.reason:new iV("Aborted","AbortError"),P=[];i||P.push(()=>r._state==="writable"?$p(r,j):Or(void 0)),a||P.push(()=>e._state==="readable"?Si(e,j):Or(void 0)),A(()=>Promise.all(P.map(C=>C())),!0,j)},n.aborted)return void p();n.addEventListener("abort",p)}var d,v,x;if(E(e,o._closedPromise,j=>(i?S(!0,j):A(()=>$p(r,j),!0,j),null)),E(r,s._closedPromise,j=>(a?S(!0,j):A(()=>Si(e,j),!0,j),null)),d=e,v=o._closedPromise,x=()=>(t?S():A(()=>function(j){let P=j._ownerWritableStream,C=P._state;return an(P)||C==="closed"?Or(void 0):C==="errored"?$e(P._storedError):mA(j)}(s)),null),d._state==="closed"?x():gv(v,x),an(r)||r._state==="closed"){let j=new TypeError("the destination writable stream closed before all data could be piped to it");a?S(!0,j):A(()=>Si(e,j),!0,j)}function y(){let j=u;return rn(u,()=>j!==u?y():void 0)}function E(j,P,C){j._state==="errored"?C(j._storedError):Ev(P,C)}function A(j,P,C){function I(){return wa(j(),()=>R(P,C),F=>R(!0,F)),null}c||(c=!0,r._state!=="writable"||an(r)?I():gv(y(),I))}function S(j,P){c||(c=!0,r._state!=="writable"||an(r)?R(j,P):gv(y(),()=>R(j,P)))}function R(j,P){return vA(s),Pn(o),n!==void 0&&n.removeEventListener("abort",p),j?h(P):l(void 0),null}dc(kt((j,P)=>{(function C(I){I?j():rn(c?Or(!0):rn(s._readyPromise,()=>kt((F,H)=>{$u(o,{_chunkSteps:z=>{u=rn(yA(s,z),void 0,Ku),F(!1)},_closeSteps:()=>F(!0),_errorSteps:H})})),C,P)})(!1)}))})}var en=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Bp(this))throw Fp("desiredSize");return e1(this)}close(){if(!Bp(this))throw Fp("close");if(!hc(this))throw new TypeError("The stream is not in a state that permits close");ns(this)}enqueue(r=void 0){if(!Bp(this))throw Fp("enqueue");if(!hc(this))throw new TypeError("The stream is not in a state that permits enqueue");return pc(this,r)}error(r=void 0){if(!Bp(this))throw Fp("error");Ei(this,r)}[Mv](r){xo(this);let t=this._cancelAlgorithm(r);return Xp(this),t}[Lv](r){let t=this._controlledReadableStream;if(this._queue.length>0){let i=Tv(this);this._closeRequested&&this._queue.length===0?(Xp(this),tl(t)):Yu(this),r._chunkSteps(i)}else z5(t,r),Yu(this)}[Dv](){}};function Bp(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof en}function Yu(e){if(AA(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Yu(e)),null),r=>(Ei(e,r),null))}}function AA(e){let r=e._controlledReadableStream;return!hc(e)||!e._started?!1:bo(r)&&Qp(r)>0?!0:e1(e)>0}function Xp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ns(e){if(!hc(e))return;let r=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Xp(e),tl(r))}function pc(e,r){if(!hc(e))return;let t=e._controlledReadableStream;if(bo(t)&&Qp(t)>0)Vv(t,r,!1);else{let i;try{i=e._strategySizeAlgorithm(r)}catch(a){throw Ei(e,a),a}try{Gv(e,r,i)}catch(a){throw Ei(e,a),a}}Yu(e)}function Ei(e,r){let t=e._controlledReadableStream;t._state==="readable"&&(xo(e),Xp(e),TA(t,r))}function e1(e){let r=e._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function hc(e){let r=e._controlledReadableStream._state;return!e._closeRequested&&r==="readable"}function jA(e,r,t,i,a,n,o){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=o,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,Yu(r),null),s=>(Ei(r,s),null))}function Fp(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function nV(e,r){return Jo(e._readableStreamController)?function(t){let i,a,n,o,s,c=uc(t),u=!1,l=!1,h=!1,p=!1,d=!1,v=kt(C=>{s=C});function x(C){Ev(C._closedPromise,I=>(C!==c||(Qa(n._readableStreamController,I),Qa(o._readableStreamController,I),p&&d||s(void 0)),null))}function y(){Zo(c)&&(Pn(c),c=uc(t),x(c)),$u(c,{_chunkSteps:C=>{es(()=>{l=!1,h=!1;let I=C,F=C;if(!p&&!d)try{F=b5(C)}catch(H){return Qa(n._readableStreamController,H),Qa(o._readableStreamController,H),void s(Si(t,H))}p||Dp(n._readableStreamController,I),d||Dp(o._readableStreamController,F),u=!1,l?A():h&&S()})},_closeSteps:()=>{u=!1,p||Vu(n._readableStreamController),d||Vu(o._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&qp(n._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&qp(o._readableStreamController,0),p&&d||s(void 0)},_errorSteps:()=>{u=!1}})}function E(C,I){vo(c)&&(Pn(c),c=sA(t),x(c));let F=I?o:n,H=I?n:o;uA(c,C,1,{_chunkSteps:z=>{es(()=>{l=!1,h=!1;let G=I?d:p;if(I?p:d)G||zp(F._readableStreamController,z);else{let D;try{D=b5(z)}catch(V){return Qa(F._readableStreamController,V),Qa(H._readableStreamController,V),void s(Si(t,V))}G||zp(F._readableStreamController,z),Dp(H._readableStreamController,D)}u=!1,l?A():h&&S()})},_closeSteps:z=>{u=!1;let G=I?d:p,D=I?p:d;G||Vu(F._readableStreamController),D||Vu(H._readableStreamController),z!==void 0&&(G||zp(F._readableStreamController,z),!D&&H._readableStreamController._pendingPullIntos.length>0&&qp(H._readableStreamController,0)),G&&D||s(void 0)},_errorSteps:()=>{u=!1}})}function A(){if(u)return l=!0,Or(void 0);u=!0;let C=Ov(n._readableStreamController);return C===null?y():E(C._view,!1),Or(void 0)}function S(){if(u)return h=!0,Or(void 0);u=!0;let C=Ov(o._readableStreamController);return C===null?y():E(C._view,!0),Or(void 0)}function R(C){if(p=!0,i=C,d){let I=Uu([i,a]),F=Si(t,I);s(F)}return v}function j(C){if(d=!0,a=C,p){let I=Uu([i,a]),F=Si(t,I);s(F)}return v}function P(){}return n=E5(P,A,R),o=E5(P,S,j),x(c),[n,o]}(e):function(t,i){let a=uc(t),n,o,s,c,u,l=!1,h=!1,p=!1,d=!1,v=kt(S=>{u=S});function x(){return l?(h=!0,Or(void 0)):(l=!0,$u(a,{_chunkSteps:S=>{es(()=>{h=!1;let R=S,j=S;p||pc(s._readableStreamController,R),d||pc(c._readableStreamController,j),l=!1,h&&x()})},_closeSteps:()=>{l=!1,p||ns(s._readableStreamController),d||ns(c._readableStreamController),p&&d||u(void 0)},_errorSteps:()=>{l=!1}}),Or(void 0))}function y(S){if(p=!0,n=S,d){let R=Uu([n,o]),j=Si(t,R);u(j)}return v}function E(S){if(d=!0,o=S,p){let R=Uu([n,o]),j=Si(t,R);u(j)}return v}function A(){}return s=Qu(A,x,y),c=Qu(A,x,E),Ev(a._closedPromise,S=>(Ei(s._readableStreamController,S),Ei(c._readableStreamController,S),p&&d||u(void 0),null)),[s,c]}(e)}function oV(e){return mt(r=e)&&r.getReader!==void 0?function(t){let i;function a(){let o;try{o=t.read()}catch(s){return $e(s)}return On(o,s=>{if(!mt(s))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(s.done)ns(i._readableStreamController);else{let c=s.value;pc(i._readableStreamController,c)}})}function n(o){try{return Or(t.cancel(o))}catch(s){return $e(s)}}return i=Qu(Ku,a,n,0),i}(e.getReader()):function(t){let i,a=G5(t,"async");function n(){let s;try{s=K5(a)}catch(c){return $e(c)}return On(Or(s),c=>{if(!mt(c))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(c.done)ns(i._readableStreamController);else{let u=c.value;pc(i._readableStreamController,u)}})}function o(s){let c=a.iterator,u;try{u=Hu(c,"return")}catch(l){return $e(l)}return u===void 0?Or(void 0):On(Bn(u,c,[s]),l=>{if(!mt(l))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i=Qu(Ku,n,o,0),i}(e);var r}function sV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function cV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function uV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function lV(e,r){if((e=`${e}`)!="bytes")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function S5(e,r){tn(e,r);let t=e==null?void 0:e.preventAbort,i=e==null?void 0:e.preventCancel,a=e==null?void 0:e.preventClose,n=e==null?void 0:e.signal;return n!==void 0&&function(o,s){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(o))throw new TypeError(`${s} is not an AbortSignal.`)}(n,`${r} has member 'signal' that`),{preventAbort:Boolean(t),preventCancel:Boolean(i),preventClose:Boolean(a),signal:n}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(en.prototype.close,"close"),Pr(en.prototype.enqueue,"enqueue"),Pr(en.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(en.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Bt=class{constructor(r={},t={}){r===void 0?r=null:q5(r,"First parameter");let i=Kp(t,"Second parameter"),a=function(n,o){tn(n,o);let s=n,c=s==null?void 0:s.autoAllocateChunkSize,u=s==null?void 0:s.cancel,l=s==null?void 0:s.pull,h=s==null?void 0:s.start,p=s==null?void 0:s.type;return{autoAllocateChunkSize:c===void 0?void 0:Uv(c,`${o} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:sV(u,s,`${o} has member 'cancel' that`),pull:l===void 0?void 0:cV(l,s,`${o} has member 'pull' that`),start:h===void 0?void 0:uV(h,s,`${o} has member 'start' that`),type:p===void 0?void 0:lV(p,`${o} has member 'type' that`)}}(r,"First parameter");if(r1(this),a.type==="bytes"){if(i.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(n,o,s){let c=Object.create(Zi.prototype),u,l,h;u=o.start!==void 0?()=>o.start(c):()=>{},l=o.pull!==void 0?()=>o.pull(c):()=>Or(void 0),h=o.cancel!==void 0?d=>o.cancel(d):()=>Or(void 0);let p=o.autoAllocateChunkSize;if(p===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");oA(n,c,u,l,h,s,p)})(this,a,Wu(i,0))}else{let n=Gp(i);(function(o,s,c,u){let l=Object.create(en.prototype),h,p,d;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.pull!==void 0?()=>s.pull(l):()=>Or(void 0),d=s.cancel!==void 0?v=>s.cancel(v):()=>Or(void 0),jA(o,l,h,p,d,c,u)})(this,a,Wu(i,1),n)}}get locked(){if(!go(this))throw Qo("locked");return bo(this)}cancel(r=void 0){return go(this)?bo(this)?$e(new TypeError("Cannot cancel a stream that already has a reader")):Si(this,r):$e(Qo("cancel"))}getReader(r=void 0){if(!go(this))throw Qo("getReader");return function(t,i){tn(t,i);let a=t==null?void 0:t.mode;return{mode:a===void 0?void 0:YH(a,`${i} has member 'mode' that`)}}(r,"First parameter").mode===void 0?uc(this):sA(this)}pipeThrough(r,t={}){if(!go(this))throw Qo("pipeThrough");Cn(r,1,"pipeThrough");let i=function(n,o){tn(n,o);let s=n==null?void 0:n.readable;jv(s,"readable","ReadableWritablePair"),Hv(s,`${o} has member 'readable' that`);let c=n==null?void 0:n.writable;return jv(c,"writable","ReadableWritablePair"),fA(c,`${o} has member 'writable' that`),{readable:s,writable:c}}(r,"First parameter"),a=S5(t,"Second parameter");if(bo(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(fc(i.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return dc(k5(this,i.writable,a.preventClose,a.preventAbort,a.preventCancel,a.signal)),i.readable}pipeTo(r,t={}){if(!go(this))return $e(Qo("pipeTo"));if(r===void 0)return $e("Parameter 1 is required in 'pipeTo'.");if(!cc(r))return $e(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let i;try{i=S5(t,"Second parameter")}catch(a){return $e(a)}return bo(this)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):fc(r)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):k5(this,r,i.preventClose,i.preventAbort,i.preventCancel,i.signal)}tee(){if(!go(this))throw Qo("tee");return Uu(nV(this))}values(r=void 0){if(!go(this))throw Qo("values");return function(t,i){let a=uc(t),n=new Vp(a,i),o=Object.create($5);return o._asyncIteratorImpl=n,o}(this,function(t,i){tn(t,i);let a=t==null?void 0:t.preventCancel;return{preventCancel:Boolean(a)}}(r,"First parameter").preventCancel)}[rl](r){return this.values(r)}static from(r){return oV(r)}};function Qu(e,r,t,i=1,a=()=>1){let n=Object.create(Bt.prototype);return r1(n),jA(n,Object.create(en.prototype),e,r,t,i,a),n}function E5(e,r,t){let i=Object.create(Bt.prototype);return r1(i),oA(i,Object.create(Zi.prototype),e,r,t,0,void 0),i}function r1(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function go(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof Bt}function bo(e){return e._reader!==void 0}function Si(e,r){if(e._disturbed=!0,e._state==="closed")return Or(void 0);if(e._state==="errored")return $e(e._storedError);tl(e);let t=e._reader;if(t!==void 0&&Zo(t)){let i=t._readIntoRequests;t._readIntoRequests=new ka,i.forEach(a=>{a._closeSteps(void 0)})}return On(e._readableStreamController[Mv](r),Ku)}function tl(e){e._state="closed";let r=e._reader;if(r!==void 0&&(D5(r),vo(r))){let t=r._readRequests;r._readRequests=new ka,t.forEach(i=>{i._closeSteps()})}}function TA(e,r){e._state="errored",e._storedError=r;let t=e._reader;t!==void 0&&(zv(t,r),vo(t)?U5(t,r):lA(t,r))}function Qo(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function RA(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark;return jv(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Nv(t)}}Object.defineProperties(Bt,{from:{enumerable:!0}}),Object.defineProperties(Bt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Pr(Bt.from,"from"),Pr(Bt.prototype.cancel,"cancel"),Pr(Bt.prototype.getReader,"getReader"),Pr(Bt.prototype.pipeThrough,"pipeThrough"),Pr(Bt.prototype.pipeTo,"pipeTo"),Pr(Bt.prototype.tee,"tee"),Pr(Bt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Bt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Bt.prototype,rl,{value:Bt.prototype.values,writable:!0,configurable:!0});var PA=e=>e.byteLength;Pr(PA,"size");var Ju=class{constructor(r){Cn(r,1,"ByteLengthQueuingStrategy"),r=RA(r,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!j5(this))throw A5("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!j5(this))throw A5("size");return PA}};function A5(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function j5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Ju}Object.defineProperties(Ju.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ju.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var OA=()=>1;Pr(OA,"size");var Zu=class{constructor(r){Cn(r,1,"CountQueuingStrategy"),r=RA(r,"First parameter"),this._countQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!R5(this))throw T5("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!R5(this))throw T5("size");return OA}};function T5(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function R5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Zu}function fV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function pV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function hV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function dV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}Object.defineProperties(Zu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Zu.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var el=class{constructor(r={},t={},i={}){r===void 0&&(r=null);let a=Kp(t,"Second parameter"),n=Kp(i,"Third parameter"),o=function(p,d){tn(p,d);let v=p==null?void 0:p.cancel,x=p==null?void 0:p.flush,y=p==null?void 0:p.readableType,E=p==null?void 0:p.start,A=p==null?void 0:p.transform,S=p==null?void 0:p.writableType;return{cancel:v===void 0?void 0:dV(v,p,`${d} has member 'cancel' that`),flush:x===void 0?void 0:fV(x,p,`${d} has member 'flush' that`),readableType:y,start:E===void 0?void 0:pV(E,p,`${d} has member 'start' that`),transform:A===void 0?void 0:hV(A,p,`${d} has member 'transform' that`),writableType:S}}(r,"First parameter");if(o.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(o.writableType!==void 0)throw new RangeError("Invalid writableType specified");let s=Wu(n,0),c=Gp(n),u=Wu(a,1),l=Gp(a),h;(function(p,d,v,x,y,E){function A(){return d}function S(I){return function(F,H){let z=F._transformStreamController;return F._backpressure?On(F._backpressureChangePromise,()=>{let G=F._writable;if(G._state==="erroring")throw G._storedError;return O5(z,H)}):O5(z,H)}(p,I)}function R(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._readable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Up(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):(Ei(G._readableStreamController,H),Sv(z)),null),V=>(Ei(G._readableStreamController,V),sc(z,V),null)),z._finishPromise}(p,I)}function j(){return function(I){let F=I._transformStreamController;if(F._finishPromise!==void 0)return F._finishPromise;let H=I._readable;F._finishPromise=kt((G,D)=>{F._finishPromise_resolve=G,F._finishPromise_reject=D});let z=F._flushAlgorithm();return Up(F),wa(z,()=>(H._state==="errored"?sc(F,H._storedError):(ns(H._readableStreamController),Sv(F)),null),G=>(Ei(H._readableStreamController,G),sc(F,G),null)),F._finishPromise}(p)}function P(){return function(I){return Yp(I,!1),I._backpressureChangePromise}(p)}function C(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._writable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Up(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):(Xu(G._writableStreamController,H),Fv(F),Sv(z)),null),V=>(Xu(G._writableStreamController,V),Fv(F),sc(z,V),null)),z._finishPromise}(p,I)}p._writable=function(I,F,H,z,G=1,D=()=>1){let V=Object.create(Tn.prototype);return hA(V),xA(V,Object.create(is.prototype),I,F,H,z,G,D),V}(A,S,j,R,v,x),p._readable=Qu(A,P,C,y,E),p._backpressure=void 0,p._backpressureChangePromise=void 0,p._backpressureChangePromise_resolve=void 0,Yp(p,!0),p._transformStreamController=void 0})(this,kt(p=>{h=p}),u,l,s,c),function(p,d){let v=Object.create(Rn.prototype),x,y,E;x=d.transform!==void 0?A=>d.transform(A,v):A=>{try{return BA(v,A),Or(void 0)}catch(S){return $e(S)}},y=d.flush!==void 0?()=>d.flush(v):()=>Or(void 0),E=d.cancel!==void 0?A=>d.cancel(A):()=>Or(void 0),function(A,S,R,j,P){S._controlledTransformStream=A,A._transformStreamController=S,S._transformAlgorithm=R,S._flushAlgorithm=j,S._cancelAlgorithm=P,S._finishPromise=void 0,S._finishPromise_resolve=void 0,S._finishPromise_reject=void 0}(p,v,x,y,E)}(this,o),o.start!==void 0?h(o.start(this._transformStreamController)):h(void 0)}get readable(){if(!P5(this))throw C5("readable");return this._readable}get writable(){if(!P5(this))throw C5("writable");return this._writable}};function P5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof el}function CA(e,r){Ei(e._readable._readableStreamController,r),t1(e,r)}function t1(e,r){Up(e._transformStreamController),Xu(e._writable._writableStreamController,r),Fv(e)}function Fv(e){e._backpressure&&Yp(e,!1)}function Yp(e,r){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=kt(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=r}Object.defineProperties(el.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(el.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});var Rn=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ip(this))throw Mp("desiredSize");return e1(this._controlledTransformStream._readable._readableStreamController)}enqueue(r=void 0){if(!Ip(this))throw Mp("enqueue");BA(this,r)}error(r=void 0){if(!Ip(this))throw Mp("error");var t;t=r,CA(this._controlledTransformStream,t)}terminate(){if(!Ip(this))throw Mp("terminate");(function(r){let t=r._controlledTransformStream;ns(t._readable._readableStreamController);let i=new TypeError("TransformStream terminated");t1(t,i)})(this)}};function Ip(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Rn}function Up(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function BA(e,r){let t=e._controlledTransformStream,i=t._readable._readableStreamController;if(!hc(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{pc(i,r)}catch(n){throw t1(t,n),t._readable._storedError}(function(n){return!AA(n)})(i)!==t._backpressure&&Yp(t,!0)}function O5(e,r){return On(e._transformAlgorithm(r),void 0,t=>{throw CA(e._controlledTransformStream,t),t})}function Mp(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Sv(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function sc(e,r){e._finishPromise_reject!==void 0&&(dc(e._finishPromise),e._finishPromise_reject(r),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function C5(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Rn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Rn.prototype.enqueue,"enqueue"),Pr(Rn.prototype.error,"error"),Pr(Rn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var rh=class extends Bt{};var th=class{chunks;isWorking=!1;isCancelled=!1;constructor(r){this.chunks=r}start(r){this.work(r)}async work(r){let{chunks:t}=this;for(this.isWorking=!0;!this.isCancelled&&(r.desiredSize||0)>0;){let i;try{i=t.next()}catch(a){r.error(a);break}i&&(!i.done&&!this.isCancelled?r.enqueue(i.value):r.close())}this.isWorking=!1}pull(r){this.isWorking||this.work(r)}cancel(){this.isCancelled=!0}};var ah=class extends rh{_chunks;constructor(r){super(new th(r.values()),{type:"bytes"}),this._chunks=r}async*[Symbol.asyncIterator](r){let t=this.getReader();yield*this._chunks,t.releaseLock()}};var ss=class{type;size;parts;constructor(r=[],t={}){this.parts=[],this.size=0;for(let i of r)if(typeof i=="string"){let a=new TextEncoder().encode(i);this.parts.push(a),this.size+=a.byteLength}else if(i instanceof ss)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:a,byteOffset:n,byteLength:o}=i;this.parts.push(new Uint8Array(a,n,o)),this.size+=o}else{let a=new TextEncoder().encode(String(i));this.parts.push(a),this.size+=a.byteLength}this.type=mV(t.type)}slice(r=0,t=this.size,i=""){let{size:a,parts:n}=this,o=r<0?Math.max(a+r,0):Math.min(r,a),s=t<0?Math.max(a+t,0):Math.min(t,a),c=Math.max(s-o,0),u=new ss([],{type:i});if(c===0)return u;let l=0,h=[];for(let p of n){let{byteLength:d}=p;if(o>0&&d<=o)o-=d,s-=d;else{let v=p.subarray(o,Math.min(d,s));if(h.push(v),l+=v.byteLength,o=0,l>=c)break}}return u.parts=h,u.size=l,u}async arrayBuffer(){return this._toArrayBuffer()}async text(){let r=new TextDecoder,t="";for(let i of this.parts)t+=r.decode(i);return t}stream(){return new ah(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let r=new ArrayBuffer(this.size),t=new Uint8Array(r),i=0;for(let a of this.parts)t.set(a,i),i+=a.byteLength;return r}};function mV(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function gV(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=ss),globalThis.Blob}var vV=gV();var ih=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(r){let t=await r.arrayBuffer();this.onload&&this.onload({target:{result:t}})}async readAsBinaryString(r){throw Error("Not implemented")}async readAsDataURL(r){let t=await r.text(),i=`data://;base64,${Ec(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var nh=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(r,t,i={}){super(r,i),this.name=String(t).replace(/\//g,":"),this.lastModified=(i==null?void 0:i.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function FA(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=ih),typeof File>"u"&&!globalThis.File&&(globalThis.File=nh),global}var yV=FA();var a1=Xt(require("module"),1),IA=Xt(require("path"),1),sh=Xt(require("fs"),1);async function MA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():sh.default.readFileSync(e).buffer}async function LA(e){return e.startsWith("http")?await(await fetch(e)).text():sh.default.readFileSync(e,"utf8")}async function DA(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return oh(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=sh.default.readFileSync(e,"utf8");return oh(r)}function oh(e,r="",t){if(typeof r=="object"&&(t=r,r=""),r=r.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=a1.default._nodeModulePaths(IA.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new a1.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var Ai=class{map;constructor(r){this.map={},r instanceof Ai?r.forEach((t,i)=>this.append(i,t)):Array.isArray(r)?r.forEach(t=>this.append(t[0],t[1])):r&&Object.getOwnPropertyNames(r).forEach(t=>this.append(t,r[t]))}append(r,t){r=al(r),t=qA(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[al(r)]}get(r){return r=al(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(al(r))}set(r,t){this.map[al(r)]=qA(t)}forEach(r,t=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(t?r.call(t,this.map[i],i,this):r(this.map[i],i,this))}keys(){let r=[];return this.forEach(function(t,i){r.push(i)}),i1(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),i1(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),i1(r)}*[Symbol.iterator](){yield*this.entries()}};function al(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 qA(e){return typeof e!="string"&&(e=String(e)),e}function i1(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function n1(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var s1=Xt(require("stream"),1),bV=e=>typeof e=="boolean",zA=e=>typeof e=="function",xV=e=>e!==null&&typeof e=="object",o1=e=>xV(e)&&zA(e.read)&&zA(e.pipe)&&bV(e.readable),Fn=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(r,t){let{headers:i,status:a=200,statusText:n="OK",url:o}=t||{};this.url=o,this.ok=a===200,this.status=a,this.statusText=n,this.headers=new Ai((t==null?void 0:t.headers)||{}),o1(r)?this._body=Sp(r,i):typeof r=="string"?this._body=s1.Readable.from([new TextEncoder().encode(r)]):this._body=s1.Readable.from([r||new ArrayBuffer(0)])}get body(){return n1(!this.bodyUsed),n1(o1(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return o1(this._body)?await f5(this._body):this._body||new ArrayBuffer(0)}async text(){let r=await this.arrayBuffer();return new TextDecoder().decode(r)}async json(){let r=await this.text();return JSON.parse(r)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var UA=Xt(require("http"),1),HA=Xt(require("https"),1);var _V=e=>e&&e instanceof ArrayBuffer,wV=e=>e&&e instanceof Buffer;function NA(e){let r=e.indexOf(","),t,i;return e.slice(r-7,r)===";base64"?(t=Buffer.from(e.slice(r+1),"base64"),i=e.slice(5,r-7).trim()):(t=Buffer.from(decodeURIComponent(e.slice(r+1))),i=e.slice(5,r).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:kV(t),mimeType:i}}function kV(e){if(_V(e))return e;if(wV(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var c1=e=>e.startsWith("data:"),SV=e=>e.startsWith("http:")||e.startsWith("https:");async function il(e,r){try{if(globalThis.fetch!==il&&(SV(e)||c1(e)))return await fetch(e,r);if(c1(e)){let{arrayBuffer:u,mimeType:l}=NA(e);return new Fn(u,{headers:{"content-type":l},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await EV(i,r),n=RV(e,a,t),{status:o,statusText:s}=TV(a),c=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&c){let u=AV(e,n.get("location"));return await il(u,r)}return new Fn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new Fn(null,{status:400,statusText:String(t),url:e})}}async function EV(e,r){return await new Promise((t,i)=>{let a=jV(e,r),n=e.startsWith("https:")?HA.default.request(a,o=>t(o)):UA.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function AV(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function jV(e,r){let t=(r==null?void 0:r.headers)||{},i={};for(let n of Object.keys(t))i[n.toLowerCase()]=t[n];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let a=new URL(e);return{hostname:a.hostname,path:a.pathname,method:"GET",...r,...r==null?void 0:r.fetch,headers:i,port:a.port}}function TV(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function RV(e,r,t={}){let i={};if(r&&r.headers){let a=r.headers;for(let n in a){let o=a[n];i[n.toLowerCase()]=String(o)}}if(!i["content-length"]){let a=PV(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ai(i)}function PV(e){return c1(e)?e.length-5:null}var OV=parseInt(VA.versions.node.split(".")[0]);ay&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=mv;globalThis.loaders.NodeFile=Wo;globalThis.loaders.NodeFileSystem=jp;globalThis.loaders.fetchNode=Ep;globalThis.loaders.NodeHash=Tp;globalThis.TextEncoder||(globalThis.TextEncoder=Sc);globalThis.TextDecoder||(globalThis.TextDecoder=wo);globalThis.ReadableStream||(globalThis.ReadableStream=ReadableStream);!("atob"in globalThis)&&Ec&&(globalThis.atob=Ec);!("btoa"in globalThis)&&Uh&&(globalThis.btoa=Uh);globalThis.loaders.encodeImageNode=c_;globalThis.loaders.parseImageNode=Vg;globalThis.loaders.imageFormatsNode=Hg;globalThis._parseImageNode=Vg;globalThis._imageFormatsNode=Hg;globalThis.loaders.readFileAsArrayBuffer=MA;globalThis.loaders.readFileAsText=LA;globalThis.loaders.requireFromFile=DA;globalThis.loaders.requireFromString=oh;OV<18&&(!("Headers"in globalThis)&&Ai&&(globalThis.Headers=Ai),!("Response"in globalThis)&&Fn&&(globalThis.Response=Fn),!("fetch"in globalThis)&&il&&(globalThis.fetch=il));var CV=e=>typeof e=="boolean",nl=e=>typeof e=="function",cs=e=>e!==null&&typeof e=="object",u1=e=>cs(e)&&e.constructor==={}.constructor;var GA=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",KA=e=>e&&typeof e[Symbol.asyncIterator]=="function";var Za=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ei=e=>typeof Blob<"u"&&e instanceof Blob,$A=e=>e&&typeof e=="object"&&e.isBuffer;var BV=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||cs(e)&&nl(e.tee)&&nl(e.cancel)&&nl(e.getReader);var FV=e=>cs(e)&&nl(e.read)&&nl(e.pipe)&&CV(e.readable),ch=e=>BV(e)||FV(e);var uh=class extends Error{constructor(r,t){super(r),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var IV=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,MV=/^([-\w.]+\/[-\w.+]+)/;function l1(e,r){return e.toLowerCase()===r.toLowerCase()}function WA(e){let r=MV.exec(e);return r?r[1]:e}function f1(e){let r=IV.exec(e);return r?r[1]:""}var XA=/\?.*/;function YA(e){let r=e.match(XA);return r&&r[0]}function mc(e){return e.replace(XA,"")}function QA(e){if(e.length<50)return e;let r=e.slice(e.length-15);return`${e.substr(0,32)}...${r}`}function us(e){return Za(e)?e.url:ei(e)?e.name||"":typeof e=="string"?e:""}function ol(e){if(Za(e)){let r=e,t=r.headers.get("content-type")||"",i=mc(r.url);return WA(t)||f1(i)}return ei(e)?e.type||"":typeof e=="string"?f1(e):""}function JA(e){return Za(e)?e.headers["content-length"]||-1:ei(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function lh(e){if(Za(e))return e;let r={},t=JA(e);t>=0&&(r["content-length"]=String(t));let i=us(e),a=ol(e);a&&(r["content-type"]=a);let n=await DV(e);n&&(r["x-first-bytes"]=n),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:r});return Object.defineProperty(o,"url",{value:i}),o}async function ZA(e){if(!e.ok)throw await LV(e)}async function LV(e){let r=QA(e.url),t=`Failed to fetch resource (${e.status}) ${e.statusText}: ${r}`;t=t.length>100?`${t.slice(0,100)}...`:t;let i={reason:e.statusText,url:e.url,response:e};try{let a=e.headers.get("Content-Type");i.reason=!e.bodyUsed&&(a!=null&&a.includes("application/json"))?await e.json():await e.text()}catch{}return new uh(t,i)}async function DV(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(i=>{let a=new FileReader;a.onload=n=>{var o;return i((o=n==null?void 0:n.target)==null?void 0:o.result)},a.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${qV(t)}`}return null}function qV(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function zV(e){return!NV(e)&&!UV(e)}function NV(e){return e.startsWith("http:")||e.startsWith("https:")}function UV(e){return e.startsWith("data:")}async function p1(e,r){var t,i;if(typeof e=="string"){let a=Ko(e);return zV(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await lh(e)}var h1=new Xi({id:"loaders.gl"}),fh=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},ph=class{console;constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var d1={fetch:null,mimeType:void 0,nothrow:!1,log:new ph,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:No,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ej={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 m1(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function g1(){let e=m1();return e.globalOptions=e.globalOptions||{...d1},e.globalOptions}function aj(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],HV(e,t),GV(r,e,i)}function HV(e,r){rj(e,null,d1,ej,r);for(let t of r){let i=e&&e[t.id]||{},a=t.options&&t.options[t.id]||{},n=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};rj(i,t.id,a,n,r)}}function rj(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let c=!r&&cs(e[s]),u=s==="baseUri"&&!r,l=s==="workerUrl"&&r;if(!(s in t)&&!u&&!l){if(s in i)h1.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!c){let h=VV(s,a);h1.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function VV(e,r){let t=e.toLowerCase(),i="";for(let a of r)for(let n in a.options){if(e===n)return`Did you mean '${a.id}.${n}'?`;let o=n.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${a.id}.${n}'?`)}return i}function GV(e,r,t){let a={...e.options||{}};return KV(a,t),a.log===null&&(a.log=new fh),tj(a,g1()),tj(a,r),a}function tj(e,r){for(let t in r)if(t in r){let i=r[t];u1(i)&&u1(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function KV(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function sl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function v1(e){ki(e,"null loader"),ki(sl(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var $V=()=>{let e=m1();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function ij(){return $V()}var WV=/\.([^.]+)$/;async function sj(e,r=[],t,i){if(!cj(e))return null;let a=nj(e,r,{...t,nothrow:!0},i);if(a)return a;if(ei(e)&&(e=await e.slice(0,10).arrayBuffer(),a=nj(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(uj(e));return a}function nj(e,r=[],t,i){if(!cj(e))return null;if(r&&!Array.isArray(r))return v1(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...ij()),YV(a);let n=XV(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(uj(e));return n}function XV(e,r,t,i){let a=us(e),n=ol(e),o=mc(a)||(i==null?void 0:i.url),s=null,c="";return t!=null&&t.mimeType&&(s=y1(r,t==null?void 0:t.mimeType),c=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||QV(r,o),c=c||(s?`matched url ${o}`:""),s=s||y1(r,n),c=c||(s?`matched MIME type ${n}`:""),s=s||ZV(r,e),c=c||(s?`matched initial data ${lj(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||y1(r,t==null?void 0:t.fallbackMimeType),c=c||(s?`matched fallback MIME type ${n}`:"")),c&&Wg.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${c}.`),s}function cj(e){return!(e instanceof Response&&e.status===204)}function uj(e){let r=us(e),t=ol(e),i="No valid loader found (";i+=r?`${$o.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?lj(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function YV(e){for(let r of e)v1(r)}function QV(e,r){let t=r&&WV.exec(r),i=t&&t[1];return i?JV(e,i):null}function JV(e,r){r=r.toLowerCase();for(let t of e)for(let i of t.extensions)if(i.toLowerCase()===r)return t;return null}function y1(e,r){var t;for(let i of e)if((t=i.mimeTypes)!=null&&t.some(a=>l1(r,a))||l1(r,`application/x.${i.id}`))return i;return null}function ZV(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(eG(r,t))return t}else if(ArrayBuffer.isView(r)){if(oj(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&oj(r,0,t))return t;return null}function eG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function oj(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>rG(e,r,t,a))}function rG(e,r,t,i){if(i instanceof ArrayBuffer)return cv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=b1(e,r,i.length);return i===a;default:return!1}}function lj(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?b1(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?b1(e,0,r):""}function b1(e,r,t){if(e.byteLength<r+t)return"";let i=new DataView(e),a="";for(let n=0;n<t;n++)a+=String.fromCharCode(i.getUint8(r+n));return a}function*fj(e,r){let t=(r==null?void 0:r.chunkSize)||262144,i=0,a=new TextEncoder;for(;i<e.length;){let n=Math.min(e.length-i,t),o=e.slice(i,i+n);i+=n,yield a.encode(o)}}function*pj(e,r={}){let{chunkSize:t=262144}=r,i=0;for(;i<e.byteLength;){let a=Math.min(e.byteLength-i,t),n=new ArrayBuffer(a),o=new Uint8Array(e,i,a);new Uint8Array(n).set(o),i+=a,yield n}}async function*hj(e,r){let t=(r==null?void 0:r.chunkSize)||1048576,i=0;for(;i<e.size;){let a=i+t,n=await e.slice(i,a).arrayBuffer();i=a,yield n}}function x1(e,r){return No?tG(e,r):aG(e,r)}async function*tG(e,r){let t=e.getReader(),i;try{for(;;){let a=i||t.read();r!=null&&r._streamReadAhead&&(i=t.read());let{done:n,value:o}=await a;if(n)return;yield wp(o)}}catch{t.releaseLock()}}async function*aG(e,r){for await(let t of e)yield wp(t)}function dj(e,r){if(typeof e=="string")return fj(e,r);if(e instanceof ArrayBuffer)return pj(e,r);if(ei(e))return hj(e,r);if(ch(e))return x1(e,r);if(Za(e))return x1(e.body,r);throw new Error("makeIterator")}var mj="Cannot convert supplied data type";function iG(e,r,t){if(r.text&&typeof e=="string")return e;if($A(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return r.text&&!r.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(r.text&&!r.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,a=e.byteLength||e.length;return(e.byteOffset!==0||a!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+a)),i}throw new Error(mj)}async function gj(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return iG(e,r,t);if(ei(e)&&(e=await lh(e)),Za(e)){let a=e;return await ZA(a),r.binary?await a.arrayBuffer():await a.text()}if(ch(e)&&(e=dj(e,t)),GA(e)||KA(e))return Lu(e);throw new Error(mj)}function hh(e,r){let t=g1(),i=e||t;return typeof i.fetch=="function"?i.fetch:cs(i.fetch)?a=>p1(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:p1}function vj(e,r,t){if(t)return t;let i={fetch:hh(r,e),...e};if(i.url){let a=mc(i.url);i.baseUrl=a,i.queryString=YA(i.url),i.filename=$o.filename(a),i.baseUrl=$o.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function yj(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let i=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...i]:i}return t&&t.length?t:void 0}async function In(e,r,t,i){r&&!Array.isArray(r)&&!sl(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=us(e),o=yj(r,i),s=await sj(e,o,t);return s?(t=aj(t,s,o,a),i=vj({url:a,_parse:In,loaders:o},t,i||null),await nG(s,e,t,i)):null}async function nG(e,r,t,i){if(av(e),t=Xg(e.options,t),Za(r)){let n=r,{ok:o,redirected:s,status:c,statusText:u,type:l,url:h}=n,p=Object.fromEntries(n.headers.entries());i.response={headers:p,ok:o,redirected:s,status:c,statusText:u,type:l,url:h}}r=await gj(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(ov(e,t))return await sv(e,r,t,i,In);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw Wt(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function bj(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 _1(e){let r=1/0,t=1/0,i=1/0,a=-1/0,n=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let u=0;u<c;u+=3){let l=s[u],h=s[u+1],p=s[u+2];r=l<r?l:r,t=h<t?h:t,i=p<i?p:i,a=l>a?l:a,n=h>n?h:n,o=p>o?p:o}return[[r,t,i],[a,n,o]]}function w1(e,r,t){let i=bj(r.value),a=t||xj(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function xj(e){let r={};return"byteOffset"in e&&(r.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(r.byteStride=e.byteStride.toString(10)),"normalized"in e&&(r.normalized=e.normalized.toString()),r}async function k1(e,r,t,i){let a,n;!Array.isArray(r)&&!sl(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=hh(n),s=e;return typeof e=="string"&&(s=await o(e)),ei(e)&&(s=await o(e)),Array.isArray(a)?await In(s,a,n):await In(s,a,n)}var oG=1/Math.PI*180,sG=1/180*Math.PI,cG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...cG}};var gt=globalThis.mathgl.config;function S1(e,{precision:r=gt.precision}={}){return e=uG(e),`${parseFloat(e.toPrecision(r))}`}function _o(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E1(e){return _j(e)}function A1(e){return wj(e)}function _j(e,r){return kj(e,t=>t*sG,r)}function wj(e,r){return kj(e,t=>t*oG,r)}function Mn(e,r,t){let i=gt.EPSILON;t&&(gt.EPSILON=t);try{if(e===r)return!0;if(_o(e)&&_o(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Mn(e[a],r[a]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=gt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{gt.EPSILON=i}}function uG(e){return Math.round(e/gt.EPSILON)*gt.EPSILON}function lG(e){return e.clone?e.clone():new Array(e.length)}function kj(e,r,t){if(_o(e)){let i=e;t=t||lG(i);for(let a=0;a<t.length&&a<i.length;++a){let n=typeof e=="number"?e:e[a];t[a]=r(n,a,t)}return t}return r(e)}var gc=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(r,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=r[i+t];return this.check()}toArray(r=[],t=0){for(let i=0;i<this.ELEMENTS;++i)r[t+i]=this[i];return r}toObject(r){return r}from(r){return Array.isArray(r)?this.copy(r):this.fromObject(r)}to(r){return r===this?this:_o(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(gt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+S1(this[i],r);return`${r.printTypes?this.constructor.name:""}[${t}]`}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Mn(this[t],r[t]))return!1;return!0}exactEquals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==r[t])return!1;return!0}negate(){for(let r=0;r<this.ELEMENTS;++r)this[r]=-this[r];return this.check()}lerp(r,t,i){if(i===void 0)return this.lerp(this,r,t);for(let a=0;a<this.ELEMENTS;++a){let n=r[a],o=typeof t=="number"?t:t[a];this[a]=n+i*(o-n)}return this.check()}min(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(r[t],this[t]);return this.check()}max(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(r[t],this[t]);return this.check()}clamp(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r[i]),t[i]);return this.check()}add(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]+=t[i];return this.check()}subtract(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]-=t[i];return this.check()}scale(r){if(typeof r=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;else for(let t=0;t<this.ELEMENTS&&t<r.length;++t)this[t]*=r[t];return this.check()}multiplyByScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}check(){if(gt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let r=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)r=r&&Number.isFinite(this[t]);return r}sub(r){return this.subtract(r)}setScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=r;return this.check()}addScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]+=r;return this.check()}subScalar(r){return this.addScalar(-r)}multiplyScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}divideScalar(r){return this.multiplyByScalar(1/r)}clampScalar(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r),t);return this.check()}get elements(){return this}};function fG(e,r){if(e.length!==r)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function ia(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function dh(e,r,t=""){if(gt.debug&&!fG(e,r))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return e}function ri(e,r){if(!e)throw new Error(`math.gl assertion ${r}`)}var mh=class extends gc{get x(){return this[0]}set x(r){this[0]=ia(r)}get y(){return this[1]}set y(r){this[1]=ia(r)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let r=0;for(let t=0;t<this.ELEMENTS;++t)r+=this[t]*this[t];return r}magnitudeSquared(){return this.lengthSquared()}distance(r){return Math.sqrt(this.distanceSquared(r))}distanceSquared(r){let t=0;for(let i=0;i<this.ELEMENTS;++i){let a=this[i]-r[i];t+=a*a}return ia(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return ia(t)}normalize(){let r=this.magnitude();if(r!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=r;return this.check()}multiply(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]*=t[i];return this.check()}divide(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]/=t[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(r){return this.distance(r)}distanceToSquared(r){return this.distanceSquared(r)}getComponent(r){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),ia(this[r])}setComponent(r,t){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),this[r]=t,this.check()}addVectors(r,t){return this.copy(r).add(t)}subVectors(r,t){return this.copy(r).subtract(t)}multiplyVectors(r,t){return this.copy(r).multiply(t)}addScaledVector(r,t){return this.add(new this.constructor(r).multiplyScalar(t))}};var ji=typeof Float32Array<"u"?Float32Array:Array,cl=Math.random;function vc(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Ine=Math.PI/180;function pG(){let e=new ji(2);return ji!=Float32Array&&(e[0]=0,e[1]=0),e}function Sj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[4]*a+t[12],e[1]=t[1]*i+t[5]*a+t[13],e}var Mne=function(){let e=pG();return function(r,t,i,a,n,o){let s,c;for(t||(t=2),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],n(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function Ej(e,r,t){let i=r[0],a=r[1],n=t[3]*i+t[7]*a||1;return e[0]=(t[0]*i+t[4]*a)/n,e[1]=(t[1]*i+t[5]*a)/n,e}function gh(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n||1;return e[0]=(t[0]*i+t[4]*a+t[8]*n)/o,e[1]=(t[1]*i+t[5]*a+t[9]*n)/o,e[2]=(t[2]*i+t[6]*a+t[10]*n)/o,e}function Aj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[2]*a,e[1]=t[1]*i+t[3]*a,e[2]=r[2],e}var ll={};xl(ll,{add:()=>yG,angle:()=>I1,bezier:()=>CG,ceil:()=>bG,clone:()=>dG,copy:()=>gG,create:()=>jj,cross:()=>R1,dist:()=>NG,distance:()=>Cj,div:()=>zG,divide:()=>Oj,dot:()=>T1,equals:()=>LG,exactEquals:()=>MG,floor:()=>xG,forEach:()=>GG,fromValues:()=>mG,hermite:()=>OG,inverse:()=>jG,len:()=>HG,length:()=>Tj,lerp:()=>RG,max:()=>wG,min:()=>_G,mul:()=>qG,multiply:()=>Pj,negate:()=>AG,normalize:()=>TG,random:()=>BG,rotateX:()=>C1,rotateY:()=>B1,rotateZ:()=>F1,round:()=>kG,scale:()=>SG,scaleAndAdd:()=>EG,set:()=>vG,slerp:()=>PG,sqrDist:()=>UG,sqrLen:()=>VG,squaredDistance:()=>Bj,squaredLength:()=>Fj,str:()=>IG,sub:()=>DG,subtract:()=>Rj,transformMat3:()=>P1,transformMat4:()=>ul,transformQuat:()=>O1,zero:()=>FG});function jj(){let e=new ji(3);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function dG(e){let r=new ji(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Tj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function mG(e,r,t){let i=new ji(3);return i[0]=e,i[1]=r,i[2]=t,i}function gG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function vG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function yG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Rj(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Pj(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Oj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function bG(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function xG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function _G(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function wG(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function kG(e,r){return e[0]=vc(r[0]),e[1]=vc(r[1]),e[2]=vc(r[2]),e}function SG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function EG(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function Cj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function Bj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return t*t+i*i+a*a}function Fj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function AG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function jG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function TG(e,r){let t=r[0],i=r[1],a=r[2],n=t*t+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function T1(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function R1(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],c=t[2];return e[0]=a*c-n*s,e[1]=n*o-i*c,e[2]=i*s-a*o,e}function RG(e,r,t,i){let a=r[0],n=r[1],o=r[2];return e[0]=a+i*(t[0]-a),e[1]=n+i*(t[1]-n),e[2]=o+i*(t[2]-o),e}function PG(e,r,t,i){let a=Math.acos(Math.min(Math.max(T1(r,t),-1),1)),n=Math.sin(a),o=Math.sin((1-i)*a)/n,s=Math.sin(i*a)/n;return e[0]=o*r[0]+s*t[0],e[1]=o*r[1]+s*t[1],e[2]=o*r[2]+s*t[2],e}function OG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,c=o*(n-2)+n,u=o*(n-1),l=o*(3-2*n);return e[0]=r[0]*s+t[0]*c+i[0]*u+a[0]*l,e[1]=r[1]*s+t[1]*c+i[1]*u+a[1]*l,e[2]=r[2]*s+t[2]*c+i[2]*u+a[2]*l,e}function CG(e,r,t,i,a,n){let o=1-n,s=o*o,c=n*n,u=s*o,l=3*n*s,h=3*c*o,p=c*n;return e[0]=r[0]*u+t[0]*l+i[0]*h+a[0]*p,e[1]=r[1]*u+t[1]*l+i[1]*h+a[1]*p,e[2]=r[2]*u+t[2]*l+i[2]*h+a[2]*p,e}function BG(e,r){r=r===void 0?1:r;let t=cl()*2*Math.PI,i=cl()*2-1,a=Math.sqrt(1-i*i)*r;return e[0]=Math.cos(t)*a,e[1]=Math.sin(t)*a,e[2]=i*r,e}function ul(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n+t[15];return o=o||1,e[0]=(t[0]*i+t[4]*a+t[8]*n+t[12])/o,e[1]=(t[1]*i+t[5]*a+t[9]*n+t[13])/o,e[2]=(t[2]*i+t[6]*a+t[10]*n+t[14])/o,e}function P1(e,r,t){let i=r[0],a=r[1],n=r[2];return e[0]=i*t[0]+a*t[3]+n*t[6],e[1]=i*t[1]+a*t[4]+n*t[7],e[2]=i*t[2]+a*t[5]+n*t[8],e}function O1(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],c=r[1],u=r[2],l=a*u-n*c,h=n*s-i*u,p=i*c-a*s,d=a*p-n*h,v=n*l-i*p,x=i*h-a*l,y=o*2;return l*=y,h*=y,p*=y,d*=2,v*=2,x*=2,e[0]=s+l+d,e[1]=c+h+v,e[2]=u+p+x,e}function C1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0],n[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),n[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function B1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),n[1]=a[1],n[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function F1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),n[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),n[2]=a[2],e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function I1(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],c=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),u=c&&T1(e,r)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function FG(e){return e[0]=0,e[1]=0,e[2]=0,e}function IG(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function MG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function LG(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2];return Math.abs(t-n)<=1e-6*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=1e-6*Math.max(1,Math.abs(a),Math.abs(s))}var DG=Rj,qG=Pj,zG=Oj,NG=Cj,UG=Bj,HG=Tj,VG=Fj,GG=function(){let e=jj();return function(r,t,i,a,n,o){let s,c;for(t||(t=3),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();var M1=[0,0,0],vh,xr=class extends mh{static get ZERO(){return vh||(vh=new xr(0,0,0),Object.freeze(vh)),vh}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&_o(r)?this.copy(r):(gt.debug&&(ia(r),ia(t),ia(i)),this[0]=r,this[1]=t,this[2]=i)}set(r,t,i){return this[0]=r,this[1]=t,this[2]=i,this.check()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this.check()}fromObject(r){return gt.debug&&(ia(r.x),ia(r.y),ia(r.z)),this[0]=r.x,this[1]=r.y,this[2]=r.z,this.check()}toObject(r){return r.x=this[0],r.y=this[1],r.z=this[2],r}get ELEMENTS(){return 3}get z(){return this[2]}set z(r){this[2]=ia(r)}angle(r){return I1(this,r)}cross(r){return R1(this,this,r),this.check()}rotateX({radians:r,origin:t=M1}){return C1(this,this,t,r),this.check()}rotateY({radians:r,origin:t=M1}){return B1(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=M1}){return F1(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return ul(this,this,r),this.check()}transformAsVector(r){return gh(this,this,r),this.check()}transformByMatrix3(r){return P1(this,this,r),this.check()}transformByMatrix2(r){return Aj(this,this,r),this.check()}transformByQuaternion(r){return O1(this,this,r),this.check()}};var yh=class extends gc{toString(){let r="[";if(gt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=` ${this[i*this.RANK+t]}`}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=` ${this[t]}`}return r+="]",r}getElementIndex(r,t){return t*this.RANK+r}getElement(r,t){return this[t*this.RANK+r]}setElement(r,t,i){return this[t*this.RANK+r]=ia(i),this}getColumn(r,t=new Array(this.RANK).fill(-0)){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)t[a]=this[i+a];return t}setColumn(r,t){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)this[i+a]=t[a];return this}};function KG(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 Ij(e,r){if(e===r){let t=r[1],i=r[2],a=r[3],n=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=i,e[9]=n,e[11]=r[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Mj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],c=r[6],u=r[7],l=r[8],h=r[9],p=r[10],d=r[11],v=r[12],x=r[13],y=r[14],E=r[15],A=t*s-i*o,S=t*c-a*o,R=t*u-n*o,j=i*c-a*s,P=i*u-n*s,C=a*u-n*c,I=l*x-h*v,F=l*y-p*v,H=l*E-d*v,z=h*y-p*x,G=h*E-d*x,D=p*E-d*y,V=A*D-S*G+R*z+j*H-P*F+C*I;return V?(V=1/V,e[0]=(s*D-c*G+u*z)*V,e[1]=(a*G-i*D-n*z)*V,e[2]=(x*C-y*P+E*j)*V,e[3]=(p*P-h*C-d*j)*V,e[4]=(c*H-o*D-u*F)*V,e[5]=(t*D-a*H+n*F)*V,e[6]=(y*R-v*C-E*S)*V,e[7]=(l*C-p*R+d*S)*V,e[8]=(o*G-s*H+u*I)*V,e[9]=(i*H-t*G-n*I)*V,e[10]=(v*P-x*R+E*A)*V,e[11]=(h*R-l*P-d*A)*V,e[12]=(s*F-o*z-c*I)*V,e[13]=(t*z-i*F+a*I)*V,e[14]=(x*S-v*j-y*A)*V,e[15]=(l*j-h*S+p*A)*V,e):null}function Lj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11],d=e[12],v=e[13],x=e[14],y=e[15],E=r*o-t*n,A=r*s-i*n,S=t*s-i*o,R=u*v-l*d,j=u*x-h*d,P=l*x-h*v,C=r*P-t*j+i*R,I=n*P-o*j+s*R,F=u*S-l*A+h*E,H=d*S-v*A+x*E;return c*C-a*I+y*F-p*H}function L1(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],c=r[5],u=r[6],l=r[7],h=r[8],p=r[9],d=r[10],v=r[11],x=r[12],y=r[13],E=r[14],A=r[15],S=t[0],R=t[1],j=t[2],P=t[3];return e[0]=S*i+R*s+j*h+P*x,e[1]=S*a+R*c+j*p+P*y,e[2]=S*n+R*u+j*d+P*E,e[3]=S*o+R*l+j*v+P*A,S=t[4],R=t[5],j=t[6],P=t[7],e[4]=S*i+R*s+j*h+P*x,e[5]=S*a+R*c+j*p+P*y,e[6]=S*n+R*u+j*d+P*E,e[7]=S*o+R*l+j*v+P*A,S=t[8],R=t[9],j=t[10],P=t[11],e[8]=S*i+R*s+j*h+P*x,e[9]=S*a+R*c+j*p+P*y,e[10]=S*n+R*u+j*d+P*E,e[11]=S*o+R*l+j*v+P*A,S=t[12],R=t[13],j=t[14],P=t[15],e[12]=S*i+R*s+j*h+P*x,e[13]=S*a+R*c+j*p+P*y,e[14]=S*n+R*u+j*d+P*E,e[15]=S*o+R*l+j*v+P*A,e}function Dj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,c,u,l,h,p,d,v,x,y,E;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*n+r[12],e[13]=r[1]*i+r[5]*a+r[9]*n+r[13],e[14]=r[2]*i+r[6]*a+r[10]*n+r[14],e[15]=r[3]*i+r[7]*a+r[11]*n+r[15]):(o=r[0],s=r[1],c=r[2],u=r[3],l=r[4],h=r[5],p=r[6],d=r[7],v=r[8],x=r[9],y=r[10],E=r[11],e[0]=o,e[1]=s,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=p,e[7]=d,e[8]=v,e[9]=x,e[10]=y,e[11]=E,e[12]=o*i+l*a+v*n+r[12],e[13]=s*i+h*a+x*n+r[13],e[14]=c*i+p*a+y*n+r[14],e[15]=u*i+d*a+E*n+r[15]),e}function qj(e,r,t){let i=t[0],a=t[1],n=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function zj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),c,u,l,h,p,d,v,x,y,E,A,S,R,j,P,C,I,F,H,z,G,D,V,$;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,u=Math.sin(t),c=Math.cos(t),l=1-c,h=r[0],p=r[1],d=r[2],v=r[3],x=r[4],y=r[5],E=r[6],A=r[7],S=r[8],R=r[9],j=r[10],P=r[11],C=a*a*l+c,I=n*a*l+o*u,F=o*a*l-n*u,H=a*n*l-o*u,z=n*n*l+c,G=o*n*l+a*u,D=a*o*l+n*u,V=n*o*l-a*u,$=o*o*l+c,e[0]=h*C+x*I+S*F,e[1]=p*C+y*I+R*F,e[2]=d*C+E*I+j*F,e[3]=v*C+A*I+P*F,e[4]=h*H+x*z+S*G,e[5]=p*H+y*z+R*G,e[6]=d*H+E*z+j*G,e[7]=v*H+A*z+P*G,e[8]=h*D+x*V+S*$,e[9]=p*D+y*V+R*$,e[10]=d*D+E*V+j*$,e[11]=v*D+A*V+P*$,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Nj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],c=r[7],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=n*a+u*i,e[5]=o*a+l*i,e[6]=s*a+h*i,e[7]=c*a+p*i,e[8]=u*a-n*i,e[9]=l*a-o*i,e[10]=h*a-s*i,e[11]=p*a-c*i,e}function Uj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a-u*i,e[1]=o*a-l*i,e[2]=s*a-h*i,e[3]=c*a-p*i,e[8]=n*i+u*a,e[9]=o*i+l*a,e[10]=s*i+h*a,e[11]=c*i+p*a,e}function Hj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[4],l=r[5],h=r[6],p=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a+u*i,e[1]=o*a+l*i,e[2]=s*a+h*i,e[3]=c*a+p*i,e[4]=u*a-n*i,e[5]=l*a-o*i,e[6]=h*a-s*i,e[7]=p*a-c*i,e}function Vj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,c=a+a,u=t*o,l=i*o,h=i*s,p=a*o,d=a*s,v=a*c,x=n*o,y=n*s,E=n*c;return e[0]=1-h-v,e[1]=l+E,e[2]=p-y,e[3]=0,e[4]=l-E,e[5]=1-u-v,e[6]=d+x,e[7]=0,e[8]=p+y,e[9]=d-x,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gj(e,r,t,i,a,n,o){let s=1/(t-r),c=1/(a-i),u=1/(n-o);return e[0]=n*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*c,e[10]=(o+n)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*u,e[15]=0,e}function $G(e,r,t,i,a){let n=1/Math.tan(r/2);if(e[0]=n/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let o=1/(i-a);e[10]=(a+i)*o,e[14]=2*a*i*o}else e[10]=-1,e[14]=-2*i;return e}var Kj=$G;function WG(e,r,t,i,a,n,o){let s=1/(r-t),c=1/(i-a),u=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*c,e[14]=(o+n)*u,e[15]=1,e}var $j=WG;function Wj(e,r,t,i){let a,n,o,s,c,u,l,h,p,d,v=r[0],x=r[1],y=r[2],E=i[0],A=i[1],S=i[2],R=t[0],j=t[1],P=t[2];return Math.abs(v-R)<1e-6&&Math.abs(x-j)<1e-6&&Math.abs(y-P)<1e-6?KG(e):(h=v-R,p=x-j,d=y-P,a=1/Math.sqrt(h*h+p*p+d*d),h*=a,p*=a,d*=a,n=A*d-S*p,o=S*h-E*d,s=E*p-A*h,a=Math.sqrt(n*n+o*o+s*s),a?(a=1/a,n*=a,o*=a,s*=a):(n=0,o=0,s=0),c=p*s-d*o,u=d*n-h*s,l=h*o-p*n,a=Math.sqrt(c*c+u*u+l*l),a?(a=1/a,c*=a,u*=a,l*=a):(c=0,u=0,l=0),e[0]=n,e[1]=c,e[2]=h,e[3]=0,e[4]=o,e[5]=u,e[6]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=d,e[11]=0,e[12]=-(n*v+o*x+s*y),e[13]=-(c*v+u*x+l*y),e[14]=-(h*v+p*x+d*y),e[15]=1,e)}function YG(){let e=new ji(4);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Xj(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*n+t[12]*o,e[1]=t[1]*i+t[5]*a+t[9]*n+t[13]*o,e[2]=t[2]*i+t[6]*a+t[10]*n+t[14]*o,e[3]=t[3]*i+t[7]*a+t[11]*n+t[15]*o,e}var Wne=function(){let e=YG();return function(r,t,i,a,n,o){let s,c;for(t||(t=4),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();var z1;(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"})(z1||(z1={}));var JG=45*Math.PI/180,ZG=1,D1=.1,q1=500,eK=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ti=class extends yh{static get IDENTITY(){return tK()}static get ZERO(){return rK()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return z1}constructor(r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(r)?this.copy(r):this.identity()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this[3]=r[3],this[4]=r[4],this[5]=r[5],this[6]=r[6],this[7]=r[7],this[8]=r[8],this[9]=r[9],this[10]=r[10],this[11]=r[11],this[12]=r[12],this[13]=r[13],this[14]=r[14],this[15]=r[15],this.check()}set(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=c,this[8]=u,this[9]=l,this[10]=h,this[11]=p,this[12]=d,this[13]=v,this[14]=x,this[15]=y,this.check()}setRowMajor(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=n,this[2]=u,this[3]=d,this[4]=t,this[5]=o,this[6]=l,this[7]=v,this[8]=i,this[9]=s,this[10]=h,this[11]=x,this[12]=a,this[13]=c,this[14]=p,this[15]=y,this.check()}toRowMajor(r){return r[0]=this[0],r[1]=this[4],r[2]=this[8],r[3]=this[12],r[4]=this[1],r[5]=this[5],r[6]=this[9],r[7]=this[13],r[8]=this[2],r[9]=this[6],r[10]=this[10],r[11]=this[14],r[12]=this[3],r[13]=this[7],r[14]=this[11],r[15]=this[15],r}identity(){return this.copy(eK)}fromObject(r){return this.check()}fromQuaternion(r){return Vj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=D1,far:s=q1}=r;return s===1/0?aK(this,t,i,a,n,o):Gj(this,t,i,a,n,o,s),this.check()}lookAt(r){let{eye:t,center:i=[0,0,0],up:a=[0,1,0]}=r;return Wj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=D1,far:s=q1}=r;return $j(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=JG,aspect:i=ZG,focalDistance:a=1,near:n=D1,far:o=q1}=r;Yj(t);let s=t/2,c=a*Math.tan(s),u=c*i;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return Yj(t),Kj(this,t,i,a,n),this.check()}determinant(){return Lj(this)}getScale(r=[-0,-0,-0]){return r[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),r[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),r[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),r}getTranslation(r=[-0,-0,-0]){return r[0]=this[12],r[1]=this[13],r[2]=this[14],r}getRotation(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=0,r[4]=this[4]*a,r[5]=this[5]*n,r[6]=this[6]*o,r[7]=0,r[8]=this[8]*a,r[9]=this[9]*n,r[10]=this[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}getRotationMatrix3(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=this[4]*a,r[4]=this[5]*n,r[5]=this[6]*o,r[6]=this[8]*a,r[7]=this[9]*n,r[8]=this[10]*o,r}transpose(){return Ij(this,this),this.check()}invert(){return Mj(this,this),this.check()}multiplyLeft(r){return L1(this,r,this),this.check()}multiplyRight(r){return L1(this,this,r),this.check()}rotateX(r){return Nj(this,this,r),this.check()}rotateY(r){return Uj(this,this,r),this.check()}rotateZ(r){return Hj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return zj(this,this,r,t),this.check()}scale(r){return qj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return Dj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=Xj(t||[-0,-0,-0,-0],r,this),dh(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=Sj(t||[-0,-0],r,this);break;case 3:a=ul(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return dh(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=Ej(t||[-0,-0],r,this);break;case 3:i=gh(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return dh(i,r.length),i}transformPoint(r,t){return this.transformAsPoint(r,t)}transformVector(r,t){return this.transformAsPoint(r,t)}transformDirection(r,t){return this.transformAsVector(r,t)}makeRotationX(r){return this.identity().rotateX(r)}makeTranslation(r,t,i){return this.identity().translate([r,t,i])}},bh,xh;function rK(){return bh||(bh=new ti([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(bh)),bh}function tK(){return xh||(xh=new ti,Object.freeze(xh)),xh}function Yj(e){if(e>Math.PI*2)throw Error("expected radians")}function aK(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),c=(t+r)/(t-r),u=(a+i)/(a-i),l=-1,h=-1,p=-2*n;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]=c,e[9]=u,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}var ls={};xl(ls,{EPSILON1:()=>iK,EPSILON10:()=>hK,EPSILON11:()=>dK,EPSILON12:()=>mK,EPSILON13:()=>gK,EPSILON14:()=>vK,EPSILON15:()=>yK,EPSILON16:()=>bK,EPSILON17:()=>xK,EPSILON18:()=>_K,EPSILON19:()=>wK,EPSILON2:()=>nK,EPSILON20:()=>kK,EPSILON3:()=>oK,EPSILON4:()=>sK,EPSILON5:()=>cK,EPSILON6:()=>uK,EPSILON7:()=>lK,EPSILON8:()=>fK,EPSILON9:()=>pK,PI_OVER_FOUR:()=>EK,PI_OVER_SIX:()=>AK,PI_OVER_TWO:()=>SK,TWO_PI:()=>jK});var iK=.1,nK=.01,oK=.001,sK=1e-4,cK=1e-5,uK=1e-6,lK=1e-7,fK=1e-8,pK=1e-9,hK=1e-10,dK=1e-11,mK=1e-12,gK=1e-13,vK=1e-14,yK=1e-15,bK=1e-16,xK=1e-17,_K=1e-18,wK=1e-19,kK=1e-20,SK=Math.PI/2,EK=Math.PI/4,AK=Math.PI/6,jK=Math.PI*2;var Dn=6356752314245179e-9,TK={radii:[6378137,6378137,Dn],radiiSquared:[6378137*6378137,6378137*6378137,Dn*Dn],oneOverRadii:[1/6378137,1/6378137,1/Dn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dn*Dn)],maximumRadius:Math.max(6378137,6378137,Dn),centerToleranceSquared:.1};function _h(e){return e}var Eoe=new xr;function RK(e,r=[],t=_h){return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Qj(e,r=[]){return RK(e,r,gt._cartographicRadians?_h:E1)}function PK(e,r,t=_h){return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Jj(e,r){return PK(e,r,gt._cartographicRadians?_h:A1)}var Zj=1e-14,OK=new xr,eT={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"}},N1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},fl={east:new xr,north:new xr,up:new xr,west:new xr,south:new xr,down:new xr},CK=new xr,BK=new xr,FK=new xr;function U1(e,r,t,i,a,n){let o=eT[r]&&eT[r][t];ri(o&&(!i||i===o));let s,c,u,l=OK.copy(a);if(Mn(l.x,0,Zj)&&Mn(l.y,0,Zj)){let p=Math.sign(l.z);s=CK.fromArray(N1[r]),r!=="east"&&r!=="west"&&s.scale(p),c=BK.fromArray(N1[t]),t!=="east"&&t!=="west"&&c.scale(p),u=FK.fromArray(N1[i]),i!=="east"&&i!=="west"&&u.scale(p)}else{let{up:p,east:d,north:v}=fl;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),v.copy(p).cross(d);let{down:x,west:y,south:E}=fl;x.copy(p).scale(-1),y.copy(d).scale(-1),E.copy(v).scale(-1),s=fl[r],c=fl[t],u=fl[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=l.x,n[13]=l.y,n[14]=l.z,n[15]=1,n}var yc=new xr,IK=new xr,MK=new xr;function rT(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;yc.from(e);let o=yc.x,s=yc.y,c=yc.z,u=i.x,l=i.y,h=i.z,p=o*o*u*u,d=s*s*l*l,v=c*c*h*h,x=p+d+v,y=Math.sqrt(1/x);if(!Number.isFinite(y))return;let E=IK;if(E.copy(e).scale(y),x<n)return E.to(t);let A=a.x,S=a.y,R=a.z,j=MK;j.set(E.x*A*2,E.y*S*2,E.z*R*2);let P=(1-y)*yc.len()/(.5*j.len()),C=0,I,F,H,z;do{P-=C,I=1/(1+P*A),F=1/(1+P*S),H=1/(1+P*R);let G=I*I,D=F*F,V=H*H,$=G*I,ge=D*F,le=V*H;z=p*G+d*D+v*V-1;let de=-2*(p*$*A+d*ge*S+v*le*R);C=z/de}while(Math.abs(z)>ls.EPSILON12);return yc.scale([I,F,H]).to(t)}var wh=new xr,tT=new xr,qK=new xr,Ti=new xr,zK=new xr,kh=new xr,qn=class{constructor(r=0,t=0,i=0){this.centerToleranceSquared=ls.EPSILON1,ri(r>=0),ri(t>=0),ri(i>=0),this.radii=new xr(r,t,i),this.radiiSquared=new xr(r*r,t*t,i*i),this.radiiToTheFourth=new xr(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new xr(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new xr(r===0?0:1/(r*r),t===0?0:1/(t*t),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,t,i),this.maximumRadius=Math.max(r,t,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(r){return this===r||Boolean(r&&this.radii.equals(r.radii))}toString(){return this.radii.toString()}cartographicToCartesian(r,t=[0,0,0]){let i=tT,a=qK,[,,n]=r;this.geodeticSurfaceNormalCartographic(r,i),a.copy(this.radiiSquared).scale(i);let o=Math.sqrt(i.dot(a));return a.scale(1/o),i.scale(n),a.add(i),a.to(t)}cartesianToCartographic(r,t=[0,0,0]){kh.from(r);let i=this.scaleToGeodeticSurface(kh,Ti);if(!i)return;let a=this.geodeticSurfaceNormal(i,tT),n=zK;n.copy(kh).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),c=Math.sign(ll.dot(n,kh))*ll.length(n);return Jj([o,s,c],t)}eastNorthUpToFixedFrame(r,t=new ti){return U1(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new ti){return U1(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return wh.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=Qj(r),a=i[0],n=i[1],o=Math.cos(n);return wh.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),wh.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return wh.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return rT(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Ti.from(r);let i=Ti.x,a=Ti.y,n=Ti.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Ti.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){ri(Mn(this.radii.x,this.radii.y,ls.EPSILON15)),ri(this.radii.z>0),Ti.from(r);let a=Ti.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Ti.set(0,0,a).to(i)}};qn.WGS84=new qn(6378137,6378137,Dn);var aT="4.3.1";var iT,NK=(iT=globalThis.loaders)==null?void 0:iT.parseImageNode,H1=typeof Image<"u",V1=typeof ImageBitmap<"u",UK=Boolean(NK),G1=No?!0:UK;function nT(e){switch(e){case"auto":return V1||H1||G1;case"imagebitmap":return V1;case"image":return H1;case"data":return G1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function oT(){if(V1)return"imagebitmap";if(H1)return"image";if(G1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function HK(e){let r=VK(e);if(!r)throw new Error("Not an image");return r}function sT(e){switch(HK(e)){case"data":return e;case"image":case"imagebitmap":let r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function VK(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 GK=/^data:image\/svg\+xml/,KK=/\.svg((\?|#).*)?$/;function Sh(e){return e&&(GK.test(e)||KK.test(e))}function cT(e,r){if(Sh(r)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return K1(e,r)}function K1(e,r){if(Sh(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Eh(e,r,t){let i=cT(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await $K(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function $K(e,r){let t=new Image;return t.src=e,r.image&&r.image.decode&&t.decode?(await t.decode(),t):await new Promise((i,a)=>{try{t.onload=()=>i(t),t.onerror=n=>{let o=n instanceof Error?n.message:"error";a(new Error(o))}}catch(n){a(n)}})}var WK={},uT=!0;async function lT(e,r,t){let i;Sh(t)?i=await Eh(e,r,t):i=K1(e,t);let a=r&&r.imagebitmap;return await XK(i,a)}async function XK(e,r=null){if((YK(r)||!uT)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),uT=!1}return await createImageBitmap(e)}function YK(e){for(let r in e||WK)return!1;return!0}function fT(e){return!e$(e,"ftyp",4)||!(e[8]&96)?null:QK(e)}function QK(e){switch(JK(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function JK(e,r,t){return String.fromCharCode(...e.slice(r,t))}function ZK(e){return[...e].map(r=>r.charCodeAt(0))}function e$(e,r,t=0){let i=ZK(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var nn=!1,pl=!0;function Ah(e){let r=hl(e);return t$(r)||n$(r)||a$(r)||i$(r)||r$(r)}function r$(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=fT(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function t$(e){let r=hl(e);return r.byteLength>=24&&r.getUint32(0,nn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,nn),height:r.getUint32(20,nn)}:null}function a$(e){let r=hl(e);return r.byteLength>=10&&r.getUint32(0,nn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,pl),height:r.getUint16(8,pl)}:null}function i$(e){let r=hl(e);return r.byteLength>=14&&r.getUint16(0,nn)===16973&&r.getUint32(2,pl)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,pl),height:r.getUint32(22,pl)}:null}function n$(e){let r=hl(e);if(!(r.byteLength>=3&&r.getUint16(0,nn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=o$(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,nn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,nn),width:r.getUint16(n+7,nn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,nn)}return null}function o$(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function hl(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 pT(e,r){var a;let{mimeType:t}=Ah(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return ki(i),await i(e,t)}async function hT(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=s$(a),s;switch(o){case"imagebitmap":s=await lT(e,r,n);break;case"image":s=await Eh(e,r,n);break;case"data":s=await pT(e,r);break;default:ki(!1)}return a==="data"&&(s=sT(s)),s}function s$(e){switch(e){case"auto":case"data":return oT();default:return nT(e),e}}var c$=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],u$=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],l$={image:{type:"auto",decode:!0}},jh={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:aT,mimeTypes:u$,extensions:c$,parse:hT,tests:[e=>Boolean(Ah(new DataView(e)))],options:l$};var dT="4.3.1";var mT={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:dT,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function vT(e,r,t){let i=yT(r.metadata),a=[],n=f$(r.attributes);for(let o in e){let s=e[o],c=gT(o,s,n[o]);a.push(c)}if(t){let o=gT("indices",t);a.push(o)}return{fields:a,metadata:i}}function f$(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function gT(e,r,t){let i=t?yT(t.metadata):void 0;return w1(e,r,i)}function yT(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var bT={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},p$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},h$=4,dl=class{draco;decoder;metadataQuerier;constructor(r){this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(r,t={}){let i=new this.draco.DecoderBuffer;i.Init(new Int8Array(r),r.byteLength),this._disableAttributeTransforms(t);let a=this.decoder.GetEncodedGeometryType(i),n=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(a){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){let p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(n,a,t),c=this._getMeshData(n,s,t),u=_1(c.attributes),l=vT(c.attributes,s,c.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:u},...c,schema:l}}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}_getDracoLoaderData(r,t,i){let a=this._getTopLevelMetadata(r),n=this._getDracoAttributes(r,i);return{geometry_type:t,num_attributes:r.num_attributes(),num_points:r.num_points(),num_faces:r instanceof this.draco.Mesh?r.num_faces():0,metadata:a,attributes:n}}_getDracoAttributes(r,t){let i={};for(let a=0;a<r.num_attributes();a++){let n=this.decoder.GetAttribute(r,a),o=this._getAttributeMetadata(r,a);i[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:a,metadata:o};let s=this._getQuantizationTransform(n,t);s&&(i[n.unique_id()].quantization_transform=s);let c=this._getOctahedronTransform(n,t);c&&(i[n.unique_id()].octahedron_transform=c)}return i}_getMeshData(r,t,i){let a=this._getMeshAttributes(t,r,i);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(r instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(r),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(r),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(r,t,i){let a={};for(let n of Object.values(r.attributes)){let o=this._deduceAttributeName(n,i);n.name=o;let s=this._getAttributeValues(t,n);if(s){let{value:c,size:u}=s;a[o]={value:c,size:u,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}}return a}_getTriangleListIndices(r){let i=r.num_faces()*3,a=i*h$,n=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(r,a,n),new Uint32Array(this.draco.HEAPF32.buffer,n,i).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(r){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(r,t),g$(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=p$[t.data_type];if(!i)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,c=d$(this.draco,i),u,l=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,c,s,l),u=new i(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:a}}_deduceAttributeName(r,t){let i=r.unique_id;for(let[o,s]of Object.entries(t.extraAttributes||{}))if(s===i)return o;let a=r.attribute_type;for(let o in bT)if(this.draco[o]===a)return bT[o];let n=t.attributeNameEntry||"name";return r.metadata[n]?r.metadata[n].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(r){let t=this.decoder.GetMetadata(r);return this._getDracoMetadata(t)}_getAttributeMetadata(r,t){let i=this.decoder.GetAttributeMetadata(r,t);return this._getDracoMetadata(i)}_getDracoMetadata(r){if(!r||!r.ptr)return{};let t={},i=this.metadataQuerier.NumEntries(r);for(let a=0;a<i;a++){let n=this.metadataQuerier.GetEntryName(r,a);t[n]=this._getDracoMetadataField(r,n)}return t}_getDracoMetadataField(r,t){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(r,t,i);let a=m$(i);return{int:this.metadataQuerier.GetIntEntry(r,t),string:this.metadataQuerier.GetStringEntry(r,t),double:this.metadataQuerier.GetDoubleEntry(r,t),intArray:a}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(r){let{quantizedAttributes:t=[],octahedronAttributes:i=[]}=r,a=[...t,...i];for(let n of a)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(r,t){let{quantizedAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))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(r,t){let{octahedronAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function d$(e,r){switch(r){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 m$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function g$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var v$="1.5.6",y$="1.4.1",$1=`https://www.gstatic.com/draco/versioned/decoders/${v$}`,Sa={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},W1={[Sa.DECODER]:`${$1}/${Sa.DECODER}`,[Sa.DECODER_WASM]:`${$1}/${Sa.DECODER_WASM}`,[Sa.FALLBACK_DECODER]:`${$1}/${Sa.FALLBACK_DECODER}`,[Sa.ENCODER]:`https://raw.githubusercontent.com/google/draco/${y$}/javascript/${Sa.ENCODER}`},X1;async function xT(e){let r=e.modules||{};return r.draco3d?X1||=r.draco3d.createDecoderModule({}).then(t=>({draco:t})):X1||=b$(e),await X1}async function b$(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await Qi(W1[Sa.FALLBACK_DECODER],"draco",e,Sa.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await Qi(W1[Sa.DECODER],"draco",e,Sa.DECODER),await Qi(W1[Sa.DECODER_WASM],"draco",e,Sa.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await x$(r,t)}function x$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var _T={...mT,parse:_$};async function _$(e,r){let{draco:t}=await xT(r),i=new dl(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var Th="4.3.1";var Rh={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},wT;async function Q1(e){Yg(e.modules);let r=Qg("basis");return r||(wT||=w$(e),await wT)}async function w$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Rh.TRANSCODER,"textures",e),await Qi(Rh.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await k$(r,t)}function k$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,initializeBasis:o}=a;o(),i({BasisFile:n})})})}var Y1;async function J1(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(Y1=Y1||S$(e),await Y1)}async function S$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Rh.ENCODER,"textures",e),await Qi(Rh.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await E$(r,t)}function E$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:c}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:c})})})}var re={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 A$=["","WEBKIT_","MOZ_"],kT={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"},Ph=null;function ST(e){if(!Ph){e=e||j$()||void 0,Ph=new Set;for(let r of A$)for(let t in kT)if(e&&e.getExtension(`${r}${t}`)){let i=kT[t];Ph.add(i)}}return Ph}function j$(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Z1=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},fs=class{constructor(r,t,i,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(r.buffer,r.byteOffset+t,i),this._littleEndian=a,this._offset=0}_nextUint8(){let r=this._dataView.getUint8(this._offset);return this._offset+=1,r}_nextUint16(){let r=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,r}_nextUint32(){let r=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint64(){let r=this._dataView.getUint32(this._offset,this._littleEndian),t=this._dataView.getUint32(this._offset+4,this._littleEndian),i=r+2**32*t;return this._offset+=8,i}_nextInt32(){let r=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint8Array(r){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,r);return this._offset+=r,t}_skip(r){return this._offset+=r,this}_scan(r,t=0){let i=this._offset,a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<r;)a++,this._offset++;return a<r&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,a)}};var qse=new Uint8Array([0]),ha=[171,75,84,88,32,50,48,187,13,10,26,10];function ET(e){return new TextDecoder().decode(e)}function AT(e){let r=new Uint8Array(e.buffer,e.byteOffset,ha.length);if(r[0]!==ha[0]||r[1]!==ha[1]||r[2]!==ha[2]||r[3]!==ha[3]||r[4]!==ha[4]||r[5]!==ha[5]||r[6]!==ha[6]||r[7]!==ha[7]||r[8]!==ha[8]||r[9]!==ha[9]||r[10]!==ha[10]||r[11]!==ha[11])throw new Error("Missing KTX 2.0 identifier.");let t=new Z1,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new fs(e,ha.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();let n=a._nextUint32();t.supercompressionScheme=a._nextUint32();let o=a._nextUint32(),s=a._nextUint32(),c=a._nextUint32(),u=a._nextUint32(),l=a._nextUint64(),h=a._nextUint64(),p=n*3*8,d=new fs(e,ha.length+i,p,!0);for(let ie=0;ie<n;ie++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let v=new fs(e,o,s,!0),x={vendorId:v._skip(4)._nextUint16(),descriptorType:v._nextUint16(),versionNumber:v._nextUint16(),descriptorBlockSize:v._nextUint16(),colorModel:v._nextUint8(),colorPrimaries:v._nextUint8(),transferFunction:v._nextUint8(),flags:v._nextUint8(),texelBlockDimension:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],bytesPlane:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],samples:[]},y=6,E=4,A=(x.descriptorBlockSize/4-y)/E;for(let ie=0;ie<A;ie++){let we={bitOffset:v._nextUint16(),bitLength:v._nextUint8(),channelType:v._nextUint8(),samplePosition:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};we.channelType&64?(we.sampleLower=v._nextInt32(),we.sampleUpper=v._nextInt32()):(we.sampleLower=v._nextUint32(),we.sampleUpper=v._nextUint32()),x.samples[ie]=we}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(x);let S=new fs(e,c,u,!0);for(;S._offset<u;){let ie=S._nextUint32(),we=S._scan(ie),Te=ET(we);if(t.keyValue[Te]=S._nextUint8Array(ie-we.byteLength-1),Te.match(/^ktx/i)){let U=ET(t.keyValue[Te]);t.keyValue[Te]=U.substring(0,U.lastIndexOf("\0"))}let Se=ie%4?4-ie%4:0;S._skip(Se)}if(h<=0)return t;let R=new fs(e,l,h,!0),j=R._nextUint16(),P=R._nextUint16(),C=R._nextUint32(),I=R._nextUint32(),F=R._nextUint32(),H=R._nextUint32(),z=[];for(let ie=0;ie<n;ie++)z.push({imageFlags:R._nextUint32(),rgbSliceByteOffset:R._nextUint32(),rgbSliceByteLength:R._nextUint32(),alphaSliceByteOffset:R._nextUint32(),alphaSliceByteLength:R._nextUint32()});let G=l+R._offset,D=G+C,V=D+I,$=V+F,ge=new Uint8Array(e.buffer,e.byteOffset+G,C),le=new Uint8Array(e.buffer,e.byteOffset+D,I),oe=new Uint8Array(e.buffer,e.byteOffset+V,F),de=new Uint8Array(e.buffer,e.byteOffset+$,H);return t.globalData={endpointCount:j,selectorCount:P,imageDescs:z,endpointsData:ge,selectorsData:le,tablesData:oe,extendedData:de},t}function bc(e,r){let t=new Array(r.mipMapLevels),i=r.width,a=r.height,n=0;for(let o=0;o<r.mipMapLevels;++o){let s=R$(r,i,a,e,o),c=T$(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:c,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function T$(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function R$(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var P$={131:re.COMPRESSED_RGB_S3TC_DXT1_EXT,132:re.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:re.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:re.COMPRESSED_RED_RGTC1_EXT,140:re.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:re.COMPRESSED_RED_GREEN_RGTC2_EXT,142:re.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:re.COMPRESSED_RGB8_ETC2,148:re.COMPRESSED_SRGB8_ETC2,149:re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:re.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:re.COMPRESSED_RGBA8_ETC2_EAC,152:re.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:re.COMPRESSED_R11_EAC,154:re.COMPRESSED_SIGNED_R11_EAC,155:re.COMPRESSED_RG11_EAC,156:re.COMPRESSED_SIGNED_RG11_EAC,157:re.COMPRESSED_RGBA_ASTC_4x4_KHR,158:re.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:re.COMPRESSED_RGBA_ASTC_5x4_KHR,160:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:re.COMPRESSED_RGBA_ASTC_5x5_KHR,162:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:re.COMPRESSED_RGBA_ASTC_6x5_KHR,164:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:re.COMPRESSED_RGBA_ASTC_6x6_KHR,166:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:re.COMPRESSED_RGBA_ASTC_8x5_KHR,168:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:re.COMPRESSED_RGBA_ASTC_8x6_KHR,170:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:re.COMPRESSED_RGBA_ASTC_8x8_KHR,172:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:re.COMPRESSED_RGBA_ASTC_10x5_KHR,174:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:re.COMPRESSED_RGBA_ASTC_10x6_KHR,176:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:re.COMPRESSED_RGBA_ASTC_10x8_KHR,178:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:re.COMPRESSED_RGBA_ASTC_10x10_KHR,180:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:re.COMPRESSED_RGBA_ASTC_12x10_KHR,182:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:re.COMPRESSED_RGBA_ASTC_12x12_KHR,184:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:re.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:re.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:re.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:re.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:re.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:re.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:re.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:re.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:re.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:re.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:re.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:re.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:re.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:re.COMPRESSED_RGBA_ASTC_12x12_KHR};function jT(e){return P$[e]}var Ba=[171,75,84,88,32,50,48,187,13,10,26,10];function Oh(e){let r=new Uint8Array(e);return!(r.byteLength<Ba.length||r[0]!==Ba[0]||r[1]!==Ba[1]||r[2]!==Ba[2]||r[3]!==Ba[3]||r[4]!==Ba[4]||r[5]!==Ba[5]||r[6]!==Ba[6]||r[7]!==Ba[7]||r[8]!==Ba[8]||r[9]!==Ba[9]||r[10]!==Ba[10]||r[11]!==Ba[11])}function TT(e){let r=new Uint8Array(e),t=AT(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=jT(t.vkFormat);return bc(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var O$={etc1:{basisFormat:0,compressed:!0,format:re.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:re.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:re.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:re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:re.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 Ch(e,r){if(r.basis.containerFormat==="auto"){if(Oh(e)){let i=await J1(r);return RT(i.KTX2File,e,r)}let{BasisFile:t}=await Q1(r);return ey(t,e,r)}switch(r.basis.module){case"encoder":let t=await J1(r);switch(r.basis.containerFormat){case"ktx2":return RT(t.KTX2File,e,r);case"basis":default:return ey(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await Q1(r);return ey(i,e,r)}}function ey(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let a=i.getNumImages(),n=[];for(let o=0;o<a;o++){let s=i.getNumLevels(o),c=[];for(let u=0;u<s;u++)c.push(C$(i,o,u,t));n.push(c)}return n}finally{i.close(),i.delete()}}function C$(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:c,basisFormat:u}=PT(i,o),l=e.getImageTranscodedSizeInBytes(r,t,u),h=new Uint8Array(l);if(!e.transcodeImage(h,r,t,u,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:c,hasAlpha:o}}function RT(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let a=i.getLevels(),n=[];for(let o=0;o<a;o++)n.push(B$(i,o,t));return[n]}finally{i.close(),i.delete()}}function B$(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:c}=PT(t,i),u=e.getImageTranscodedSizeInBytes(r,0,0,c),l=new Uint8Array(u);if(!e.transcodeImage(l,r,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:l,compressed:o,levelSize:u,hasAlpha:i,format:s}}function PT(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=F$()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),O$[t]}function F$(){let e=ST();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 OT={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Th,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"}}},ml={...OT,parse:Ch};var Fa={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},I$={DXT1:re.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":re.COMPRESSED_RGB_ATC_WEBGL,ATCA:re.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:re.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},M$=FT,L$=Bh,D$=Bh,q$={DXT1:FT,DXT3:Bh,DXT5:Bh,"ATC ":M$,ATCA:L$,ATCI:D$};function CT(e){return new Uint32Array(e,0,Fa.HEADER_LENGTH)[Fa.MAGIC_NUMBER_INDEX]===Fa.MAGIC_NUMBER}function BT(e){let r=new Int32Array(e,0,Fa.HEADER_LENGTH),t=r[Fa.HEADER_PF_FOURCC_INDEX];ki(Boolean(r[Fa.HEADER_PF_FLAGS_INDEX]&Fa.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=z$(t),a=I$[i],n=q$[i];ki(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[Fa.HEADER_FLAGS_INDEX]&Fa.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[Fa.MIPMAPCOUNT_INDEX]));let s=r[Fa.HEADER_WIDTH_INDEX],c=r[Fa.HEADER_HEIGHT_INDEX],u=r[Fa.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,u);return bc(l,{mipMapLevels:o,width:s,height:c,sizeFunction:n,internalFormat:a})}function FT(e,r){return(e+3>>2)*(r+3>>2)*8}function Bh(e,r){return(e+3>>2)*(r+3>>2)*16}function z$(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var ai={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},N$={0:[re.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[re.COMPRESSED_RGB_ETC1_WEBGL],7:[re.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[re.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[re.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[re.COMPRESSED_RGB8_ETC2],23:[re.COMPRESSED_RGBA8_ETC2_EAC],24:[re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[re.COMPRESSED_R11_EAC],26:[re.COMPRESSED_RG11_EAC],27:[re.COMPRESSED_RGBA_ASTC_4X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[re.COMPRESSED_RGBA_ASTC_5X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[re.COMPRESSED_RGBA_ASTC_5X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[re.COMPRESSED_RGBA_ASTC_6X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[re.COMPRESSED_RGBA_ASTC_6X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[re.COMPRESSED_RGBA_ASTC_8X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[re.COMPRESSED_RGBA_ASTC_8X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[re.COMPRESSED_RGBA_ASTC_8X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[re.COMPRESSED_RGBA_ASTC_10X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[re.COMPRESSED_RGBA_ASTC_10X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[re.COMPRESSED_RGBA_ASTC_10X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[re.COMPRESSED_RGBA_ASTC_10X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[re.COMPRESSED_RGBA_ASTC_12X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[re.COMPRESSED_RGBA_ASTC_12X12_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},U$={0:IT,1:IT,2:MT,3:MT,6:gl,7:gl,9:vl,11:vl,22:gl,23:vl,24:gl,25:gl,26:vl,27:vl,28:H$,29:V$,30:G$,31:K$,32:$$,33:W$,34:X$,35:Y$,36:Q$,37:J$,38:Z$,39:eW,40:rW};function LT(e){let t=new Uint32Array(e,0,ai.HEADER_LENGTH)[ai.MAGIC_NUMBER_INDEX];return t===ai.MAGIC_NUMBER||t===ai.MAGIC_NUMBER_EXTRA}function DT(e){let r=new Uint32Array(e,0,ai.HEADER_LENGTH),t=r[ai.PIXEL_FORMAT_INDEX],i=r[ai.COLOUR_SPACE_INDEX],a=N$[t]||[],n=a.length>1&&i?a[1]:a[0],o=U$[t],s=r[ai.MIPMAPCOUNT_INDEX],c=r[ai.WIDTH_INDEX],u=r[ai.HEIGHT_INDEX],l=ai.HEADER_SIZE+r[ai.METADATA_SIZE_INDEX],h=new Uint8Array(e,l);return bc(h,{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:n})}function IT(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function MT(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function gl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function vl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function H$(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function V$(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function G$(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function K$(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function $$(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function W$(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function X$(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function Y$(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function Q$(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function J$(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function Z$(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function eW(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function rW(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function qT(e){if(Oh(e))return TT(e);if(CT(e))return BT(e);if(LT(e))return DT(e);throw new Error("Texture container format not recognized")}var zT={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:Th,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}}},Fh={...zT,parse:async(e,r)=>{var t;return(t=r==null?void 0:r["compressed-texture"])!=null&&t.useBasis?(r.basis={format:{alpha:"BC3",noAlpha:"BC1"},...r.basis,containerFormat:"ktx2",module:"encoder"},(await Ch(e,r))[0]):qT(e)}};function NT(e,r=null){return r?`${e}?token=${r}`:e}var tW={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},aW={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ps={...tW,...aW};function ry(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 UT={UInt8:ps.UNSIGNED_BYTE,UInt16:ps.UNSIGNED_SHORT,Float32:ps.FLOAT,UInt32:ps.UNSIGNED_INT,UInt64:ps.DOUBLE};function xc(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 Ih=new xr([0,0,0]);function iW(e){switch(e){case"ktx-etc2":case"dds":return Fh;case"ktx2":return ml;case"jpg":case"png":default:return jh}}var nW="i3s-attribute-type";async function KT(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ti,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=NT(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),c=iW(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(c===jh){let p={...r.textureLoaderOptions,image:{type:"data"}};try{let d=await Gg(h,[],p,a);n.texture=d}catch{let v=await In(h,c,p,a);n.texture=v}}else if(c===Fh||c===ml){let p=await k1(h,c,r.textureLoaderOptions);c===ml&&(p=p[0]),n.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else n.texture=h}return n.material=dW(r.materialDefinition,n.texture),n.material&&(n.texture=null),await oW(e,n,r,t,i)}async function oW(e,r,t,i,a){var h,p;let n=e.byteLength,o,s,c=0,u=0,l;if(t.isDracoGeometry){let d=await In(e,_T,{draco:{attributeNameEntry:nW}});s=d.header.vertexCount,l=(h=d.indices)==null?void 0:h.value;let{POSITION:v,NORMAL:x,COLOR_0:y,TEXCOORD_0:E,["feature-index"]:A,["uv-region"]:S}=d.attributes;o={position:v,normal:x,color:y,uv0:E,uvRegion:S,id:A},sW(o,d);let R=yW(A);R&&vW(o,R)}else{let{vertexAttributes:d,ordering:v,featureAttributes:x,featureAttributeOrder:y}=i.store.defaultGeometrySchema,E=uW(e,i);c=E.byteOffset,s=E.vertexCount,u=E.featureCount;let{attributes:A,byteOffset:S}=VT(e,c,d,s,v),{attributes:R}=VT(e,S,x,u,y);gW(R),o=cW(A,R)}if(!((p=a==null?void 0:a.i3s)!=null&&p.coordinateSystem)||a.i3s.coordinateSystem===2){let d=fW(o.position,t);r.modelMatrix=d.invert(),r.coordinateSystem=2}else r.modelMatrix=hW(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:HT(o.color),texCoords:o.uv0,uvRegions:HT(o.uvRegion||o.region)},r.indices=l||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let d in r.attributes)r.attributes[d]||delete r.attributes[d];return r.vertexCount=s,r.byteLength=n,r}function sW(e,r){for(let t in r.loaderData.attributes){let i=r.loaderData.attributes[t];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function cW(e,r){return{...e,...r}}function HT(e){return e&&(e.normalized=!0,e)}function uW(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=ry(o);switch(n){case"vertexCount".toString():i=new s(e,0,4)[0],t+=xc(o);break;case"featureCount".toString():a=new s(e,4,4)[0],t+=xc(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function VT(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:c}=t[o];if(r+i*c*xc(s)<=e.byteLength){let u=e.slice(r),l;if(s==="UInt64")l=lW(u,i*c,xc(s));else{let h=ry(s);l=new h(u,0,i*c)}switch(n[o]={value:l,type:UT[s],size:c},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*c*xc(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function lW(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),c=a.getUint32(n+4,!0),u=s+2**32*c;i.push(u),n+=t}return new Uint32Array(i)}function fW(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new ti,o=new xr(t[0],t[1],t[2]),s=new xr;return qn.WGS84.cartographicToCartesian(o,s),qn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=pW(i,a,o),n}function pW(e,r={},t){let i=new Float64Array(e.length),a=r["i3s-scale_x"]&&r["i3s-scale_x"].double||1,n=r["i3s-scale_y"]&&r["i3s-scale_y"].double||1;for(let o=0;o<i.length;o+=3)i[o]=e[o]*a+t.x,i[o+1]=e[o+1]*n+t.y,i[o+2]=e[o+2]+t.z;for(let o=0;o<i.length;o+=3)qn.WGS84.cartographicToCartesian(i.subarray(o,o+3),Ih),i[o]=Ih.x,i[o+1]=Ih.y,i[o+2]=Ih.z;return i}function hW(e){var n,o;let r=e.metadata,t=((n=r==null?void 0:r["i3s-scale_x"])==null?void 0:n.double)||1,i=((o=r==null?void 0:r["i3s-scale_y"])==null?void 0:o.double)||1,a=new ti;return a[0]=t,a[5]=i,a}function dW(e,r){let t;return e?t={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(t={pbrMetallicRoughness:{}},r?t.pbrMetallicRoughness.baseColorTexture={texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),t.alphaCutoff=t.alphaCutoff||.25,t.alphaMode&&(t.alphaMode=t.alphaMode.toUpperCase()),t.emissiveFactor&&(t.emissiveFactor=GT(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=GT(t.pbrMetallicRoughness.baseColorFactor)),r&&mW(t,r),t}function GT(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function mW(e,r){let t={source:{image:r}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:t}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:t}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:t}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:t}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:t})}function gW(e){let{id:r,faceRange:t}=e;if(!r||!t)return;let i=r.value,a=t.value,n=a[a.length-1]+1,o=new Uint32Array(n*3),s=0,c=0;for(let u=1;u<a.length;u+=2){let l=Number(i[s]),h=a[u],p=a[u-1],d=h-p+1,v=c+d*3;o.fill(l,c,v),s++,c=v}e.id.value=o}function vW(e,r){let t=e.id.value,i=new Float32Array(t.length);for(let a=0;a<t.length;a++)i[a]=r[t[a]];e.id.value=i}function yW(e){var r,t;return(t=(r=e==null?void 0:e.metadata)==null?void 0:r["i3s-feature-ids"])==null?void 0:t.intArray}var bW="4.3.1",$T={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:bW,mimeTypes:["application/octet-stream"],parse:xW,extensions:["bin"],options:{"i3s-content":{}}};async function xW(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,c=o||n;return!s||!c?null:await KT(e,s,c,r,t)}nv($T);
99
+ }`}function Iu(e,r=!0,t){let i=t||new Set;if(e){if(i5(e))i.add(e);else if(i5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Iu(e[a],r,i)}}return t===void 0?Array.from(i):[]}function i5(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}var ev=()=>{},ho=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Nt||typeof Fu<"u"&&!Nt}constructor(r){let{name:t,source:i,url:a}=r;Wt(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=ev,this.onError=n=>console.log(n),this.worker=Nt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=ev,this.onError=ev,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Iu(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=t5({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;r=new Fu(i,{eval:!1})}else if(this.source)r=new Fu(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var Mu=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return ho.isSupported()}constructor(r){this.source=r.source,this.url=r.url,this.setProps(r)}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(a,n,o)=>a.done(o),i=(a,n)=>a.error(n)){let a=new Promise(n=>(this.jobQueue.push({name:r,onMessage:t,onError:i,onStart:n}),this));return this._startQueuedJob(),await a}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let i=new Cu(t.name,r);r.onMessage=a=>t.onMessage(i,a.type,a.payload),r.onError=a=>t.onError(i,a),t.onStart(i);try{await i.result}catch(a){console.error(`Worker exception: ${a}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!Nt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new ho({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return r5?this.maxMobileConcurrency:this.maxConcurrency}};var vH={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Vo=class{props;workerPools=new Map;static isSupported(){return ho.isSupported()}static getWorkerFarm(r={}){return Vo._workerFarm=Vo._workerFarm||new Vo({}),Vo._workerFarm.setProps(r),Vo._workerFarm}constructor(r){this.props={...vH},this.setProps(r),this.workerPools=new Map}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:i,url:a}=r,n=this.workerPools.get(t);return n||(n=new Mu({name:t,source:i,url:a}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},mo=Vo;ty(mo,"_workerFarm");async function Go(){return Jg}var rv=new Map,Ca=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await Go())}static set onmessage(r){async function t(i){let a=await Go(),{type:n,payload:o}=a?i:i.data;r(n,o)}Go().then(i=>{i?(i.on("message",a=>{t(a)}),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=rv.get(r);t||(t=async a=>{if(!yH(a))return;let n=await Go(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await Go()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=rv.get(r);rv.delete(r),await Go()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Iu(t),n=await Go();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function yH(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function tv(e,r={}){let t=r[e.id]||{},i=Nt?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(Nt?a=`modules/${e.module}/dist/${i}`:a=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!a){let n=e.version;n==="latest"&&(n=Z4);let o=n?`@${n}`:"";a=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return Wt(a),a}function av(e,r=Pu){Wt(e,"no worker provided");let t=e.version;return!(!r||!t)}var iv={};async function Qi(e,r=null,t={},i=null){return r&&(e=n5(e,r,t,i)),iv[e]=iv[e]||bH(e),await iv[e]}function n5(e,r,t={},i=null){if(!t.useLocalLibraries&&e.startsWith("http"))return e;i=i||e;let a=t.modules||{};return a[i]?a[i]:Nt?t.CDN?(Wt(t.CDN.startsWith("http")),`${t.CDN}/${r}@${Pu}/dist/libs/${i}`):Ou?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function bH(e){if(e.endsWith("wasm"))return await _H(e);if(!Nt)try{let{requireFromFile:t}=globalThis.loaders||{};return await(t==null?void 0:t(e))}catch(t){return console.error(t),null}if(Ou)return importScripts(e);let r=await wH(e);return xH(r,e)}function xH(e,r){if(!Nt){let{requireFromString:i}=globalThis.loaders||{};return i==null?void 0:i(e,r)}if(Ou)return eval.call(globalThis,e),null;let t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}async function _H(e){let{readFileAsArrayBuffer:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await r(e)}async function wH(e){let{readFileAsText:r}=globalThis.loaders||{};return Nt||!r||e.startsWith("http")?await(await fetch(e)).text():await r(e)}var kH=0;async function nv(e){await Ca.inWorkerThread()&&(Ca.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await EH({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:SH}});Ca.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Ca.postMessage("error",{error:a})}break;default:}})}function SH(e,r,t,i){return new Promise((a,n)=>{let o=kH++,s=(u,l)=>{if(l.id===o)switch(u){case"done":Ca.removeEventListener(s),a(l.result);break;case"error":Ca.removeEventListener(s),n(l.error);break;default:}};Ca.addEventListener(s);let c={id:o,input:e,options:t};Ca.postMessage("process",c)})}async function EH({loader:e,arrayBuffer:r,options:t,context:i}){let a,n;if(e.parseSync||e.parse)a=r,n=e.parseSync||e.parse;else if(e.parseTextSync)a=new TextDecoder().decode(r),n=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await n(a,{...t},i,e)}function ov(e,r){return!mo.isSupported()||!Nt&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function sv(e,r,t,i,a){let n=e.id,o=tv(e,t),c=mo.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let u=await c.startJob("process-on-worker",AH.bind(null,a));return u.postMessage("process",{input:r,options:t,context:i}),await(await u.result).result}async function AH(e,r,t,i){switch(t){case"done":r.done(i);break;case"error":r.error(new Error(i.error));break;case"process":let{id:a,input:n,options:o}=i;try{let s=await e(n,o);r.postMessage("done",{id:a,result:s})}catch(s){let c=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function cv(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let i=new Uint8Array(e),a=new Uint8Array(r);for(let n=0;n<i.length;++n)if(i[n]!==a[n])return!1;return!0}function uv(...e){return o5(e)}function o5(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}async function Lu(e){let r=[];for await(let t of e)r.push(t);return uv(...r)}var jH="",s5={};function Ko(e){for(let r in s5)if(e.startsWith(r)){let t=s5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${jH}${e}`),e}function c5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function u5(e){return e&&typeof e=="object"&&e.isBuffer}function wp(e){if(u5(e))return c5(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 r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var $o={};xl($o,{dirname:()=>PH,filename:()=>RH,join:()=>OH,resolve:()=>CH});function l5(){var r;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(r=window.location)==null?void 0:r.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function RH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function PH(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function OH(...e){let r="/";return e=e.map((t,i)=>(i&&(t=t.replace(new RegExp(`^${r}`),"")),i!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function CH(...e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n];let t="",i=!1,a;for(let n=r.length-1;n>=-1&&!i;n--){let o;n>=0?o=r[n]:(a===void 0&&(a=l5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Du)}return t=BH(t,!i),i?`/${t}`:t.length>0?t:"."}var Du=47,lv=46;function BH(e,r){let t="",i=-1,a=0,n,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===Du)break;n=Du}if(n===Du){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==lv||t.charCodeAt(t.length-2)!==lv){if(t.length>2){let c=t.length-1,u=c;for(;u>=0&&t.charCodeAt(u)!==Du;--u);if(u!==c){t=u===-1?"":t.slice(0,u),i=s,a=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",i=s,a=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{let c=e.slice(i+1,s);t.length>0?t+=`/${c}`:t=c,o=!1}i=s,a=0}else n===lv&&a!==-1?++a:a=-1}return t}var En=Xt(require("fs"),1),Wo=class{handle;size;bigsize;url;constructor(r,t,i){r=Ko(r),this.handle=En.default.openSync(r,t,i);let a=En.default.fstatSync(this.handle,{bigint:!0});this.size=Number(a.size),this.bigsize=a.size,this.url=r}async close(){return new Promise((r,t)=>{En.default.close(this.handle,i=>i?t(i):r())})}async truncate(r){return new Promise((t,i)=>{En.default.ftruncate(this.handle,r,a=>{a?i(a):(this.bigsize=BigInt(r),this.size=Number(this.bigsize),t())})})}async append(r){return new Promise((t,i)=>{En.default.appendFile(this.handle,r,a=>{a?i(a):(this.bigsize=this.bigsize+BigInt(r.length),this.size=Number(this.bigsize),t())})})}async stat(){return await new Promise((r,t)=>En.default.fstat(this.handle,{bigint:!0},(i,a)=>{let n={size:Number(a.size),bigsize:a.size,isDirectory:a.isDirectory()};i?t(i):r(n)}))}async read(r,t){let i=new ArrayBuffer(t),a=BigInt(r),n=0,o=new Uint8Array(i),s;for(;t>0;){let c=await FH(this.handle,o,0,t,a);if(c===0)break;n+=c,a+=BigInt(c),t-=c,s!==void 0&&(s+=c)}return n<t?i.slice(0,n):i}async write(r,t=0,i=r.byteLength){return new Promise((a,n)=>{let o=Number(t),s=new Uint8Array(r,Number(t),i);En.default.write(this.handle,s,0,i,o,(c,u)=>c?n(c):a(u))})}};async function FH(e,r,t,i,a){return await new Promise((n,o)=>En.default.read(e,r,t,i,a,(s,c)=>s?o(s):n(c)))}var Ap=Xt(require("fs/promises"),1);var pv=Xt(require("fs"),1),fv=require("stream");var kp=Xt(require("zlib"),1),IH=e=>e&&e instanceof ArrayBuffer,MH=e=>e&&e instanceof Buffer;function Sp(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(kp.default.createBrotliDecompress());case"gzip":return e.pipe(kp.default.createGunzip());case"deflate":return e.pipe(kp.default.createDeflate());default:return e}}async function f5(e){let r=[];return await new Promise((t,i)=>{e.on("error",a=>i(a)),e.on("readable",()=>e.read()),e.on("data",a=>{typeof a=="string"&&i(new Error("Read stream not binary")),r.push(DH(a))}),e.on("end",()=>{let a=LH(r);t(a)})})}function LH(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}function DH(e){if(IH(e))return e;if(MH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var qH=e=>typeof e=="boolean",p5=e=>typeof e=="function",zH=e=>e!==null&&typeof e=="object",NH=e=>zH(e)&&p5(e.read)&&p5(e.pipe)&&qH(e.readable);async function Ep(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=Ko(i);let a=new Headers;e.endsWith(".gz")&&(a["content-encoding"]="gzip"),e.endsWith(".br")&&(a["content-encoding"]="br");try{let n=await new Promise((h,p)=>{let d=pv.default.createReadStream(i,{encoding:null});d.once("readable",()=>h(d)),d.on("error",v=>p(v))}),o=n;NH(n)?o=Sp(n,a):typeof n=="string"?o=fv.Readable.from([new TextEncoder().encode(n)]):o=fv.Readable.from([n||new ArrayBuffer(0)]);let s=200,c="OK",u=UH(i),l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}catch(n){let o=n.message,s=400,c=o,u={},l=new Response(o,{headers:u,status:s,statusText:c});return Object.defineProperty(l,"url",{value:e}),l}}function UH(e){let r={};if(!r["content-length"]){let t=pv.default.statSync(e);r["content-length"]=t.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip"),new Headers(r)}var jp=class{readable=!0;writable=!0;constructor(){}async readdir(r=".",t){return await Ap.default.readdir(r,t)}async stat(r){let t=await Ap.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Ap.default.unlink(r)}async fetch(r,t){return await Ep(r,t)}async openReadableFile(r,t="r"){return new Wo(r,t)}async openWritableFile(r,t="w",i){return new Wo(r,t,i)}};var qu=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let c of r)i.push(c),yield c;let a=await this.concatenate(i),n=await this.hash(a,t);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:n})}async concatenate(r){return await Lu(r)}};var zu=Xt(require("crypto"),1),Tp=class extends qu{name="crypto-node";options;_algorithm;_hash;constructor(r){var t,i;if(super(),this.options=r,!((i=(t=this.options)==null?void 0:t.crypto)!=null&&i.algorithm))throw new Error(this.name)}async hash(r,t){var a,n,o,s;let i=(o=(n=(a=this.options)==null?void 0:a.crypto)==null?void 0:n.algorithm)==null?void 0:o.toLowerCase();try{if(!zu.createHash)throw new Error("crypto.createHash not available");let c=(s=zu.createHash)==null?void 0:s(i),u=new Uint8Array(r);return c.update(u).digest("base64")}catch(c){throw Error(`${i} hash not available. ${c}`)}}async*hashBatches(r,t="base64"){var n,o,s,c,u,l,h;if(!zu.createHash)throw new Error("crypto.createHash not available");let i=(c=zu.createHash)==null?void 0:c((s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let p of r){let d=new Uint8Array(p);i.update(d),yield p}let a=i.digest(t);(h=(l=(u=this.options)==null?void 0:u.crypto)==null?void 0:l.onEnd)==null||h.call(l,{hash:a})}};var VA=require("node:process");var h5=Xt(require("stream"),1),hv=class{},HH=h5.Readable||hv;function mv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new dv(t,r)}var dv=class extends HH{_pulling;_bytesMode;_iterator;constructor(r,t){super(t),this._iterator=r,this._pulling=!1,this._bytesMode=!t||!t.objectMode}async _read(r){this._pulling||(this._pulling=!0,this._pulling=await this._pull(r,this._iterator))}async _destroy(r,t){var i,a,n,o;this._iterator&&(r?await((a=(i=this._iterator)==null?void 0:i.throw)==null?void 0:a.call(i,r)):await((o=(n=this._iterator)==null?void 0:n.return)==null?void 0:o.call(n,r)),t==null||t(null))}async _pull(r,t){var n;let i=this._bytesMode,a=null;for(;this.readable&&!(a=await t.next()).done&&(r!==null&&(r-=i&&ArrayBuffer.isView(a.value)?a.value.byteLength:1),!(!this.push(new Uint8Array(a.value))||r<=0)););return(a!=null&&a.done||!this.readable)&&(this.push(null)||!0)&&((n=t==null?void 0:t.return)==null||n.call(t)),!this.readable}};function Ku(){}function mt(e){return typeof e=="object"&&e!==null||typeof e=="function"}var B5=Ku;function Pr(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch{}}var Iv=Promise,VH=Promise.resolve.bind(Iv),GH=Promise.prototype.then,KH=Promise.reject.bind(Iv),$H=VH;function kt(e){return new Iv(e)}function Or(e){return kt(r=>r(e))}function $e(e){return KH(e)}function rn(e,r,t){return GH.call(e,r,t)}function wa(e,r,t){rn(rn(e,r,t),void 0,B5)}function gv(e,r){wa(e,r)}function Ev(e,r){wa(e,void 0,r)}function On(e,r,t){return rn(e,r,t)}function dc(e){rn(e,void 0,B5)}var es=e=>{if(typeof queueMicrotask=="function")es=queueMicrotask;else{let r=Or(void 0);es=t=>rn(r,t)}return es(e)};function rs(e,r,t){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function Bn(e,r,t){try{return Or(rs(e,r,t))}catch(i){return $e(i)}}var ka=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(r){let t=this._back,i=t;t._elements.length===16383&&(i={_elements:[],_next:void 0}),t._elements.push(r),i!==t&&(this._back=i,t._next=i),++this._size}shift(){let r=this._front,t=r,i=this._cursor,a=i+1,n=r._elements,o=n[i];return a===16384&&(t=r._next,a=0),--this._size,this._cursor=a,r!==t&&(this._front=t),n[i]=void 0,o}forEach(r){let t=this._cursor,i=this._front,a=i._elements;for(;!(t===a.length&&i._next===void 0||t===a.length&&(i=i._next,a=i._elements,t=0,a.length===0));)r(a[t]),++t}peek(){let r=this._front,t=this._cursor;return r._elements[t]}},F5=Symbol("[[AbortSteps]]"),I5=Symbol("[[ErrorSteps]]"),Mv=Symbol("[[CancelSteps]]"),Lv=Symbol("[[PullSteps]]"),Dv=Symbol("[[ReleaseSteps]]");function M5(e,r){e._ownerReadableStream=r,r._reader=e,r._state==="readable"?Av(e):r._state==="closed"?function(t){Av(t),D5(t)}(e):L5(e,r._storedError)}function qv(e,r){return Si(e._ownerReadableStream,r)}function Pn(e){let r=e._ownerReadableStream;r._state==="readable"?zv(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){L5(t,i)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[Dv](),r._reader=void 0,e._ownerReadableStream=void 0}function Hp(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Av(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t})}function L5(e,r){Av(e),zv(e,r)}function zv(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function D5(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var d5=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},WH=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function tn(e,r){if(e!==void 0&&typeof(t=e)!="object"&&typeof t!="function")throw new TypeError(`${r} is not an object.`);var t}function Ja(e,r){if(typeof e!="function")throw new TypeError(`${r} is not a function.`)}function q5(e,r){if(!function(t){return typeof t=="object"&&t!==null||typeof t=="function"}(e))throw new TypeError(`${r} is not an object.`)}function Cn(e,r,t){if(e===void 0)throw new TypeError(`Parameter ${r} is required in '${t}'.`)}function jv(e,r,t){if(e===void 0)throw new TypeError(`${r} is required in '${t}'.`)}function Nv(e){return Number(e)}function m5(e){return e===0?0:e}function Uv(e,r){let t=Number.MAX_SAFE_INTEGER,i=Number(e);if(i=m5(i),!d5(i))throw new TypeError(`${r} is not a finite number`);if(i=function(a){return m5(WH(a))}(i),i<0||i>t)throw new TypeError(`${r} is outside the accepted range of 0 to ${t}, inclusive`);return d5(i)&&i!==0?i:0}function Hv(e,r){if(!go(e))throw new TypeError(`${r} is not a ReadableStream.`)}function uc(e){return new An(e)}function z5(e,r){e._reader._readRequests.push(r)}function Vv(e,r,t){let i=e._reader._readRequests.shift();t?i._closeSteps():i._chunkSteps(r)}function Qp(e){return e._reader._readRequests.length}function N5(e){let r=e._reader;return r!==void 0&&!!vo(r)}var An=class{constructor(r){if(Cn(r,1,"ReadableStreamDefaultReader"),Hv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");M5(this,r),this._readRequests=new ka}get closed(){return vo(this)?this._closedPromise:$e(Rp("closed"))}cancel(r=void 0){return vo(this)?this._ownerReadableStream===void 0?$e(Hp("cancel")):qv(this,r):$e(Rp("cancel"))}read(){if(!vo(this))return $e(Rp("read"));if(this._ownerReadableStream===void 0)return $e(Hp("read from"));let r,t,i=kt((a,n)=>{r=a,t=n});return $u(this,{_chunkSteps:a=>r({value:a,done:!1}),_closeSteps:()=>r({value:void 0,done:!0}),_errorSteps:a=>t(a)}),i}releaseLock(){if(!vo(this))throw Rp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");U5(r,t)}(this)}};function vo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof An}function $u(e,r){let t=e._ownerReadableStream;t._disturbed=!0,t._state==="closed"?r._closeSteps():t._state==="errored"?r._errorSteps(t._storedError):t._readableStreamController[Lv](r)}function U5(e,r){let t=e._readRequests;e._readRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Rp(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var vv,yv,bv;function Uu(e){return e.slice()}function H5(e,r,t,i,a){new Uint8Array(e).set(new Uint8Array(t,i,a),r)}Object.defineProperties(An.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(An.prototype.cancel,"cancel"),Pr(An.prototype.read,"read"),Pr(An.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(An.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var ts=e=>(ts=typeof e.transfer=="function"?r=>r.transfer():typeof structuredClone=="function"?r=>structuredClone(r,{transfer:[r]}):r=>r,ts(e)),as=e=>(as=typeof e.detached=="boolean"?r=>r.detached:r=>r.byteLength===0,as(e));function V5(e,r,t){if(e.slice)return e.slice(r,t);let i=t-r,a=new ArrayBuffer(i);return H5(a,0,e,r,i),a}function Hu(e,r){let t=e[r];if(t!=null){if(typeof t!="function")throw new TypeError(`${String(r)} is not a function`);return t}}function g5(e){try{let r=e.done,t=e.value;return rn($H(t),i=>({done:r,value:i}))}catch(r){return $e(r)}}var rl=(bv=(vv=Symbol.asyncIterator)!==null&&vv!==void 0?vv:(yv=Symbol.for)===null||yv===void 0?void 0:yv.call(Symbol,"Symbol.asyncIterator"))!==null&&bv!==void 0?bv:"@@asyncIterator";function G5(e,r="sync",t){if(t===void 0)if(r==="async"){if((t=Hu(e,rl))===void 0)return function(a){let n={next(){let o;try{o=K5(a)}catch(s){return $e(s)}return g5(o)},return(o){let s;try{let c=Hu(a.iterator,"return");if(c===void 0)return Or({done:!0,value:o});s=rs(c,a.iterator,[o])}catch(c){return $e(c)}return mt(s)?g5(s):$e(new TypeError("The iterator.return() method must return an object"))}};return{iterator:n,nextMethod:n.next,done:!1}}(G5(e,"sync",Hu(e,Symbol.iterator)))}else t=Hu(e,Symbol.iterator);if(t===void 0)throw new TypeError("The object is not iterable");let i=rs(t,e,[]);if(!mt(i))throw new TypeError("The iterator method must return an object");return{iterator:i,nextMethod:i.next,done:!1}}function K5(e){let r=rs(e.nextMethod,e.iterator,[]);if(!mt(r))throw new TypeError("The iterator.next() method must return an object");return r}var Vp=class{constructor(r,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=r,this._preventCancel=t}next(){let r=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?On(this._ongoingPromise,r,r):r(),this._ongoingPromise}return(r){let t=()=>this._returnSteps(r);return this._ongoingPromise?On(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let r=this._reader,t,i,a=kt((n,o)=>{t=n,i=o});return $u(r,{_chunkSteps:n=>{this._ongoingPromise=void 0,es(()=>t({value:n,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),t({value:void 0,done:!0})},_errorSteps:n=>{this._ongoingPromise=void 0,this._isFinished=!0,Pn(r),i(n)}}),a}_returnSteps(r){if(this._isFinished)return Promise.resolve({value:r,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let i=qv(t,r);return Pn(t),On(i,()=>({value:r,done:!0}))}return Pn(t),Or({value:r,done:!0})}},$5={next(){return v5(this)?this._asyncIteratorImpl.next():$e(y5("next"))},return(e){return v5(this)?this._asyncIteratorImpl.return(e):$e(y5("return"))},[rl](){return this}};function v5(e){if(!mt(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof Vp}catch{return!1}}function y5(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty($5,rl,{enumerable:!1});var W5=Number.isNaN||function(e){return e!=e};function b5(e){let r=V5(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Tv(e){let r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function Gv(e,r,t){if(typeof(i=t)!="number"||W5(i)||i<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var i;e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function xo(e){e._queue=new ka,e._queueTotalSize=0}function X5(e){return e===DataView}var yo=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!xv(this))throw _v("view");return this._view}respond(r){if(!xv(this))throw _v("respond");if(Cn(r,1,"respond"),r=Uv(r,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");qp(this._associatedReadableByteStreamController,r)}respondWithNewView(r){if(!xv(this))throw _v("respondWithNewView");if(Cn(r,1,"respondWithNewView"),!ArrayBuffer.isView(r))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(as(r.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");zp(this._associatedReadableByteStreamController,r)}};Object.defineProperties(yo.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Pr(yo.prototype.respond,"respond"),Pr(yo.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yo.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Zi=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Jo(this))throw Nu("byobRequest");return Ov(this)}get desiredSize(){if(!Jo(this))throw Nu("desiredSize");return nA(this)}close(){if(!Jo(this))throw Nu("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be closed`);Vu(this)}enqueue(r){if(!Jo(this))throw Nu("enqueue");if(Cn(r,1,"enqueue"),!ArrayBuffer.isView(r))throw new TypeError("chunk must be an array buffer view");if(r.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(r.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Dp(this,r)}error(r=void 0){if(!Jo(this))throw Nu("error");Qa(this,r)}[Mv](r){Y5(this),xo(this);let t=this._cancelAlgorithm(r);return Jp(this),t}[Lv](r){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void iA(this,r);let i=this._autoAllocateChunkSize;if(i!==void 0){let a;try{a=new ArrayBuffer(i)}catch(o){return void r._errorSteps(o)}let n={buffer:a,bufferByteLength:i,byteOffset:0,byteLength:i,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}z5(t,r),os(this)}[Dv](){if(this._pendingPullIntos.length>0){let r=this._pendingPullIntos.peek();r.readerType="none",this._pendingPullIntos=new ka,this._pendingPullIntos.push(r)}}};function Jo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Zi}function xv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof yo}function os(e){if(function(t){let i=t._controlledReadableByteStream;return i._state!=="readable"||t._closeRequested||!t._started?!1:!!(N5(i)&&Qp(i)>0||$v(i)&&cA(i)>0||nA(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,os(e)),null),t=>(Qa(e,t),null))}}function Y5(e){Kv(e),e._pendingPullIntos=new ka}function Rv(e,r){let t=!1;e._state==="closed"&&(t=!0);let i=Q5(r);r.readerType==="default"?Vv(e,i,t):function(a,n,o){let s=a._reader,c=s._readIntoRequests.shift();o?c._closeSteps(n):c._chunkSteps(n)}(e,i,t)}function Q5(e){let r=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/t)}function Lp(e,r,t,i){e._queue.push({buffer:r,byteOffset:t,byteLength:i}),e._queueTotalSize+=i}function J5(e,r,t,i){let a;try{a=V5(r,t,t+i)}catch(n){throw Qa(e,n),n}Lp(e,a,0,i)}function Z5(e,r){r.bytesFilled>0&&J5(e,r.buffer,r.byteOffset,r.bytesFilled),lc(e)}function eA(e,r){let t=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),i=r.bytesFilled+t,a=t,n=!1,o=i-i%r.elementSize;o>=r.minimumFill&&(a=o-r.bytesFilled,n=!0);let s=e._queue;for(;a>0;){let c=s.peek(),u=Math.min(a,c.byteLength),l=r.byteOffset+r.bytesFilled;H5(r.buffer,l,c.buffer,c.byteOffset,u),c.byteLength===u?s.shift():(c.byteOffset+=u,c.byteLength-=u),e._queueTotalSize-=u,rA(e,u,r),a-=u}return n}function rA(e,r,t){t.bytesFilled+=r}function tA(e){e._queueTotalSize===0&&e._closeRequested?(Jp(e),tl(e._controlledReadableByteStream)):os(e)}function Kv(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Pv(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let r=e._pendingPullIntos.peek();eA(e,r)&&(lc(e),Rv(e._controlledReadableByteStream,r))}}function XH(e,r,t,i){let a=e._controlledReadableByteStream,n=r.constructor,o=function(p){return X5(p)?1:p.BYTES_PER_ELEMENT}(n),{byteOffset:s,byteLength:c}=r,u=t*o,l;try{l=ts(r.buffer)}catch(p){return void i._errorSteps(p)}let h={buffer:l,bufferByteLength:l.byteLength,byteOffset:s,byteLength:c,bytesFilled:0,minimumFill:u,elementSize:o,viewConstructor:n,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(h),void x5(a,i);if(a._state!=="closed"){if(e._queueTotalSize>0){if(eA(e,h)){let p=Q5(h);return tA(e),void i._chunkSteps(p)}if(e._closeRequested){let p=new TypeError("Insufficient bytes to fill elements in the given buffer");return Qa(e,p),void i._errorSteps(p)}}e._pendingPullIntos.push(h),x5(a,i),os(e)}else{let p=new n(h.buffer,h.byteOffset,0);i._closeSteps(p)}}function aA(e,r){let t=e._pendingPullIntos.peek();Kv(e),e._controlledReadableByteStream._state==="closed"?function(i,a){a.readerType==="none"&&lc(i);let n=i._controlledReadableByteStream;if($v(n))for(;cA(n)>0;)Rv(n,lc(i))}(e,t):function(i,a,n){if(rA(0,a,n),n.readerType==="none")return Z5(i,n),void Pv(i);if(n.bytesFilled<n.minimumFill)return;lc(i);let o=n.bytesFilled%n.elementSize;if(o>0){let s=n.byteOffset+n.bytesFilled;J5(i,n.buffer,s-o,o)}n.bytesFilled-=o,Rv(i._controlledReadableByteStream,n),Pv(i)}(e,r,t),os(e)}function lc(e){return e._pendingPullIntos.shift()}function Jp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Vu(e){let r=e._controlledReadableByteStream;if(!e._closeRequested&&r._state==="readable")if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){let i=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Qa(e,i),i}}Jp(e),tl(r)}}function Dp(e,r){let t=e._controlledReadableByteStream;if(e._closeRequested||t._state!=="readable")return;let{buffer:i,byteOffset:a,byteLength:n}=r;if(as(i))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let o=ts(i);if(e._pendingPullIntos.length>0){let s=e._pendingPullIntos.peek();if(as(s.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Kv(e),s.buffer=ts(s.buffer),s.readerType==="none"&&Z5(e,s)}N5(t)?(function(s){let c=s._controlledReadableByteStream._reader;for(;c._readRequests.length>0;){if(s._queueTotalSize===0)return;iA(s,c._readRequests.shift())}}(e),Qp(t)===0?Lp(e,o,a,n):(e._pendingPullIntos.length>0&&lc(e),Vv(t,new Uint8Array(o,a,n),!1))):$v(t)?(Lp(e,o,a,n),Pv(e)):Lp(e,o,a,n),os(e)}function Qa(e,r){let t=e._controlledReadableByteStream;t._state==="readable"&&(Y5(e),xo(e),Jp(e),TA(t,r))}function iA(e,r){let t=e._queue.shift();e._queueTotalSize-=t.byteLength,tA(e);let i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);r._chunkSteps(i)}function Ov(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let r=e._pendingPullIntos.peek(),t=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),i=Object.create(yo.prototype);(function(a,n,o){a._associatedReadableByteStreamController=n,a._view=o})(i,e,t),e._byobRequest=i}return e._byobRequest}function nA(e){let r=e._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function qp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=ts(t.buffer),aA(e,r)}function zp(e,r){let t=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let i=r.byteLength;t.buffer=ts(r.buffer),aA(e,i)}function oA(e,r,t,i,a,n,o){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,xo(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,r._autoAllocateChunkSize=o,r._pendingPullIntos=new ka,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,os(r),null),s=>(Qa(r,s),null))}function _v(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Nu(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function YH(e,r){if((e=`${e}`)!="byob")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function sA(e){return new jn(e)}function x5(e,r){e._reader._readIntoRequests.push(r)}function cA(e){return e._reader._readIntoRequests.length}function $v(e){let r=e._reader;return r!==void 0&&!!Zo(r)}Object.defineProperties(Zi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Zi.prototype.close,"close"),Pr(Zi.prototype.enqueue,"enqueue"),Pr(Zi.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Zi.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var jn=class{constructor(r){if(Cn(r,1,"ReadableStreamBYOBReader"),Hv(r,"First parameter"),bo(r))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Jo(r._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");M5(this,r),this._readIntoRequests=new ka}get closed(){return Zo(this)?this._closedPromise:$e(Pp("closed"))}cancel(r=void 0){return Zo(this)?this._ownerReadableStream===void 0?$e(Hp("cancel")):qv(this,r):$e(Pp("cancel"))}read(r,t={}){if(!Zo(this))return $e(Pp("read"));if(!ArrayBuffer.isView(r))return $e(new TypeError("view must be an array buffer view"));if(r.byteLength===0)return $e(new TypeError("view must have non-zero byteLength"));if(r.buffer.byteLength===0)return $e(new TypeError("view's buffer must have non-zero byteLength"));if(as(r.buffer))return $e(new TypeError("view's buffer has been detached"));let i;try{i=function(c,u){var l;return tn(c,u),{min:Uv((l=c==null?void 0:c.min)!==null&&l!==void 0?l:1,`${u} has member 'min' that`)}}(t,"options")}catch(c){return $e(c)}let a=i.min;if(a===0)return $e(new TypeError("options.min must be greater than 0"));if(function(c){return X5(c.constructor)}(r)){if(a>r.byteLength)return $e(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(a>r.length)return $e(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return $e(Hp("read from"));let n,o,s=kt((c,u)=>{n=c,o=u});return uA(this,r,a,{_chunkSteps:c=>n({value:c,done:!1}),_closeSteps:c=>n({value:c,done:!0}),_errorSteps:c=>o(c)}),s}releaseLock(){if(!Zo(this))throw Pp("releaseLock");this._ownerReadableStream!==void 0&&function(r){Pn(r);let t=new TypeError("Reader was released");lA(r,t)}(this)}};function Zo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof jn}function uA(e,r,t,i){let a=e._ownerReadableStream;a._disturbed=!0,a._state==="errored"?i._errorSteps(a._storedError):XH(a._readableStreamController,r,t,i)}function lA(e,r){let t=e._readIntoRequests;e._readIntoRequests=new ka,t.forEach(i=>{i._errorSteps(r)})}function Pp(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Wu(e,r){let{highWaterMark:t}=e;if(t===void 0)return r;if(W5(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function Gp(e){let{size:r}=e;return r||(()=>1)}function Kp(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark,i=e==null?void 0:e.size;return{highWaterMark:t===void 0?void 0:Nv(t),size:i===void 0?void 0:QH(i,`${r} has member 'size' that`)}}function QH(e,r){return Ja(e,r),t=>Nv(e(t))}function JH(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function ZH(e,r,t){return Ja(e,t),()=>Bn(e,r,[])}function eV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function rV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function fA(e,r){if(!cc(e))throw new TypeError(`${r} is not a WritableStream.`)}Object.defineProperties(jn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Pr(jn.prototype.cancel,"cancel"),Pr(jn.prototype.read,"read"),Pr(jn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(jn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var tV=typeof AbortController=="function",Tn=class{constructor(r={},t={}){r===void 0?r=null:q5(r,"First parameter");let i=Kp(t,"Second parameter"),a=function(o,s){tn(o,s);let c=o==null?void 0:o.abort,u=o==null?void 0:o.close,l=o==null?void 0:o.start,h=o==null?void 0:o.type,p=o==null?void 0:o.write;return{abort:c===void 0?void 0:JH(c,o,`${s} has member 'abort' that`),close:u===void 0?void 0:ZH(u,o,`${s} has member 'close' that`),start:l===void 0?void 0:eV(l,o,`${s} has member 'start' that`),write:p===void 0?void 0:rV(p,o,`${s} has member 'write' that`),type:h}}(r,"First parameter");if(hA(this),a.type!==void 0)throw new RangeError("Invalid type is specified");let n=Gp(i);(function(o,s,c,u){let l=Object.create(is.prototype),h,p,d,v;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.write!==void 0?x=>s.write(x,l):()=>Or(void 0),d=s.close!==void 0?()=>s.close():()=>Or(void 0),v=s.abort!==void 0?x=>s.abort(x):()=>Or(void 0),xA(o,l,h,p,d,v,c,u)})(this,a,Wu(i,1),n)}get locked(){if(!cc(this))throw Cp("locked");return fc(this)}abort(r=void 0){return cc(this)?fc(this)?$e(new TypeError("Cannot abort a stream that already has a writer")):$p(this,r):$e(Cp("abort"))}close(){return cc(this)?fc(this)?$e(new TypeError("Cannot close a stream that already has a writer")):an(this)?$e(new TypeError("Cannot close an already-closing stream")):dA(this):$e(Cp("close"))}getWriter(){if(!cc(this))throw Cp("getWriter");return pA(this)}};function pA(e){return new Ji(e)}function hA(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new ka,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function cc(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Tn}function fc(e){return e._writer!==void 0}function $p(e,r){var t;if(e._state==="closed"||e._state==="errored")return Or(void 0);e._writableStreamController._abortReason=r,(t=e._writableStreamController._abortController)===null||t===void 0||t.abort(r);let i=e._state;if(i==="closed"||i==="errored")return Or(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let a=!1;i==="erroring"&&(a=!0,r=void 0);let n=kt((o,s)=>{e._pendingAbortRequest={_promise:void 0,_resolve:o,_reject:s,_reason:r,_wasAlreadyErroring:a}});return e._pendingAbortRequest._promise=n,a||Wv(e,r),n}function dA(e){let r=e._state;if(r==="closed"||r==="errored")return $e(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));let t=kt((n,o)=>{let s={_resolve:n,_reject:o};e._closeRequest=s}),i=e._writer;var a;return i!==void 0&&e._backpressure&&r==="writable"&&Zv(i),Gv(a=e._writableStreamController,bA,0),Zp(a),t}function Cv(e,r){e._state!=="writable"?Xv(e):Wv(e,r)}function Wv(e,r){let t=e._writableStreamController;e._state="erroring",e._storedError=r;let i=e._writer;i!==void 0&&gA(i,r),!function(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}(e)&&t._started&&Xv(e)}function Xv(e){e._state="errored",e._writableStreamController[I5]();let r=e._storedError;if(e._writeRequests.forEach(i=>{i._reject(r)}),e._writeRequests=new ka,e._pendingAbortRequest===void 0)return void Op(e);let t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(r),void Op(e);wa(e._writableStreamController[F5](t._reason),()=>(t._resolve(),Op(e),null),i=>(t._reject(i),Op(e),null))}function an(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Op(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let r=e._writer;r!==void 0&&Jv(r,e._storedError)}function Yv(e,r){let t=e._writer;t!==void 0&&r!==e._backpressure&&(r?function(i){eh(i)}(t):Zv(t)),e._backpressure=r}Object.defineProperties(Tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Pr(Tn.prototype.abort,"abort"),Pr(Tn.prototype.close,"close"),Pr(Tn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});var Ji=class{constructor(r){if(Cn(r,1,"WritableStreamDefaultWriter"),fA(r,"First parameter"),fc(r))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=r,r._writer=this;let t=r._state;if(t==="writable")!an(r)&&r._backpressure?eh(this):_5(this),Np(this);else if(t==="erroring")Bv(this,r._storedError),Np(this);else if(t==="closed")_5(this),Np(i=this),SA(i);else{let a=r._storedError;Bv(this,a),kA(this,a)}var i}get closed(){return Xo(this)?this._closedPromise:$e(Yo("closed"))}get desiredSize(){if(!Xo(this))throw Yo("desiredSize");if(this._ownerWritableStream===void 0)throw Gu("desiredSize");return function(r){let t=r._ownerWritableStream,i=t._state;return i==="errored"||i==="erroring"?null:i==="closed"?0:_A(t._writableStreamController)}(this)}get ready(){return Xo(this)?this._readyPromise:$e(Yo("ready"))}abort(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Gu("abort")):function(t,i){return $p(t._ownerWritableStream,i)}(this,r):$e(Yo("abort"))}close(){if(!Xo(this))return $e(Yo("close"));let r=this._ownerWritableStream;return r===void 0?$e(Gu("close")):an(r)?$e(new TypeError("Cannot close an already-closing stream")):mA(this)}releaseLock(){if(!Xo(this))throw Yo("releaseLock");this._ownerWritableStream!==void 0&&vA(this)}write(r=void 0){return Xo(this)?this._ownerWritableStream===void 0?$e(Gu("write to")):yA(this,r):$e(Yo("write"))}};function Xo(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Ji}function mA(e){return dA(e._ownerWritableStream)}function aV(e,r){e._closedPromiseState==="pending"?Jv(e,r):function(t,i){kA(t,i)}(e,r)}function gA(e,r){e._readyPromiseState==="pending"?EA(e,r):function(t,i){Bv(t,i)}(e,r)}function vA(e){let r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");gA(e,t),aV(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function yA(e,r){let t=e._ownerWritableStream,i=t._writableStreamController,a=function(s,c){try{return s._strategySizeAlgorithm(c)}catch(u){return Xu(s,u),1}}(i,r);if(t!==e._ownerWritableStream)return $e(Gu("write to"));let n=t._state;if(n==="errored")return $e(t._storedError);if(an(t)||n==="closed")return $e(new TypeError("The stream is closing or closed and cannot be written to"));if(n==="erroring")return $e(t._storedError);let o=function(s){return kt((c,u)=>{let l={_resolve:c,_reject:u};s._writeRequests.push(l)})}(t);return function(s,c,u){try{Gv(s,c,u)}catch(h){return void Xu(s,h)}let l=s._controlledWritableStream;!an(l)&&l._state==="writable"&&Yv(l,Qv(s)),Zp(s)}(i,r,a),o}Object.defineProperties(Ji.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Pr(Ji.prototype.abort,"abort"),Pr(Ji.prototype.close,"close"),Pr(Ji.prototype.releaseLock,"releaseLock"),Pr(Ji.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ji.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var bA={},is=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!wv(this))throw kv("abortReason");return this._abortReason}get signal(){if(!wv(this))throw kv("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(r=void 0){if(!wv(this))throw kv("error");this._controlledWritableStream._state==="writable"&&wA(this,r)}[F5](r){let t=this._abortAlgorithm(r);return Wp(this),t}[I5](){xo(this)}};function wv(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof is}function xA(e,r,t,i,a,n,o,s){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._abortReason=void 0,r._abortController=function(){if(tV)return new AbortController}(),r._started=!1,r._strategySizeAlgorithm=s,r._strategyHWM=o,r._writeAlgorithm=i,r._closeAlgorithm=a,r._abortAlgorithm=n;let c=Qv(r);Yv(e,c),wa(Or(t()),()=>(r._started=!0,Zp(r),null),u=>(r._started=!0,Cv(e,u),null))}function Wp(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function _A(e){return e._strategyHWM-e._queueTotalSize}function Zp(e){let r=e._controlledWritableStream;if(!e._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring")return void Xv(r);if(e._queue.length===0)return;let t=e._queue.peek().value;t===bA?function(i){let a=i._controlledWritableStream;(function(o){o._inFlightCloseRequest=o._closeRequest,o._closeRequest=void 0})(a),Tv(i);let n=i._closeAlgorithm();Wp(i),wa(n,()=>(function(o){o._inFlightCloseRequest._resolve(void 0),o._inFlightCloseRequest=void 0,o._state==="erroring"&&(o._storedError=void 0,o._pendingAbortRequest!==void 0&&(o._pendingAbortRequest._resolve(),o._pendingAbortRequest=void 0)),o._state="closed";let s=o._writer;s!==void 0&&SA(s)}(a),null),o=>(function(s,c){s._inFlightCloseRequest._reject(c),s._inFlightCloseRequest=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._reject(c),s._pendingAbortRequest=void 0),Cv(s,c)}(a,o),null))}(e):function(i,a){let n=i._controlledWritableStream;(function(s){s._inFlightWriteRequest=s._writeRequests.shift()})(n);let o=i._writeAlgorithm(a);wa(o,()=>{(function(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0})(n);let s=n._state;if(Tv(i),!an(n)&&s==="writable"){let c=Qv(i);Yv(n,c)}return Zp(i),null},s=>(n._state==="writable"&&Wp(i),function(c,u){c._inFlightWriteRequest._reject(u),c._inFlightWriteRequest=void 0,Cv(c,u)}(n,s),null))}(e,t)}function Xu(e,r){e._controlledWritableStream._state==="writable"&&wA(e,r)}function Qv(e){return _A(e)<=0}function wA(e,r){let t=e._controlledWritableStream;Wp(e),Wv(t,r)}function Cp(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function kv(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Yo(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Gu(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Np(e){e._closedPromise=kt((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function kA(e,r){Np(e),Jv(e,r)}function Jv(e,r){e._closedPromise_reject!==void 0&&(dc(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function SA(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function eh(e){e._readyPromise=kt((r,t)=>{e._readyPromise_resolve=r,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function Bv(e,r){eh(e),EA(e,r)}function _5(e){eh(e),Zv(e)}function EA(e,r){e._readyPromise_reject!==void 0&&(dc(e._readyPromise),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Zv(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(is.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(is.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var w5=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:void 0,iV=function(){let e=w5==null?void 0:w5.DOMException;return function(r){if(typeof r!="function"&&typeof r!="object"||r.name!=="DOMException")return!1;try{return new r,!0}catch{return!1}}(e)?e:void 0}()||function(){let e=function(r,t){this.message=r||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Pr(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function k5(e,r,t,i,a,n){let o=uc(e),s=pA(r);e._disturbed=!0;let c=!1,u=Or(void 0);return kt((l,h)=>{let p;if(n!==void 0){if(p=()=>{let j=n.reason!==void 0?n.reason:new iV("Aborted","AbortError"),P=[];i||P.push(()=>r._state==="writable"?$p(r,j):Or(void 0)),a||P.push(()=>e._state==="readable"?Si(e,j):Or(void 0)),A(()=>Promise.all(P.map(C=>C())),!0,j)},n.aborted)return void p();n.addEventListener("abort",p)}var d,v,x;if(E(e,o._closedPromise,j=>(i?S(!0,j):A(()=>$p(r,j),!0,j),null)),E(r,s._closedPromise,j=>(a?S(!0,j):A(()=>Si(e,j),!0,j),null)),d=e,v=o._closedPromise,x=()=>(t?S():A(()=>function(j){let P=j._ownerWritableStream,C=P._state;return an(P)||C==="closed"?Or(void 0):C==="errored"?$e(P._storedError):mA(j)}(s)),null),d._state==="closed"?x():gv(v,x),an(r)||r._state==="closed"){let j=new TypeError("the destination writable stream closed before all data could be piped to it");a?S(!0,j):A(()=>Si(e,j),!0,j)}function y(){let j=u;return rn(u,()=>j!==u?y():void 0)}function E(j,P,C){j._state==="errored"?C(j._storedError):Ev(P,C)}function A(j,P,C){function I(){return wa(j(),()=>R(P,C),F=>R(!0,F)),null}c||(c=!0,r._state!=="writable"||an(r)?I():gv(y(),I))}function S(j,P){c||(c=!0,r._state!=="writable"||an(r)?R(j,P):gv(y(),()=>R(j,P)))}function R(j,P){return vA(s),Pn(o),n!==void 0&&n.removeEventListener("abort",p),j?h(P):l(void 0),null}dc(kt((j,P)=>{(function C(I){I?j():rn(c?Or(!0):rn(s._readyPromise,()=>kt((F,H)=>{$u(o,{_chunkSteps:z=>{u=rn(yA(s,z),void 0,Ku),F(!1)},_closeSteps:()=>F(!0),_errorSteps:H})})),C,P)})(!1)}))})}var en=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Bp(this))throw Fp("desiredSize");return e1(this)}close(){if(!Bp(this))throw Fp("close");if(!hc(this))throw new TypeError("The stream is not in a state that permits close");ns(this)}enqueue(r=void 0){if(!Bp(this))throw Fp("enqueue");if(!hc(this))throw new TypeError("The stream is not in a state that permits enqueue");return pc(this,r)}error(r=void 0){if(!Bp(this))throw Fp("error");Ei(this,r)}[Mv](r){xo(this);let t=this._cancelAlgorithm(r);return Xp(this),t}[Lv](r){let t=this._controlledReadableStream;if(this._queue.length>0){let i=Tv(this);this._closeRequested&&this._queue.length===0?(Xp(this),tl(t)):Yu(this),r._chunkSteps(i)}else z5(t,r),Yu(this)}[Dv](){}};function Bp(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof en}function Yu(e){if(AA(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,wa(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Yu(e)),null),r=>(Ei(e,r),null))}}function AA(e){let r=e._controlledReadableStream;return!hc(e)||!e._started?!1:bo(r)&&Qp(r)>0?!0:e1(e)>0}function Xp(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ns(e){if(!hc(e))return;let r=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Xp(e),tl(r))}function pc(e,r){if(!hc(e))return;let t=e._controlledReadableStream;if(bo(t)&&Qp(t)>0)Vv(t,r,!1);else{let i;try{i=e._strategySizeAlgorithm(r)}catch(a){throw Ei(e,a),a}try{Gv(e,r,i)}catch(a){throw Ei(e,a),a}}Yu(e)}function Ei(e,r){let t=e._controlledReadableStream;t._state==="readable"&&(xo(e),Xp(e),TA(t,r))}function e1(e){let r=e._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function hc(e){let r=e._controlledReadableStream._state;return!e._closeRequested&&r==="readable"}function jA(e,r,t,i,a,n,o){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,xo(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=o,r._strategyHWM=n,r._pullAlgorithm=i,r._cancelAlgorithm=a,e._readableStreamController=r,wa(Or(t()),()=>(r._started=!0,Yu(r),null),s=>(Ei(r,s),null))}function Fp(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function nV(e,r){return Jo(e._readableStreamController)?function(t){let i,a,n,o,s,c=uc(t),u=!1,l=!1,h=!1,p=!1,d=!1,v=kt(C=>{s=C});function x(C){Ev(C._closedPromise,I=>(C!==c||(Qa(n._readableStreamController,I),Qa(o._readableStreamController,I),p&&d||s(void 0)),null))}function y(){Zo(c)&&(Pn(c),c=uc(t),x(c)),$u(c,{_chunkSteps:C=>{es(()=>{l=!1,h=!1;let I=C,F=C;if(!p&&!d)try{F=b5(C)}catch(H){return Qa(n._readableStreamController,H),Qa(o._readableStreamController,H),void s(Si(t,H))}p||Dp(n._readableStreamController,I),d||Dp(o._readableStreamController,F),u=!1,l?A():h&&S()})},_closeSteps:()=>{u=!1,p||Vu(n._readableStreamController),d||Vu(o._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&qp(n._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&qp(o._readableStreamController,0),p&&d||s(void 0)},_errorSteps:()=>{u=!1}})}function E(C,I){vo(c)&&(Pn(c),c=sA(t),x(c));let F=I?o:n,H=I?n:o;uA(c,C,1,{_chunkSteps:z=>{es(()=>{l=!1,h=!1;let G=I?d:p;if(I?p:d)G||zp(F._readableStreamController,z);else{let D;try{D=b5(z)}catch(V){return Qa(F._readableStreamController,V),Qa(H._readableStreamController,V),void s(Si(t,V))}G||zp(F._readableStreamController,z),Dp(H._readableStreamController,D)}u=!1,l?A():h&&S()})},_closeSteps:z=>{u=!1;let G=I?d:p,D=I?p:d;G||Vu(F._readableStreamController),D||Vu(H._readableStreamController),z!==void 0&&(G||zp(F._readableStreamController,z),!D&&H._readableStreamController._pendingPullIntos.length>0&&qp(H._readableStreamController,0)),G&&D||s(void 0)},_errorSteps:()=>{u=!1}})}function A(){if(u)return l=!0,Or(void 0);u=!0;let C=Ov(n._readableStreamController);return C===null?y():E(C._view,!1),Or(void 0)}function S(){if(u)return h=!0,Or(void 0);u=!0;let C=Ov(o._readableStreamController);return C===null?y():E(C._view,!0),Or(void 0)}function R(C){if(p=!0,i=C,d){let I=Uu([i,a]),F=Si(t,I);s(F)}return v}function j(C){if(d=!0,a=C,p){let I=Uu([i,a]),F=Si(t,I);s(F)}return v}function P(){}return n=E5(P,A,R),o=E5(P,S,j),x(c),[n,o]}(e):function(t,i){let a=uc(t),n,o,s,c,u,l=!1,h=!1,p=!1,d=!1,v=kt(S=>{u=S});function x(){return l?(h=!0,Or(void 0)):(l=!0,$u(a,{_chunkSteps:S=>{es(()=>{h=!1;let R=S,j=S;p||pc(s._readableStreamController,R),d||pc(c._readableStreamController,j),l=!1,h&&x()})},_closeSteps:()=>{l=!1,p||ns(s._readableStreamController),d||ns(c._readableStreamController),p&&d||u(void 0)},_errorSteps:()=>{l=!1}}),Or(void 0))}function y(S){if(p=!0,n=S,d){let R=Uu([n,o]),j=Si(t,R);u(j)}return v}function E(S){if(d=!0,o=S,p){let R=Uu([n,o]),j=Si(t,R);u(j)}return v}function A(){}return s=Qu(A,x,y),c=Qu(A,x,E),Ev(a._closedPromise,S=>(Ei(s._readableStreamController,S),Ei(c._readableStreamController,S),p&&d||u(void 0),null)),[s,c]}(e)}function oV(e){return mt(r=e)&&r.getReader!==void 0?function(t){let i;function a(){let o;try{o=t.read()}catch(s){return $e(s)}return On(o,s=>{if(!mt(s))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(s.done)ns(i._readableStreamController);else{let c=s.value;pc(i._readableStreamController,c)}})}function n(o){try{return Or(t.cancel(o))}catch(s){return $e(s)}}return i=Qu(Ku,a,n,0),i}(e.getReader()):function(t){let i,a=G5(t,"async");function n(){let s;try{s=K5(a)}catch(c){return $e(c)}return On(Or(s),c=>{if(!mt(c))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(c.done)ns(i._readableStreamController);else{let u=c.value;pc(i._readableStreamController,u)}})}function o(s){let c=a.iterator,u;try{u=Hu(c,"return")}catch(l){return $e(l)}return u===void 0?Or(void 0):On(Bn(u,c,[s]),l=>{if(!mt(l))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i=Qu(Ku,n,o,0),i}(e);var r}function sV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function cV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function uV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function lV(e,r){if((e=`${e}`)!="bytes")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function S5(e,r){tn(e,r);let t=e==null?void 0:e.preventAbort,i=e==null?void 0:e.preventCancel,a=e==null?void 0:e.preventClose,n=e==null?void 0:e.signal;return n!==void 0&&function(o,s){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(o))throw new TypeError(`${s} is not an AbortSignal.`)}(n,`${r} has member 'signal' that`),{preventAbort:Boolean(t),preventCancel:Boolean(i),preventClose:Boolean(a),signal:n}}Object.defineProperties(en.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(en.prototype.close,"close"),Pr(en.prototype.enqueue,"enqueue"),Pr(en.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(en.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var Bt=class{constructor(r={},t={}){r===void 0?r=null:q5(r,"First parameter");let i=Kp(t,"Second parameter"),a=function(n,o){tn(n,o);let s=n,c=s==null?void 0:s.autoAllocateChunkSize,u=s==null?void 0:s.cancel,l=s==null?void 0:s.pull,h=s==null?void 0:s.start,p=s==null?void 0:s.type;return{autoAllocateChunkSize:c===void 0?void 0:Uv(c,`${o} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:sV(u,s,`${o} has member 'cancel' that`),pull:l===void 0?void 0:cV(l,s,`${o} has member 'pull' that`),start:h===void 0?void 0:uV(h,s,`${o} has member 'start' that`),type:p===void 0?void 0:lV(p,`${o} has member 'type' that`)}}(r,"First parameter");if(r1(this),a.type==="bytes"){if(i.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(n,o,s){let c=Object.create(Zi.prototype),u,l,h;u=o.start!==void 0?()=>o.start(c):()=>{},l=o.pull!==void 0?()=>o.pull(c):()=>Or(void 0),h=o.cancel!==void 0?d=>o.cancel(d):()=>Or(void 0);let p=o.autoAllocateChunkSize;if(p===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");oA(n,c,u,l,h,s,p)})(this,a,Wu(i,0))}else{let n=Gp(i);(function(o,s,c,u){let l=Object.create(en.prototype),h,p,d;h=s.start!==void 0?()=>s.start(l):()=>{},p=s.pull!==void 0?()=>s.pull(l):()=>Or(void 0),d=s.cancel!==void 0?v=>s.cancel(v):()=>Or(void 0),jA(o,l,h,p,d,c,u)})(this,a,Wu(i,1),n)}}get locked(){if(!go(this))throw Qo("locked");return bo(this)}cancel(r=void 0){return go(this)?bo(this)?$e(new TypeError("Cannot cancel a stream that already has a reader")):Si(this,r):$e(Qo("cancel"))}getReader(r=void 0){if(!go(this))throw Qo("getReader");return function(t,i){tn(t,i);let a=t==null?void 0:t.mode;return{mode:a===void 0?void 0:YH(a,`${i} has member 'mode' that`)}}(r,"First parameter").mode===void 0?uc(this):sA(this)}pipeThrough(r,t={}){if(!go(this))throw Qo("pipeThrough");Cn(r,1,"pipeThrough");let i=function(n,o){tn(n,o);let s=n==null?void 0:n.readable;jv(s,"readable","ReadableWritablePair"),Hv(s,`${o} has member 'readable' that`);let c=n==null?void 0:n.writable;return jv(c,"writable","ReadableWritablePair"),fA(c,`${o} has member 'writable' that`),{readable:s,writable:c}}(r,"First parameter"),a=S5(t,"Second parameter");if(bo(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(fc(i.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return dc(k5(this,i.writable,a.preventClose,a.preventAbort,a.preventCancel,a.signal)),i.readable}pipeTo(r,t={}){if(!go(this))return $e(Qo("pipeTo"));if(r===void 0)return $e("Parameter 1 is required in 'pipeTo'.");if(!cc(r))return $e(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let i;try{i=S5(t,"Second parameter")}catch(a){return $e(a)}return bo(this)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):fc(r)?$e(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):k5(this,r,i.preventClose,i.preventAbort,i.preventCancel,i.signal)}tee(){if(!go(this))throw Qo("tee");return Uu(nV(this))}values(r=void 0){if(!go(this))throw Qo("values");return function(t,i){let a=uc(t),n=new Vp(a,i),o=Object.create($5);return o._asyncIteratorImpl=n,o}(this,function(t,i){tn(t,i);let a=t==null?void 0:t.preventCancel;return{preventCancel:Boolean(a)}}(r,"First parameter").preventCancel)}[rl](r){return this.values(r)}static from(r){return oV(r)}};function Qu(e,r,t,i=1,a=()=>1){let n=Object.create(Bt.prototype);return r1(n),jA(n,Object.create(en.prototype),e,r,t,i,a),n}function E5(e,r,t){let i=Object.create(Bt.prototype);return r1(i),oA(i,Object.create(Zi.prototype),e,r,t,0,void 0),i}function r1(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function go(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof Bt}function bo(e){return e._reader!==void 0}function Si(e,r){if(e._disturbed=!0,e._state==="closed")return Or(void 0);if(e._state==="errored")return $e(e._storedError);tl(e);let t=e._reader;if(t!==void 0&&Zo(t)){let i=t._readIntoRequests;t._readIntoRequests=new ka,i.forEach(a=>{a._closeSteps(void 0)})}return On(e._readableStreamController[Mv](r),Ku)}function tl(e){e._state="closed";let r=e._reader;if(r!==void 0&&(D5(r),vo(r))){let t=r._readRequests;r._readRequests=new ka,t.forEach(i=>{i._closeSteps()})}}function TA(e,r){e._state="errored",e._storedError=r;let t=e._reader;t!==void 0&&(zv(t,r),vo(t)?U5(t,r):lA(t,r))}function Qo(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function RA(e,r){tn(e,r);let t=e==null?void 0:e.highWaterMark;return jv(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Nv(t)}}Object.defineProperties(Bt,{from:{enumerable:!0}}),Object.defineProperties(Bt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Pr(Bt.from,"from"),Pr(Bt.prototype.cancel,"cancel"),Pr(Bt.prototype.getReader,"getReader"),Pr(Bt.prototype.pipeThrough,"pipeThrough"),Pr(Bt.prototype.pipeTo,"pipeTo"),Pr(Bt.prototype.tee,"tee"),Pr(Bt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Bt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Bt.prototype,rl,{value:Bt.prototype.values,writable:!0,configurable:!0});var PA=e=>e.byteLength;Pr(PA,"size");var Ju=class{constructor(r){Cn(r,1,"ByteLengthQueuingStrategy"),r=RA(r,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!j5(this))throw A5("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!j5(this))throw A5("size");return PA}};function A5(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function j5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Ju}Object.defineProperties(Ju.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ju.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var OA=()=>1;Pr(OA,"size");var Zu=class{constructor(r){Cn(r,1,"CountQueuingStrategy"),r=RA(r,"First parameter"),this._countQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!R5(this))throw T5("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!R5(this))throw T5("size");return OA}};function T5(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function R5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Zu}function fV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}function pV(e,r,t){return Ja(e,t),i=>rs(e,r,[i])}function hV(e,r,t){return Ja(e,t),(i,a)=>Bn(e,r,[i,a])}function dV(e,r,t){return Ja(e,t),i=>Bn(e,r,[i])}Object.defineProperties(Zu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Zu.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var el=class{constructor(r={},t={},i={}){r===void 0&&(r=null);let a=Kp(t,"Second parameter"),n=Kp(i,"Third parameter"),o=function(p,d){tn(p,d);let v=p==null?void 0:p.cancel,x=p==null?void 0:p.flush,y=p==null?void 0:p.readableType,E=p==null?void 0:p.start,A=p==null?void 0:p.transform,S=p==null?void 0:p.writableType;return{cancel:v===void 0?void 0:dV(v,p,`${d} has member 'cancel' that`),flush:x===void 0?void 0:fV(x,p,`${d} has member 'flush' that`),readableType:y,start:E===void 0?void 0:pV(E,p,`${d} has member 'start' that`),transform:A===void 0?void 0:hV(A,p,`${d} has member 'transform' that`),writableType:S}}(r,"First parameter");if(o.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(o.writableType!==void 0)throw new RangeError("Invalid writableType specified");let s=Wu(n,0),c=Gp(n),u=Wu(a,1),l=Gp(a),h;(function(p,d,v,x,y,E){function A(){return d}function S(I){return function(F,H){let z=F._transformStreamController;return F._backpressure?On(F._backpressureChangePromise,()=>{let G=F._writable;if(G._state==="erroring")throw G._storedError;return O5(z,H)}):O5(z,H)}(p,I)}function R(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._readable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Up(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):(Ei(G._readableStreamController,H),Sv(z)),null),V=>(Ei(G._readableStreamController,V),sc(z,V),null)),z._finishPromise}(p,I)}function j(){return function(I){let F=I._transformStreamController;if(F._finishPromise!==void 0)return F._finishPromise;let H=I._readable;F._finishPromise=kt((G,D)=>{F._finishPromise_resolve=G,F._finishPromise_reject=D});let z=F._flushAlgorithm();return Up(F),wa(z,()=>(H._state==="errored"?sc(F,H._storedError):(ns(H._readableStreamController),Sv(F)),null),G=>(Ei(H._readableStreamController,G),sc(F,G),null)),F._finishPromise}(p)}function P(){return function(I){return Yp(I,!1),I._backpressureChangePromise}(p)}function C(I){return function(F,H){let z=F._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let G=F._writable;z._finishPromise=kt((V,$)=>{z._finishPromise_resolve=V,z._finishPromise_reject=$});let D=z._cancelAlgorithm(H);return Up(z),wa(D,()=>(G._state==="errored"?sc(z,G._storedError):(Xu(G._writableStreamController,H),Fv(F),Sv(z)),null),V=>(Xu(G._writableStreamController,V),Fv(F),sc(z,V),null)),z._finishPromise}(p,I)}p._writable=function(I,F,H,z,G=1,D=()=>1){let V=Object.create(Tn.prototype);return hA(V),xA(V,Object.create(is.prototype),I,F,H,z,G,D),V}(A,S,j,R,v,x),p._readable=Qu(A,P,C,y,E),p._backpressure=void 0,p._backpressureChangePromise=void 0,p._backpressureChangePromise_resolve=void 0,Yp(p,!0),p._transformStreamController=void 0})(this,kt(p=>{h=p}),u,l,s,c),function(p,d){let v=Object.create(Rn.prototype),x,y,E;x=d.transform!==void 0?A=>d.transform(A,v):A=>{try{return BA(v,A),Or(void 0)}catch(S){return $e(S)}},y=d.flush!==void 0?()=>d.flush(v):()=>Or(void 0),E=d.cancel!==void 0?A=>d.cancel(A):()=>Or(void 0),function(A,S,R,j,P){S._controlledTransformStream=A,A._transformStreamController=S,S._transformAlgorithm=R,S._flushAlgorithm=j,S._cancelAlgorithm=P,S._finishPromise=void 0,S._finishPromise_resolve=void 0,S._finishPromise_reject=void 0}(p,v,x,y,E)}(this,o),o.start!==void 0?h(o.start(this._transformStreamController)):h(void 0)}get readable(){if(!P5(this))throw C5("readable");return this._readable}get writable(){if(!P5(this))throw C5("writable");return this._writable}};function P5(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof el}function CA(e,r){Ei(e._readable._readableStreamController,r),t1(e,r)}function t1(e,r){Up(e._transformStreamController),Xu(e._writable._writableStreamController,r),Fv(e)}function Fv(e){e._backpressure&&Yp(e,!1)}function Yp(e,r){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=kt(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=r}Object.defineProperties(el.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(el.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});var Rn=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ip(this))throw Mp("desiredSize");return e1(this._controlledTransformStream._readable._readableStreamController)}enqueue(r=void 0){if(!Ip(this))throw Mp("enqueue");BA(this,r)}error(r=void 0){if(!Ip(this))throw Mp("error");var t;t=r,CA(this._controlledTransformStream,t)}terminate(){if(!Ip(this))throw Mp("terminate");(function(r){let t=r._controlledTransformStream;ns(t._readable._readableStreamController);let i=new TypeError("TransformStream terminated");t1(t,i)})(this)}};function Ip(e){return!!mt(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Rn}function Up(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function BA(e,r){let t=e._controlledTransformStream,i=t._readable._readableStreamController;if(!hc(i))throw new TypeError("Readable side is not in a state that permits enqueue");try{pc(i,r)}catch(n){throw t1(t,n),t._readable._storedError}(function(n){return!AA(n)})(i)!==t._backpressure&&Yp(t,!0)}function O5(e,r){return On(e._transformAlgorithm(r),void 0,t=>{throw CA(e._controlledTransformStream,t),t})}function Mp(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Sv(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function sc(e,r){e._finishPromise_reject!==void 0&&(dc(e._finishPromise),e._finishPromise_reject(r),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function C5(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Rn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Pr(Rn.prototype.enqueue,"enqueue"),Pr(Rn.prototype.error,"error"),Pr(Rn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var rh=class extends Bt{};var th=class{chunks;isWorking=!1;isCancelled=!1;constructor(r){this.chunks=r}start(r){this.work(r)}async work(r){let{chunks:t}=this;for(this.isWorking=!0;!this.isCancelled&&(r.desiredSize||0)>0;){let i;try{i=t.next()}catch(a){r.error(a);break}i&&(!i.done&&!this.isCancelled?r.enqueue(i.value):r.close())}this.isWorking=!1}pull(r){this.isWorking||this.work(r)}cancel(){this.isCancelled=!0}};var ah=class extends rh{_chunks;constructor(r){super(new th(r.values()),{type:"bytes"}),this._chunks=r}async*[Symbol.asyncIterator](r){let t=this.getReader();yield*this._chunks,t.releaseLock()}};var ss=class{type;size;parts;constructor(r=[],t={}){this.parts=[],this.size=0;for(let i of r)if(typeof i=="string"){let a=new TextEncoder().encode(i);this.parts.push(a),this.size+=a.byteLength}else if(i instanceof ss)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:a,byteOffset:n,byteLength:o}=i;this.parts.push(new Uint8Array(a,n,o)),this.size+=o}else{let a=new TextEncoder().encode(String(i));this.parts.push(a),this.size+=a.byteLength}this.type=mV(t.type)}slice(r=0,t=this.size,i=""){let{size:a,parts:n}=this,o=r<0?Math.max(a+r,0):Math.min(r,a),s=t<0?Math.max(a+t,0):Math.min(t,a),c=Math.max(s-o,0),u=new ss([],{type:i});if(c===0)return u;let l=0,h=[];for(let p of n){let{byteLength:d}=p;if(o>0&&d<=o)o-=d,s-=d;else{let v=p.subarray(o,Math.min(d,s));if(h.push(v),l+=v.byteLength,o=0,l>=c)break}}return u.parts=h,u.size=l,u}async arrayBuffer(){return this._toArrayBuffer()}async text(){let r=new TextDecoder,t="";for(let i of this.parts)t+=r.decode(i);return t}stream(){return new ah(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let r=new ArrayBuffer(this.size),t=new Uint8Array(r),i=0;for(let a of this.parts)t.set(a,i),i+=a.byteLength;return r}};function mV(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function gV(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=ss),globalThis.Blob}var vV=gV();var ih=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(r){let t=await r.arrayBuffer();this.onload&&this.onload({target:{result:t}})}async readAsBinaryString(r){throw Error("Not implemented")}async readAsDataURL(r){let t=await r.text(),i=`data://;base64,${Ec(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var nh=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(r,t,i={}){super(r,i),this.name=String(t).replace(/\//g,":"),this.lastModified=(i==null?void 0:i.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function FA(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=ih),typeof File>"u"&&!globalThis.File&&(globalThis.File=nh),global}var yV=FA();var a1=Xt(require("module"),1),IA=Xt(require("path"),1),sh=Xt(require("fs"),1);async function MA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():sh.default.readFileSync(e).buffer}async function LA(e){return e.startsWith("http")?await(await fetch(e)).text():sh.default.readFileSync(e,"utf8")}async function DA(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return oh(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=sh.default.readFileSync(e,"utf8");return oh(r)}function oh(e,r="",t){if(typeof r=="object"&&(t=r,r=""),r=r.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=a1.default._nodeModulePaths(IA.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new a1.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var Ai=class{map;constructor(r){this.map={},r instanceof Ai?r.forEach((t,i)=>this.append(i,t)):Array.isArray(r)?r.forEach(t=>this.append(t[0],t[1])):r&&Object.getOwnPropertyNames(r).forEach(t=>this.append(t,r[t]))}append(r,t){r=al(r),t=qA(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[al(r)]}get(r){return r=al(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(al(r))}set(r,t){this.map[al(r)]=qA(t)}forEach(r,t=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(t?r.call(t,this.map[i],i,this):r(this.map[i],i,this))}keys(){let r=[];return this.forEach(function(t,i){r.push(i)}),i1(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),i1(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),i1(r)}*[Symbol.iterator](){yield*this.entries()}};function al(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 qA(e){return typeof e!="string"&&(e=String(e)),e}function i1(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function n1(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var s1=Xt(require("stream"),1),bV=e=>typeof e=="boolean",zA=e=>typeof e=="function",xV=e=>e!==null&&typeof e=="object",o1=e=>xV(e)&&zA(e.read)&&zA(e.pipe)&&bV(e.readable),Fn=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(r,t){let{headers:i,status:a=200,statusText:n="OK",url:o}=t||{};this.url=o,this.ok=a===200,this.status=a,this.statusText=n,this.headers=new Ai((t==null?void 0:t.headers)||{}),o1(r)?this._body=Sp(r,i):typeof r=="string"?this._body=s1.Readable.from([new TextEncoder().encode(r)]):this._body=s1.Readable.from([r||new ArrayBuffer(0)])}get body(){return n1(!this.bodyUsed),n1(o1(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return o1(this._body)?await f5(this._body):this._body||new ArrayBuffer(0)}async text(){let r=await this.arrayBuffer();return new TextDecoder().decode(r)}async json(){let r=await this.text();return JSON.parse(r)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var UA=Xt(require("http"),1),HA=Xt(require("https"),1);var _V=e=>e&&e instanceof ArrayBuffer,wV=e=>e&&e instanceof Buffer;function NA(e){let r=e.indexOf(","),t,i;return e.slice(r-7,r)===";base64"?(t=Buffer.from(e.slice(r+1),"base64"),i=e.slice(5,r-7).trim()):(t=Buffer.from(decodeURIComponent(e.slice(r+1))),i=e.slice(5,r).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:kV(t),mimeType:i}}function kV(e){if(_V(e))return e;if(wV(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var c1=e=>e.startsWith("data:"),SV=e=>e.startsWith("http:")||e.startsWith("https:");async function il(e,r){try{if(globalThis.fetch!==il&&(SV(e)||c1(e)))return await fetch(e,r);if(c1(e)){let{arrayBuffer:u,mimeType:l}=NA(e);return new Fn(u,{headers:{"content-type":l},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await EV(i,r),n=RV(e,a,t),{status:o,statusText:s}=TV(a),c=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&c){let u=AV(e,n.get("location"));return await il(u,r)}return new Fn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new Fn(null,{status:400,statusText:String(t),url:e})}}async function EV(e,r){return await new Promise((t,i)=>{let a=jV(e,r),n=e.startsWith("https:")?HA.default.request(a,o=>t(o)):UA.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function AV(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function jV(e,r){let t=(r==null?void 0:r.headers)||{},i={};for(let n of Object.keys(t))i[n.toLowerCase()]=t[n];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let a=new URL(e);return{hostname:a.hostname,path:a.pathname,method:"GET",...r,...r==null?void 0:r.fetch,headers:i,port:a.port}}function TV(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function RV(e,r,t={}){let i={};if(r&&r.headers){let a=r.headers;for(let n in a){let o=a[n];i[n.toLowerCase()]=String(o)}}if(!i["content-length"]){let a=PV(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ai(i)}function PV(e){return c1(e)?e.length-5:null}var OV=parseInt(VA.versions.node.split(".")[0]);ay&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=mv;globalThis.loaders.NodeFile=Wo;globalThis.loaders.NodeFileSystem=jp;globalThis.loaders.fetchNode=Ep;globalThis.loaders.NodeHash=Tp;globalThis.TextEncoder||(globalThis.TextEncoder=Sc);globalThis.TextDecoder||(globalThis.TextDecoder=wo);globalThis.ReadableStream||(globalThis.ReadableStream=ReadableStream);!("atob"in globalThis)&&Ec&&(globalThis.atob=Ec);!("btoa"in globalThis)&&Uh&&(globalThis.btoa=Uh);globalThis.loaders.encodeImageNode=c_;globalThis.loaders.parseImageNode=Vg;globalThis.loaders.imageFormatsNode=Hg;globalThis._parseImageNode=Vg;globalThis._imageFormatsNode=Hg;globalThis.loaders.readFileAsArrayBuffer=MA;globalThis.loaders.readFileAsText=LA;globalThis.loaders.requireFromFile=DA;globalThis.loaders.requireFromString=oh;OV<18&&(!("Headers"in globalThis)&&Ai&&(globalThis.Headers=Ai),!("Response"in globalThis)&&Fn&&(globalThis.Response=Fn),!("fetch"in globalThis)&&il&&(globalThis.fetch=il));var CV=e=>typeof e=="boolean",nl=e=>typeof e=="function",cs=e=>e!==null&&typeof e=="object",u1=e=>cs(e)&&e.constructor==={}.constructor;var GA=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",KA=e=>e&&typeof e[Symbol.asyncIterator]=="function";var Za=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ei=e=>typeof Blob<"u"&&e instanceof Blob,$A=e=>e&&typeof e=="object"&&e.isBuffer;var BV=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||cs(e)&&nl(e.tee)&&nl(e.cancel)&&nl(e.getReader);var FV=e=>cs(e)&&nl(e.read)&&nl(e.pipe)&&CV(e.readable),ch=e=>BV(e)||FV(e);var uh=class extends Error{constructor(r,t){super(r),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var IV=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,MV=/^([-\w.]+\/[-\w.+]+)/;function l1(e,r){return e.toLowerCase()===r.toLowerCase()}function WA(e){let r=MV.exec(e);return r?r[1]:e}function f1(e){let r=IV.exec(e);return r?r[1]:""}var XA=/\?.*/;function YA(e){let r=e.match(XA);return r&&r[0]}function mc(e){return e.replace(XA,"")}function QA(e){if(e.length<50)return e;let r=e.slice(e.length-15);return`${e.substr(0,32)}...${r}`}function us(e){return Za(e)?e.url:ei(e)?e.name||"":typeof e=="string"?e:""}function ol(e){if(Za(e)){let r=e,t=r.headers.get("content-type")||"",i=mc(r.url);return WA(t)||f1(i)}return ei(e)?e.type||"":typeof e=="string"?f1(e):""}function JA(e){return Za(e)?e.headers["content-length"]||-1:ei(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function lh(e){if(Za(e))return e;let r={},t=JA(e);t>=0&&(r["content-length"]=String(t));let i=us(e),a=ol(e);a&&(r["content-type"]=a);let n=await DV(e);n&&(r["x-first-bytes"]=n),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:r});return Object.defineProperty(o,"url",{value:i}),o}async function ZA(e){if(!e.ok)throw await LV(e)}async function LV(e){let r=QA(e.url),t=`Failed to fetch resource (${e.status}) ${e.statusText}: ${r}`;t=t.length>100?`${t.slice(0,100)}...`:t;let i={reason:e.statusText,url:e.url,response:e};try{let a=e.headers.get("Content-Type");i.reason=!e.bodyUsed&&(a!=null&&a.includes("application/json"))?await e.json():await e.text()}catch{}return new uh(t,i)}async function DV(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(i=>{let a=new FileReader;a.onload=n=>{var o;return i((o=n==null?void 0:n.target)==null?void 0:o.result)},a.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${qV(t)}`}return null}function qV(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function zV(e){return!NV(e)&&!UV(e)}function NV(e){return e.startsWith("http:")||e.startsWith("https:")}function UV(e){return e.startsWith("data:")}async function p1(e,r){var t,i;if(typeof e=="string"){let a=Ko(e);return zV(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await lh(e)}var h1=new Xi({id:"loaders.gl"}),fh=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},ph=class{console;constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var d1={fetch:null,mimeType:void 0,nothrow:!1,log:new ph,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:No,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ej={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 m1(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function g1(){let e=m1();return e.globalOptions=e.globalOptions||{...d1},e.globalOptions}function aj(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],HV(e,t),GV(r,e,i)}function HV(e,r){rj(e,null,d1,ej,r);for(let t of r){let i=e&&e[t.id]||{},a=t.options&&t.options[t.id]||{},n=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};rj(i,t.id,a,n,r)}}function rj(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let c=!r&&cs(e[s]),u=s==="baseUri"&&!r,l=s==="workerUrl"&&r;if(!(s in t)&&!u&&!l){if(s in i)h1.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!c){let h=VV(s,a);h1.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function VV(e,r){let t=e.toLowerCase(),i="";for(let a of r)for(let n in a.options){if(e===n)return`Did you mean '${a.id}.${n}'?`;let o=n.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${a.id}.${n}'?`)}return i}function GV(e,r,t){let a={...e.options||{}};return KV(a,t),a.log===null&&(a.log=new fh),tj(a,g1()),tj(a,r),a}function tj(e,r){for(let t in r)if(t in r){let i=r[t];u1(i)&&u1(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function KV(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function sl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function v1(e){ki(e,"null loader"),ki(sl(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var $V=()=>{let e=m1();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function ij(){return $V()}var WV=/\.([^.]+)$/;async function sj(e,r=[],t,i){if(!cj(e))return null;let a=nj(e,r,{...t,nothrow:!0},i);if(a)return a;if(ei(e)&&(e=await e.slice(0,10).arrayBuffer(),a=nj(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(uj(e));return a}function nj(e,r=[],t,i){if(!cj(e))return null;if(r&&!Array.isArray(r))return v1(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...ij()),YV(a);let n=XV(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(uj(e));return n}function XV(e,r,t,i){let a=us(e),n=ol(e),o=mc(a)||(i==null?void 0:i.url),s=null,c="";return t!=null&&t.mimeType&&(s=y1(r,t==null?void 0:t.mimeType),c=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||QV(r,o),c=c||(s?`matched url ${o}`:""),s=s||y1(r,n),c=c||(s?`matched MIME type ${n}`:""),s=s||ZV(r,e),c=c||(s?`matched initial data ${lj(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||y1(r,t==null?void 0:t.fallbackMimeType),c=c||(s?`matched fallback MIME type ${n}`:"")),c&&Wg.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${c}.`),s}function cj(e){return!(e instanceof Response&&e.status===204)}function uj(e){let r=us(e),t=ol(e),i="No valid loader found (";i+=r?`${$o.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?lj(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function YV(e){for(let r of e)v1(r)}function QV(e,r){let t=r&&WV.exec(r),i=t&&t[1];return i?JV(e,i):null}function JV(e,r){r=r.toLowerCase();for(let t of e)for(let i of t.extensions)if(i.toLowerCase()===r)return t;return null}function y1(e,r){var t;for(let i of e)if((t=i.mimeTypes)!=null&&t.some(a=>l1(r,a))||l1(r,`application/x.${i.id}`))return i;return null}function ZV(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(eG(r,t))return t}else if(ArrayBuffer.isView(r)){if(oj(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&oj(r,0,t))return t;return null}function eG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function oj(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>rG(e,r,t,a))}function rG(e,r,t,i){if(i instanceof ArrayBuffer)return cv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=b1(e,r,i.length);return i===a;default:return!1}}function lj(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?b1(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?b1(e,0,r):""}function b1(e,r,t){if(e.byteLength<r+t)return"";let i=new DataView(e),a="";for(let n=0;n<t;n++)a+=String.fromCharCode(i.getUint8(r+n));return a}function*fj(e,r){let t=(r==null?void 0:r.chunkSize)||262144,i=0,a=new TextEncoder;for(;i<e.length;){let n=Math.min(e.length-i,t),o=e.slice(i,i+n);i+=n,yield a.encode(o)}}function*pj(e,r={}){let{chunkSize:t=262144}=r,i=0;for(;i<e.byteLength;){let a=Math.min(e.byteLength-i,t),n=new ArrayBuffer(a),o=new Uint8Array(e,i,a);new Uint8Array(n).set(o),i+=a,yield n}}async function*hj(e,r){let t=(r==null?void 0:r.chunkSize)||1048576,i=0;for(;i<e.size;){let a=i+t,n=await e.slice(i,a).arrayBuffer();i=a,yield n}}function x1(e,r){return No?tG(e,r):aG(e,r)}async function*tG(e,r){let t=e.getReader(),i;try{for(;;){let a=i||t.read();r!=null&&r._streamReadAhead&&(i=t.read());let{done:n,value:o}=await a;if(n)return;yield wp(o)}}catch{t.releaseLock()}}async function*aG(e,r){for await(let t of e)yield wp(t)}function dj(e,r){if(typeof e=="string")return fj(e,r);if(e instanceof ArrayBuffer)return pj(e,r);if(ei(e))return hj(e,r);if(ch(e))return x1(e,r);if(Za(e))return x1(e.body,r);throw new Error("makeIterator")}var mj="Cannot convert supplied data type";function iG(e,r,t){if(r.text&&typeof e=="string")return e;if($A(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return r.text&&!r.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(r.text&&!r.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,a=e.byteLength||e.length;return(e.byteOffset!==0||a!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+a)),i}throw new Error(mj)}async function gj(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return iG(e,r,t);if(ei(e)&&(e=await lh(e)),Za(e)){let a=e;return await ZA(a),r.binary?await a.arrayBuffer():await a.text()}if(ch(e)&&(e=dj(e,t)),GA(e)||KA(e))return Lu(e);throw new Error(mj)}function hh(e,r){let t=g1(),i=e||t;return typeof i.fetch=="function"?i.fetch:cs(i.fetch)?a=>p1(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:p1}function vj(e,r,t){if(t)return t;let i={fetch:hh(r,e),...e};if(i.url){let a=mc(i.url);i.baseUrl=a,i.queryString=YA(i.url),i.filename=$o.filename(a),i.baseUrl=$o.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function yj(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let i=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...i]:i}return t&&t.length?t:void 0}async function In(e,r,t,i){r&&!Array.isArray(r)&&!sl(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=us(e),o=yj(r,i),s=await sj(e,o,t);return s?(t=aj(t,s,o,a),i=vj({url:a,_parse:In,loaders:o},t,i||null),await nG(s,e,t,i)):null}async function nG(e,r,t,i){if(av(e),t=Xg(e.options,t),Za(r)){let n=r,{ok:o,redirected:s,status:c,statusText:u,type:l,url:h}=n,p=Object.fromEntries(n.headers.entries());i.response={headers:p,ok:o,redirected:s,status:c,statusText:u,type:l,url:h}}r=await gj(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(ov(e,t))return await sv(e,r,t,i,In);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw Wt(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function bj(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 _1(e){let r=1/0,t=1/0,i=1/0,a=-1/0,n=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let u=0;u<c;u+=3){let l=s[u],h=s[u+1],p=s[u+2];r=l<r?l:r,t=h<t?h:t,i=p<i?p:i,a=l>a?l:a,n=h>n?h:n,o=p>o?p:o}return[[r,t,i],[a,n,o]]}function w1(e,r,t){let i=bj(r.value),a=t||xj(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function xj(e){let r={};return"byteOffset"in e&&(r.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(r.byteStride=e.byteStride.toString(10)),"normalized"in e&&(r.normalized=e.normalized.toString()),r}async function k1(e,r,t,i){let a,n;!Array.isArray(r)&&!sl(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=hh(n),s=e;return typeof e=="string"&&(s=await o(e)),ei(e)&&(s=await o(e)),Array.isArray(a)?await In(s,a,n):await In(s,a,n)}var oG=1/Math.PI*180,sG=1/180*Math.PI,cG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...cG}};var gt=globalThis.mathgl.config;function S1(e,{precision:r=gt.precision}={}){return e=uG(e),`${parseFloat(e.toPrecision(r))}`}function _o(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E1(e){return _j(e)}function A1(e){return wj(e)}function _j(e,r){return kj(e,t=>t*sG,r)}function wj(e,r){return kj(e,t=>t*oG,r)}function Mn(e,r,t){let i=gt.EPSILON;t&&(gt.EPSILON=t);try{if(e===r)return!0;if(_o(e)&&_o(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Mn(e[a],r[a]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=gt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{gt.EPSILON=i}}function uG(e){return Math.round(e/gt.EPSILON)*gt.EPSILON}function lG(e){return e.clone?e.clone():new Array(e.length)}function kj(e,r,t){if(_o(e)){let i=e;t=t||lG(i);for(let a=0;a<t.length&&a<i.length;++a){let n=typeof e=="number"?e:e[a];t[a]=r(n,a,t)}return t}return r(e)}var gc=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(r,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=r[i+t];return this.check()}toArray(r=[],t=0){for(let i=0;i<this.ELEMENTS;++i)r[t+i]=this[i];return r}toObject(r){return r}from(r){return Array.isArray(r)?this.copy(r):this.fromObject(r)}to(r){return r===this?this:_o(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(gt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+S1(this[i],r);return`${r.printTypes?this.constructor.name:""}[${t}]`}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Mn(this[t],r[t]))return!1;return!0}exactEquals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==r[t])return!1;return!0}negate(){for(let r=0;r<this.ELEMENTS;++r)this[r]=-this[r];return this.check()}lerp(r,t,i){if(i===void 0)return this.lerp(this,r,t);for(let a=0;a<this.ELEMENTS;++a){let n=r[a],o=typeof t=="number"?t:t[a];this[a]=n+i*(o-n)}return this.check()}min(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(r[t],this[t]);return this.check()}max(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(r[t],this[t]);return this.check()}clamp(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r[i]),t[i]);return this.check()}add(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]+=t[i];return this.check()}subtract(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]-=t[i];return this.check()}scale(r){if(typeof r=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;else for(let t=0;t<this.ELEMENTS&&t<r.length;++t)this[t]*=r[t];return this.check()}multiplyByScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}check(){if(gt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let r=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)r=r&&Number.isFinite(this[t]);return r}sub(r){return this.subtract(r)}setScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=r;return this.check()}addScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]+=r;return this.check()}subScalar(r){return this.addScalar(-r)}multiplyScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}divideScalar(r){return this.multiplyByScalar(1/r)}clampScalar(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r),t);return this.check()}get elements(){return this}};function fG(e,r){if(e.length!==r)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function ia(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function dh(e,r,t=""){if(gt.debug&&!fG(e,r))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return e}function ri(e,r){if(!e)throw new Error(`math.gl assertion ${r}`)}var mh=class extends gc{get x(){return this[0]}set x(r){this[0]=ia(r)}get y(){return this[1]}set y(r){this[1]=ia(r)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let r=0;for(let t=0;t<this.ELEMENTS;++t)r+=this[t]*this[t];return r}magnitudeSquared(){return this.lengthSquared()}distance(r){return Math.sqrt(this.distanceSquared(r))}distanceSquared(r){let t=0;for(let i=0;i<this.ELEMENTS;++i){let a=this[i]-r[i];t+=a*a}return ia(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return ia(t)}normalize(){let r=this.magnitude();if(r!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=r;return this.check()}multiply(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]*=t[i];return this.check()}divide(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]/=t[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(r){return this.distance(r)}distanceToSquared(r){return this.distanceSquared(r)}getComponent(r){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),ia(this[r])}setComponent(r,t){return ri(r>=0&&r<this.ELEMENTS,"index is out of range"),this[r]=t,this.check()}addVectors(r,t){return this.copy(r).add(t)}subVectors(r,t){return this.copy(r).subtract(t)}multiplyVectors(r,t){return this.copy(r).multiply(t)}addScaledVector(r,t){return this.add(new this.constructor(r).multiplyScalar(t))}};var ji=typeof Float32Array<"u"?Float32Array:Array,cl=Math.random;function vc(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Ine=Math.PI/180;function pG(){let e=new ji(2);return ji!=Float32Array&&(e[0]=0,e[1]=0),e}function Sj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[4]*a+t[12],e[1]=t[1]*i+t[5]*a+t[13],e}var Mne=function(){let e=pG();return function(r,t,i,a,n,o){let s,c;for(t||(t=2),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],n(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function Ej(e,r,t){let i=r[0],a=r[1],n=t[3]*i+t[7]*a||1;return e[0]=(t[0]*i+t[4]*a)/n,e[1]=(t[1]*i+t[5]*a)/n,e}function gh(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n||1;return e[0]=(t[0]*i+t[4]*a+t[8]*n)/o,e[1]=(t[1]*i+t[5]*a+t[9]*n)/o,e[2]=(t[2]*i+t[6]*a+t[10]*n)/o,e}function Aj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[2]*a,e[1]=t[1]*i+t[3]*a,e[2]=r[2],e}var ll={};xl(ll,{add:()=>yG,angle:()=>I1,bezier:()=>CG,ceil:()=>bG,clone:()=>dG,copy:()=>gG,create:()=>jj,cross:()=>R1,dist:()=>NG,distance:()=>Cj,div:()=>zG,divide:()=>Oj,dot:()=>T1,equals:()=>LG,exactEquals:()=>MG,floor:()=>xG,forEach:()=>GG,fromValues:()=>mG,hermite:()=>OG,inverse:()=>jG,len:()=>HG,length:()=>Tj,lerp:()=>RG,max:()=>wG,min:()=>_G,mul:()=>qG,multiply:()=>Pj,negate:()=>AG,normalize:()=>TG,random:()=>BG,rotateX:()=>C1,rotateY:()=>B1,rotateZ:()=>F1,round:()=>kG,scale:()=>SG,scaleAndAdd:()=>EG,set:()=>vG,slerp:()=>PG,sqrDist:()=>UG,sqrLen:()=>VG,squaredDistance:()=>Bj,squaredLength:()=>Fj,str:()=>IG,sub:()=>DG,subtract:()=>Rj,transformMat3:()=>P1,transformMat4:()=>ul,transformQuat:()=>O1,zero:()=>FG});function jj(){let e=new ji(3);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function dG(e){let r=new ji(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Tj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function mG(e,r,t){let i=new ji(3);return i[0]=e,i[1]=r,i[2]=t,i}function gG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function vG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function yG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function Rj(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Pj(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function Oj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function bG(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function xG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function _G(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function wG(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function kG(e,r){return e[0]=vc(r[0]),e[1]=vc(r[1]),e[2]=vc(r[2]),e}function SG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function EG(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function Cj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function Bj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return t*t+i*i+a*a}function Fj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function AG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function jG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function TG(e,r){let t=r[0],i=r[1],a=r[2],n=t*t+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function T1(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function R1(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],c=t[2];return e[0]=a*c-n*s,e[1]=n*o-i*c,e[2]=i*s-a*o,e}function RG(e,r,t,i){let a=r[0],n=r[1],o=r[2];return e[0]=a+i*(t[0]-a),e[1]=n+i*(t[1]-n),e[2]=o+i*(t[2]-o),e}function PG(e,r,t,i){let a=Math.acos(Math.min(Math.max(T1(r,t),-1),1)),n=Math.sin(a),o=Math.sin((1-i)*a)/n,s=Math.sin(i*a)/n;return e[0]=o*r[0]+s*t[0],e[1]=o*r[1]+s*t[1],e[2]=o*r[2]+s*t[2],e}function OG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,c=o*(n-2)+n,u=o*(n-1),l=o*(3-2*n);return e[0]=r[0]*s+t[0]*c+i[0]*u+a[0]*l,e[1]=r[1]*s+t[1]*c+i[1]*u+a[1]*l,e[2]=r[2]*s+t[2]*c+i[2]*u+a[2]*l,e}function CG(e,r,t,i,a,n){let o=1-n,s=o*o,c=n*n,u=s*o,l=3*n*s,h=3*c*o,p=c*n;return e[0]=r[0]*u+t[0]*l+i[0]*h+a[0]*p,e[1]=r[1]*u+t[1]*l+i[1]*h+a[1]*p,e[2]=r[2]*u+t[2]*l+i[2]*h+a[2]*p,e}function BG(e,r){r=r===void 0?1:r;let t=cl()*2*Math.PI,i=cl()*2-1,a=Math.sqrt(1-i*i)*r;return e[0]=Math.cos(t)*a,e[1]=Math.sin(t)*a,e[2]=i*r,e}function ul(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n+t[15];return o=o||1,e[0]=(t[0]*i+t[4]*a+t[8]*n+t[12])/o,e[1]=(t[1]*i+t[5]*a+t[9]*n+t[13])/o,e[2]=(t[2]*i+t[6]*a+t[10]*n+t[14])/o,e}function P1(e,r,t){let i=r[0],a=r[1],n=r[2];return e[0]=i*t[0]+a*t[3]+n*t[6],e[1]=i*t[1]+a*t[4]+n*t[7],e[2]=i*t[2]+a*t[5]+n*t[8],e}function O1(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],c=r[1],u=r[2],l=a*u-n*c,h=n*s-i*u,p=i*c-a*s,d=a*p-n*h,v=n*l-i*p,x=i*h-a*l,y=o*2;return l*=y,h*=y,p*=y,d*=2,v*=2,x*=2,e[0]=s+l+d,e[1]=c+h+v,e[2]=u+p+x,e}function C1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0],n[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),n[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function B1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),n[1]=a[1],n[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function F1(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),n[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),n[2]=a[2],e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function I1(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],c=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),u=c&&T1(e,r)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function FG(e){return e[0]=0,e[1]=0,e[2]=0,e}function IG(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function MG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function LG(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2];return Math.abs(t-n)<=1e-6*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=1e-6*Math.max(1,Math.abs(a),Math.abs(s))}var DG=Rj,qG=Pj,zG=Oj,NG=Cj,UG=Bj,HG=Tj,VG=Fj,GG=function(){let e=jj();return function(r,t,i,a,n,o){let s,c;for(t||(t=3),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();var M1=[0,0,0],vh,xr=class extends mh{static get ZERO(){return vh||(vh=new xr(0,0,0),Object.freeze(vh)),vh}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&_o(r)?this.copy(r):(gt.debug&&(ia(r),ia(t),ia(i)),this[0]=r,this[1]=t,this[2]=i)}set(r,t,i){return this[0]=r,this[1]=t,this[2]=i,this.check()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this.check()}fromObject(r){return gt.debug&&(ia(r.x),ia(r.y),ia(r.z)),this[0]=r.x,this[1]=r.y,this[2]=r.z,this.check()}toObject(r){return r.x=this[0],r.y=this[1],r.z=this[2],r}get ELEMENTS(){return 3}get z(){return this[2]}set z(r){this[2]=ia(r)}angle(r){return I1(this,r)}cross(r){return R1(this,this,r),this.check()}rotateX({radians:r,origin:t=M1}){return C1(this,this,t,r),this.check()}rotateY({radians:r,origin:t=M1}){return B1(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=M1}){return F1(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return ul(this,this,r),this.check()}transformAsVector(r){return gh(this,this,r),this.check()}transformByMatrix3(r){return P1(this,this,r),this.check()}transformByMatrix2(r){return Aj(this,this,r),this.check()}transformByQuaternion(r){return O1(this,this,r),this.check()}};var yh=class extends gc{toString(){let r="[";if(gt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=` ${this[i*this.RANK+t]}`}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=` ${this[t]}`}return r+="]",r}getElementIndex(r,t){return t*this.RANK+r}getElement(r,t){return this[t*this.RANK+r]}setElement(r,t,i){return this[t*this.RANK+r]=ia(i),this}getColumn(r,t=new Array(this.RANK).fill(-0)){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)t[a]=this[i+a];return t}setColumn(r,t){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)this[i+a]=t[a];return this}};function KG(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 Ij(e,r){if(e===r){let t=r[1],i=r[2],a=r[3],n=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=i,e[9]=n,e[11]=r[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Mj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],c=r[6],u=r[7],l=r[8],h=r[9],p=r[10],d=r[11],v=r[12],x=r[13],y=r[14],E=r[15],A=t*s-i*o,S=t*c-a*o,R=t*u-n*o,j=i*c-a*s,P=i*u-n*s,C=a*u-n*c,I=l*x-h*v,F=l*y-p*v,H=l*E-d*v,z=h*y-p*x,G=h*E-d*x,D=p*E-d*y,V=A*D-S*G+R*z+j*H-P*F+C*I;return V?(V=1/V,e[0]=(s*D-c*G+u*z)*V,e[1]=(a*G-i*D-n*z)*V,e[2]=(x*C-y*P+E*j)*V,e[3]=(p*P-h*C-d*j)*V,e[4]=(c*H-o*D-u*F)*V,e[5]=(t*D-a*H+n*F)*V,e[6]=(y*R-v*C-E*S)*V,e[7]=(l*C-p*R+d*S)*V,e[8]=(o*G-s*H+u*I)*V,e[9]=(i*H-t*G-n*I)*V,e[10]=(v*P-x*R+E*A)*V,e[11]=(h*R-l*P-d*A)*V,e[12]=(s*F-o*z-c*I)*V,e[13]=(t*z-i*F+a*I)*V,e[14]=(x*S-v*j-y*A)*V,e[15]=(l*j-h*S+p*A)*V,e):null}function Lj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11],d=e[12],v=e[13],x=e[14],y=e[15],E=r*o-t*n,A=r*s-i*n,S=t*s-i*o,R=u*v-l*d,j=u*x-h*d,P=l*x-h*v,C=r*P-t*j+i*R,I=n*P-o*j+s*R,F=u*S-l*A+h*E,H=d*S-v*A+x*E;return c*C-a*I+y*F-p*H}function L1(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],c=r[5],u=r[6],l=r[7],h=r[8],p=r[9],d=r[10],v=r[11],x=r[12],y=r[13],E=r[14],A=r[15],S=t[0],R=t[1],j=t[2],P=t[3];return e[0]=S*i+R*s+j*h+P*x,e[1]=S*a+R*c+j*p+P*y,e[2]=S*n+R*u+j*d+P*E,e[3]=S*o+R*l+j*v+P*A,S=t[4],R=t[5],j=t[6],P=t[7],e[4]=S*i+R*s+j*h+P*x,e[5]=S*a+R*c+j*p+P*y,e[6]=S*n+R*u+j*d+P*E,e[7]=S*o+R*l+j*v+P*A,S=t[8],R=t[9],j=t[10],P=t[11],e[8]=S*i+R*s+j*h+P*x,e[9]=S*a+R*c+j*p+P*y,e[10]=S*n+R*u+j*d+P*E,e[11]=S*o+R*l+j*v+P*A,S=t[12],R=t[13],j=t[14],P=t[15],e[12]=S*i+R*s+j*h+P*x,e[13]=S*a+R*c+j*p+P*y,e[14]=S*n+R*u+j*d+P*E,e[15]=S*o+R*l+j*v+P*A,e}function Dj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,c,u,l,h,p,d,v,x,y,E;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*n+r[12],e[13]=r[1]*i+r[5]*a+r[9]*n+r[13],e[14]=r[2]*i+r[6]*a+r[10]*n+r[14],e[15]=r[3]*i+r[7]*a+r[11]*n+r[15]):(o=r[0],s=r[1],c=r[2],u=r[3],l=r[4],h=r[5],p=r[6],d=r[7],v=r[8],x=r[9],y=r[10],E=r[11],e[0]=o,e[1]=s,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=p,e[7]=d,e[8]=v,e[9]=x,e[10]=y,e[11]=E,e[12]=o*i+l*a+v*n+r[12],e[13]=s*i+h*a+x*n+r[13],e[14]=c*i+p*a+y*n+r[14],e[15]=u*i+d*a+E*n+r[15]),e}function qj(e,r,t){let i=t[0],a=t[1],n=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function zj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),c,u,l,h,p,d,v,x,y,E,A,S,R,j,P,C,I,F,H,z,G,D,V,$;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,u=Math.sin(t),c=Math.cos(t),l=1-c,h=r[0],p=r[1],d=r[2],v=r[3],x=r[4],y=r[5],E=r[6],A=r[7],S=r[8],R=r[9],j=r[10],P=r[11],C=a*a*l+c,I=n*a*l+o*u,F=o*a*l-n*u,H=a*n*l-o*u,z=n*n*l+c,G=o*n*l+a*u,D=a*o*l+n*u,V=n*o*l-a*u,$=o*o*l+c,e[0]=h*C+x*I+S*F,e[1]=p*C+y*I+R*F,e[2]=d*C+E*I+j*F,e[3]=v*C+A*I+P*F,e[4]=h*H+x*z+S*G,e[5]=p*H+y*z+R*G,e[6]=d*H+E*z+j*G,e[7]=v*H+A*z+P*G,e[8]=h*D+x*V+S*$,e[9]=p*D+y*V+R*$,e[10]=d*D+E*V+j*$,e[11]=v*D+A*V+P*$,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Nj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],c=r[7],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=n*a+u*i,e[5]=o*a+l*i,e[6]=s*a+h*i,e[7]=c*a+p*i,e[8]=u*a-n*i,e[9]=l*a-o*i,e[10]=h*a-s*i,e[11]=p*a-c*i,e}function Uj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[8],l=r[9],h=r[10],p=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a-u*i,e[1]=o*a-l*i,e[2]=s*a-h*i,e[3]=c*a-p*i,e[8]=n*i+u*a,e[9]=o*i+l*a,e[10]=s*i+h*a,e[11]=c*i+p*a,e}function Hj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],c=r[3],u=r[4],l=r[5],h=r[6],p=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a+u*i,e[1]=o*a+l*i,e[2]=s*a+h*i,e[3]=c*a+p*i,e[4]=u*a-n*i,e[5]=l*a-o*i,e[6]=h*a-s*i,e[7]=p*a-c*i,e}function Vj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,c=a+a,u=t*o,l=i*o,h=i*s,p=a*o,d=a*s,v=a*c,x=n*o,y=n*s,E=n*c;return e[0]=1-h-v,e[1]=l+E,e[2]=p-y,e[3]=0,e[4]=l-E,e[5]=1-u-v,e[6]=d+x,e[7]=0,e[8]=p+y,e[9]=d-x,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gj(e,r,t,i,a,n,o){let s=1/(t-r),c=1/(a-i),u=1/(n-o);return e[0]=n*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n*2*c,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*c,e[10]=(o+n)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*u,e[15]=0,e}function $G(e,r,t,i,a){let n=1/Math.tan(r/2);if(e[0]=n/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let o=1/(i-a);e[10]=(a+i)*o,e[14]=2*a*i*o}else e[10]=-1,e[14]=-2*i;return e}var Kj=$G;function WG(e,r,t,i,a,n,o){let s=1/(r-t),c=1/(i-a),u=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*c,e[14]=(o+n)*u,e[15]=1,e}var $j=WG;function Wj(e,r,t,i){let a,n,o,s,c,u,l,h,p,d,v=r[0],x=r[1],y=r[2],E=i[0],A=i[1],S=i[2],R=t[0],j=t[1],P=t[2];return Math.abs(v-R)<1e-6&&Math.abs(x-j)<1e-6&&Math.abs(y-P)<1e-6?KG(e):(h=v-R,p=x-j,d=y-P,a=1/Math.sqrt(h*h+p*p+d*d),h*=a,p*=a,d*=a,n=A*d-S*p,o=S*h-E*d,s=E*p-A*h,a=Math.sqrt(n*n+o*o+s*s),a?(a=1/a,n*=a,o*=a,s*=a):(n=0,o=0,s=0),c=p*s-d*o,u=d*n-h*s,l=h*o-p*n,a=Math.sqrt(c*c+u*u+l*l),a?(a=1/a,c*=a,u*=a,l*=a):(c=0,u=0,l=0),e[0]=n,e[1]=c,e[2]=h,e[3]=0,e[4]=o,e[5]=u,e[6]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=d,e[11]=0,e[12]=-(n*v+o*x+s*y),e[13]=-(c*v+u*x+l*y),e[14]=-(h*v+p*x+d*y),e[15]=1,e)}function YG(){let e=new ji(4);return ji!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Xj(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*n+t[12]*o,e[1]=t[1]*i+t[5]*a+t[9]*n+t[13]*o,e[2]=t[2]*i+t[6]*a+t[10]*n+t[14]*o,e[3]=t[3]*i+t[7]*a+t[11]*n+t[15]*o,e}var Wne=function(){let e=YG();return function(r,t,i,a,n,o){let s,c;for(t||(t=4),i||(i=0),a?c=Math.min(a*t+i,r.length):c=r.length,s=i;s<c;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();var z1;(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"})(z1||(z1={}));var JG=45*Math.PI/180,ZG=1,D1=.1,q1=500,eK=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ti=class extends yh{static get IDENTITY(){return tK()}static get ZERO(){return rK()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return z1}constructor(r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(r)?this.copy(r):this.identity()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this[3]=r[3],this[4]=r[4],this[5]=r[5],this[6]=r[6],this[7]=r[7],this[8]=r[8],this[9]=r[9],this[10]=r[10],this[11]=r[11],this[12]=r[12],this[13]=r[13],this[14]=r[14],this[15]=r[15],this.check()}set(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=c,this[8]=u,this[9]=l,this[10]=h,this[11]=p,this[12]=d,this[13]=v,this[14]=x,this[15]=y,this.check()}setRowMajor(r,t,i,a,n,o,s,c,u,l,h,p,d,v,x,y){return this[0]=r,this[1]=n,this[2]=u,this[3]=d,this[4]=t,this[5]=o,this[6]=l,this[7]=v,this[8]=i,this[9]=s,this[10]=h,this[11]=x,this[12]=a,this[13]=c,this[14]=p,this[15]=y,this.check()}toRowMajor(r){return r[0]=this[0],r[1]=this[4],r[2]=this[8],r[3]=this[12],r[4]=this[1],r[5]=this[5],r[6]=this[9],r[7]=this[13],r[8]=this[2],r[9]=this[6],r[10]=this[10],r[11]=this[14],r[12]=this[3],r[13]=this[7],r[14]=this[11],r[15]=this[15],r}identity(){return this.copy(eK)}fromObject(r){return this.check()}fromQuaternion(r){return Vj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=D1,far:s=q1}=r;return s===1/0?aK(this,t,i,a,n,o):Gj(this,t,i,a,n,o,s),this.check()}lookAt(r){let{eye:t,center:i=[0,0,0],up:a=[0,1,0]}=r;return Wj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=D1,far:s=q1}=r;return $j(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=JG,aspect:i=ZG,focalDistance:a=1,near:n=D1,far:o=q1}=r;Yj(t);let s=t/2,c=a*Math.tan(s),u=c*i;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return Yj(t),Kj(this,t,i,a,n),this.check()}determinant(){return Lj(this)}getScale(r=[-0,-0,-0]){return r[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),r[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),r[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),r}getTranslation(r=[-0,-0,-0]){return r[0]=this[12],r[1]=this[13],r[2]=this[14],r}getRotation(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=0,r[4]=this[4]*a,r[5]=this[5]*n,r[6]=this[6]*o,r[7]=0,r[8]=this[8]*a,r[9]=this[9]*n,r[10]=this[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}getRotationMatrix3(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=this[4]*a,r[4]=this[5]*n,r[5]=this[6]*o,r[6]=this[8]*a,r[7]=this[9]*n,r[8]=this[10]*o,r}transpose(){return Ij(this,this),this.check()}invert(){return Mj(this,this),this.check()}multiplyLeft(r){return L1(this,r,this),this.check()}multiplyRight(r){return L1(this,this,r),this.check()}rotateX(r){return Nj(this,this,r),this.check()}rotateY(r){return Uj(this,this,r),this.check()}rotateZ(r){return Hj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return zj(this,this,r,t),this.check()}scale(r){return qj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return Dj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=Xj(t||[-0,-0,-0,-0],r,this),dh(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=Sj(t||[-0,-0],r,this);break;case 3:a=ul(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return dh(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=Ej(t||[-0,-0],r,this);break;case 3:i=gh(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return dh(i,r.length),i}transformPoint(r,t){return this.transformAsPoint(r,t)}transformVector(r,t){return this.transformAsPoint(r,t)}transformDirection(r,t){return this.transformAsVector(r,t)}makeRotationX(r){return this.identity().rotateX(r)}makeTranslation(r,t,i){return this.identity().translate([r,t,i])}},bh,xh;function rK(){return bh||(bh=new ti([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(bh)),bh}function tK(){return xh||(xh=new ti,Object.freeze(xh)),xh}function Yj(e){if(e>Math.PI*2)throw Error("expected radians")}function aK(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),c=(t+r)/(t-r),u=(a+i)/(a-i),l=-1,h=-1,p=-2*n;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]=c,e[9]=u,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}var ls={};xl(ls,{EPSILON1:()=>iK,EPSILON10:()=>hK,EPSILON11:()=>dK,EPSILON12:()=>mK,EPSILON13:()=>gK,EPSILON14:()=>vK,EPSILON15:()=>yK,EPSILON16:()=>bK,EPSILON17:()=>xK,EPSILON18:()=>_K,EPSILON19:()=>wK,EPSILON2:()=>nK,EPSILON20:()=>kK,EPSILON3:()=>oK,EPSILON4:()=>sK,EPSILON5:()=>cK,EPSILON6:()=>uK,EPSILON7:()=>lK,EPSILON8:()=>fK,EPSILON9:()=>pK,PI_OVER_FOUR:()=>EK,PI_OVER_SIX:()=>AK,PI_OVER_TWO:()=>SK,TWO_PI:()=>jK});var iK=.1,nK=.01,oK=.001,sK=1e-4,cK=1e-5,uK=1e-6,lK=1e-7,fK=1e-8,pK=1e-9,hK=1e-10,dK=1e-11,mK=1e-12,gK=1e-13,vK=1e-14,yK=1e-15,bK=1e-16,xK=1e-17,_K=1e-18,wK=1e-19,kK=1e-20,SK=Math.PI/2,EK=Math.PI/4,AK=Math.PI/6,jK=Math.PI*2;var Dn=6356752314245179e-9,TK={radii:[6378137,6378137,Dn],radiiSquared:[6378137*6378137,6378137*6378137,Dn*Dn],oneOverRadii:[1/6378137,1/6378137,1/Dn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dn*Dn)],maximumRadius:Math.max(6378137,6378137,Dn),centerToleranceSquared:.1};function _h(e){return e}var Eoe=new xr;function RK(e,r=[],t=_h){return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Qj(e,r=[]){return RK(e,r,gt._cartographicRadians?_h:E1)}function PK(e,r,t=_h){return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Jj(e,r){return PK(e,r,gt._cartographicRadians?_h:A1)}var Zj=1e-14,OK=new xr,eT={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"}},N1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},fl={east:new xr,north:new xr,up:new xr,west:new xr,south:new xr,down:new xr},CK=new xr,BK=new xr,FK=new xr;function U1(e,r,t,i,a,n){let o=eT[r]&&eT[r][t];ri(o&&(!i||i===o));let s,c,u,l=OK.copy(a);if(Mn(l.x,0,Zj)&&Mn(l.y,0,Zj)){let p=Math.sign(l.z);s=CK.fromArray(N1[r]),r!=="east"&&r!=="west"&&s.scale(p),c=BK.fromArray(N1[t]),t!=="east"&&t!=="west"&&c.scale(p),u=FK.fromArray(N1[i]),i!=="east"&&i!=="west"&&u.scale(p)}else{let{up:p,east:d,north:v}=fl;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),v.copy(p).cross(d);let{down:x,west:y,south:E}=fl;x.copy(p).scale(-1),y.copy(d).scale(-1),E.copy(v).scale(-1),s=fl[r],c=fl[t],u=fl[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=l.x,n[13]=l.y,n[14]=l.z,n[15]=1,n}var yc=new xr,IK=new xr,MK=new xr;function rT(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;yc.from(e);let o=yc.x,s=yc.y,c=yc.z,u=i.x,l=i.y,h=i.z,p=o*o*u*u,d=s*s*l*l,v=c*c*h*h,x=p+d+v,y=Math.sqrt(1/x);if(!Number.isFinite(y))return;let E=IK;if(E.copy(e).scale(y),x<n)return E.to(t);let A=a.x,S=a.y,R=a.z,j=MK;j.set(E.x*A*2,E.y*S*2,E.z*R*2);let P=(1-y)*yc.len()/(.5*j.len()),C=0,I,F,H,z;do{P-=C,I=1/(1+P*A),F=1/(1+P*S),H=1/(1+P*R);let G=I*I,D=F*F,V=H*H,$=G*I,ge=D*F,le=V*H;z=p*G+d*D+v*V-1;let de=-2*(p*$*A+d*ge*S+v*le*R);C=z/de}while(Math.abs(z)>ls.EPSILON12);return yc.scale([I,F,H]).to(t)}var wh=new xr,tT=new xr,qK=new xr,Ti=new xr,zK=new xr,kh=new xr,qn=class{constructor(r=0,t=0,i=0){this.centerToleranceSquared=ls.EPSILON1,ri(r>=0),ri(t>=0),ri(i>=0),this.radii=new xr(r,t,i),this.radiiSquared=new xr(r*r,t*t,i*i),this.radiiToTheFourth=new xr(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new xr(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new xr(r===0?0:1/(r*r),t===0?0:1/(t*t),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,t,i),this.maximumRadius=Math.max(r,t,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(r){return this===r||Boolean(r&&this.radii.equals(r.radii))}toString(){return this.radii.toString()}cartographicToCartesian(r,t=[0,0,0]){let i=tT,a=qK,[,,n]=r;this.geodeticSurfaceNormalCartographic(r,i),a.copy(this.radiiSquared).scale(i);let o=Math.sqrt(i.dot(a));return a.scale(1/o),i.scale(n),a.add(i),a.to(t)}cartesianToCartographic(r,t=[0,0,0]){kh.from(r);let i=this.scaleToGeodeticSurface(kh,Ti);if(!i)return;let a=this.geodeticSurfaceNormal(i,tT),n=zK;n.copy(kh).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),c=Math.sign(ll.dot(n,kh))*ll.length(n);return Jj([o,s,c],t)}eastNorthUpToFixedFrame(r,t=new ti){return U1(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new ti){return U1(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return wh.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=Qj(r),a=i[0],n=i[1],o=Math.cos(n);return wh.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),wh.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return wh.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return rT(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Ti.from(r);let i=Ti.x,a=Ti.y,n=Ti.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Ti.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Ti.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){ri(Mn(this.radii.x,this.radii.y,ls.EPSILON15)),ri(this.radii.z>0),Ti.from(r);let a=Ti.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Ti.set(0,0,a).to(i)}};qn.WGS84=new qn(6378137,6378137,Dn);var aT="4.3.3";var iT,NK=(iT=globalThis.loaders)==null?void 0:iT.parseImageNode,H1=typeof Image<"u",V1=typeof ImageBitmap<"u",UK=Boolean(NK),G1=No?!0:UK;function nT(e){switch(e){case"auto":return V1||H1||G1;case"imagebitmap":return V1;case"image":return H1;case"data":return G1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function oT(){if(V1)return"imagebitmap";if(H1)return"image";if(G1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function HK(e){let r=VK(e);if(!r)throw new Error("Not an image");return r}function sT(e){switch(HK(e)){case"data":return e;case"image":case"imagebitmap":let r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function VK(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 GK=/^data:image\/svg\+xml/,KK=/\.svg((\?|#).*)?$/;function Sh(e){return e&&(GK.test(e)||KK.test(e))}function cT(e,r){if(Sh(r)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return K1(e,r)}function K1(e,r){if(Sh(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Eh(e,r,t){let i=cT(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await $K(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function $K(e,r){let t=new Image;return t.src=e,r.image&&r.image.decode&&t.decode?(await t.decode(),t):await new Promise((i,a)=>{try{t.onload=()=>i(t),t.onerror=n=>{let o=n instanceof Error?n.message:"error";a(new Error(o))}}catch(n){a(n)}})}var WK={},uT=!0;async function lT(e,r,t){let i;Sh(t)?i=await Eh(e,r,t):i=K1(e,t);let a=r&&r.imagebitmap;return await XK(i,a)}async function XK(e,r=null){if((YK(r)||!uT)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),uT=!1}return await createImageBitmap(e)}function YK(e){for(let r in e||WK)return!1;return!0}function fT(e){return!e$(e,"ftyp",4)||!(e[8]&96)?null:QK(e)}function QK(e){switch(JK(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function JK(e,r,t){return String.fromCharCode(...e.slice(r,t))}function ZK(e){return[...e].map(r=>r.charCodeAt(0))}function e$(e,r,t=0){let i=ZK(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var nn=!1,pl=!0;function Ah(e){let r=hl(e);return t$(r)||n$(r)||a$(r)||i$(r)||r$(r)}function r$(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=fT(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function t$(e){let r=hl(e);return r.byteLength>=24&&r.getUint32(0,nn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,nn),height:r.getUint32(20,nn)}:null}function a$(e){let r=hl(e);return r.byteLength>=10&&r.getUint32(0,nn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,pl),height:r.getUint16(8,pl)}:null}function i$(e){let r=hl(e);return r.byteLength>=14&&r.getUint16(0,nn)===16973&&r.getUint32(2,pl)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,pl),height:r.getUint32(22,pl)}:null}function n$(e){let r=hl(e);if(!(r.byteLength>=3&&r.getUint16(0,nn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=o$(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,nn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,nn),width:r.getUint16(n+7,nn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,nn)}return null}function o$(){let e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function hl(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 pT(e,r){var a;let{mimeType:t}=Ah(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return ki(i),await i(e,t)}async function hT(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=s$(a),s;switch(o){case"imagebitmap":s=await lT(e,r,n);break;case"image":s=await Eh(e,r,n);break;case"data":s=await pT(e,r);break;default:ki(!1)}return a==="data"&&(s=sT(s)),s}function s$(e){switch(e){case"auto":case"data":return oT();default:return nT(e),e}}var c$=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],u$=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],l$={image:{type:"auto",decode:!0}},jh={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:aT,mimeTypes:u$,extensions:c$,parse:hT,tests:[e=>Boolean(Ah(new DataView(e)))],options:l$};var dT="4.3.3";var mT={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:dT,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function vT(e,r,t){let i=yT(r.metadata),a=[],n=f$(r.attributes);for(let o in e){let s=e[o],c=gT(o,s,n[o]);a.push(c)}if(t){let o=gT("indices",t);a.push(o)}return{fields:a,metadata:i}}function f$(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function gT(e,r,t){let i=t?yT(t.metadata):void 0;return w1(e,r,i)}function yT(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var bT={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},p$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},h$=4,dl=class{draco;decoder;metadataQuerier;constructor(r){this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(r,t={}){let i=new this.draco.DecoderBuffer;i.Init(new Int8Array(r),r.byteLength),this._disableAttributeTransforms(t);let a=this.decoder.GetEncodedGeometryType(i),n=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(a){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){let p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(n,a,t),c=this._getMeshData(n,s,t),u=_1(c.attributes),l=vT(c.attributes,s,c.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:u},...c,schema:l}}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}_getDracoLoaderData(r,t,i){let a=this._getTopLevelMetadata(r),n=this._getDracoAttributes(r,i);return{geometry_type:t,num_attributes:r.num_attributes(),num_points:r.num_points(),num_faces:r instanceof this.draco.Mesh?r.num_faces():0,metadata:a,attributes:n}}_getDracoAttributes(r,t){let i={};for(let a=0;a<r.num_attributes();a++){let n=this.decoder.GetAttribute(r,a),o=this._getAttributeMetadata(r,a);i[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:a,metadata:o};let s=this._getQuantizationTransform(n,t);s&&(i[n.unique_id()].quantization_transform=s);let c=this._getOctahedronTransform(n,t);c&&(i[n.unique_id()].octahedron_transform=c)}return i}_getMeshData(r,t,i){let a=this._getMeshAttributes(t,r,i);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(r instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(r),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(r),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(r,t,i){let a={};for(let n of Object.values(r.attributes)){let o=this._deduceAttributeName(n,i);n.name=o;let s=this._getAttributeValues(t,n);if(s){let{value:c,size:u}=s;a[o]={value:c,size:u,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}}return a}_getTriangleListIndices(r){let i=r.num_faces()*3,a=i*h$,n=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(r,a,n),new Uint32Array(this.draco.HEAPF32.buffer,n,i).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(r){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(r,t),g$(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=p$[t.data_type];if(!i)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,c=d$(this.draco,i),u,l=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,c,s,l),u=new i(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:a}}_deduceAttributeName(r,t){let i=r.unique_id;for(let[o,s]of Object.entries(t.extraAttributes||{}))if(s===i)return o;let a=r.attribute_type;for(let o in bT)if(this.draco[o]===a)return bT[o];let n=t.attributeNameEntry||"name";return r.metadata[n]?r.metadata[n].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(r){let t=this.decoder.GetMetadata(r);return this._getDracoMetadata(t)}_getAttributeMetadata(r,t){let i=this.decoder.GetAttributeMetadata(r,t);return this._getDracoMetadata(i)}_getDracoMetadata(r){if(!r||!r.ptr)return{};let t={},i=this.metadataQuerier.NumEntries(r);for(let a=0;a<i;a++){let n=this.metadataQuerier.GetEntryName(r,a);t[n]=this._getDracoMetadataField(r,n)}return t}_getDracoMetadataField(r,t){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(r,t,i);let a=m$(i);return{int:this.metadataQuerier.GetIntEntry(r,t),string:this.metadataQuerier.GetStringEntry(r,t),double:this.metadataQuerier.GetDoubleEntry(r,t),intArray:a}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(r){let{quantizedAttributes:t=[],octahedronAttributes:i=[]}=r,a=[...t,...i];for(let n of a)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(r,t){let{quantizedAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))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(r,t){let{octahedronAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function d$(e,r){switch(r){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 m$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function g$(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var v$="1.5.6",y$="1.4.1",$1=`https://www.gstatic.com/draco/versioned/decoders/${v$}`,Sa={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},W1={[Sa.DECODER]:`${$1}/${Sa.DECODER}`,[Sa.DECODER_WASM]:`${$1}/${Sa.DECODER_WASM}`,[Sa.FALLBACK_DECODER]:`${$1}/${Sa.FALLBACK_DECODER}`,[Sa.ENCODER]:`https://raw.githubusercontent.com/google/draco/${y$}/javascript/${Sa.ENCODER}`},X1;async function xT(e){let r=e.modules||{};return r.draco3d?X1||=r.draco3d.createDecoderModule({}).then(t=>({draco:t})):X1||=b$(e),await X1}async function b$(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await Qi(W1[Sa.FALLBACK_DECODER],"draco",e,Sa.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await Qi(W1[Sa.DECODER],"draco",e,Sa.DECODER),await Qi(W1[Sa.DECODER_WASM],"draco",e,Sa.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await x$(r,t)}function x$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var _T={...mT,parse:_$};async function _$(e,r){let{draco:t}=await xT(r),i=new dl(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var Th="4.3.3";var Rh={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},wT;async function Q1(e){Yg(e.modules);let r=Qg("basis");return r||(wT||=w$(e),await wT)}async function w$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Rh.TRANSCODER,"textures",e),await Qi(Rh.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await k$(r,t)}function k$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,initializeBasis:o}=a;o(),i({BasisFile:n})})})}var Y1;async function J1(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(Y1=Y1||S$(e),await Y1)}async function S$(e){let r=null,t=null;return[r,t]=await Promise.all([await Qi(Rh.ENCODER,"textures",e),await Qi(Rh.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await E$(r,t)}function E$(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:c}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:c})})})}var re={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 A$=["","WEBKIT_","MOZ_"],kT={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"},Ph=null;function ST(e){if(!Ph){e=e||j$()||void 0,Ph=new Set;for(let r of A$)for(let t in kT)if(e&&e.getExtension(`${r}${t}`)){let i=kT[t];Ph.add(i)}}return Ph}function j$(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Z1=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},fs=class{constructor(r,t,i,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(r.buffer,r.byteOffset+t,i),this._littleEndian=a,this._offset=0}_nextUint8(){let r=this._dataView.getUint8(this._offset);return this._offset+=1,r}_nextUint16(){let r=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,r}_nextUint32(){let r=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint64(){let r=this._dataView.getUint32(this._offset,this._littleEndian),t=this._dataView.getUint32(this._offset+4,this._littleEndian),i=r+2**32*t;return this._offset+=8,i}_nextInt32(){let r=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,r}_nextUint8Array(r){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,r);return this._offset+=r,t}_skip(r){return this._offset+=r,this}_scan(r,t=0){let i=this._offset,a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<r;)a++,this._offset++;return a<r&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,a)}};var qse=new Uint8Array([0]),ha=[171,75,84,88,32,50,48,187,13,10,26,10];function ET(e){return new TextDecoder().decode(e)}function AT(e){let r=new Uint8Array(e.buffer,e.byteOffset,ha.length);if(r[0]!==ha[0]||r[1]!==ha[1]||r[2]!==ha[2]||r[3]!==ha[3]||r[4]!==ha[4]||r[5]!==ha[5]||r[6]!==ha[6]||r[7]!==ha[7]||r[8]!==ha[8]||r[9]!==ha[9]||r[10]!==ha[10]||r[11]!==ha[11])throw new Error("Missing KTX 2.0 identifier.");let t=new Z1,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new fs(e,ha.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();let n=a._nextUint32();t.supercompressionScheme=a._nextUint32();let o=a._nextUint32(),s=a._nextUint32(),c=a._nextUint32(),u=a._nextUint32(),l=a._nextUint64(),h=a._nextUint64(),p=n*3*8,d=new fs(e,ha.length+i,p,!0);for(let ie=0;ie<n;ie++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let v=new fs(e,o,s,!0),x={vendorId:v._skip(4)._nextUint16(),descriptorType:v._nextUint16(),versionNumber:v._nextUint16(),descriptorBlockSize:v._nextUint16(),colorModel:v._nextUint8(),colorPrimaries:v._nextUint8(),transferFunction:v._nextUint8(),flags:v._nextUint8(),texelBlockDimension:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],bytesPlane:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],samples:[]},y=6,E=4,A=(x.descriptorBlockSize/4-y)/E;for(let ie=0;ie<A;ie++){let we={bitOffset:v._nextUint16(),bitLength:v._nextUint8(),channelType:v._nextUint8(),samplePosition:[v._nextUint8(),v._nextUint8(),v._nextUint8(),v._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};we.channelType&64?(we.sampleLower=v._nextInt32(),we.sampleUpper=v._nextInt32()):(we.sampleLower=v._nextUint32(),we.sampleUpper=v._nextUint32()),x.samples[ie]=we}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(x);let S=new fs(e,c,u,!0);for(;S._offset<u;){let ie=S._nextUint32(),we=S._scan(ie),Te=ET(we);if(t.keyValue[Te]=S._nextUint8Array(ie-we.byteLength-1),Te.match(/^ktx/i)){let U=ET(t.keyValue[Te]);t.keyValue[Te]=U.substring(0,U.lastIndexOf("\0"))}let Se=ie%4?4-ie%4:0;S._skip(Se)}if(h<=0)return t;let R=new fs(e,l,h,!0),j=R._nextUint16(),P=R._nextUint16(),C=R._nextUint32(),I=R._nextUint32(),F=R._nextUint32(),H=R._nextUint32(),z=[];for(let ie=0;ie<n;ie++)z.push({imageFlags:R._nextUint32(),rgbSliceByteOffset:R._nextUint32(),rgbSliceByteLength:R._nextUint32(),alphaSliceByteOffset:R._nextUint32(),alphaSliceByteLength:R._nextUint32()});let G=l+R._offset,D=G+C,V=D+I,$=V+F,ge=new Uint8Array(e.buffer,e.byteOffset+G,C),le=new Uint8Array(e.buffer,e.byteOffset+D,I),oe=new Uint8Array(e.buffer,e.byteOffset+V,F),de=new Uint8Array(e.buffer,e.byteOffset+$,H);return t.globalData={endpointCount:j,selectorCount:P,imageDescs:z,endpointsData:ge,selectorsData:le,tablesData:oe,extendedData:de},t}function bc(e,r){let t=new Array(r.mipMapLevels),i=r.width,a=r.height,n=0;for(let o=0;o<r.mipMapLevels;++o){let s=R$(r,i,a,e,o),c=T$(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:c,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function T$(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function R$(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var P$={131:re.COMPRESSED_RGB_S3TC_DXT1_EXT,132:re.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:re.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:re.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:re.COMPRESSED_RED_RGTC1_EXT,140:re.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:re.COMPRESSED_RED_GREEN_RGTC2_EXT,142:re.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:re.COMPRESSED_RGB8_ETC2,148:re.COMPRESSED_SRGB8_ETC2,149:re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:re.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:re.COMPRESSED_RGBA8_ETC2_EAC,152:re.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:re.COMPRESSED_R11_EAC,154:re.COMPRESSED_SIGNED_R11_EAC,155:re.COMPRESSED_RG11_EAC,156:re.COMPRESSED_SIGNED_RG11_EAC,157:re.COMPRESSED_RGBA_ASTC_4x4_KHR,158:re.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:re.COMPRESSED_RGBA_ASTC_5x4_KHR,160:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:re.COMPRESSED_RGBA_ASTC_5x5_KHR,162:re.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:re.COMPRESSED_RGBA_ASTC_6x5_KHR,164:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:re.COMPRESSED_RGBA_ASTC_6x6_KHR,166:re.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:re.COMPRESSED_RGBA_ASTC_8x5_KHR,168:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:re.COMPRESSED_RGBA_ASTC_8x6_KHR,170:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:re.COMPRESSED_RGBA_ASTC_8x8_KHR,172:re.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:re.COMPRESSED_RGBA_ASTC_10x5_KHR,174:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:re.COMPRESSED_RGBA_ASTC_10x6_KHR,176:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:re.COMPRESSED_RGBA_ASTC_10x8_KHR,178:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:re.COMPRESSED_RGBA_ASTC_10x10_KHR,180:re.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:re.COMPRESSED_RGBA_ASTC_12x10_KHR,182:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:re.COMPRESSED_RGBA_ASTC_12x12_KHR,184:re.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:re.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:re.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:re.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:re.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:re.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:re.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:re.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:re.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:re.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:re.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:re.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:re.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:re.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:re.COMPRESSED_RGBA_ASTC_12x12_KHR};function jT(e){return P$[e]}var Ba=[171,75,84,88,32,50,48,187,13,10,26,10];function Oh(e){let r=new Uint8Array(e);return!(r.byteLength<Ba.length||r[0]!==Ba[0]||r[1]!==Ba[1]||r[2]!==Ba[2]||r[3]!==Ba[3]||r[4]!==Ba[4]||r[5]!==Ba[5]||r[6]!==Ba[6]||r[7]!==Ba[7]||r[8]!==Ba[8]||r[9]!==Ba[9]||r[10]!==Ba[10]||r[11]!==Ba[11])}function TT(e){let r=new Uint8Array(e),t=AT(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=jT(t.vkFormat);return bc(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var O$={etc1:{basisFormat:0,compressed:!0,format:re.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:re.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:re.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:re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:re.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 Ch(e,r){if(r.basis.containerFormat==="auto"){if(Oh(e)){let i=await J1(r);return RT(i.KTX2File,e,r)}let{BasisFile:t}=await Q1(r);return ey(t,e,r)}switch(r.basis.module){case"encoder":let t=await J1(r);switch(r.basis.containerFormat){case"ktx2":return RT(t.KTX2File,e,r);case"basis":default:return ey(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await Q1(r);return ey(i,e,r)}}function ey(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let a=i.getNumImages(),n=[];for(let o=0;o<a;o++){let s=i.getNumLevels(o),c=[];for(let u=0;u<s;u++)c.push(C$(i,o,u,t));n.push(c)}return n}finally{i.close(),i.delete()}}function C$(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:c,basisFormat:u}=PT(i,o),l=e.getImageTranscodedSizeInBytes(r,t,u),h=new Uint8Array(l);if(!e.transcodeImage(h,r,t,u,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:c,hasAlpha:o}}function RT(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let a=i.getLevels(),n=[];for(let o=0;o<a;o++)n.push(B$(i,o,t));return[n]}finally{i.close(),i.delete()}}function B$(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:c}=PT(t,i),u=e.getImageTranscodedSizeInBytes(r,0,0,c),l=new Uint8Array(u);if(!e.transcodeImage(l,r,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:l,compressed:o,levelSize:u,hasAlpha:i,format:s}}function PT(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=F$()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),O$[t]}function F$(){let e=ST();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 OT={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:Th,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"}}},ml={...OT,parse:Ch};var Fa={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},I$={DXT1:re.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:re.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:re.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":re.COMPRESSED_RGB_ATC_WEBGL,ATCA:re.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:re.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},M$=FT,L$=Bh,D$=Bh,q$={DXT1:FT,DXT3:Bh,DXT5:Bh,"ATC ":M$,ATCA:L$,ATCI:D$};function CT(e){return new Uint32Array(e,0,Fa.HEADER_LENGTH)[Fa.MAGIC_NUMBER_INDEX]===Fa.MAGIC_NUMBER}function BT(e){let r=new Int32Array(e,0,Fa.HEADER_LENGTH),t=r[Fa.HEADER_PF_FOURCC_INDEX];ki(Boolean(r[Fa.HEADER_PF_FLAGS_INDEX]&Fa.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=z$(t),a=I$[i],n=q$[i];ki(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[Fa.HEADER_FLAGS_INDEX]&Fa.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[Fa.MIPMAPCOUNT_INDEX]));let s=r[Fa.HEADER_WIDTH_INDEX],c=r[Fa.HEADER_HEIGHT_INDEX],u=r[Fa.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,u);return bc(l,{mipMapLevels:o,width:s,height:c,sizeFunction:n,internalFormat:a})}function FT(e,r){return(e+3>>2)*(r+3>>2)*8}function Bh(e,r){return(e+3>>2)*(r+3>>2)*16}function z$(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var ai={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},N$={0:[re.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[re.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[re.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[re.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[re.COMPRESSED_RGB_ETC1_WEBGL],7:[re.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[re.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[re.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[re.COMPRESSED_RGB8_ETC2],23:[re.COMPRESSED_RGBA8_ETC2_EAC],24:[re.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[re.COMPRESSED_R11_EAC],26:[re.COMPRESSED_RG11_EAC],27:[re.COMPRESSED_RGBA_ASTC_4X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[re.COMPRESSED_RGBA_ASTC_5X4_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[re.COMPRESSED_RGBA_ASTC_5X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[re.COMPRESSED_RGBA_ASTC_6X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[re.COMPRESSED_RGBA_ASTC_6X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[re.COMPRESSED_RGBA_ASTC_8X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[re.COMPRESSED_RGBA_ASTC_8X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[re.COMPRESSED_RGBA_ASTC_8X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[re.COMPRESSED_RGBA_ASTC_10X5_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[re.COMPRESSED_RGBA_ASTC_10X6_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[re.COMPRESSED_RGBA_ASTC_10X8_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[re.COMPRESSED_RGBA_ASTC_10X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[re.COMPRESSED_RGBA_ASTC_12X10_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[re.COMPRESSED_RGBA_ASTC_12X12_KHR,re.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},U$={0:IT,1:IT,2:MT,3:MT,6:gl,7:gl,9:vl,11:vl,22:gl,23:vl,24:gl,25:gl,26:vl,27:vl,28:H$,29:V$,30:G$,31:K$,32:$$,33:W$,34:X$,35:Y$,36:Q$,37:J$,38:Z$,39:eW,40:rW};function LT(e){let t=new Uint32Array(e,0,ai.HEADER_LENGTH)[ai.MAGIC_NUMBER_INDEX];return t===ai.MAGIC_NUMBER||t===ai.MAGIC_NUMBER_EXTRA}function DT(e){let r=new Uint32Array(e,0,ai.HEADER_LENGTH),t=r[ai.PIXEL_FORMAT_INDEX],i=r[ai.COLOUR_SPACE_INDEX],a=N$[t]||[],n=a.length>1&&i?a[1]:a[0],o=U$[t],s=r[ai.MIPMAPCOUNT_INDEX],c=r[ai.WIDTH_INDEX],u=r[ai.HEIGHT_INDEX],l=ai.HEADER_SIZE+r[ai.METADATA_SIZE_INDEX],h=new Uint8Array(e,l);return bc(h,{mipMapLevels:s,width:c,height:u,sizeFunction:o,internalFormat:n})}function IT(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function MT(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function gl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function vl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function H$(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function V$(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function G$(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function K$(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function $$(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function W$(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function X$(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function Y$(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function Q$(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function J$(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function Z$(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function eW(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function rW(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function qT(e){if(Oh(e))return TT(e);if(CT(e))return BT(e);if(LT(e))return DT(e);throw new Error("Texture container format not recognized")}var zT={dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"textures",version:Th,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}}},Fh={...zT,parse:async(e,r)=>{var t;return(t=r==null?void 0:r["compressed-texture"])!=null&&t.useBasis?(r.basis={format:{alpha:"BC3",noAlpha:"BC1"},...r.basis,containerFormat:"ktx2",module:"encoder"},(await Ch(e,r))[0]):qT(e)}};function NT(e,r=null){return r?`${e}?token=${r}`:e}var tW={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},aW={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ps={...tW,...aW};function ry(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 UT={UInt8:ps.UNSIGNED_BYTE,UInt16:ps.UNSIGNED_SHORT,Float32:ps.FLOAT,UInt32:ps.UNSIGNED_INT,UInt64:ps.DOUBLE};function xc(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 Ih=new xr([0,0,0]);function iW(e){switch(e){case"ktx-etc2":case"dds":return Fh;case"ktx2":return ml;case"jpg":case"png":default:return jh}}var nW="i3s-attribute-type";async function KT(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new ti,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=NT(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),c=iW(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(c===jh){let p={...r.textureLoaderOptions,image:{type:"data"}};try{let d=await Gg(h,[],p,a);n.texture=d}catch{let v=await In(h,c,p,a);n.texture=v}}else if(c===Fh||c===ml){let p=await k1(h,c,r.textureLoaderOptions);c===ml&&(p=p[0]),n.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else n.texture=h}return n.material=dW(r.materialDefinition,n.texture),n.material&&(n.texture=null),await oW(e,n,r,t,i)}async function oW(e,r,t,i,a){var h,p;let n=e.byteLength,o,s,c=0,u=0,l;if(t.isDracoGeometry){let d=await In(e,_T,{draco:{attributeNameEntry:nW}});s=d.header.vertexCount,l=(h=d.indices)==null?void 0:h.value;let{POSITION:v,NORMAL:x,COLOR_0:y,TEXCOORD_0:E,["feature-index"]:A,["uv-region"]:S}=d.attributes;o={position:v,normal:x,color:y,uv0:E,uvRegion:S,id:A},sW(o,d);let R=yW(A);R&&vW(o,R)}else{let{vertexAttributes:d,ordering:v,featureAttributes:x,featureAttributeOrder:y}=i.store.defaultGeometrySchema,E=uW(e,i);c=E.byteOffset,s=E.vertexCount,u=E.featureCount;let{attributes:A,byteOffset:S}=VT(e,c,d,s,v),{attributes:R}=VT(e,S,x,u,y);gW(R),o=cW(A,R)}if(!((p=a==null?void 0:a.i3s)!=null&&p.coordinateSystem)||a.i3s.coordinateSystem===2){let d=fW(o.position,t);r.modelMatrix=d.invert(),r.coordinateSystem=2}else r.modelMatrix=hW(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:HT(o.color),texCoords:o.uv0,uvRegions:HT(o.uvRegion||o.region)},r.indices=l||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let d in r.attributes)r.attributes[d]||delete r.attributes[d];return r.vertexCount=s,r.byteLength=n,r}function sW(e,r){for(let t in r.loaderData.attributes){let i=r.loaderData.attributes[t];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function cW(e,r){return{...e,...r}}function HT(e){return e&&(e.normalized=!0,e)}function uW(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=ry(o);switch(n){case"vertexCount".toString():i=new s(e,0,4)[0],t+=xc(o);break;case"featureCount".toString():a=new s(e,4,4)[0],t+=xc(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function VT(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:c}=t[o];if(r+i*c*xc(s)<=e.byteLength){let u=e.slice(r),l;if(s==="UInt64")l=lW(u,i*c,xc(s));else{let h=ry(s);l=new h(u,0,i*c)}switch(n[o]={value:l,type:UT[s],size:c},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*c*xc(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function lW(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),c=a.getUint32(n+4,!0),u=s+2**32*c;i.push(u),n+=t}return new Uint32Array(i)}function fW(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new ti,o=new xr(t[0],t[1],t[2]),s=new xr;return qn.WGS84.cartographicToCartesian(o,s),qn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=pW(i,a,o),n}function pW(e,r={},t){let i=new Float64Array(e.length),a=r["i3s-scale_x"]&&r["i3s-scale_x"].double||1,n=r["i3s-scale_y"]&&r["i3s-scale_y"].double||1;for(let o=0;o<i.length;o+=3)i[o]=e[o]*a+t.x,i[o+1]=e[o+1]*n+t.y,i[o+2]=e[o+2]+t.z;for(let o=0;o<i.length;o+=3)qn.WGS84.cartographicToCartesian(i.subarray(o,o+3),Ih),i[o]=Ih.x,i[o+1]=Ih.y,i[o+2]=Ih.z;return i}function hW(e){var n,o;let r=e.metadata,t=((n=r==null?void 0:r["i3s-scale_x"])==null?void 0:n.double)||1,i=((o=r==null?void 0:r["i3s-scale_y"])==null?void 0:o.double)||1,a=new ti;return a[0]=t,a[5]=i,a}function dW(e,r){let t;return e?t={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(t={pbrMetallicRoughness:{}},r?t.pbrMetallicRoughness.baseColorTexture={texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),t.alphaCutoff=t.alphaCutoff||.25,t.alphaMode&&(t.alphaMode=t.alphaMode.toUpperCase()),t.emissiveFactor&&(t.emissiveFactor=GT(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=GT(t.pbrMetallicRoughness.baseColorFactor)),r&&mW(t,r),t}function GT(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function mW(e,r){let t={source:{image:r}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:t}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:t}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:t}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:t}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:t})}function gW(e){let{id:r,faceRange:t}=e;if(!r||!t)return;let i=r.value,a=t.value,n=a[a.length-1]+1,o=new Uint32Array(n*3),s=0,c=0;for(let u=1;u<a.length;u+=2){let l=Number(i[s]),h=a[u],p=a[u-1],d=h-p+1,v=c+d*3;o.fill(l,c,v),s++,c=v}e.id.value=o}function vW(e,r){let t=e.id.value,i=new Float32Array(t.length);for(let a=0;a<t.length;a++)i[a]=r[t[a]];e.id.value=i}function yW(e){var r,t;return(t=(r=e==null?void 0:e.metadata)==null?void 0:r["i3s-feature-ids"])==null?void 0:t.intArray}var bW="4.3.3",$T={dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:bW,mimeTypes:["application/octet-stream"],parse:xW,extensions:["bin"],options:{"i3s-content":{}}};async function xW(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,c=o||n;return!s||!c?null:await KT(e,s,c,r,t)}nv($T);
100
100
  /*! Bundled license information:
101
101
 
102
102
  is-buffer/index.js: